systemc icon indicating copy to clipboard operation
systemc copied to clipboard

sc_externs.h signatures do not match standard. add on extern "C"

Open mattgately opened this issue 5 years ago • 4 comments

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.

mattgately avatar Jan 17 '20 18:01 mattgately

Thanks @mattgately for reporting this issue! The LWG will have a look at it.

maehne avatar Jan 28 '20 16:01 maehne