This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: 1 << BITS_PER_UNIT


> 
> 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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]