new format warnings in cppinit.c and ggc-page.c

Joseph S. Myers jsm28@cam.ac.uk
Sat May 18 03:59:00 GMT 2002


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



More information about the Gcc-bugs mailing list