Re:C and C++ Prioritize Performance over Correctness
by layer8 on Friday August 18, 2023 @03:37PM
(#37181004)
> The standards writers could have made all UB implementation defined, but they didn't.
This is not possible without performance impact, because, in the general case, whether a program constitutes UB depends on data and/or previous program flow (halting problem), and thus would require additional runtime checks even for code that happens to never run into UB.
This is not possible without performance impact, because, in the general case, whether a program constitutes UB depends on data and/or previous program flow (halting problem), and thus would require additional runtime checks even for code that happens to never run into UB.