Atmel CAVR-4 Manuale Utente
CAVR-4
222
Descriptions of pragma directives
AVR® IAR C/C++ Compiler
Reference Guide
Note: If you use the
#pragma
optimize
directive to specify an optimization level that
is higher than the optimization level you specify using a compiler option, the pragma
directive is ignored.
directive is ignored.
Example
#pragma optimize=s 9
int small_and_used_often()
{
...
}
#pragma optimize=z 9
int big_and_seldom_used()
{
...
}
#pragma pack
#pragma pack([[{push|pop},][name,]][n])
The
#pragma
pack
directive is used for specifying the alignment of structures and
union members.
Note: In the AVR IAR Compiler, alignment is always 1 and this pragma directive has
no effect. It is available in order to maintain compatibility with other IAR Systems
compilers.
no effect. It is available in order to maintain compatibility with other IAR Systems
compilers.
pack(n)
sets the structure alignment to
n
. The
pack(n)
only affects declarations of
structures following the pragma directive and to the next
#pragma
pack
or end of file.
pack()
resets the structure alignment to default.
pack(push
[,name]
[,n])
pushes the current alignment with the label
name
and sets
alignment to
n
. Note that both
name
and
n
are optional.
pack(pop
[,name]
[,n])
pops to the label
name
and sets alignment to
n
. Note that
both
name
and
n
are optional.
If
name
is omitted, only top alignment is removed. If
n
is omitted, alignment is set to the
value popped from the stack.
n
Packing alignment, one of: 1, 2, 4, 8, or 16
name
Pushed or popped alignment label