Datasheet
The storage class specifiers auto and register cannot appear in an external dec-
laration. No more than one external definition can be given for each identifier in a
translation unit declared with internal linkage. An external definition is an external
declaration that defines an object or a function and also allocates a storage. If an
identifier declared with external linkage is used in an expression (other than as part
of the operand of
sizeof), then exactly one external definition of that identifier must
be somewhere in the entire program.
STORAGE CLASSES
Associating identifiers with objects requires each identifier to have at least two attrib-
utes: storage class and type (sometimes referred to as data type). The mikroC PRO
for AVR compiler deduces these attributes from implicit or explicit declarations in the
source code.
A storage class dictates the location (data segment, register, heap, or stack) of
object and its duration or lifetime (the entire running time of the program, or during
execution of some blocks of code). A storage class can be established by the syn-
tax of a declaration, by its placement in the source code, or by both of these factors:
storage-class type identifier
The storage class specifiers in the mikroC PRO for AVR are:
- auto
- register
- static
- extern
Auto
The auto modifer is used to define that a local variable has a local duration. This is
the default for local variables and is rarely used. auto can not be used with globals.
See also Functions.
Register
At the moment the modifier register technically has no special meaning. The
mikroC PRO for AVR compiler simply ignores requests for register allocation.
181
MIKROELEKTRONIKA - SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Language Reference
mikroC PRO for AVR
CHAPTER 5