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: cpplib and a couple others: squelch -pedantic warnings


"Kaveh R. Ghazi" <ghazi@caip.rutgers.edu> writes:

[...]

| Do you think we should define a single xfree which takes a const void*
| and checks whether the parameter is NULL?  Is allowing NULL to be
| passed to {x}free something we want to silently allow?  I know some
| implementations of malloc/free allow this, but I'm not sure whether
| its encouraged.  I.e. Will doing so paper over bugs?

	void *ptr = NULL;
        free (ptr);

is valid and should be a no-op.  I don't think a warning is
particularily useful here.

-- Gaby
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]