Skip to content

Replace assert(...) by macros from invariant.h [blocks: #6749] #6754

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

Merged

Conversation

tautschnig
Copy link
Collaborator

While new/modified code shouldn't use assert(...) anyway, we had several
existing uses of assert. Once we remove nonstd/optional.h, we will no
longer implicitly include cassert, implying that a lot of #include
changes will be necessary. Instead of adding these, go all the
way and fix the undesired uses of assert.

  • Each commit message has a non-empty body, explaining why the change was made.
  • n/a Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • n/a The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
  • Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
  • n/a My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • n/a White-space or formatting changes outside the feature-related changed lines are in commits of their own.

@codecov
Copy link

codecov bot commented Mar 24, 2022

Codecov Report

Base: 78.38% // Head: 78.38% // Increases project coverage by +0.00% 🎉

Coverage data is based on head (8934bb1) compared to base (794f6f7).
Patch coverage: 74.35% of modified lines in pull request are covered.

❗ Current head 8934bb1 differs from pull request most recent head f901919. Consider uploading reports for the commit f901919 to get more accurate results

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #6754   +/-   ##
========================================
  Coverage    78.38%   78.38%           
========================================
  Files         1647     1647           
  Lines       190343   190334    -9     
========================================
+ Hits        149196   149201    +5     
+ Misses       41147    41133   -14     
Impacted Files Coverage Δ
src/analyses/custom_bitvector_analysis.cpp 55.96% <0.00%> (ø)
src/analyses/invariant_set.cpp 0.00% <0.00%> (ø)
src/analyses/invariant_set.h 0.00% <0.00%> (ø)
src/ansi-c/c_typecheck_base.cpp 83.09% <0.00%> (ø)
src/cpp/cpp_item.h 64.15% <0.00%> (-7.55%) ⬇️
src/cpp/cpp_typecheck_initializer.cpp 29.94% <0.00%> (ø)
src/cpp/expr2cpp.cpp 42.97% <0.00%> (ø)
src/goto-analyzer/unreachable_instructions.cpp 89.01% <ø> (ø)
src/goto-diff/change_impact.cpp 0.00% <0.00%> (ø)
.../goto-instrument/accelerate/acceleration_utils.cpp 2.23% <ø> (+<0.01%) ⬆️
... and 104 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@tautschnig tautschnig mentioned this pull request Mar 25, 2022
4 tasks
@tautschnig tautschnig force-pushed the cleanup/assert-to-invariant branch from ef2f2de to e32eb8c Compare March 25, 2022 19:24
@tautschnig tautschnig changed the title Replace assert(...) by macros from invariant.h Replace assert(...) by macros from invariant.h [blocks: #6749] Mar 25, 2022
@tautschnig tautschnig self-assigned this Mar 30, 2022
@tautschnig tautschnig force-pushed the cleanup/assert-to-invariant branch from e32eb8c to 1cc7fc1 Compare May 10, 2022 12:24
@tautschnig tautschnig removed their assignment May 10, 2022
@tautschnig tautschnig force-pushed the cleanup/assert-to-invariant branch from 1cc7fc1 to 800e30b Compare May 10, 2022 12:28
@tautschnig tautschnig force-pushed the cleanup/assert-to-invariant branch from 800e30b to c2c62d1 Compare May 17, 2022 20:01
@tautschnig tautschnig force-pushed the cleanup/assert-to-invariant branch from c2c62d1 to 8fde4ca Compare June 7, 2022 11:11
@peterschrammel peterschrammel removed their assignment Jun 7, 2022
@tautschnig tautschnig force-pushed the cleanup/assert-to-invariant branch from 8fde4ca to d09ef2e Compare June 8, 2022 07:26
@@ -221,9 +221,9 @@ static void make_subtype(typet &dest, typet &src)
break;
}
else if(p->is_nil())
assert(false);
UNREACHABLE;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A rare annotation but seems right in this case!

@tautschnig tautschnig self-assigned this Jun 14, 2022
@tautschnig tautschnig force-pushed the cleanup/assert-to-invariant branch from d09ef2e to 4f30f4d Compare June 15, 2022 09:44
@tautschnig tautschnig force-pushed the cleanup/assert-to-invariant branch from 4f30f4d to cd49345 Compare June 28, 2022 18:53
@tautschnig tautschnig removed their assignment Jun 30, 2022
@tautschnig tautschnig force-pushed the cleanup/assert-to-invariant branch from cd49345 to fb0dd57 Compare October 27, 2022 09:40
@tautschnig tautschnig force-pushed the cleanup/assert-to-invariant branch 2 times, most recently from c8f5829 to 33eb2cc Compare November 21, 2022 08:34
@tautschnig tautschnig force-pushed the cleanup/assert-to-invariant branch from 33eb2cc to 8934bb1 Compare December 1, 2022 21:14
@tautschnig tautschnig assigned tautschnig and unassigned kroening and chris-ryder Dec 1, 2022
While new/modified code shouldn't use assert(...) anyway, we had several
existing uses of assert. Once we remove nonstd/optional.h, we will no
longer implicitly include cassert, implying that a lot of #include
<cassert> changes will be necessary. Instead of adding these, go all the
way and fix the undesired uses of assert.
@tautschnig tautschnig force-pushed the cleanup/assert-to-invariant branch from 8934bb1 to f901919 Compare December 1, 2022 22:29
@tautschnig tautschnig merged commit 8ed5e40 into diffblue:develop Dec 1, 2022
@tautschnig tautschnig deleted the cleanup/assert-to-invariant branch December 1, 2022 23:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants