This is the mail archive of the gcc-patches@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]

Re: Patch for pedantic format warnings


On Thu, 20 Jul 2000, Michael Meissner wrote:

> The standard requires that *printf %p format take a void * (and another place
> requires that void * and char * have the same size, alignment, and bit

Indeed, see a recent thread on comp.std.c for discussion of whether char *
is allowed here (there's a new allowance for interchanging void * and char
* with va_arg, but whether it applies to printf is not so clear; the
representation requirements are already in the old standard, but whether
the normative text achieves the intent stated in the footnote is unclear).

The most obviously dodgy case is passing function pointers to %p, but all
cases other than pointers to void and to character types clearly invoke
undefined behaviour and so seem suitable for -pedantic warnings.

-- 
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]