News for hackers. Stuff that matters.
Re:Everything in C is undefined behavior by Maxatar on Thursday May 21, 2026 @12:38AM (#48217940)
>That is, the compiler de facto defines what happens when you compile UB code.

That is not what undefined behavior is though, that is unspecified behavior.

The entire point of undefined behavior is to cover the cases where the compiler can't define the semantics of your program either because doing so is genuinely not possible, or is incredibly onerous to deduce, or would require introducing runtime checks whose performance cost is at odds with C and C++'s predominant use cases.

Re:Everything in C is undefined behavior by thomashabets2 on Thursday May 21, 2026 @03:31AM (#48219112)
Sorry, by "de facto defines" I meant that it factually does something, even if that "something" is "segfault the compiler at build time".

That "de facto" did some heavy lifting.