Hacker News new | ask | show | jobs
by kmm01 1851 days ago
I'm afraid the author themselves is misreading the definition of undefined behavior. Undefined behavior is not "behavior upon use of a nonportable or erroneous program construct". That rephrasing completely changed the meaning. Undefined behavior is, as the C standard states, "behavior [, ...,] for which the Standard imposes no requirements". The whole ", upon use of...," part is just exemplifying situations in which undefined behavior can occur. The standard will sometimes say that a certain construct results in undefined behavior but more importantly any construct for which the standard does not specify a certain behavior has (what else?) undefined behavior.
1 comments

True. I think the point of the author is that the C standards group is not doing their job by leaving so much room for compilers to interpret undefined behavior.