I have an oversight in my code where I'm declaring & defining a function with C-linkage, though it's not possible. Example snippet: <snip> //------------------------------------------------------------ #ifdef __cplusplus extern "C" { #endif // ... some functions which are compatible with C linkage // Intended to be a helper function not exposed from library std::string GetEngineVersion() { // ... } #ifdef __cplusplus } #endif //------------------------------------------------------------ </snip> Obviously the GetEngineVersion function cannot have C linkage because it returns a C++ class. My question is: does GCC have a warning for this scenario? Specifically, can it warn when something is declared extern "C" that's incompatible with C linkage? I compile with the following warning flags and I didn't get a warning: -Wall -Wunused-parameter -Wextra -Weffc++ -Wctor-dtor-privacy -Wnon-virtual-dtor -Wreorder -Wold-style-cast -Woverloaded-virtual -Werror Incidentally, when I compile the same code in VS2013 I get this warning: warning C4190: 'GetEngineVersion' has C-linkage specified, but returns UDT 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>' which is incompatible with C Best regards, Nick