This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: new format warnings in cppinit.c and ggc-page.c
- From: "Joseph S. Myers" <jsm28 at cam dot ac dot uk>
- To: Neil Booth <neil at daikokuya dot demon dot co dot uk>
- Cc: Brad Lucier <lucier at math dot purdue dot edu>, <gcc-bugs at gcc dot gnu dot org>
- Date: Sat, 18 May 2002 11:59:05 +0100 (BST)
- Subject: Re: new format warnings in cppinit.c and ggc-page.c
On Sat, 18 May 2002, Neil Booth wrote:
> Brad Lucier wrote:-
>
> > ../../gcc/cppinit.c:877: warning: unsigned int format, different type arg (arg 4)
> > ../../gcc/cppinit.c:877: warning: unsigned int format, different type arg (arg 5)
> > ../../gcc/cppinit.c:897: warning: unsigned int format, different type arg (arg 4)
> > ../../gcc/cppinit.c:897: warning: unsigned int format, different type arg (arg 5)
>
> Is there an ISO format specifier for size_t? I couldn't find one.
%zu in C99. If we put a suitable printf implementation in libiberty for
systems with deficient C libraries (e.g., extended snprintfv as used by
autogen to handle all the formats we want), we could use %zu (and %p,
getting rid of HOST_PTR_PRINTF). (Though most of GCC uses diagnostic.c
rather than the C library, so that needs such support adding as well,
depending on where you want to use the format.)
--
Joseph S. Myers
jsm28@cam.ac.uk