preprocessor/8880: __WCHAR_TYPE__ macro incorrectly set to "long int" with -fshort-wchar

Neil Booth neil@daikokuya.co.uk
Wed Dec 11 13:16:00 GMT 2002


The following reply was made to PR preprocessor/8880; it has been noted by GNATS.

From: Neil Booth <neil@daikokuya.co.uk>
To: cheinan@primus.com
Cc: gcc-gnats@gcc.gnu.org, gcc-patches@gcc.gnu.org, gcc-bugs@gcc.gnu.org
Subject: Re: preprocessor/8880: __WCHAR_TYPE__ macro incorrectly set to "long int" with -fshort-wchar
Date: Wed, 11 Dec 2002 21:13:15 +0000

 Please confirm this patch fixes it (a kludge around the kludge that is
 predefined macros before 3.3).
 
 Neil.
 
 	PR preprocessor/8880
 	* gcc.c (cpp_unique_options): Handle -fshort-wchar later so it
 	overrides any target CPU specs.
 
 Index: gcc.c
 ===================================================================
 RCS file: /cvs/gcc/gcc/gcc/gcc.c,v
 retrieving revision 1.296.2.12.4.4
 diff -u -p -r1.296.2.12.4.4 gcc.c
 --- gcc.c	14 Oct 2002 21:55:26 -0000	1.296.2.12.4.4
 +++ gcc.c	11 Dec 2002 21:11:52 -0000
 @@ -688,10 +688,10 @@ static const char *cpp_unique_options =
   %{!undef:%{!ansi:%{!std=*:%p}%{std=gnu*:%p}} %P} %{trigraphs}\
   %{Os:-D__OPTIMIZE_SIZE__} %{O*:%{!O0:-D__OPTIMIZE__}}\
   %{fno-inline|O0|!O*:-D__NO_INLINE__} %{ffast-math:-D__FAST_MATH__}\
 - %{fshort-wchar:-U__WCHAR_TYPE__ -D__WCHAR_TYPE__=short\\ unsigned\\ int}\
   %{ffreestanding:-D__STDC_HOSTED__=0} %{fno-hosted:-D__STDC_HOSTED__=0}\
   %{!ffreestanding:%{!fno-hosted:-D__STDC_HOSTED__=1}} %{remap}\
   %{g3:-dD} %{H} %C %{D*&U*&A*} %{i*} %Z %i\
 + %{fshort-wchar:-U__WCHAR_TYPE__ -D__WCHAR_TYPE__=short\\ unsigned\\ int}\
   %{E|M|MM:%W{o*}}";
  
  /* This contains cpp options which are common with cc1_options and are passed



More information about the Gcc-prs mailing list