3 ms·
There was much gnawing of teeth when compilers started to take advantage of the “strict aliasing rule”: http://labs.qt.nokia.com/2011/06/10/type-punning-and-str
by pascal_cuoq 14y ago
There was much gnawing of teeth when compilers started to take advantage of the “strict aliasing rule”: http://labs.qt.nokia.com/2011/06/10/type-punning-and-strict-aliasing/ http://labs.qt.nokia.com/2011/06/10/type-punning-and-strict-...
Programmers might think that it is okay to use uninitialized variables as a source of additional entropy (xoring with the real source of entropy), but it isn't, because the compiler will treat the uninitialized access as undefined behavior and eliminate code altogether:
http://kqueue.org/blog/2012/06/25/more-randomness-or-less/ http://kqueue.org/blog/2012/06/25/more-randomness-or-less/
This 3-part blog post by Chris Lattner has various examples: http://blog.llvm.org/2011/05/what-every-c-programmer-should-know.html http://blog.llvm.org/2011/05/what-every-c-programmer-should-...