HP aC++/HP C Programmer's Guide (B3901-90036; A.06.26; September 2011)
derived_ from V.The addresses that can be _derived_ from some value V are the
addresses that can be _directly derived_ from V and the addresses that can be
_derived_ from the result of dereferencing those addresses. The function does not store
addresses passed to it as arguments to any memory location that is visible (can be
referenced directly or indirectly) after the call to this function returns.
Example:
void foo(int *pi) __attribute__ ((non_exposing));
attribute noreturn
__attribute__ ((noreturn))
Similar to the NO_RETURN pragma, this attribute asserts to the optimizer that this function
never returns to the call site. This allows the optimizer to delete any code after the function
call. A C++ function marked with this attribute may still throw an exception unless it has
an empty throw list.
Example:
void foo(int i) __attribute__ ((noreturn));
attribute format
__attribute__ ((format(type, arg_format_string,
arg_check_start)))
The format attribute specifies that a function takes printf, scanf, strftime or
strfmon style arguments which should be type-checked against a format string. In the
example above, the format string is the second argument of the function foo and the
arguments to check start with the third argument.
Example:
int foo(int i, const char *my_format, ...) __attribute__((format(printf, 2, 3)));
attribute visibility
__attribute__ ((visibility("default"|"protected"|"hidden")))
The visibility attributes "default", "protected", and "hidden", are equivalent
to the options -Bdefault, -Bprotected, and -Bhidden, and the pragmas
DEFAULT_BINDING, EXTERN, and HIDDEN, respectively.
Example:
void foo(int i) __attribute__ ((visibility("hidden"));
attribute warn_unused_result
__attribute__ ((warn_unused_result))
If a caller of a function with this attribute does not use its return value, the compiler emits
a warning. This is useful for functions where not checking the result can be a security
144 Pragma Directives and Attributes