This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: -isystem and C++ headers
On Tue, May 11, 2004 at 04:47:59PM -0700, Geoff Keating wrote:
> Daniel Jacobowitz <drow@false.org> writes:
>
> > c-opts.c says this:
> >
> > case OPT_isystem:
> > add_path (xstrdup (arg), SYSTEM, 0);
> > break;
> >
> > Is there a particular reason the third argument, cxx_aware, is not set?
> > This means that anything included via -isystem will be marked with extern
> > "C" by g++.
>
> I expect this is because we don't have a separate -isystem-c++ flag,
> and because the most typical use is something like
>
> -isystem /some/root/usr/include
>
> which would fail if those headers needed extern "C".
Perhaps -isystem should honor NO_IMPLICIT_EXTERN_C then. Not that this
would help me now; we use implicit extern "C" for newlib targets. I
don't know whether it's necessary, but we don't switch it off.
> > This breaks the GDB testsuite in a combined tree, because all
> > of libstdc++'s headers get marked as "system" headers. This isn't new, I
> > don't think; I usually run my GDB testsuites using an installed compiler
> > instead because I've had such a hard time getting combined trees to search
> > in the tree instead of the install dir.
> >
> > The -isystem comes from DejaGNU, and has for a long time: see proc
> > g++_include_flags in libgloss.exp. DejaGNU should probably be updated to
> > invoke scripts/testsuite_flags instead. It looks like this aspect of
> > -isystem hasn't changed since at least 3.2, but I'm still not sure it's
> > right.
>
> I think it would be just as good for dejagnu to not use -isystem when
> testing in the build tree. -isystem also suppresses most kinds of warnings,
> which is probably not what you want for a file in the build tree.
>
> What does the libstdc++ testsuite itself do? It seems to work.
Just -I.
I guess upstream DejaGNU should be updated, one way or the other.
Would folks prefer I hardcode the pathnames (as it does now) but change
-isystem to -I, or add a reference to scripts/testsuite_flags?
--
Daniel Jacobowitz