This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: #include_next and removing of duplicate include dirs
On Mon, Sep 03, 2001 at 04:01:51PM -0700, Benjamin Kosnik wrote:
>
> > A header named <std_cstddef.h> should be able to say simply
> > #include <stddef.h>. If that gets the wrong <stddef.h>, then we
> > need to look at why libstdc++ needs to replace <stddef.h> in the
> > first place. You are only asking for endless nightmares creating
> > headers with the same names as the libc headers.
>
> Hey. Didn't I just answer this in my first reply to Jakub?
Sorry, I came in halfway through the thread.
> This is a requirement of the C++ standard, see Annex D, "C" compatibility
> headers.
Wouldn't it be simpler and easier in the long run to cooperate with
the C library? For Linux and the BSDs, we can work with their library
developers to institute changes, such that the system-provided C
headers conform to the C++ standard when used by the C++ compiler.
For other platforms, their C headers will either do the right thing or
not. If they do (I believe this is the case for very recent Solaris,
e.g.) we just need to link up with their mechanism for doing it. If
they don't, that's too bad, we don't claim perfect conformance on this
target.
Certainly a header like <stddef.h> that is provided by GCC ought to
have the necessary C++ compatibility support from the beginning, and
need no wrapper from libstdc++.
zw