Atmel CAVR-4 Manual De Usuario
CAVR-4
134
Writing efficient code
AVR® IAR C/C++ Compiler
Reference Guide
NON-INITIALIZED VARIABLES
Normally, the runtime environment will initialize all global and static variables when the
application is started.
application is started.
The compiler supports the declaration of variables that will not be initialized, using the
_ _no_init
type modifier. They can be specified either as a keyword or using the
#pragma
object_attribute
directive. The compiler places such variables in
separate segments, according to the specified memory keyword. See the chapter Placing
code and data for more information.
code and data for more information.
For
_ _no_init
, the
const
keyword implies that an object is read-only, rather than that
the object is stored in read-only memory. It is not possible to give a
_ _no_init
object
an initial value.
Variables declared using the
_ _no_init
keyword could, for example, be large input
buffers or mapped to special RAM that keeps its content even when the application is
turned off.
turned off.
For information about the
_ _no_init
keyword, see page 211. Note that to use this
keyword, language extensions must be enabled; see -e, page 179. For information about
the
the
#pragma
object_attribute