This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: -isystem and C++ headers


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

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

-- 
- Geoffrey Keating <geoffk@geoffk.org>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]