10.48 __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-Confidential PDF file icon PDF version ARM DUI0472J
Copyright © 2010-2013 ARM. All rights reserved.