strptime: fix regression on mingw
authorEric Blake <eblake@redhat.com>
Thu, 12 Jan 2012 15:39:07 +0000 (08:39 -0700)
committerEric Blake <eblake@redhat.com>
Thu, 12 Jan 2012 15:39:07 +0000 (08:39 -0700)
The previous change lost the side effect of skipping past a
time-zone offset sign.  Instead, fix things to rely on the
fact that _GL_UNUSED can be applied to any variable, even if
some compilation paths use it, to silence gcc on the paths
where it is not used.

* lib/strptime.c (__strptime_internal) [!_LIBC && !HAVE_TM_GMTOFF]:
Fix regression.  Reported by Bruno Haible.

Signed-off-by: Eric Blake <eblake@redhat.com>
ChangeLog
lib/strptime.c

index 80b5702..dabbd8d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-01-12  Eric Blake  <eblake@redhat.com>
+
+       strptime: fix regression on mingw
+       * lib/strptime.c (__strptime_internal) [!_LIBC && !HAVE_TM_GMTOFF]:
+       Fix regression.  Reported by Bruno Haible.
+
 2012-01-11  Reuben Thomas  <rrt@sc3d.org>
            Bruno Haible  <bruno@clisp.org>
 
index 0d4c3a4..6a0139e 100644 (file)
@@ -674,9 +674,7 @@ __strptime_internal (rp, fmt, tm, decided, era_cnt LOCALE_PARAM)
              specify hours.  If fours digits are used, minutes are
              also specified.  */
           {
-#if defined _LIBC || HAVE_TM_GMTOFF
-            bool neg;
-#endif
+            bool neg _GL_UNUSED;
             int n;
 
             val = 0;
@@ -684,9 +682,7 @@ __strptime_internal (rp, fmt, tm, decided, era_cnt LOCALE_PARAM)
               ++rp;
             if (*rp != '+' && *rp != '-')
               return NULL;
-#if defined _LIBC || HAVE_TM_GMTOFF
             neg = *rp++ == '-';
-#endif
             n = 0;
             while (n < 4 && *rp >= '0' && *rp <= '9')
               {