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

Missing warnings for negative and too big shift count #596

Closed
Vexu opened this issue Dec 4, 2023 · 2 comments · Fixed by #614
Closed

Missing warnings for negative and too big shift count #596

Vexu opened this issue Dec 4, 2023 · 2 comments · Fixed by #614
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@Vexu
Copy link
Owner

Vexu commented Dec 4, 2023

$ clang a.c -c
a.c:1:14: warning: shift count is negative [-Wshift-count-negative]
int a = 0b11 << -32;
             ^  ~~~
a.c:2:14: warning: shift count >= width of type [-Wshift-count-overflow]
int b = 0b11 << 32;
             ^  ~~
2 warnings generated.
@Vexu Vexu added enhancement New feature or request good first issue Good for newcomers labels Dec 4, 2023
@sno2
Copy link

sno2 commented Dec 29, 2023

Should this be implemented in Parser.zig?

@Vexu
Copy link
Owner Author

Vexu commented Dec 30, 2023

Yes but you can also change the shift functions in Value.zig.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants