https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100404
--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> --- There is a way from keeping the compiler from knowing what the value of the incoming pointer is to hide it behind an inline-asm which does nothing: int __attribute__ ((nonnull)) isnull(char *ptr) { asm("" : "+r"(ptr)); if (ptr == 0) return 0; return 1; } --- CUT ---- This is an useful trick for a lot of thing.