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: Joel E. Denny
Subject: Re: [PATCH] build: avoid printf format mismatch warnings
Date: Tue, 29 Sep 2009 14:24:28 -0400 (EDT)
User-agent: Alpine 1.00 (DEB 882 2007-12-20)

On Tue, 29 Sep 2009, Jim Meyering wrote:

> 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.

Yep.  Thanks Nicolas.




reply via email to

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