This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: 1 << BITS_PER_UNIT
- To: richard dot earnshaw at arm dot com
- Subject: Re: 1 << BITS_PER_UNIT
- From: Alexandre Oliva <oliva at dcc dot unicamp dot br>
- Date: 26 Oct 1998 07:54:42 -200
- Cc: Michael Hayes <m dot hayes at elec dot canterbury dot ac dot nz>, egcs at cygnus dot com
- References: <199810260944.JAA05764@sun52.NIS.cambridge>
Richard Earnshaw <rearnsha@arm.com> writes:
> I wasn't suggesting ((1 << x) - 1) == (2 << (x - 1)), that is obviously
> false, but (1 << x) == (2 << (x - 1)). Do some elementary math.
Ah, now I get it.
> The point is that (1 << BITS_PER_UNIT) - 1 gets you a warning, but
> (2 << (BITS_PER_UNIT - 1)) - 1 gives the same result but no warning, and
> is well within the spec since (BITS_PER_UNIT - 1) is less than the word
> size.
Right. One more reason for us to stick with a macro, heh?
--
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:oliva@gnu.org mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil