This is the mail archive of the gcc-help@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: error: template with C linkage


"Kevin P. Fleming" <kpfleming@digium.com> writes:

>> This approach is controlled on a target-by-target basis, by the way.  If
>> OpenBSD's header files are C++ ready, gcc's OpenBSD target configuration
>> should be changed to define NO_IMPLICIT_EXTERN_C.
>
> Does '-isystem' factor into this in any way? I would hope that using
> -isystem' to specify an additional directory of 'system' header files
> would not also turn on implicit 'extern "C"' mode.
>
> If you are curious, we use '-isystem' to have GCC relax our
> warning/error modes on header files that are nominally part of our
> project but are installed into 'system' locations (like
> /opt/<package>/include).

Using -isystem causes the directory to be treated as a standard system
directory, which does indeed include implicit wrapping in extern "C" if
that is customary for the target.

Of course most targets these days do define NO_IMPLICIT_EXTERN_C,
OpenBSD seems to be a bit of an outlier in that regard, and that may
simply be a bug in gcc's OpenBSD support.

Ian


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