Fun with NULL pointers, part 2
Fun with NULL pointers, part 2
Posted Jul 22, 2009 9:53 UTC (Wed) by mb (subscriber, #50428)In reply to: Fun with NULL pointers, part 2 by johill
Parent article: Fun with NULL pointers, part 2
Well, for most architectures the BUG() functions are __attribute__((noreturn)) or something equivalent. So the compiler cannot assume that the execution flow reaches to after the if (!ptr) check at all, if ptr is NULL. So it should not optimize it out in that case.
