Fix for -fshort-wchar warnings ...

Craig Newell
Mon Aug 28 07:15:00 GMT 2000

Hi All,

  Currently using "-fshort-wchar" produces an unnecessary warning such as:

In file included from :0:
<command line>: warning: "__WCHAR_TYPE__" redefined

  This is simply fixed by undefining __WCHAR_TYPE__ before redefining it
as in the following patch:

2000-08-28	Craig Newell <>

	* gcc.c: Undefine "__WCHAR_TYPE__" before redefining it.

Index: gcc/gcc.c
RCS file: /cvs/gcc/egcs/gcc/gcc.c,v
retrieving revision 1.160
diff -u -r1.160 gcc.c
--- gcc.c	2000/08/24 20:31:32	1.160
+++ gcc.c	2000/08/28 14:14:25
@@ -565,7 +565,7 @@
  %{!undef:%{!ansi:%{!std=*:%p}%{std=gnu*:%p}} %P} %{trigraphs}\
  %c %{Os:-D__OPTIMIZE_SIZE__} %{O*:%{!O0:-D__OPTIMIZE__}}\
- %{fshort-wchar:-D__WCHAR_TYPE__=short\\ unsigned\\ int}\
+ %{fshort-wchar:-U__WCHAR_TYPE__ -D__WCHAR_TYPE__=short\\ unsigned\\ int}\
  %{fshow-column} %{fno-show-column}\
  %{fleading-underscore} %{fno-leading-underscore}\
  %{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*} %Z %i\


      Craig Newell                email:
      Free Spirit                 icbm:  N 42°38'47" W 71°18'19"

More information about the Gcc-patches mailing list