-
Notifications
You must be signed in to change notification settings - Fork 274
Use CPROVER_PREFIX macro instead of hardcoded __CPROVER_ string #3171
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
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.
Passed Diffblue compatibility checks (cbmc commit: 836af2c).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/87932897
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.
What a terrifying number of magic strings duplicated everywhere, this is certainly an improvement though.
@@ -43,7 +43,8 @@ void slice_global_inits(goto_modelt &goto_model) | |||
call_grapht::create_from_root_function(goto_model, entry_point, false); | |||
const auto directed_graph = call_graph.get_directed_graph(); | |||
INVARIANT( | |||
!directed_graph.empty(), "At least __CPROVER_start should be reachable"); | |||
!directed_graph.empty(), | |||
"at least " CPROVER_PREFIX "start should be reachable"); |
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.
⛏️ goto_functionst::entry_point()
inplace of it all if anything
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.
Good one, because also that one was always wrong: it was missing an extra underscore...
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.
Good to see this cleanup! Is it worth also adding a linter and/or clang-format rule to catch the use of raw magic __CPROVER_blah strings?
836af2c
to
21a5586
Compare
@chrisr-diffblue Linter check added. |
Thanks for the additional linter check @tautschnig - definitely LGTM now. |
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.
Passed Diffblue compatibility checks (cbmc commit: 21a5586).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/87942241
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.
Passed Diffblue compatibility checks (cbmc commit: d942999).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/87943412
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.
Looks good, thanks for the clean up.
d942999
to
4da3fa5
Compare
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.
Passed Diffblue compatibility checks (cbmc commit: 4da3fa5).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/88740531
Using string literals is prone to typos and sometimes, but not always, using the CPROVER_PREFIX macro removes the potential for central modifications. Fixes: diffblue#735
This should help avoid future code introducing literal uses of __CPROVER_ back into the code base.
4da3fa5
to
3a67fb6
Compare
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.
🚫
This PR failed Diffblue compatibility checks (cbmc commit: 3a67fb6).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/89554147
Status will be re-evaluated on next push.
Please contact @peterschrammel, @thk123, or @allredj for support.
Common spurious failures:
- the cbmc commit has disappeared in the mean time (e.g. in a force-push)
- the author is not in the list of contributors (e.g. first-time contributors).
The incompatibility may have been introduced by an earlier PR. In that case merging this
PR should be avoided unless it fixes the current incompatibility.
Using string literals is prone to typos and sometimes, but not always, using the CPROVER_PREFIX macro removes the potential for central modifications.
Fixes: #735