2 ms·
Yep. Optimization by C compilers has gotten to the point of "your worst enemy is the compiler". (My favorite: I had UB in my debug function, but inside an ifdef
by TheLoneWolfling 12y ago
Yep. Optimization by C compilers has gotten to the point of "your worst enemy is the compiler". (My favorite: I had UB in my debug function, but inside an ifdef debug block for speed purposes. So I was getting the most absurd magic errors, that only happened when I was trying to debug)
As I've said, I want reads from uninitialized variables to be at least consistent.
if (x) {
foo();
} else {
foo();
}
should always run foo(). Ditto:
foo();
if (x)
bar();
baz();
should always run baz() (assuming everything before it is "normal" - not going to get into jumps or system exit here), should always run foo() if it runs baz(), and should always run foo().