undefined behaviour
Posted Jul 17, 2009 19:38 UTC (Fri) by
foom (subscriber, #14868)
In reply to:
undefined behaviour by ehabkost
Parent article:
Linux 2.6.30 exploit posted
Well, that's a wrong point. When the C standard says something is undefined,
that means the *compiler* can do whatever it wants. GCC would be within its rights to automatically
exec NetHack whenever you dereference a null pointer. :) But instead it chooses to assume that the
program will crash, and optimizes the rest of the program accordingly. Which is also a perfectly
valid option. "Undefined" is for the benefit of the compiler, not a constraint upon the compiler.
(
Log in to post comments)