On 8 December 2011 01:09, Ian Lance Taylor wrote:
> Jonathan Wakely <jwakely....@gmail.com> writes:
>
>>> Should the Cygwin header use
>>> extern "C++" on those declarations even though they're inside #ifdef
>>> __cplusplus, or should adaint.c not #include things inside extern "C"?
>>
>> You could surround them in extern "C++", linkage specifications nest.
>
> ...but I think it would be better for adaint.c to not #include system
> header files inside extern "C".

Indeed, I sent a follow up message which the gcc list rejected because
the android gmail app refuses to send plain text email. Here's what I
said:

Oh sorry, I missed that the question was about a /standard/ header.
Not sure about that. I think it's invalid, the standard says:

"Whether a name from the C standard library declared with external
linkage has extern "C" or extern "C++" linkage is
implementation-defined."

It shouldn't be needed unless the header is quite broken, and might
cause problems, as it has here.  A well behaved header will put
explicit extern "C++" around anything that need "C++" language
linkage, to protect against such questionable behaviour from users.

Reply via email to