https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110815
Bug ID: 110815 Summary: [static] not as useful as the nonnull attribute Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: muecker at gwdg dot de Target Milestone: --- C code increasingly uses void foo(char buf[static 10]); to indicate that buf is a non-null pointer. GCC already has some warnings for this but all you would get with the nonnull attribute. In particular, -Wnonnull-compare is missing. void foo (int a[static 1]) { if ((void*)0 == a) // should warn return; } https://godbolt.org/z/E6E33Pa8h