changeset 7684:784e80c3d895

Work around a compile-time error from the HP-UX 11.00 /bin/cc. * lib/fts.c (enum Fts_stat): Give this previously-anon enum a name. (fts_read): Use a temporary to narrow the overused st_size member before using it in a switch statement. Reported by Matthew Woehlke.
author Jim Meyering <jim@meyering.net>
date Wed, 22 Nov 2006 23:48:30 +0000
parents 40c3e7d43e2d
children 89b16a28419e
files ChangeLog lib/fts.c
diffstat 2 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2006-11-22  Jim Meyering  <jim@meyering.net>
 
+	Work around a compile-time error from the HP-UX 11.00 /bin/cc.
+	* lib/fts.c (enum Fts_stat): Give this previously-anon enum a name.
+	(fts_read): Use a temporary to narrow the overused st_size member
+	before using it in a switch statement.  Reported by Matthew Woehlke.
+
 	* m4/clock_time.m4 (gl_CLOCK_TIME): Quote AC_SUBST argument.
 	* m4/euidaccess.m4 (gl_PREREQ_EUIDACCESS): Likewise.
 
--- a/lib/fts.c
+++ b/lib/fts.c
@@ -92,7 +92,7 @@
 # define DT_MUST_BE(d, t) false
 #endif
 
-enum
+enum Fts_stat
 {
   FTS_NO_STAT_REQUIRED = 1,
   FTS_STAT_REQUIRED = 2
@@ -731,7 +731,8 @@
 check_for_dir:
 		if (p->fts_info == FTS_NSOK)
 		  {
-		    switch (p->fts_statp->st_size)
+		    enum Fts_stat need_stat = p->fts_statp->st_size;
+		    switch (need_stat)
 		      {
 		      case FTS_STAT_REQUIRED:
 			p->fts_info = fts_stat(sp, p, false);