This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/20550] Silencing the warning: comparison is always true due to limited range of data type
- From: "joseph at codesourcery dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Mar 2005 12:02:04 -0000
- Subject: [Bug c/20550] Silencing the warning: comparison is always true due to limited range of data type
- References: <20050319105124.20550.qrczak@knm.org.pl>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From joseph at codesourcery dot com 2005-03-19 12:02 -------
Subject: Re: New: Silencing the warning: comparison is always
true due to limited range of data type
On Sat, 19 Mar 2005, qrczak at knm dot org dot pl wrote:
> 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).
I've suggesting moving this warning to an option -Wcomparison-fixed, not
on by default and not in -Wall but included in -Wextra. See bug 12963.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20550