c++ testsuite patches
Jason Merrill
jason@cygnus.com
Mon May 31 20:56:00 GMT 1999
>>>>> Horst von Brand <vonbrand@sleipnir.valparaiso.cl> writes:
>> If I add
>>
>> extern void g(long);
>>
>> I get the same warning as on an x86 box
>>
>> z.cc:4: warning: converting NULL to non-pointer type
>>
>> and the test passes.
> This is broken, IMHO.
No, this is correct. __null is defined as a 0 of the integral type with
the same size as a pointer. On the alpha, that would be 'long'. So since
__null is 0L, clearly overload resolution should prefer the identity
conversion (long->long) to the null pointer conversion (NULL->void *). Of
course, this is probably not what the programmer intended; thus the
warning.
Adding the long overload is the right thing.
Jason
More information about the Gcc-patches
mailing list