This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: cpplib and endianness problems
- To: Neil Booth <neil at daikokuya dot demon dot co dot uk>
- Subject: Re: cpplib and endianness problems
- From: Jamie Lokier <egcs at tantalophile dot demon dot co dot uk>
- Date: Wed, 10 Jan 2001 15:44:44 +0100
- Cc: Dave Brolley <brolley at redhat dot com>, gcc at gcc dot gnu dot org, Zack Weinberg <zackw at Stanford dot EDU>
- References: <20001217144034.D13575@daikokuya.demon.co.uk> <3A3E35F7.7060503@redhat.com> <20010109234936.B10605@daikokuya.demon.co.uk>
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