|
|
|
|
|
by kllrnohj
1294 days ago
|
|
> It is definitely not, e.g., an assertion on the operand because UB can't happen. C specification says a program is ill-formed if any UB happens. So yes, the spec does say that compilers are allowed to assume UB doesn't happen. After all, a program with UB is ill-formed and therefore shouldn't exist! I think you're conflating "unspecified behavior" and "undefined behavior" - the two have different meanings in the spec. |
|
I disagree on the logic from "ill-formed" to "assume it doesn't happen".
> I think you're conflating "unspecified behavior" and "undefined behavior" - the two have different meanings in the spec.
I admit I don't differentiate those two words. I think they are just word-play.