News for hackers. Stuff that matters.
Re:Undefined behavior in C is a reading error by kmm01 on Thursday May 20, 2021 @12:33PM (#27223365)
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.
Re:Undefined behavior in C is a reading error by warkdarrior on Thursday May 20, 2021 @01:19PM (#27224040)
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.