Open
Description
By default, programs like this will abort with an illegal instruction due to UBSAN:
int main() {
int i = 100;
i <<= i;
return i;
}
However, programs like this will compile and run successfully:
int main() {
int i;
return i;
}
Since zig already enables runtime checks for undefined behavior by default, it doesn't seem like too much of a stretch to enable compile-time checks as well.