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 : free(NULL) in cpphash.c


>>>>> "Zack" == Zack Weinberg <zack@wolery.cumb.org> writes:

    Zack> free(NULL) is defined to be a no-op

I don't think that's true in ISO C.  In C++, `delete NULL' is defined
to be a no-op, but in ISO C, I believe that `free (NULL)' has
undefined behavior.  I have certainly programmed systems that would
crash when you tried this. :-(

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com

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