-
Notifications
You must be signed in to change notification settings - Fork 200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Registration may not run when using the C++ interface #2424
Comments
Hi, do you have a working example that exhibits such issue? Any platform or compiler where |
Indeed, I ran into this issue when linking the generated C++ file with a Rust program. At first I thought it was a Rust issue but they pointed out that this behaviour is allowed by the C++ standard. |
Can you reproduce with a 100% C++ test? Would you like to suggest a fix? |
I am not aware of a C++ compiler whose default linker behaves this way, nor is there an easy fix. |
The C++ standard says that:
https://en.cppreference.com/w/cpp/language/initialization#Deferred_dynamic_initialization
Since the generated C++ files do not contain any variable or function that is odr-used this means that the compiler is free not to initialise the factory instance and so that factory doesn't get registered and
souffle::ProgramFactory::newInstance
fails to find the program.The text was updated successfully, but these errors were encountered: