public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/13071] New: no way to exclude backward C++ headers from include path
@ 2003-11-16 12:47 debian-gcc at lists dot debian dot org
  2003-11-16 17:29 ` [Bug c++/13071] " paolo at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 14+ messages in thread
From: debian-gcc at lists dot debian dot org @ 2003-11-16 12:47 UTC (permalink / raw)
  To: gcc-bugs

[forwarded from http://bugs.debian.org/211586]

$ cat bug-211586.cc 
extern "C" {
#include <complex.h>
}

on a Linux system this is supposed to include /usr/include/complex.h, but
/usr/include/c++/3.3/backward/complex.h is found. There is currently no way to
exclude the deprecated or antiquated header files from the include path.

-- 
           Summary: no way to exclude backward C++ headers from include path
           Product: gcc
           Version: 3.3.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: debian-gcc at lists dot debian dot org
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13071


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug c++/13071] no way to exclude backward C++ headers from include path
  2003-11-16 12:47 [Bug c++/13071] New: no way to exclude backward C++ headers from include path debian-gcc at lists dot debian dot org
@ 2003-11-16 17:29 ` paolo at gcc dot gnu dot org
  2003-11-16 18:37 ` doko at cs dot tu-berlin dot de
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 14+ messages in thread
From: paolo at gcc dot gnu dot org @ 2003-11-16 17:29 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From paolo at gcc dot gnu dot org  2003-11-16 17:29 -------
"There is currently no way" seems to me way (punt intended :) too strong!
What about:

 -nostdinc++ -I/usr/include/c++/3.3.2 -I/usr/include/c++/3.3.2/i686-pc-linux-gnu

??

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13071


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug c++/13071] no way to exclude backward C++ headers from include path
  2003-11-16 12:47 [Bug c++/13071] New: no way to exclude backward C++ headers from include path debian-gcc at lists dot debian dot org
  2003-11-16 17:29 ` [Bug c++/13071] " paolo at gcc dot gnu dot org
@ 2003-11-16 18:37 ` doko at cs dot tu-berlin dot de
  2003-11-16 18:45 ` [Bug driver/13071] " pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 14+ messages in thread
From: doko at cs dot tu-berlin dot de @ 2003-11-16 18:37 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From doko at cs dot tu-berlin dot de  2003-11-16 18:37 -------
Subject: Re:  no way to exclude backward C++ headers from include path

paolo at gcc dot gnu dot org writes:
> 
> ------- Additional Comments From paolo at gcc dot gnu dot org  2003-11-16 17:29 -------
> "There is currently no way" seems to me way (punt intended :) too strong!
> What about:
> 
>  -nostdinc++ -I/usr/include/c++/3.3.2 -I/usr/include/c++/3.3.2/i686-pc-linux-gnu

maybe too strong, but not very portable or user friendly. the user needs at least to
know the exact version of gcc he uses, if configured with
--with-gxx-include-dir, the name of this directory and the system
alias that gcc was configured for. something like -backwardstdcinc++
to explicitely enable the backward include dir would be useful.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13071


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug driver/13071] no way to exclude backward C++ headers from include path
  2003-11-16 12:47 [Bug c++/13071] New: no way to exclude backward C++ headers from include path debian-gcc at lists dot debian dot org
  2003-11-16 17:29 ` [Bug c++/13071] " paolo at gcc dot gnu dot org
  2003-11-16 18:37 ` doko at cs dot tu-berlin dot de
@ 2003-11-16 18:45 ` pinskia at gcc dot gnu dot org
  2003-11-26  8:42 ` [Bug driver/13071] no easy " pinskia at gcc dot gnu dot org
  2003-12-04 18:34 ` pinskia at gcc dot gnu dot org
  4 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-11-16 18:45 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c++                         |driver


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13071


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug driver/13071] no easy way to exclude backward C++ headers from include path
  2003-11-16 12:47 [Bug c++/13071] New: no way to exclude backward C++ headers from include path debian-gcc at lists dot debian dot org
                   ` (2 preceding siblings ...)
  2003-11-16 18:45 ` [Bug driver/13071] " pinskia at gcc dot gnu dot org
@ 2003-11-26  8:42 ` pinskia at gcc dot gnu dot org
  2003-12-04 18:34 ` pinskia at gcc dot gnu dot org
  4 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-11-26  8:42 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-11-26 08:42 -------
confirmed, changed summary based on the fact there is a way but it is not easy.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Priority|P2                          |P3
   Last reconfirmed|0000-00-00 00:00:00         |2003-11-26 08:42:43
               date|                            |
            Summary|no way to exclude backward  |no easy way to exclude
                   |C++ headers from include    |backward C++ headers from
                   |path                        |include path


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13071


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug driver/13071] no easy way to exclude backward C++ headers from include path
  2003-11-16 12:47 [Bug c++/13071] New: no way to exclude backward C++ headers from include path debian-gcc at lists dot debian dot org
                   ` (3 preceding siblings ...)
  2003-11-26  8:42 ` [Bug driver/13071] no easy " pinskia at gcc dot gnu dot org
@ 2003-12-04 18:34 ` pinskia at gcc dot gnu dot org
  4 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-12-04 18:34 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-12-04 18:34 -------
