This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: preprocessor/8880: __WCHAR_TYPE__ macro incorrectly set to "long int" with -fshort-wchar
- From: Neil Booth <neil at daikokuya dot co dot uk>
- To: cheinan at primus dot com
- Cc: gcc-gnats at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org, gcc-bugs at gcc dot gnu dot org
- Date: Wed, 11 Dec 2002 21:13:15 +0000
- Subject: Re: preprocessor/8880: __WCHAR_TYPE__ macro incorrectly set to "long int" with -fshort-wchar
- References: <20021209201745.13373.qmail@sources.redhat.com>
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