From: Eric Blake Date: Fri, 11 Feb 2011 20:30:04 +0000 (-0700) Subject: strptime: avoid compiler warnings X-Git-Tag: v0.1~3196 X-Git-Url: http://erislabs.org.uk/gitweb/?a=commitdiff_plain;h=ecb020f2b046790d76d05d377ca1e864e2bc9fdc;p=gnulib.git strptime: avoid compiler warnings Reported against mingw, but reproduced on glibc with: CFLAGS='-Wall -Wunused-label -Wunused-variable' \ ac_cv_func_strptime=no ./gnulib-tool --with-tests --test strptime * lib/strptime.c (__strptime_internal) [!_NL_CURRENT]: Avoid compiler warnings about dead code. Reported by Daniel P. Berrange. Signed-off-by: Eric Blake --- diff --git a/ChangeLog b/ChangeLog index 5ed291188..eea655040 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2011-02-11 Eric Blake + + strptime: avoid compiler warnings + * lib/strptime.c (__strptime_internal) [!_NL_CURRENT]: Avoid + compiler warnings about dead code. + Reported by Matthias Bolte. + 2011-02-11 Thien-Thi Nguyen doc: update users.txt diff --git a/lib/strptime.c b/lib/strptime.c index c0e0c353d..9e4394b88 100644 --- a/lib/strptime.c +++ b/lib/strptime.c @@ -251,7 +251,9 @@ __strptime_internal (rp, fmt, tm, decided, era_cnt LOCALE_PARAM) int have_mon, have_mday; int have_uweek, have_wweek; int week_no; +#ifdef _NL_CURRENT size_t num_eras; +#endif struct era_entry *era; have_I = is_pm = 0; @@ -408,7 +410,9 @@ __strptime_internal (rp, fmt, tm, decided, era_cnt LOCALE_PARAM) break; case 'C': /* Match century number. */ +#ifdef _NL_CURRENT match_century: +#endif get_number (0, 99, 2); century = val; want_xday = 1; @@ -644,7 +648,9 @@ __strptime_internal (rp, fmt, tm, decided, era_cnt LOCALE_PARAM) have_wday = 1; break; case 'y': +#ifdef _NL_CURRENT match_year_in_century: +#endif /* Match year within century. */ get_number (0, 99, 2); /* The "Year 2000: The Millennium Rollover" paper suggests that