Bug 22786 - g++ -fshort-wchar gives warning for every file
Summary: g++ -fshort-wchar gives warning for every file
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gcc
Version: 7.0
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-12-23 20:46 UTC by David Baron
Modified: 2007-04-18 16:30 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2000-12-28 12:09:35 UTC
Embargoed:


Attachments (Terms of Use)

Description David Baron 2000-12-23 20:46:51 UTC
Using the -fshort-wchar option with g++ (but not gcc) gives the following
warning for every file compiled:

<command line>: warning: "__WCHAR_TYPE__" redefined

Steps to reproduce:
 * create a file called test.cpp containing "int main() { return 0; }"
 * `g++ -fshort-wchar -o test test.cpp`

This seems like the -fshort-wchar option is being tranlated to a -D option
at 2 different points (perhaps g++ and gcc), which leads to 2
-D__WCHAR_TYPE__ options, or something like that.

It would be nice to see this fixed, since we're using this for Mozilla when
the option is available.  I haven't tested this on the gcc trunk.

Comment 1 David Baron 2000-12-23 21:02:39 UTC
It turns out I may not have been looking closely enough.  bryner pointed out to
me that this warning shows up for gcc as well.  My memory of trying it on my RH
7.0 system (which I don't have access to now) was the reverse, but maybe I
didn't test what I thought I did.

Comment 2 Jakub Jelinek 2000-12-28 12:09:32 UTC
This was fixed by
2000-09-04  Craig Newell  <CraigN>

        * gcc.c: Undefine "__WCHAR_TYPE__" before redefining it.
in CVS gcc, gcc-c++-2.96-70 will include this fix.


Note You need to log in before you can comment on or make changes to this bug.