Bug 40084 - g++ complaining about redeclaration of wchar_t with -pedantic
Summary: g++ complaining about redeclaration of wchar_t with -pedantic
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: standards (show other bugs)
Version: 4.6-STABLE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-standards (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-07-01 19:10 UTC by Stefan Farfeleder
Modified: 2002-08-07 17:32 UTC (History)
1 user (show)

See Also:


Attachments
file.diff (448 bytes, patch)
2002-07-01 19:10 UTC, Stefan Farfeleder
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Farfeleder 2002-07-01 19:10:01 UTC
With the update to gcc 2.95.4, code to distinguish system headers from others
was disabled in is_system_include(). As a consequence, warnings (only with
-pedantic) about wchar_t being redeclared (because wchar_t is builtin in C++)
aren't suppressed anymore.

Fix: One possible solution would be not to define _BSD_WCHAR_T_ in ansi.h when
compiling in C++ mode:
How-To-Repeat: %cat wchar.cc
#include <cstddef>
int
main()
{ 
}
%g++ -ansi -pedantic -W -Wall wchar.cc
In file included from /usr/include/g++/cstddef:6,
                 from wchar.cc:1:
/usr/include/stddef.h:58: warning: redeclaration of wchar_t as `int'
Comment 1 Warner Losh freebsd_committer freebsd_triage 2002-08-07 17:31:54 UTC
State Changed
From-To: open->closed

Relevant fix MFC'd.