https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69835
Bug ID: 69835 Summary: [6 Regression] -Wnonnull diagnoses parameter comparisons with NULL even when those could have changed Product: gcc Version: 6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: jakub at gcc dot gnu.org Reporter: jakub at gcc dot gnu.org Target Milestone: --- -Wnonnull warns even about: static void f(const char *s) { do { printf("%s\n",s); s = NULL; } while (s != NULL); } which is wrong, after the parameter has been changed or could have been changed, it is completely valid to compare it against NULL.