3 ms·
This article is a pretty ignorant diatribe. Undefined behavior simply means that the standard doesn't have requirements for what is being expressed in the prog
by kazinator 8y ago
This article is a pretty ignorant diatribe.
Undefined behavior simply means that the standard doesn't have requirements for what is being expressed in the program.
The possible range of actual behaviors doesn't define what UB is; that wording just clarifies that UB doesn't necessarily mean that there is a software defect: it is possible to behave in a documented manner characteristic of an implementation. This refers to documented extensions.
The way to fix C isn't to monkey with the definition of UB, but to target specific cases where there aren't requirements and, like, put requirements there.
- mpweiher 8y ago> The possible range of actual behaviors doesn't define what UB Hmm...you might want to actually read an article before declaring it an "ignorant diatribe". The current standards do say "possible". The first ANSI/ISO standard said "permissible". It also wasn't a "NOTE" back then. If the standard currently said what I would like it to say, why on earth would I advocate changing it?!? And once again, the wording I want is the way it was in ANSIC-C '89. So I am advocating changing the wording back to what it was...and lo-and-behold, C compilers were more sensible back then. So please inform yourself.
- kazinator 8y agoA lot of things were better in the ANSI C/C90 era; but the definition of undefined behavior is essentially the same. "Permissible" is a poor choice of word; "possible" is a legitimate clarification. The reason "permissible" is poor because it wrongly hints at the possibility that some behaviors in response to UB may be "impermissible". Which, in turn, wrongly suggests that UB is something other than the absence of requirements. Compilers were more sensible, but not because of squabbling over some minor wording over the definition of undefined behavior. It was never the case that undefined behavior was intended to be constrained in any way.