[Bug c/12150] New: warning in dead code (comparison is always false) [regression]
mattias at virtutech dot se
gcc-bugzilla@gcc.gnu.org
Wed Sep 3 08:41:00 GMT 2003
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12150
Summary: warning in dead code (comparison is always false)
[regression]
Product: gcc
Version: 3.3.1
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: mattias at virtutech dot se
CC: gcc-bugs at gcc dot gnu dot org,gustav at virtutech dot
se
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
unsigned f(unsigned x)
{
if (sizeof x > 4)
return x >= 1ull << 32 ? 1 : 0;
return 0;
}
gives the warning
foo.c:4: warning: comparison is always false due to limited range of data type
when compiled with -Wall.
This is a regression from 3.2.2.
(see also bug 4210)
More information about the Gcc-bugs
mailing list