This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: cpplib and a couple others: squelch -pedantic warnings
- To: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Subject: Re: cpplib and a couple others: squelch -pedantic warnings
- From: Gabriel Dos Reis <gdr at codesourcery dot com>
- Date: 04 May 2000 22:17:45 +0200
- Cc: grahams at rcp dot co dot uk, gcc-patches at gcc dot gnu dot org, jason at cygnus dot com, zack at wolery dot cumb dot org
- Organization: CodeSourcery, LLC
- References: <200005041937.PAA10931@caip.rutgers.edu>
"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