2 ms·
If all compliant compilers implement undefined behavior as an attempt to format the hard drive, it's not exactly undefined behavior any more, right? The behavi
by nostrademons 12y ago
If all compliant compilers implement undefined behavior as an attempt to format the hard drive, it's not exactly undefined behavior any more, right? The behavior has been defined as "format the hard drive".
The HTML5 spec is a good example of the pros and cons of defining everything. On one hand, you can be sure that every compliant parser will parse the document the same way, including incredibly malformed documents. On the other, it significantly increases the complexity of the implementation, and it eliminates certain optimization opportunities. On the third hand - it doesn't seem to have discouraged page authors from writing incredibly malformed HTML. If it had discouraged page authors from writing incredibly malformed HTML, then a significant portion of the web would break.
- kazinator 12y agoThe behavior is still formally undefined; it has been locally defined by the implementor as a documented extension. So to speak, it is "evil-implementor-defined", but not "standard-defined". :)