int main(){ { int t[2]; t[f()] = 12; output = t[f()]; } { int t[2]; t[g()] = 12; output = t[g()]; } }
I've been playing with this program and similar ones. Stack slot reuse is a disaster for Valgrind, and arrays are a good universal suppressor for thing kind of compiler warning.
Ok, maybe not such a good idea. Too bad-- it would be nice if there was some way to get reliable feedback about this undefined behavior.
John