[Top][All Lists]
[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: |
Derek Robert Price |
Subject: |
Re: [Bug-gnulib] Minor patch to silence gcc -Wall warnings from getdate.y |
Date: |
Mon, 01 Nov 2004 16:29:21 -0500 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040616 |
Paul Eggert wrote:
>Derek Robert Price <address@hidden> writes:
>
>
>
>> Silence warnings from `gcc -Wall'.
>>
>>
>
>Sorry, but no patch was attached.
>
>
Whoops. Attached now.
>Also, what warnings are suppressed by the patch (compiler version,
>warning wording, etc.)?
>
>
getdate.y: In function `get_date':
getdate.y:1262: warning: implicit declaration of function `sprintf'
getdate.y:1311: warning: suggest parentheses around arithmetic in
operand of |
getdate.y:1311: warning: suggest parentheses around arithmetic in
operand of |
Thanks,
Derek
--
*8^)
Email: address@hidden
Get CVS support at <http://ximbiot.com>!
Index: lib/getdate.y
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/getdate.y,v
retrieving revision 1.86
diff -u -p -r1.86 getdate.y
--- lib/getdate.y 29 Oct 2004 20:59:53 -0000 1.86
+++ lib/getdate.y 1 Nov 2004 18:28:02 -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;
signature.asc
Description: OpenPGP digital signature