Bug 22786 - g++ -fshort-wchar gives warning for every file
g++ -fshort-wchar gives warning for every file
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: gcc (Show other bugs)
7.0
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-12-23 15:46 EST by David Baron
Modified: 2007-04-18 12:30 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-12-28 07:09:35 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description David Baron 2000-12-23 15:46:51 EST
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 16:02:39 EST
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 07:09:32 EST
This was fixed by
2000-09-04  Craig Newell  <CraigN@ieee.org>

        * 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.