My question is mainly about the fact that a C++ toolchain "understands" both C and C++, so if I feed some code with an extern "C"
to a c++ toolchain I assume it can understand what to do with that; but what if I feed code with extern "C++"
to a C toolchain ?
What is the expected behaviour ?
If the compiler ALSO understands C++, it may accept it. If it's a pure C compiler it will object (just like it will on extern "C"
as that syntax is not valid C - this is why it's typically enclosed with #ifdef __cplusplus
or some such)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With