-
Notifications
You must be signed in to change notification settings - Fork 273
Unexpected verification result related to bit-field #3709
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
Comments
The C front-end needs to ignore the unnamed bit-field during struct initialization.
Usual promotion rules apply to bit-fields -- thus, an unsigned bit-field that is smaller than 'int' gets promoted to 'int', and thus yields a signed expression. Issue #3709.
Many thanks -- I've made PRs for the first two problems. I'll need to look a bit more into the third. gcc on Ubuntu 18.04 passes this, but clang gives a failure. This may well be implementation-defined or undefined behavior. |
Usual promotion rules apply to bit-fields -- thus, an unsigned bit-field that is smaller than 'int' gets promoted to 'int', and thus yields a signed expression. Issue #3709.
Usual promotion rules apply to bit-fields -- thus, an unsigned bit-field that is smaller than 'int' gets promoted to 'int', and thus yields a signed expression. Issue #3709.
…bit-field extended test for case of unnamed bit-fields (#3709)
The C front-end needs to ignore the unnamed bit-field during struct initialization; issue #3709.
The C front-end needs to ignore the unnamed bit-field during struct initialization; issue #3709.
The C front-end needs to ignore the unnamed bit-field during struct initialization; issue #3709.
Thank you so much for your update, the third one may be the implementation-defined feature.
CBMC version: 5.10 |
I looked at the third one. I think this is undefined behavior. The bit-field should get promoted to signed long long. Then you are doing an overflowing signed left shift. |
I.e., clang failing this is ok. |
The problem in the "other case" has already been fixed with ab6e2d1. |
Thank you for your confirmation! I also think the third one is undefined behavior. This issue can be closed. |
CBMC version: 5.10
Operating system: Ubuntu 18.04
Exact command line resulting in the issue: cbmc <file.c>
What behaviour did you expect:Result in SUCCESS (proofed by compiling with gcc and executing)
What happened instead:[foo.assertion.1] assertion 0: FAILURE
The text was updated successfully, but these errors were encountered: