|
|
|
|
|
by qw3rty01
2495 days ago
|
|
There is no guarantee it would work if it relies on undefined behavior--that's what undefined means, and also the reason the optimizer acted the way it did.
In that case, adding flags that defines what happens when particular undefined behavior hits would probably be the way to go, or rewrite it in a way that doesn't rely on undefined behavior. |
|
It seems to me that the problem is that trying to define undefined behavior is an inherent contradiction.
Setting aside the question of what exactly "undefined behavior" means, why does a language spec have to include it? If there is behavior that cannot be defined, why not just omit it from the standard?