Atmel CAVR-4 Manuale Utente
CAVR-4
Part 2. Compiler reference
Extended keywords
211
_ _nearfunc
Controls the storage of functions in code memory space.
The
_ _nearfunc
memory attribute allows you to define the memory range where a
function will be located.
Functions declared
_ _nearfunc
can be called from the entire code memory area, but
must reside in the first 128 Kbytes of the code memory.
The default for the
The default for the
-v0
to
-v4
processor options is
_ _nearfunc
, and it only affects the
size of the function pointers.
Note that pointers with function memory attributes have restrictions in implicit and
explicit casts when casting between pointers and also when casting between pointers
and integer types.
explicit casts when casting between pointers and also when casting between pointers
and integer types.
It is possible to call a
_ _nearfunc
function from a
_ _farfunc
function and vice versa.
Only the size of the function pointer is affected.
_ _no_init
The
_ _no_init
keyword is used for suppressing initialization of a variable at system
startup.
The
_ _no_init
keyword is placed in front of the type. In this example,
myarray
is
placed in a non-initialized segment:
_ _no_init int myarray[10];
The
#pragma
object_attribute
directive can also be used. The following
declaration is equivalent to the previous one:
#pragma object_attribute=_ _no_init
int myarray[10];
Note: The
_ _no_init
keyword cannot be used in combination with the
typedef
keyword.
_ _noreturn
The
_ _noreturn
keyword can be used on a function to inform the compiler that the
function will not return. If you use this keyword on such functions, the compiler can
optimize more efficiently. Examples of functions that do not return are
optimize more efficiently. Examples of functions that do not return are
abort
and
exit
.
The
_ _noreturn
keyword is an object attribute, which means the
#pragma
object_attribute
directive can be used for specifying it. For more information about
object attributes, see Object attributes, page 145.
Address range
Pointer size
0-0x1FFFE
(128 Kbytes)
16 bits
Table 66: Nearfunc pointer size