-
Notifications
You must be signed in to change notification settings - Fork 19
Fix unused variables that only appear in assert
#1036
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 unused variables that only appear in assert
#1036
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still needs formatting fixes, and #1037 should help so that the formatting guidance is provided in the GitHub action log.
I'll wait for #1037 to be merged and then will rebase this. |
This replaces instances of the form ``` x = f(..); assert(x); ``` with ``` x = f(..); INVARIANT(x, "..."); ```
c8f7102
to
675461f
Compare
bbff9ef
to
fccec66
Compare
24951de
to
e851938
Compare
src/ic3/aux_types.hh
Outdated
@@ -6,8 +6,14 @@ Author: Eugene Goldberg, eu.goldberg@gmail.com | |||
|
|||
******************************************************/ | |||
|
|||
#pragma once |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't usually use this in this code base. Why is it necessary here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure it is necessary, I am not too familiar with this code to be honest.
Is it better to replace this with
#ifndef ...
#define ..
...
#endif
?
Or omit altogether if it compiles without such a guard?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
None of those ic3 headers appear to use a header guard, so omit altogether if it compiles, I'd say.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it seems that only dnf_io.hh
requires a guard. The PR is update accordingly.
This fixes instances in the IC3 implementation where variables are only used for
assert
, leading to errors when compiling withg++
13.3.0.This also removes
assert(false)
in two instances in the IC3 implementation.