9.53 Type attributes

The __attribute__ keyword enables you to specify special attributes of variables or structure fields, functions, and types.

The keyword format is either of the following:
__attribute__((attribute1, attribute2, ...))
__attribute__((__attribute1__, __attribute2__, ...))
For example:
void * Function_Attributes_malloc_0(int b) __attribute__((malloc));
static int b __attribute__((__unused__));
The following table summarizes the available type attributes.

Table 9-4 Type attributes that the compiler supports, and their equivalents

Type attribute Non-attribute equivalent
__attribute__((bitband)) -
__attribute__((aligned)) __align
__attribute__((packed))
__packeda
__attribute__((transparent_union)) -
a
The __packed qualifier does not affect type in GNU mode.
Non-ConfidentialPDF file icon PDF versionARM DUI0375F
Copyright © 2007, 2008, 2011, 2012, 2014 ARM. All rights reserved.