Ivan, the Language Mangler 🦀 · @hywan
1198 followers · 1123 posts · Server fosstodon.org

Falsehoods programmers believe about undefined behaviour, predr.ag/blog/falsehoods-progr.

The article explains what is an undefined behaviour exactly. It’s funny.

#undefinedbehaviour

Last updated 2 years ago

David Jones · @drj
275 followers · 1247 posts · Server typo.social

The basic problem with C is that the committee have been asleep at the wheel for 30 years. As soon as UB began to be interpreted as "the compiler will now do impossible things" they should have stepped in and said "actually we mean that _some value_ is produced, but we do not care to specify what" (or a trap is raised, to keep SGI on board). That covers arithmetic anyway.
Sure for pointers and longjmp you do need "truly undefined", but even that could be profiled.

1/

#undefinedbehaviour

Last updated 2 years ago