cpplib and endianness problems

Jamie Lokier egcs@tantalophile.demon.co.uk
Wed Jan 10 06:45:00 GMT 2001


Neil Booth wrote:
> > > #if L'\xfeed' != 0xfeed
> > > #error 0xfeed	/* { dg-bogus "error" "wide charconst recognition 2" } */
> > > #endif
> > 
> > The escape sequence, \xfeed represents one character of type wchar_t. 
> > This character is then converted to type 'int'. So the answer depends on 
> > the size of wchat_t and whether it is signed or not.
> 
> Hi Dave,
> 
> Sorry to take so long to get back to you on this.
> 
> wchar_t should be >= 16 bits everywhere, right?  Similarly for int.
> Certainly on Solaris.  I don't see why the test fails.
> 
> Is there a generally correct form for the above test?  I'm a little
> confused.

Does it pass with 0x1234?  If so, wchar_t is signed and getting
sign-extended.

-- Jamie


More information about the Gcc mailing list