accellera-official / systemc

SystemC Reference Implementation
https://systemc.org/overview/systemc/
Apache License 2.0
451 stars 145 forks source link

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

Open mattgately opened 4 years ago

mattgately commented 4 years ago

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.

maehne commented 4 years ago

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

AndrewGoodrich commented 7 months ago

The extern "C" is present in the signatures for 3.0.0. This issue can be closed.

maehne commented 7 months ago

@AndrewGoodrich: I think you are misunderstanding the issue. The OP pointed out that the extern "C" part of the signatures is missing in the LRM definitions for the corresponding functions. So the question is whether the PoC should remove extern "C" from these signatures or whether it needs to be addressed as part of an erratum to the IEEE Std 1666-2023 LRM.

AndrewGoodrich commented 7 months ago

Sorry for my misunderstanding the issue. I assume this is an issue we need to discuss.

On Dec 17, 2023, at 9:27 AM, Torsten Maehne @.***> wrote:

@AndrewGoodrich https://github.com/AndrewGoodrich: I think you are misunderstanding the issue. The OP pointed out that the extern "C" part of the signatures is missing in the LRM definitions for the corresponding functions. So the question is whether the PoC should remove extern "C" from these signatures or whether it needs to be addressed as part of an erratum to the IEEE Std 1666-2023 LRM.

— Reply to this email directly, view it on GitHub https://github.com/accellera-official/systemc/issues/2#issuecomment-1859187816, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGQR2OHECSNICWMWCRL6FLYJ36MFAVCNFSM4KIMEIFKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOBVHEYTQNZYGE3A. You are receiving this because you were mentioned.