|Non-Confidential||PDF version||ARM DUI0472J|
|Home > Compiler-specific Features > __attribute__((used)) function attribute|
This function attribute informs the compiler that a static function is to be retained in the object file, even if it is unreferenced.
Static functions marked as used are emitted to a single section,
in the order they are declared. You can specify the section functions
are placed in using
Functions marked with
tagged in the object file to avoid removal by linker unused section
This function attribute is a GNU compiler extension that the ARM compiler supports.
Static variables can also be marked as used using
static int lose_this(int); static int keep_this(int) __attribute__((used)); // retained in object file static int keep_this_too(int) __attribute__((used)); // retained in object file