This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/20550] New: Silencing the warning: comparison is always true due to limited range of data type
- From: "qrczak at knm dot org dot pl" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Mar 2005 10:51:26 -0000
- Subject: [Bug c/20550] New: Silencing the warning: comparison is always true due to limited range of data type
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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