This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [gcc-in-cxx] bootstrap fails
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Ian Lance Taylor <iant at google dot com>
- Cc: Jerry Quinn <jlquinn at optonline dot net>, gcc at gcc dot gnu dot org
- Date: Sat, 21 Mar 2009 23:07:19 +0000 (UTC)
- Subject: Re: [gcc-in-cxx] bootstrap fails
- References: <49C568CA.7010301@optonline.net> <m3tz5mmqg6.fsf@google.com>
On Sat, 21 Mar 2009, Ian Lance Taylor wrote:
> > ../.././gcc/config/i386/i386.c:3282: error: comparison is always true
> > due to limited range of data type
>
> #define IN_RANGE(VALUE, LOWER, UPPER) \
> ((unsigned HOST_WIDE_INT) (VALUE) - (unsigned HOST_WIDE_INT) (LOWER) \
> <= (unsigned HOST_WIDE_INT) (UPPER) - (unsigned HOST_WIDE_INT) (LOWER))
> gcc_assert (IN_RANGE (ix86_arch, 0, 255));
>
> It all looks fine to me.
Sounds like enums in C++ having limited ranges meaning this is an
assertion of something the compiler knows to be true. (This actually
illustrates why these warnings can sometimes be problematic - you write a
check for something that may or may not be always true depending on the
sizes of types, the handling of enumerations, etc., and when it is always
true the compiler complains. But in other cases they can be useful.)
--
Joseph S. Myers
joseph@codesourcery.com