https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108154
Martin Sebor <msebor at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |INVALID
Status|UNCONFIRMED |RESOLVED
--- Comment #3 from Martin Sebor <msebor at gcc dot gnu.org> ---
The warning here is intentional -- as noted, a [static 1] array can be as small
as a single element. The warning is designed to help detect stronger
assumptions inadvertently made by the function definition. (The compiler makes
no analysis to see how the function is being called; it could if the function
were declared static but but without full LTO it can't for an extern function.)
The recommended annotation to indicate that a pointer argument must not be null
is attribute nonnull.