From 96ebe3fcc8535763bc422eedef0a661d1bd61b03 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Wed, 22 Nov 2006 23:48:30 +0000 Subject: [PATCH] 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. --- ChangeLog | 5 +++++ lib/fts.c | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7be6fcccf..b590b77fd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2006-11-22 Jim Meyering + 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. diff --git a/lib/fts.c b/lib/fts.c index b3b021021..269792a98 100644 --- 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); -- 2.11.0