This is the mail archive of the gcc-patches@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] |
If ENABLE_BUILD_WITH_CXX is defined, then GCC itself is built with C++, and we want a C++ signature for functions. If it is not defined, then GCC itself is not built with C++, and we want (and must have) a C signature.
I suppose we would decide that fancy_abort always uses a C signature, but that seems odd.
Ian
I guess the issue is when people care only about C plugins, yet fancy_abort get implicitly exported with a C++ linkage.
I suspect this goes back to the eternal question: what do we consider as part of the public GCC public API (no, Basile, I am not suggesting to have the same discussion again.)
(1) fancy_abort is declared in system.h (2) system.h should not be wrapped in extern "C" when included from a plugin, (3) it should be valid to include it from plugins compiled as C or as C++, (4) fancy_abort should use the same linkage as GCC, i.e. C when GCC built as C, C++ when built as C++ (aka ENABLE_BUILD_WITH_CXX).
That's pretty nasty. But to avoid the nastiness one of (1) - (4) needs to be dropped. Which one?
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |