This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/14259] New: comparison is always true due to limited range of data type
- From: "hans dot buchmann at fhso dot ch" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 Feb 2004 13:57:26 -0000
- Subject: [Bug c/14259] New: comparison is always true due to limited range of data type
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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