On Sun, Feb 14, 2010 at 10:09:58AM +0100, Frank Thieme wrote:
> >> 2. src/support/debug.h: DEBUG is defined as DEBUG      = (1 << 31)
> >> what is out of range for enum (32 bit) and I guess should be DEBUG
> >>  = (1 << 30) as there is no 30, yet.
> >
> > 1 << 31  is within the 32 bit range.
> 
> mmh, yeah, you are right. Why does the compiler complain then?
> 
> Error: lyx::Debug::Type is not within the range of a long or unsigned long.

Just for the record: after a hint from Kornel and Frank's testing we
established that  1u << 31  does the trick and is supposed to work
according to the Standard. 

1 << 31 is legal, though, but the outcome depends on the internal
representation of signed integers. I doubt, however, that Sun uses
something else than two's complement, so the compiler error message is
somewhat ... "unusual".

Andre'

Reply via email to