Warning for unadorned 0 in varargs lists?

Florian Weimer fw@deneb.enyo.de
Mon Aug 23 14:19:00 GMT 2004


* Joseph S. Myers:

> I'd suggest a refinement: that the variadic arguments before the sentinel 
> should be required to have types interchangable with the type of the 
> sentinel in va_arg.  So for a sentinel of type void * they could have 
> types pointer to void or to character types, or any pointer type unless 
> -pedantic (as with format warnings for printf %p).

I don't think this can be enabled unconditionally.  Is anybody
familiar with OpenWindows on 64 bit platforms?  IIRC it's common to
mix 32 bit and 64 bit arguments *before* the sentinel.  Eddie Kohler's
example is in this category, too.

(There's nothing wrong with such argument lists, as <stdarg.h> can
handle them, BTW.)



More information about the Gcc mailing list