[Bug middle-end/35188] Missing a warning: inherently false expressions

tuttle at sandbox dot cz gcc-bugzilla@gcc.gnu.org
Sat Feb 16 18:10:00 GMT 2008



------- Comment #7 from tuttle at sandbox dot cz  2008-02-16 18:09 -------
That's great, even my older gcc 4.1.3 warns for every if-body with -O1
-Wunreachable code. Shame on me I did not came with -O1 myself, sorry.

Anyway my first code line

int var1 = (1 && 0);

is not about the execution reachability. It may be considered as a simplest
form of inherently false expressions such as

( (var==10) && (var==20) )

that I would consider good to produce warnings. But that would AFAIK need a
completely new kind of warnings (as well as checking code?).

Sorry for bugging everybody with such minor thing. Feel free to close the bug.

VM


-- 


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



More information about the Gcc-bugs mailing list