On Sun, Dec 01, 2013 at 11:18:47PM +0900, Joel Rees wrote: > optimizer's excuse to silently kill undefined behavior code.
As far as I know, all examples I have seen this is not what happens. What happens is that the compiler assumes you write code that has defined behavior and optimises based on the assumptions of that defined behavior. And if it happens that it's undefined behavior it might do the wrong thing. It can for instance then come to conclusion that that code can not be executed and so can be safely removed. The making of the assumptions is a problem since it doesn't always have a way of checking those assumptions. And it had, it might be complicated to turn that back into a warning. Please note that making those assumptions is an important thing to do for a C compiler to be able to generate fast code. There is lots of code where you _might_ run into undefined behavior but never do because of how the code is called. And the compiler assumes that you only call it in defined cases. Kurt -- To UNSUBSCRIBE, email to debian-security-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/20131202001323.ga4...@roeckx.be