https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79458
Martin Sebor <msebor at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED CC| |msebor at gcc dot gnu.org Resolution|--- |INVALID --- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> --- The attribute comes before the function name: $ cat t.C && gcc -S -Wall t.C struct test { __attribute__ ((nonnull)) test (char*); [[gnu::nonnull]] test (char*, char*); }; test a (0); test b (0, 0); t.C:6:10: warning: null argument where non-null required (argument 2) [-Wnonnul] test a (0); ^ t.C:7:13: warning: null argument where non-null required (argument 2) [-Wnonnul] test b (0, 0); ^ t.C:7:13: warning: null argument where non-null required (argument 3) [-Wnonnul]