[Top][All Lists]
[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.
- [PATCH] build: avoid printf format mismatch warnings, Jim Meyering, 2009/09/29
- Re: [PATCH] build: avoid printf format mismatch warnings, Joel E. Denny, 2009/09/29
- Re: [PATCH] build: avoid printf format mismatch warnings, Jim Meyering, 2009/09/29
- Re: [PATCH] build: avoid printf format mismatch warnings, Joel E. Denny, 2009/09/29
- Re: [PATCH] build: avoid printf format mismatch warnings, Joel E. Denny, 2009/09/29
- Re: [PATCH] build: avoid printf format mismatch warnings, Jim Meyering, 2009/09/29
- Re: [PATCH] build: avoid printf format mismatch warnings, Joel E. Denny, 2009/09/29
- Re: [PATCH] build: avoid printf format mismatch warnings, Jim Meyering, 2009/09/29
- Re: [PATCH] build: avoid printf format mismatch warnings, Nicolas Joly, 2009/09/29
- Re: [PATCH] build: avoid printf format mismatch warnings, Jim Meyering, 2009/09/29
- Re: [PATCH] build: avoid printf format mismatch warnings,
Joel E. Denny <=
Re: [PATCH] build: avoid printf format mismatch warnings, Eric Blake, 2009/09/29