Skip to main content

IAR Embedded Workbench for Arm 9.70.x

default_function_attributes

In this section:
Syntax
#pragma default_function_attributes[=attribute...]

where attribute can be:

type_attribute
object_attribute
@ section_name
Parameters

type_attribute

See Type attributes.

object_attribute

See Object attributes.

@ section_name

See Data and function placement in sections.

Description

Use this pragma directive to set default section placement, type attributes, and object attributes for function declarations and definitions. The default settings are only used for declarations and definitions that do not specify type or object attributes or location in some other way.

Specifying a default_function_attributes pragma directive with no attributes, restores the initial state where no such defaults have been applied to function declarations and definitions.

Example
/* Place following functions in section MYSEC" */
#pragma default_function_attributes = @ "MYSEC"
int fun1(int x) { return x + 1; }
int fun2(int x) { return x - 1; 
/* Stop placing functions into MYSEC */
#pragma default_function_attributes =

has the same effect as:

int fun1(int x) @ "MYSEC" { return x + 1; }
int fun2(int x) @ "MYSEC" { return x - 1; }
See also

location.

object_attribute.

type_attribute.