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/20550] New: Silencing the warning: comparison is always true due to limited range of data type


It would be nice if the warning "comparison is always true due to limited range
of data type" could be turned off. From looking at the gcc source I conclude it
can't. I couldn't find a workaround which generates the same code (casting the
smaller type to the wider type just for the comparison doesn't silence the
warning, using a wider type for the variable generates worse code).

Yet better if it could be turned off locally. I know which comparisons in my C
macro may trigger it, and it would make sense to turn it off only in these places.

-- 
           Summary: Silencing the warning: comparison is always true due to
                    limited range of data type
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: qrczak at knm dot org dot pl
                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: i686-pc-linux-gnu


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


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