This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/35669] NULL (__null) not considered different from 0 with C++
- From: "manu at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 Mar 2008 19:43:37 -0000
- Subject: [Bug c++/35669] NULL (__null) not considered different from 0 with C++
- References: <bug-35669-14453@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from manu at gcc dot gnu dot org 2008-03-23 19:43 -------
(In reply to comment #4)
>
> > Otherwise, whether this is
> > worth warning or a nuisance is a matter of opinion.
>
> True. So, is there any example where use of NULL / __null in a non-pointer
> context is a good idea?
Is there an example where it leads to bugs? I don't know why C++ doesn't follow
C here, but there must be some reason, no?
On the other hand, it seems we *do* warn about it with -Wconversion. So, where
do you want to move it? Check the list of GCC warnings:
http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
I think this isn't worth discussing anymore, it just needs someone to be
bothered enough by it to write a patch+testcases, bootstrap, run the regression
testsuite and submit to gcc-patches.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35669