English
Language : 

AN3350 Datasheet, PDF (117/185 Pages) STMicroelectronics – eTPU compiler tools
AN3350
Declaration specifications
14.4.6
14.4.7
Remarks
This attribute specifies to the compiler that the program’s flow of execution might enter and
leave a function without explicit function calls and returns. For example, the standard
library’s setjmp() function allows a program to change its execution flow arbitrarily.
With this information, the compiler limits optimizations that require explicit program flow.
__attribute__((unused))
Specifies that the programmer is aware that a variable or function parameter is not referred
to.
Syntax
function-parameter __attribute__((unused));
variable-declaration __attribute__((unused));
variable-definition __attribute__((unused));
Remarks
This attribute specifies that the compiler should not issue a warning for an object if the
object is not referred to. This attribute specification has no effect if the compiler’s unused
warning setting is off.
Example 73 Example of the unused attribute
void f(int a __attribute__((unused))) /* No warning for a. */
{
int b __attribute__((unused)); /* No warning for b. */
int c; /* Possible warning for c. */
return 20;
}
__attribute__((used))
Prevents a function or static variable from being dead-stripped.
Syntax
function-declaration __attribute__((used));
function-definition __attribute__((used));
variable-declaration __attribute__((used));
variable-definition __attribute__((used));
Remarks
This attribute specifies that the linker must not dead-strip a function or static variable even if
the linker determines that the rest of the program does not refer to the object.
Doc ID 018512 Rev 2
117/185