logoalt Hacker News

ameliusyesterday at 8:45 PM1 replyview on HN

You might still make a mistake, even if you think you know the answer. It's much better to instrument the code to figure it out, or write a short test program.


Replies

bestouffyesterday at 8:56 PM

It's Undefined Behavior. So you can instrument all you want, the answer will still be wrong. You'll capture what your particular compiler does under some particular conditions (opt flags, surrounding code, etc.) but that will not be representative of what can happen in the general case (hint : anything can happen with UB).

show 3 replies