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 14:07:26 -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 #3 from manu at gcc dot gnu dot org 2008-03-23 14:07 -------
(In reply to comment #2)
>
> Using -Wconversion helps with getting the warning, but it also causes warnings
> for normal common things like foo(2*0.5). While foo(NULL) is almost certainly
Hmm, 2*0.5 should be folded pretty early so Wconversion should see 1.0 which
can be converted exactly to an integer (I think), so there should be no warning
whatsoever. Are you sure you are using GCC 4.3? I cannot reproduce the warning.
As for this PR, the warning from the C front-end seems to be mandated by the
standard (I say this because using -pedantic-errors gives an error instead, so
it is a pedwarn, it would be nice to know where in the C standard this appears,
to add a comment to the code for future reference).
Perhaps the C++ standard does not mandate such warning. If the C++ standard
actually mandated the warning, this would be a bug. Otherwise, whether this is
worth warning or a nuisance is a matter of opinion.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35669