This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: 1 << BITS_PER_UNIT
- To: Michael Hayes <m dot hayes at elec dot canterbury dot ac dot nz>
- Subject: Re: 1 << BITS_PER_UNIT
- From: Richard Earnshaw <rearnsha at arm dot com>
- Date: Wed, 14 Oct 1998 20:20:44 +0100
- Cc: egcs at cygnus dot com
- Cc: rearnsha at sun52 dot arm dot com
- Organization: ARM Ltd.
- Reply-To: richard dot earnshaw at arm dot com
>
> While there's a crusade on to remove egcs compilation warnings, here's
> one for interested folks to consider.
>
> It regards the use of (1 << BITS_PER_UNIT), usually when computing a
> bit mask with (1 << BITS_PER_UNIT) - 1, when BITS_PER_UNIT is equal to
> the number of bits in a HOST_LONG_INT. This occurs with the C4x
> target where BITS_PER_UNIT is 32. Maybe there should be a macro,
> say BITS_PER_UNIT_MASK?
>
> Michael.
>
Or just use (2 << (BITS_PER_UNIT - 1))
Same result, but no warning.
Richard