News for hackers. Stuff that matters.
Re:With Undefined Behavior, Anything Is Possible by userbinator on Friday August 17, 2018 @11:37PM (#17786718)
IMHO the standards committee has been very reasonable in its definition of undefined behaviour; the standard even mentions one of the possible interpretations of UB is "behaving during translation or program execution in a documented manner characteristic of the environment", which is pretty much what everyone writing C with target platform(s) in mind is expecting.

In other words, I wouldn't blame the standards committee; they just set out to define a minimal "subset" language which would be suitably portable so as to be widely applicable, and left the rest to the implementers. They basically said "here is what we have standardised. The rest is up to you to define what is reasonable."

The "adversarial" attitude is entirely attributed to dogmatic compiler authors who are treating the standard as gospel in their theoretical world, and completely ignoring the real-world implications --- including the users of their products. What they don't seem to understand is the standard is merely a starting point, not the be-all-and-end-all of C. "Just because the standard allows, doesn't mean you should."

Linus has some more (less ranty) posts on the topic here: https://yarchive.net/comp/linux/gcc.html

There are no comments on this comment yet.