bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-gnulib] Minor patch to silence gcc -Wall warnings from getdate


From: Paul Eggert
Subject: Re: [Bug-gnulib] Minor patch to silence gcc -Wall warnings from getdate.y
Date: Tue, 02 Nov 2004 11:16:35 -0800
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

Derek Robert Price <address@hidden> writes:

> Whoops.  Attached now.

OK, thanks.  I installed the following slightly-different patch, so
that stdio.h isn't included twice.

2004-11-02  Derek R. Price  <address@hidden>
       and  Paul Eggert  <address@hidden>

        * getdate.y [!TEST]: Include <stdio.h>, since we use sprintf now.
        (get_date): Overparenthesize to avoid GCC warning.

Index: lib/getdate.y
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/getdate.y,v
retrieving revision 1.86
diff -p -u -r1.86 getdate.y
--- lib/getdate.y       29 Oct 2004 20:59:53 -0000      1.86
+++ lib/getdate.y       2 Nov 2004 19:16:21 -0000
@@ -50,6 +50,7 @@
 
 #include <ctype.h>
 #include <limits.h>
+#include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
@@ -1307,8 +1308,8 @@ get_date (struct timespec *result, char 
          int month = tm.tm_mon + pc.rel_month;
          int day = tm.tm_mday + pc.rel_day;
          if (((year < tm.tm_year) ^ (pc.rel_year < 0))
-             | (month < tm.tm_mon) ^ (pc.rel_month < 0)
-             | (day < tm.tm_mday) ^ (pc.rel_day < 0))
+             | ((month < tm.tm_mon) ^ (pc.rel_month < 0))
+             | ((day < tm.tm_mday) ^ (pc.rel_day < 0)))
            goto fail;
          tm.tm_year = year;
          tm.tm_mon = month;
@@ -1365,8 +1366,6 @@ get_date (struct timespec *result, char 
 
 #if TEST
 
-#include <stdio.h>
-
 int
 main (int ac, char **av)
 {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]