You copied the Doc URL to your clipboard.

__attribute__((sentinel)) function attribute

This function attribute generates a warning if the specified parameter in a function call is not NULL.

Syntax

__attribute__ ((sentinel(p)))

Where:

p

is an optional integer position argument. If this argument is supplied, the compiler checks the parameter at position p counting backwards from the end of the argument list.

By default, the compiler checks the parameter at position zero, the last parameter of the function call. That is, __attribute__ ((sentinel)) is equivalent to __attribute__ ((sentinel(0)))

Was this page helpful? Yes No