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/12150] New: warning in dead code (comparison is always false) [regression]


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)


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