News for hackers. Stuff that matters.
Re:Everything in C is undefined behavior by indigo945 on Wednesday May 20, 2026 @07:17AM (#48205950)
Not only is "arguments are evaluated left-to-right" less easy to formalize than you think, it would also make all C code run slower, because the compiler would no longer be able to interleave computations for more efficient pipelining. The same goes for "expression is [only evaluated once]/[always evaluated twice]".

Of course the developer is navigating a minefield every time they use volatile, that's why it's called "volatile" - an English word otherwise only commonly used in chemistry, where it means "stuff that wants to go boom".

Re:Everything in C is undefined behavior by imtringued on Wednesday May 20, 2026 @07:45AM (#48206200)
Your argument makes no sense since the developer is expected to perform manual sequencing. Correctly written UB free code cannot be interleaved either.

All you've achieved is that the standard C function call syntax can no longer be used as is.

Re:Everything in C is undefined behavior by remexre on Wednesday May 20, 2026 @09:43AM (#48207665)
the compiler can still interleave anything it shows is side-effect free; it’s hard to show that something would benefit from being reordered without analyzing it well enough to determine what side effects it has