This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Set the scalar_identity_flag for the %Id and %Iu specs
- From: Ozkan Sezer <sezeroz at gmail dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Kai Tietz <ktietz70 at googlemail dot com>
- Date: Fri, 5 Feb 2010 13:11:19 +0200
- Subject: Re: [PATCH] Set the scalar_identity_flag for the %Id and %Iu specs
- References: <647fe9b11002020613r4eaffdceo3137c7fd483b1001@mail.gmail.com>
PING.
On Tue, Feb 2, 2010 at 4:13 PM, Ozkan Sezer <sezeroz@gmail.com> wrote:
> Hi:
>
> The M$ printf type specs %Id and %Iu are for ptrdiff_t and size_t whose
> widths change according to word size:
> http://msdn.microsoft.com/en-us/library/tcxf1dw6(VS.71).aspx
> Although msformat-c.c sets the scalar_identity_flag for %I32 and %I64,
> it does not so for %I itself, so my testcase does output warnings with
> i686-w64-mingw32 :
>
> $ i686-w64-mingw32-gcc -std=iso9899:1999 -pedantic -Wformat
> -Wno-pedantic-ms-format -c ms-format3.c
> ms-format3.c: In function 'foo':
> ms-format3.c:15: warning: format '%Id' expects type 'signed size_t',
> but argument 2 has type 'LONG_PTR'
> ms-format3.c:16: warning: format '%Iu' expects type 'size_t', but
> argument 2 has type 'ULONG_PTR'
> ms-format3.c:17: warning: format '%Iu' expects type 'size_t', but
> argument 2 has type 'DWORD_PTR'
> ms-format3.c:19: warning: format '%Iu' expects type 'size_t', but
> argument 2 has type 'SIZE_T'
>
> The attached one-liner patch fixes that situation. Please consider for
> applying. ?(Changelog at top of the patch. ?I don't have write access.)
>
> --
> Ozkan
>