On Fri, Jun 15, 2012 at 11:59 AM, Duncan Sands <baldr...@free.fr> wrote:
> Hi Richard,
>
>
>> Uh, I don't think we should do that.  Why do we include cstring here
>> anyways?
>>
>> Ian - you added this include in rev. 167764, I don't think that was
>> "proper".
>> But I'm not sure wrapping a system.h include inside extern "C" from a C++
>> plugin is proper either ...
>
>
> since the plugin needs to call GCC routines, and GCC is built as C, it has
> to
> wrap at least some GCC headers in "extern C" to avoid mangling of the names
> of those GCC routines (otherwise you can't load the plugin because the
> linker
> will look for the mangled names in GCC and not find them).  But perhaps you
> know a trick to avoid the name mangling problem?  It is true that maybe via
> a careful dance it is possible to not wrap system.h in "extern C" - I will
> give it a go.

As system.h is supposed to only include system headers and do nothing
else it has to be prepared to be included from C++ already, so no extern "C"
wrapping should be necessary for it.

Richard.

> Ciao, Duncan.
>
>
>>
>> Thanks,
>> Richard.
>>
>>> Thanks, Duncan.
>>>
>>> Index: gcc/system.h
>>> ===================================================================
>>> --- gcc/system.h        (revision 188518)
>>> +++ gcc/system.h        (working copy)
>>> @@ -191,7 +191,9 @@
>>>  #endif
>>>
>>>  #ifdef __cplusplus
>>> +extern "C++" {
>>>  # include<cstring>
>>> +}
>>>  #endif
>>>
>>>  /* Some of glibc's string inlines cause warnings.  Plus we'd rather
>
>

Reply via email to