strptime: avoid compiler warnings
authorEric Blake <eblake@redhat.com>
Fri, 11 Feb 2011 20:30:04 +0000 (13:30 -0700)
committerEric Blake <eblake@redhat.com>
Fri, 11 Feb 2011 20:34:13 +0000 (13:34 -0700)
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>
ChangeLog
lib/strptime.c

index 5ed2911..eea6550 100644 (file)
--- 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
index c0e0c35..9e4394b 100644 (file)
@@ -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