This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch for pedantic format warnings
- To: Michael Meissner <meissner at cygnus dot com>
- Subject: Re: Patch for pedantic format warnings
- From: "Joseph S. Myers" <jsm28 at cam dot ac dot uk>
- Date: Thu, 20 Jul 2000 22:59:49 +0100 (BST)
- cc: law at cygnus dot com, gcc-patches at gcc dot gnu dot org
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