Well it is bad practice to wrap any include with `extern "c"'.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13071


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug driver/13071] no easy way to exclude backward C++ headers from include path
       [not found] <bug-13071-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2022-03-17 13:54 ` redi at gcc dot gnu.org
@ 2022-03-18 10:48 ` redi at gcc dot gnu.org
  5 siblings, 0 replies; 14+ messages in thread
From: redi at gcc dot gnu.org @ 2022-03-18 10:48 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=13071

--- Comment #12 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #11)
> I'll open an LWG issue to get clarification.

LWG agrees that it's ill-formed (no diagnostic required) to include standard
headers inside a linkage-specification.

Libstdc++ tries to makes it work as QoI, e.g. r12-4367-gc1b6c360fcf3fc

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug driver/13071] no easy way to exclude backward C++ headers from include path
       [not found] <bug-13071-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2022-03-17 11:56 ` harald at gigawatt dot nl
@ 2022-03-17 13:54 ` redi at gcc dot gnu.org
  2022-03-18 10:48 ` redi at gcc dot gnu.org
  5 siblings, 0 replies; 14+ messages in thread
From: redi at gcc dot gnu.org @ 2022-03-17 13:54 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=13071

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|WAITING                     |RESOLVED
   Target Milestone|---                         |4.3.0

--- Comment #11 from Jonathan Wakely <redi at gcc dot gnu.org> ---
[using.headers] says you can't include a header inside a declaration or
definition. A linkage specification is a declaration in terms of the C++
grammar, but I'm not sure that's what [using.headers] means. It doesn't
actually declare anything.

I'll open an LWG issue to get clarification.

Anyway, let's close this.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug driver/13071] no easy way to exclude backward C++ headers from include path
       [not found] <bug-13071-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2022-03-17 11:28 ` redi at gcc dot gnu.org
@ 2022-03-17 11:56 ` harald at gigawatt dot nl
  2022-03-17 13:54 ` redi at gcc dot gnu.org
  2022-03-18 10:48 ` redi at gcc dot gnu.org
  5 siblings, 0 replies; 14+ messages in thread
From: harald at gigawatt dot nl @ 2022-03-17 11:56 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=13071

