Work around a compile-time error from the HP-UX 11.00 /bin/cc.
authorJim Meyering <jim@meyering.net>
Wed, 22 Nov 2006 23:48:30 +0000 (23:48 +0000)
committerJim Meyering <jim@meyering.net>
Wed, 22 Nov 2006 23:48:30 +0000 (23:48 +0000)
* 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.

ChangeLog
lib/fts.c

index 7be6fcc..b590b77 100644 (file)
--- 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.
 
index b3b0210..269792a 100644 (file)
--- a/lib/fts.c
+++ b/lib/fts.c
@@ -92,7 +92,7 @@ static char sccsid[] = "@(#)fts.c     8.6 (Berkeley) 8/14/94";
 # 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 @@ name:               t = sp->fts_path + NAPPEND(p->fts_parent);
 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);