This is the mail archive of the gcc-bugs@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]

[Bug c++/35669] NULL (__null) not considered different from 0 with C++



------- 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


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