-
Notifications
You must be signed in to change notification settings - Fork 274
Do not assume that build architecture has byte/char==8 bits #5962
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
Codecov Report
@@ Coverage Diff @@
## develop #5962 +/- ##
===========================================
+ Coverage 74.11% 74.30% +0.19%
===========================================
Files 1444 1444
Lines 157389 157404 +15
===========================================
+ Hits 116646 116957 +311
+ Misses 40743 40447 -296
Continue to review full report at Codecov.
|
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.
Glad to see you and the author of #5873 managed to sort things out ( #5873 (comment) )
10a5c8e
to
4f565cc
Compare
Note that the commit message isn't entirely true: The changes to ansi-c/library/gcc.c affect the analysis platform, not the build platform. |
The C/C++ standard does not guarantee this, and limits.h/climits has the CHAR_BIT define set properly. All changes in this commit only refer to the platform the tool is being built for. The analysis target requires a separate set of changes where the byte width must be taken from the configuration or annotations within expressions.
Oh, indeed, I've moved those changes to the commit in #917 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.
Thanks for the cleanup - much better :-)
@@ -357,8 +358,9 @@ int janalyzer_parse_optionst::doit() | |||
// Print a banner | |||
// | |||
log.status() << "JANALYZER version " << CBMC_VERSION << " " | |||
<< sizeof(void *) * 8 << "-bit " << config.this_architecture() | |||
<< " " << config.this_operating_system() << messaget::eom; | |||
<< sizeof(void *) * CHAR_BIT << "-bit " |
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.
Out-of-scope for this PR, but give how this exact log.status pattern is duplicated several times, it does rather feel like a utility function could be useful :-)
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.
Thank you for highlighting this. Now PR'ed in #6089.
The C/C++ standard does not guarantee this, and limits.h/climits has the
CHAR_BIT define set properly.
All changes in this commit only refer to the platform the tool is being
built for. The analysis target requires a separate set of changes where
the byte width must be taken from the configuration or annotations
within expressions.
This is a first part of #917, now factored into a PR of its own.