Specifications

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
-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.
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
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