-
Notifications
You must be signed in to change notification settings - Fork 273
C library header de-duplication #6490
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
01e6bbe
to
bfa2735
Compare
Codecov Report
@@ Coverage Diff @@
## develop #6490 +/- ##
========================================
Coverage 76.10% 76.10%
========================================
Files 1548 1548
Lines 166326 166326
========================================
Hits 126576 126576
Misses 39750 39750 Continue to review full report at Codecov.
|
@@ -7,6 +7,7 @@ for f in "$@"; do | |||
echo "Checking ${f}" | |||
cp "${f}" __libcheck.c | |||
perl -p -i -e 's/(__builtin_[^v])/s$1/' __libcheck.c | |||
perl -p -i -e 's/s(__builtin_unreachable)/$1/' __libcheck.c |
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.
Couldn't you just do this for __CPROVER_assume(0)
instead?
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.
That would be a valid hack, but then it's only __CPROVER_assume(0)
that actually makes the code thereafter unreachable, so it's a bit strange perhaps?
bfa2735
to
638a520
Compare
Fixes the declaration in builtin_headers.h. Type checking actually ignored this declaration and would always generate the expression of the correct type.
Makes GCC happier when doing library validation. Our C front-end would implicitly generate nondet return values of the correct type, so this does not actually change any verification behaviour.
The uninitialised local variable can trip up GCC's validation. Use a __VERIFIER_nondet_ function as is already done elsewhere.
These calls are wrapped in #ifdef LIBRARY_CHECK and exist for the sole purpose of making library_check.sh not warn about `noreturn` functions seemingly returning.
638a520
to
fc7072d
Compare
library/cprover.h exists for the sole purpose of syntax-checking the C library using the system's C compiler. The declarations in there, however, did not always match those of the authoritative cprover_builtin_library.h. To avoid this split-brain problem, just include cprover_builtin_library.h after providing a few declarations otherwise generated by ansi_c_internal_additions.cpp.
fc7072d
to
5295845
Compare
Please review commit-by-commit: the goal of this PR is spelled out in the last commit in this series (removing duplicate-and-conflicting declarations), and the commits before this one enable this work while making sure
library_check.sh
remains happy.