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

Rule S2183: Ints and longs should not be shifted by zero or more than their number of bits-1 #581

Closed
Evangelink opened this issue Jul 21, 2017 · 0 comments
Assignees
Labels
Type: New Feature This hasn't been here before.
Milestone

Comments

@Evangelink
Copy link
Contributor

RSPEC-2183

Since an int is a 32-bit variable, shifting by more than +/-31 is confusing at best and an error at worst. Shifting an int by 32 is the same as shifting it by 0, and shifting it by 33 is the same as shifting it by 1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: New Feature This hasn't been here before.
Projects
None yet
Development

No branches or pull requests

3 participants