5 ms·
That's not really how undefined behavior works though. In general, undefined behavior is used to optimize code by assuming it never happens and thus ignore that
by DSMan195276 12y ago
That's not really how undefined behavior works though. In general, undefined behavior is used to optimize code by assuming it never happens and thus ignore that case. "implementing" undefined behavior to format the hard drive would mean that compilers would have to implement checks for every possible type of undefined behavior whenever you do something that has a undefined case (Ex. Every time you dereference a pointer). The slow-down would be fairly noticeable.
- Dewie 12y agoI think it was a joke, so not something that should be taken literally.