3 ms·
The thing is, many compilers just assume that undefined behaviour won't happen, without defining any particular behaviour. And testing for something like pointe
by GlitchMr 10y ago
The thing is, many compilers just assume that undefined behaviour won't happen, without defining any particular behaviour. And testing for something like pointer alignment on architectures that silently allow pointer misalignment is really, really expensive.
That said, you can use -fsanitize=undefined to verify correctness of a program (as far specification is concerned). Just be prepared for it being a bit slow.
- Jweb_Guru 10y agoIt's not possible to determine all possible undefined behavior in a C program. -fsanitize=undefined is best-effort.