Skip to content
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

Bug right shift #323

Open
vranckxrobin opened this issue Oct 21, 2022 · 1 comment
Open

Bug right shift #323

vranckxrobin opened this issue Oct 21, 2022 · 1 comment

Comments

@vranckxrobin
Copy link

shift fout

I think this should not give an error.
Because for a shift it is only undefined behavior when the bits shifted is equal or greater then the number of bits that the variable represents. In this case 1024LL is 64 bits so it should work with 63 bits.

@btj
Copy link
Member

btj commented Oct 25, 2022

You are right; C11 6.2.6.2 paragraph 6 defines the width of an integer type as including the sign bit. This is also how CH2O and Cerberus interpret the standard. I will fix VeriFast.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants