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: cpplib and endianness problems


On Jan 15, 2001, Neil Booth <neil@daikokuya.demon.co.uk> wrote:

> Jamie Lokier wrote:-
>> Does it pass with 0x1234?  If so, wchar_t is signed and getting
>> sign-extended.

> Yes, it appears OK.  So I'll comment out the old test, with this patch.

I think it would be nice to check whether we do The Right Thing (TM)
when wchar_t is signed too.  How about this patch?  Ok to install?

Index: gcc/testsuite/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	* gcc.dg/cpp/if-2.c: Adjust for signed wchar_t.

Index: gcc/testsuite/gcc.dg/cpp/if-2.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/testsuite/gcc.dg/cpp/if-2.c,v
retrieving revision 1.5
diff -u -p -r1.5 if-2.c
--- gcc/testsuite/gcc.dg/cpp/if-2.c 2001/01/15 07:51:18 1.5
+++ gcc/testsuite/gcc.dg/cpp/if-2.c 2001/01/17 12:48:44
@@ -9,10 +9,8 @@
 #error L'a'	/* { dg-bogus "error" "wide charconst recognition 1" } */
 #endif
 
-#if 0 /* This test doesn't work on targets with signed 16-bit wchar_t.  */
-#if L'\xfeed' != 0xfeed
+#if L'\xfeed' != 0xfeed && L'\xfeed' != (0xfeed - 0x10000)
 #error 0xfeed	/* { dg-bogus "error" "wide charconst recognition 2" } */
-#endif
 #endif
 
 #if L'\x1234' != 0x1234

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me

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