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/32061] wrong warning wording



------- Comment #2 from eyal at eyal dot emu dot id dot au  2007-05-24 01:00 -------
(In reply to comment #1)
> I don't see the problem because
> "xx.c:7: warning: logical '&&' with non-zero constant will always evaluate as
> true"
> means the non-zero constant will evaluate as true and not the logical will
> evaluate as true.
> 

(In reply to comment #1)
> I don't see the problem because
> "xx.c:7: warning: logical '&&' with non-zero constant will always evaluate as
> true"
> means the non-zero constant will evaluate as true and not the logical will
> evaluate as true.
> 

But it says 'logical... will always evaluate as true' which clearly refers to
the result of the logical operator, not to one of its arguments.

BTW, why no warning for this?
   resp == 0 && 0
Naturally, all the above constants will hide behind some macros which could
indicate a real error, hence the value of the warning.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32061


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