Warning for unadorned 0 in varargs lists?

Segher Boessenkool segher@kernel.crashing.org
Mon Aug 23 15:42:00 GMT 2004


>>> Are there really any targets where passing an unadorned zero doesn't
>>> work?
>>
>> Yes; any target where ints are 32 bit, and pointers are 64 bit
>> (i.e., most 64-bit targets).
>
> Well, usually the ABIs specify zero padding to 64 bits on such
> platforms, which would make this work. At least Alpha does, and I
> thought it was similar on other platforms...

That "works" on most such platforms, I guess (I verified it does
for the 64-bit PowerPC ABI); but it doesn't "work" in the sense
that it is not standard-compliant.  If GCC is to give a warning
at all, it should warn for every non-standard use, not just if
it might fail for the current target.


Segher



More information about the Gcc mailing list