systemc
systemc copied to clipboard
sc_externs.h signatures do not match standard. add on extern "C"
sc_externs.h forward declares the following functions:
extern "C" int sc_main( int argc, char* argv[] );
namespace sc_core {
extern "C" int sc_elab_and_sim( int argc, char* argv[] );
extern "C" int sc_argc();
extern "C" const char* const* sc_argv();
It appends extern "C" to the signature of the functions, which is not compatible with declarations of these functions in the SystemC LRM sections 4.3.1-4.3.4.
Another source file that declares and defines the functions according to the standard, without extern "C" is unable to link to the systemc library correctly.
Thanks @mattgately for reporting this issue! The LWG will have a look at it.