This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] alias.c: Replace "return NULL_RTX" with "return 0".
On Thu, 12 Jun 2003 13:14:57 -0700, Zack Weinberg <zack@codesourcery.com> wrote:
> Jason Merrill <jason@redhat.com> writes:
>
>>>> > I think it would be better style to replace NULL_RTX with NULL
>>>> > rather than with 0.
>>>>
>>>> GCC sources prefer 0 to NULL for a generic null pointer.
>>>
>>> GCC was once written in K&R C, but times change :-)
>>
>> I prefer NULL to 0. It is both more readable and more reliable in the
>> presence of varargs.
>
> I won't argue readability (though I disagree) but NULL is *NOT* more
> reliable in the presence of varargs; there is no guarantee that NULL
> doesn't expand to "0". In the presence of varargs one has no choice
> but to write an explicit cast.
A system that defines NULL to 0 where that is a different size from
(void*)0 is broken. Does such brokenness actually exist?
Jason