[Bug c/32061] wrong warning wording

eyal at eyal dot emu dot id dot au gcc-bugzilla@gcc.gnu.org
Thu May 24 00:00:00 GMT 2007



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



More information about the Gcc-bugs mailing list