15.2.26 Nonnull Function Attribute
The nonnull (index, ...) attribute indicates to the
compiler that one or more pointer arguments to the function must be non-null. If
the compiler determines that a Null Pointer is passed as a value to a non-null
argument, and the -Wnonnull command line option was specified, a
warning diagnostic is issued.
If no arguments are given to the
nonnull attribute, all pointer
arguments of the function are marked as non-null. For
example:void * __attribute__((nonnull)) my_memset (void * ptr, int x, size_t len);