Re: Having fun with the following C code (UB)
Shachar Shemesh writes ("Re: Having fun with the following C code (UB)"):
> I never did understand what people expect.
What people expect is that the compiler compiles programs the way C
was traditionally compiled.
Obviously that expectation nowadays results in disappointment, and
isn't captured by formal standards bodies.
> gcc uses the undefined behavior to not emit checks it would
> otherwise have to, so that your code runs faster.
Most of us would prefer slower code with fewer hideous security bugs.
> Are you really sure you want to have slower code just so that your
> corner cases are easier for you? How is that a reasonable trade-off to make?
Yes, I am absolutely sure of that.
Ian.
Reply to: