Atmel CAVR-4 Manual De Usuario

Descargar
Página de 323
CAVR-4
Part 2. Compiler reference
Pragma directives
221
The following keywords can be used with 
#pragma
 
object_attribute
 for a function 
or variable:
Example
In the following example, the variable 
bar
 is placed in the non-initialized segment:
#pragma object_attribute=_ _no_init 
char bar; 
Unlike the directive 
#pragma
 
type_attribute
 that specifies the storing and accessing 
of a variable, it is not necessary to specify an object attribute in declarations. The 
following example declares 
bar
 without a 
#pragma
 
object_attribute
:
_ _no_init char bar;
#pragma optimize
#pragma optimize=token_1 token_2 token_3
where 
token_n
 is one of the following:
The 
#pragma
 
optimize
 directive is used for decreasing the optimization level, or for 
turning off some specific optimizations. This pragma directive only affects the function 
that follows immediately after the directive.
Note that it is not possible to optimize for speed and size at the same time. Only one of 
the 
s
 and 
z
 tokens can be used. It is also not possible to use macros embedded in this 
pragma directive. Any such macro will not get expanded by the preprocessor.
_ _root
Ensures that a function or data object is included in the linked 
application, even if it is not referenced.
_ _noreturn
Informs the compiler that the function will not return.
s
Optimizes for speed
z
Optimizes for size
2|none|3|low|6|medium|9|high
Specifies the level of optimization
no_code_motion
Turns off code motion
no_cse
Turns off common subexpression elimination
no_inline
Turns off function inlining
no_tbaa
Turns off type-based alias analysis