jeudi 3 août 2017

C99 'extern inline' in library used by C++11

There seem to be plenty of answers clarifying the semantics of C99's inline specification, with a single extern translation unit / implementation. If a C++ program / library was to use a C(99) API, with an extern "C" {} wrapper, will it honour the 'single implementation' semantics of the library?

If the C++ compiler is still free to create multiple instantiations as needed, is it required to recognise the C implementation as just another instance, via linker magic, or is this implementation-specific?

From my understanding, the only portable interoperable solution seems to be a static inline specification. Is C99's extern inline fundamentally incompatible with C++? (specifically C++11 and above)

Aucun commentaire:

Enregistrer un commentaire