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]

Re: PATCH for NULL handling


>>>>> "Jason" == Jason Merrill <jason@cygnus.com> writes:

    Jason> This subverts the purpose of handling NULL specially in the
    Jason> first place: to catch mistakes like this.  I would be open
    Jason> to changing build_binary_op_nodefault to notice this case
    Jason> and accept it with a warning, though.

I misunderstood the purpose of __null; I thought it was largely to
allow better error messages, For example, things like `cannot
dereference the NULL pointer' versus `0 is not a pointer'. 

Clearly, code like `i != NULL', where i is an integer, is legal, by
the standard.  I agree that it's OK if we issue a warning on such
constructs.  I'll attempt to add code for to issue the warning.

    Jason> Jason

-- 
Mark Mitchell 			mark@markmitchell.com
Mark Mitchell Consulting	http://www.markmitchell.com


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