This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ patch] accept __null as sentinel
Hi,
On Fri, 29 Apr 2005, Mark Mitchell wrote:
> > 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.
>
> But the user (probably) didn't write "__null" -- they wrote "NULL".
> So, what we really know is that using GCC's <stddef.h> will work. But
> if you're trying to write code portable to non-GCC compilers, then the
> warning still has value for you.
That's why a suggested to put it under -pedantic. If this really should
live under a special -W... option, of which we have already too many, I
would like to have it off by default (on with -pedantic), and neither in
-W nor -Wall. For people compiling only with g++ this warning is of no
help and just confusing. People interested in portability will use
-pedantic, I would hope (I have a slight deja vu here) and then see it.
Ciao,
Michael.