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

mathieu.malaterre at gmail dot com gcc-bugzilla@gcc.gnu.org
Fri Mar 1 15:32:00 GMT 2013


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56497

             Bug #: 56497
           Summary: comparison is always true due to limited range of data
                    type
    Classification: Unclassified
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: mathieu.malaterre@gmail.com


Created attachment 29563
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29563
g++ -Wtype-limits test.cxx

It would be really nice if -Wtype-limits would catch all occurences in the
following test case.

Steps:

$ g++ -Wtype-limits test.cxx
test.cxx: In function 'int main()':
test.cxx:25:33: warning: comparison is always true due to limited range of data
type [-Wtype-limits]



More information about the Gcc-bugs mailing list