Mercurial > hg > octave-lyh > gnulib-hg
changeset 14327:a1d0d5cddb06
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 <eblake@redhat.com>
author | Eric Blake <eblake@redhat.com> |
---|---|
date | Fri, 11 Feb 2011 13:30:04 -0700 |
parents | 3fdb8aa1477f |
children | 0b7fb1b0ec90 |
files | ChangeLog lib/strptime.c |
diffstat | 2 files changed, 13 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2011-02-11 Eric Blake <eblake@redhat.com> + + 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 <ttn@gnuvola.org> doc: update users.txt
--- a/lib/strptime.c +++ b/lib/strptime.c @@ -251,7 +251,9 @@ 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 @@ 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 @@ 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