Skip to content
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

Fix undefined behavior in element.cpp #45

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

axelfeldmann
Copy link

Previously, clearInputs() is declared as:

bool clearInputs(); in include/element.h.

However, in its definition in src/element.cpp, it does not actually have a return statement. This is undefined behavior and causes crashes when compiled using gcc 11.4 (and probably many other versions too!)

This PR changes the type of clearInputs() to a void function to fix this undefined behavior.

It also makes a similar (though less critical) fix to convertThreshold in MNRLAdapter.cpp.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant