bug-bison
[Top][All Lists]
Advanced

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

Re: [PATCH] build: avoid printf format mismatch warnings


From: Jim Meyering
Subject: Re: [PATCH] build: avoid printf format mismatch warnings
Date: Tue, 29 Sep 2009 20:09:18 +0200

Nicolas Joly wrote:
> On Tue, Sep 29, 2009 at 01:14:05PM -0400, Joel E. Denny wrote:
> [...]
>> With the following test program, I haven't persuaded gcc to give me a
>> warning or error:
>>
>> % cat >tmp.c <<EOF
>> #include <stdio.h>
>> int
>> main (void)
>> {
>>   size_t i = 0;
>>   printf ("%d\n", i);
>>   return 0;
>> }
>> EOF
>> % gcc -std=gnu99 -Wall -Wextra -Wno-sign-compare -Wcast-align -Wcast-qual 
>> -Wformat -Wpointer-arith -Wwrite-strings -Wbad-function-cast 
>> -Wmissing-declarations -Wmissing-prototypes -Wshadow -Wstrict-prototypes 
>> -Werror tmp.c
>>
>> Any ideas?
>
> You'll have a warning on archs where sizeof(size_t) != sizeof(int)
> such as x86_64 ...

I think you've nailed it.
That's definitely why it's happening for me.  I'm using x86_64.
Mustn't forget that systems with 32-bit size_t still exist.




reply via email to

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