public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "potswa at mac dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/52040] New: TR1 is not accessible using compiler flags alone
Date: Sun, 29 Jan 2012 14:52:00 -0000	[thread overview]
Message-ID: <bug-52040-4@http.gcc.gnu.org/bugzilla/> (raw)

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.


             reply	other threads:[~2012-01-29 14:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-29 14:52 potswa at mac dot com [this message]
2012-01-29 18:49 ` [Bug libstdc++/52040] " paolo.carlini at oracle dot com
2012-01-29 22:50 ` redi at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-52040-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).