SPRUIG8J January 2018 – March 2024
The following GCC function attributes are supported:
The following additional TI-specific function attribute is supported:
For example, this function declaration uses the alias attribute to make "my_alias" a function alias for the "myFunc" function:
void my_alias() __attribute__((alias("myFunc")));
The aligned function attribute aligns the function using the specified alignment. The alignment must be a power of 2. This attribute has the same effect as the CODE_ALIGN pragma; see Section 5.8.4.
The always_inline function attribute has the same effect as the FUNC_ALWAYS_INLINE pragma. See Section 5.8.12
The calls attribute has the same effect as the CALLS pragma, which is described in Section 5.8.1.
The format attribute is applied to the declarations of printf, fprintf, sprintf, snprintf, vprintf, vfprintf, vsprintf, vsnprintf, scanf, fscanf, vfscanf, vscanf, vsscanf, and sscanf in stdio.h. Thus when GCC extensions are enabled, the data arguments of these functions are type checked against the format specifiers in the format string argument and warnings are issued when there is a mismatch. These warnings can be suppressed in the usual ways if they are not desired.
The malloc attribute is applied to the declarations of malloc, calloc, realloc and memalign in stdlib.h.
The noinline function attribute has the same effect as the FUNC_CANNOT_INLINE pragma. See Section 5.8.13
The retain attribute has the same effect as the RETAIN pragma (Section 5.8.31). That is, the section that contains the function will not be omitted from conditionally linked output even if it is not referenced elsewhere in the application.
The section attribute when used on a function has the same effect as the CODE_SECTION pragma. See Section 5.8.5
The weak attribute has the same effect as the WEAK pragma (Section 5.8.35).