Atmel CAVR-4 Manual De Usuario
![Atmel](https://files.manualsbrain.com/attachments/0369829915bda09f9c2e00fb805a7753579683b5/common/fit/150/50/8d2bf08978ec3e5bc63f4343ac5e91ce8d0e40045619fa520d910d64af8f/brand_logo.png)
CAVR-4
270
Descriptions of language extensions
AVR® IAR C/C++ Compiler
Reference Guide
See the chapter Extended keywords for a complete list of attributes.
Placement at an absolute address or in a named segment
The operator
@
or the directive #
pragma
location
can be used for placing a variable
at an absolute address, or placing a variable or function in a named segment. The named
segment can either be a predefined segment, or a user-defined segment.
segment can either be a predefined segment, or a user-defined segment.
Example 1
_ _no_init int x @ 0x1000;
An absolute declared variable cannot have an initializer, which means the variable must
also be
also be
_ _no_init
or
const
declared.
Example 2
void test(void) @ "MYOWNSEGMENT"
{
...
Note that all segments, both user-defined and predefined, must be assigned a location,
which is done in the linker command file.
which is done in the linker command file.
_Pragma
For information about the preprocessor operator
_Pragma
, see _Pragma(), page 233.
Variadic macros
Variadic macros are the preprocessor macro equivalents of
printf
style functions. For
more information, see __VA_ARGS__, page 235.
Inline functions
The
inline
keyword can be used on functions. It works just like the C++ keyword
inline
and the
#pragma inline
directive.
Mixing declarations and statements
It is possible to mix declarations and statements within the same scope.
Declaration in for loops
It is possible to have a declaration in the initialization expression of a
for
loop.