14.1.2.10 format_arg (string-index)

The format_arg attribute specifies that a function takes printf or scanf style arguments, modifies it (for example, to translate it into another language), and passes it to a printf or scanf style function. For example, consider the declaration:

extern char * my_dgettext (char *my_domain, const char *my_format)
 __attribute__ ((format_arg (2)));

This causes the compiler to check the arguments in calls to my_dgettext, whose result is passed to a printf, scanf or strftime type function for consistency with the printf style format string argument my_format.

The parameter string-index specifies which argument is the format string argument (starting from 1).

The format-arg attribute allows you to identify your own functions which modify format strings, so that the compiler can check the calls to printf, scanf or strftime function, whose operands are a call to one of your own functions.

interrupt [ ( [ save(list) ] [, irq(irqid) ]
 [, altirq(altirqid)]
 [, preprologue(asm) ] ) ]

Use this option to indicate that the specified function is an interrupt handler. The compiler will generate function prologue and epilogue sequences suitable for use in an interrupt handler when this attribute is present. The optional parameter save specifies a list of variables to be saved and restored in the function prologue and epilogue, respectively. The optional parameters irq and altirq specify interrupt vector table IDs to be used. The optional parameter preprologue specifies assembly code that is to be emitted before the compiler-generated prologue code. See 15 Interrupts for a full description, including examples.

When using the interrupt attribute, please specify either auto_psv or no_auto_psv. If none is specified a warning will be produced and auto_psv will be assumed.