This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] alias.c: Replace "return NULL_RTX" with "return 0".


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.

zw


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]