3 ms·
I know exactly how it will behave in most of those scenarios. Right up until an optimizing compiler throws your assumptions under the bus. Compilers are allow
by jhomedall 10y ago
I know exactly how it will behave in most of those scenarios.
Right up until an optimizing compiler throws your assumptions under the bus.
Compilers are allowed to (and both GCC and Clang frequently do) assume that your program will never invoke undefined behavior, and optimize accordingly.
See: http://blog.llvm.org/2011/05/what-every-c-programmer-should-know_14.html http://blog.llvm.org/2011/05/what-every-c-programmer-should-...
Also maybe: http://blog.regehr.org/archives/1307 http://blog.regehr.org/archives/1307
This can lead to some pretty bad security flaws: https://lwn.net/Articles/575563/ https://lwn.net/Articles/575563/