------- Comment #10 from manu at gcc dot gnu dot org 2007-02-16 15:33 ------- (In reply to comment #9) > (In reply to comment #8) > > I meant that the warning is appropriate but > > the message is confusing because it is exposing that when doing > > > > bool x = ~b; > > > > we actually do > > > > bool x = (~b != 0); > > > Or, more precisely, > bool x = (~(int) b) != 0; > > > So an appropriate message would say something like: > > > > test.cpp:5: warning: '(bool) ~b' is always true > > > Don't you agree? > > > > Yes, that would be nice, but hard to implement. >
Isn't any way to tell that "!= 0" was introduced by GCC rather than by the original source code? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=8715