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: [C++ patch] accept __null as sentinel


Hi,

On Fri, 29 Apr 2005, Joseph S. Myers wrote:

> > FWIW, Michael, I agree that allowing NULL (and thus __null) to be used
> > as a valid sentinal is the only way this will practically be useful to
> > real code.
> 
> I think OpenBSD is real code.  Diagnosing the use of NULL as a sentinel
> is also what's desired for OpenBSD; they may be on the stricter side but
> this is through concerns for genuine rather than merely theoretical
> portability and security.  See Marc Espie's comments in the thread
> <http://gcc.gnu.org/ml/gcc-patches/2004-09/subjects.html#01417> for (a)  
> the desire for this warning for uncast NULL and (b) examples of real
> deployed systems where NULL for C++ is plain 0 unconditionally showing
> there to be genuine portability issues involved.

Maybe.  But note that the case of a literal 0 will still be warned (as 
also for 0L), no matter what.  It's only __null, a GCC specific thing, 
which I don't want to warn about, in a warning only implemented by GCC.  
We _know_ using __null will work.


Ciao,
Michael.


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