9.47 __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)))
Non-ConfidentialPDF file icon PDF versionARM DUI0375E
Copyright © 2007, 2008, 2011, 2012, 2014 ARM. All rights reserved.