This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/52040] New: TR1 is not accessible using compiler flags alone
- From: "potswa at mac dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 29 Jan 2012 14:12:28 +0000
- Subject: [Bug libstdc++/52040] New: TR1 is not accessible using compiler flags alone
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52040
Bug #: 52040
Summary: TR1 is not accessible using compiler flags alone
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: potswa@mac.com
C++ TR1 (N1836) Â1.3/3-4 says
3. â Users should be required to take explicit action to have access to library
extensions.
4. It is recommended either that additional declarations in standard headers be
protected with a macro that is not defined by default, or else that all
extended headers, including both new headers and parallel versions of standard
headers with nonstandard declarations, be placed in a separate directory that
is not part of the default search path.
<end quote>
The "explicit action" is left open-ended, but the document suggests that mere
inclusion of a nonstandard header should fail.
GCC interprets the explicit action to be prefixing the header name with "tr1/".
This is a change to source code, whereas other platforms such as MSVC allow TR1
to be used without altering the header names.
An alternative way to use GCC would be to pass "-isystem
/usr/include/c++/.../tr1" â instead of modifying the header name, modify the
search path. This fails because, for example, <tr1/cfloat> includes the line
#include <cfloat>
There are two ways to fix this. One was actually used in some other headers
circa GCC 4.2, and would read:
#include "../cfloat"
The other is perhaps less clean, but opinions may differ:
#include_next <cfloat>
Applying either of these fixes across the tr1/ directory should improve source
compatibility.