Tag Archives: John Regehr

reading John Regehr on undefined behavior

Reading http://blog.regehr.org/archives/213 with a colleague today, I was asked: when is it ever correct to optimize away a check for pointer NULL-ness? Doesn’t this optimization cross a line into outright sabotage?

I didn’t have a good answer, and mumbled that the programmer’s intent might not always be apparent to the optimizer.

Advertisements

Leave a comment

Filed under Uncategorized