This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]