[Bug c/14259] New: comparison is always true due to limited range of data type
hans dot buchmann at fhso dot ch
gcc-bugzilla@gcc.gnu.org
Mon Feb 23 13:57:00 GMT 2004
compiling the code target arm-elf
----------------------------------
int foo(char ch)
{
return ('\0'<=ch)&&(ch<' ');
}
produces the warning
----------------------------------
char-cmp.cc: In function `int foo(char)':
char-cmp.cc:3: warning: comparison is always true due to limited range of data type
----------------------------------
compiler version g++ -v
Reading specs from
/home/buchmann/cvs/arm/gcc-3.4-20040218/bin/../lib/gcc/arm-elf/3.4.0/specs
Configured with: /home/buchmann/cvs/dist/gcc-3.4-20040218/configure -v
--prefix=/home/buchmann/cvs/arm/gcc-3.4-20040218/ --target=arm-elf
--enable-languages=c,c++ --disable-threads --without-headers --with-newlib
Thread model: single
gcc version 3.4.0 20040218 (prerelease)
target i686-pc-linux-gnu produces no warning
Best regards
Hans Buchmann
--
Summary: comparison is always true due to limited range of data
type
Product: gcc
Version: 3.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: hans dot buchmann at fhso dot ch
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: arm-elf
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14259
More information about the Gcc-bugs
mailing list