top | item 45990610

(no title)

CryZe | 3 months ago

Zig has no undefined behavior?

discuss

order

Simran-B|3 months ago

Zig has the concept of illegal behavior, of which a subset is unchecked illegal behavior - basically undefined behavior, but if evaluated at comptime, it results in a compile error. The documentation also states that most illegal behavior is safety-checked unless you use the ReleaseFast or ReleaseSmall optimization modes (and don't enable safety checks for individual blocks).