News for hackers. Stuff that matters.
Re:C’s Biggest Mistake (2009) by dpc_pw on Sunday September 13, 2020 @01:22AM (#24458595)
> UB has nothing to do with optimization. It's about working around the differences between all the platforms that a C program might need to be compiled for.

That's what it used to mean. But at some points compilers people decided that since UB means literally "anything can happen" they can make optimizers optimize the shit out of the code assuming that UB can't be there.

C code that used to work 20 years ago, because the UB in it resulted in some weird but non-catastrophic behavior, doesn't work at all compiled modern compilers.

There are no comments on this comment yet.