Le 8 août 2011 à 20:49, Ian Lance Taylor a écrit : > > However, since we currently permit plugins to call anything in gcc, I > think the answer is going to have to be that plugins which do that > should be compiled with C++.
Ok, i'll move to C++ then, until a dedicated C plugin API comes out. > I don't think that adding extern "C" to > all gcc header files is the right approach. Adding extern "C" to a few > selected header files seems fine. Adding extern "C" to a small set of files doesn't make sense to me. When working with real-world plugin, you will certainly end up calling many different gcc primitives coming from a wide bunch of header files (which for most of them don't use extern "C" for now). This hack should be applied to all of the plugin visible files, or none, but not to just a few when someone needs it.