| ▲ | bigstrat2003 an hour ago | |||||||
> A C compiler makes so many assumptions that UB does not occur that every program, even well functioning ones, would emit walls of warnings. The problem here is that the C compiler ever assumes that UB doesn't happen. That is empirically very much not the case, therefore the compiler should never be allowed to assume a lack of UB unless it can somehow prove that to be true. I honestly don't really care how many optimizations that would break; correctness is king. Software that goes fast is only worthwhile if it works correctly. | ||||||||
| ▲ | dgrunwald 17 minutes ago | parent [-] | |||||||
> I honestly don't really care how many optimizations that would break; correctness is king. It's approximately all optimizations. Good news: there's already a compiler option that does exactly what you want: -O0. It's even enabled by default (unless overridden by another -O switch)! | ||||||||
| ||||||||