Vexu / arocc

A C compiler written in Zig.

Home Page:http://aro.vexu.eu/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Missing warnings for negative and too big shift count

Vexu opened this issue · comments

$ 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.

Should this be implemented in Parser.zig?

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