--- Comment #10 from Harald van Dijk <harald at gigawatt dot nl> ---
(In reply to Jonathan Wakely from comment #9)
> (In reply to Harald van Dijk from comment #8)
> > (In reply to Andrew Pinski from comment #7)
> > > Isn't doing the extern "C" around standard C++ headers declared by the C++
> > > standard as undefined behavior?
> > 
> > It is (as is doing extern "C++" around standard C++ headers, for that
> > matter),
> 
> Where does it say that?

It's the exact same rule as for extern "C", [using.headers]p3. (And yes, it
does make a difference to not having extern "C++" around it and can cause
breakage, this is not purely hypothetical, but it's much less likely to cause
problems than extern "C".)

> > but <complex.h> only became a standard C++ header in C++11. This
> > bug is from 2003 and the comment before yours was from 2009, so I think
> > <complex.h> was not a standard C++ header yet.
> 
> Agreed. But there is no complex.h in the backward directory now.
>[...]
> Can we close this now?

Testing with GCC 11 as provided by Ubuntu, including <complex.h> will cause
GCC's c++/11/complex.h to be included, both in C++03 and in C++11 modes, but in
C++03 it just delegates to glibc's <complex.h>. To me, that looks like it's
fixed.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug driver/13071] no easy way to exclude backward C++ headers from include path
       [not found] <bug-13071-4@http.gcc.gnu.org/bugzilla/>
  2021-09-06  6:56 ` pinskia at gcc dot gnu.org
  2021-09-06  7:53 ` harald at gigawatt dot nl
@ 2022-03-17 11:28 ` redi at gcc dot gnu.org
  2022-03-17 11:56 ` harald at gigawatt dot nl
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 14+ messages in thread
From: redi at gcc dot gnu.org @ 2022-03-17 11:28 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=13071

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |WAITING

--- Comment #9 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Harald van Dijk from comment #8)
> (In reply to Andrew Pinski from comment #7)
> > Isn't doing the extern "C" around standard C++ headers declared by the C++
> > standard as undefined behavior?
> 
> It is (as is doing extern "C++" around standard C++ headers, for that
> matter),

Where does it say that?

> but <complex.h> only became a standard C++ header in C++11. This
> bug is from 2003 and the comment before yours was from 2009, so I think
> <complex.h> was not a standard C++ header yet.

Agreed. But there is no complex.h in the backward directory now.

The contents of that directory are:

auto_ptr.h  backward_warning.h  binders.h  hash_fun.h  hash_map  hash_set 
hashtable.h  strstream

The <strstream> header is required for standard conformance, so excluding that
directory would make it impossible to use that standard header. The other
headers seem unlikely to conflict with any headers in /usr/include (which was
the original subject of this PR).

Can we close this now?

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug driver/13071] no easy way to exclude backward C++ headers from include path
       [not found] <bug-13071-4@http.gcc.gnu.org/bugzilla/>
  2021-09-06  6:56 ` pinskia at gcc dot gnu.org
@ 2021-09-06  7:53 ` harald at gigawatt dot nl
  2022-03-17 11:28 ` redi at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 14+ messages in thread
From: harald at gigawatt dot nl @ 2021-09-06  7:53 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=13071

Harald van Dijk <harald at gigawatt dot nl> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |harald at gigawatt dot nl

--- Comment #8 from Harald van Dijk <harald at gigawatt dot nl> ---
(In reply to Andrew Pinski from comment #7)
> Isn't doing the extern "C" around standard C++ headers declared by the C++
> standard as undefined behavior?

It is (as is doing extern "C++" around standard C++ headers, for that matter),
but <complex.h> only became a standard C++ header in C++11. This bug is from
2003 and the comment before yours was from 2009, so I think <complex.h> was not
a standard C++ header yet.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug driver/13071] no easy way to exclude backward C++ headers from include path
       [not found] <bug-13071-4@http.gcc.gnu.org/bugzilla/>
@ 2021-09-06  6:56 ` pinskia at gcc dot gnu.org
  2021-09-06  7:53 ` harald at gigawatt dot nl
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-09-06  6:56 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=13071

--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Isn't doing the extern "C" around standard C++ headers declared by the C++
standard as undefined behavior?

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug driver/13071] no easy way to exclude backward C++ headers from include path
       [not found] <bug-13071-5724@http.gcc.gnu.org/bugzilla/>
  2007-02-06 18:32 ` bkoz at gcc dot gnu dot org
@ 2009-06-23 18:32 ` jwakely dot gcc at gmail dot com
  1 sibling, 0 replies; 14+ messages in thread
From: jwakely dot gcc at gmail dot com @ 2009-06-23 18:32 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from jwakely dot gcc at gmail dot com  2009-06-23 18:32 -------
This seems to be fixed in all open branches (4.3+)


-- 

jwakely dot gcc at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jwakely dot gcc at gmail dot
                   |                            |com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13071


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Bug driver/13071] no easy way to exclude backward C++ headers from include path
       [not found] <bug-13071-5724@http.gcc.gnu.org/bugzilla/>
@ 2007-02-06 18:32 ` bkoz at gcc dot gnu dot org
  2009-06-23 18:32 ` jwakely dot gcc at gmail dot com
  1 sibling, 0 replies; 14+ messages in thread
From: bkoz at gcc dot gnu dot org @ 2007-02-06 18:32 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from bkoz at gcc dot gnu dot org  2007-02-06 18:32 -------

Solving for C++0x.


-- 

bkoz at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bkoz at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13071


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2022-03-18 10:48 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-16 12:47 [Bug c++/13071] New: no way to exclude backward C++ headers from include path debian-gcc at lists dot debian dot org
2003-11-16 17:29 ` [Bug c++/13071] " paolo at gcc dot gnu dot org
2003-11-16 18:37 ` doko at cs dot tu-berlin dot de
2003-11-16 18:45 ` [Bug driver/13071] " pinskia at gcc dot gnu dot org
2003-11-26  8:42 ` [Bug driver/13071] no easy " pinskia at gcc dot gnu dot org
2003-12-04 18:34 ` pinskia at gcc dot gnu dot org
     [not found] <bug-13071-5724@http.gcc.gnu.org/bugzilla/>
2007-02-06 18:32 ` bkoz at gcc dot gnu dot org
2009-06-23 18:32 ` jwakely dot gcc at gmail dot com
     [not found] <bug-13071-4@http.gcc.gnu.org/bugzilla/>
2021-09-06  6:56 ` pinskia at gcc dot gnu.org
2021-09-06  7:53 ` harald at gigawatt dot nl
2022-03-17 11:28 ` redi at gcc dot gnu.org
2022-03-17 11:56 ` harald at gigawatt dot nl
2022-03-17 13:54 ` redi at gcc dot gnu.org
2022-03-18 10:48 ` redi at gcc dot gnu.org

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