This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/14259] New: comparison is always true due to limited range of data type


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]