Atmel CAVR-4 ユーザーズマニュアル
CAVR-4
Part 2. Compiler reference
269
IAR language extensions
This chapter describes IAR language extensions to the ISO/ANSI standard for
the C programming language. All extensions can also be used for the C++
programming language.
In the IAR Embedded Workbench™ IDE, language extensions are enabled by
default.
See the compiler options -e on page 179 and --strict_ansi on page 196 for
information about how to enable and disable language extensions from the
command line.
Why should language extensions be used?
By using language extensions, you gain full control over the resources and features of
the target microcontroller, and can thereby fine-tune your application.
the target microcontroller, and can thereby fine-tune your application.
If you want to use the source code with different compilers, note that language
extensions may require minor modifications before the code can be compiled. A
compiler typically supports microcontroller-specific language extensions as well as
vendor-specific ones.
extensions may require minor modifications before the code can be compiled. A
compiler typically supports microcontroller-specific language extensions as well as
vendor-specific ones.
Descriptions of language extensions
This section gives an overview of available language extensions.
Memory, type, and object attributes
Entities such as variables and functions may be declared with memory, type, and object
attributes. The syntax follows the syntax for qualifiers—such as
attributes. The syntax follows the syntax for qualifiers—such as
const
—but the
semantics is different.
●
A memory attribute controls the placement of the entity. There can be only one
memory attribute.
memory attribute.
●
A type attribute controls aspects of the object visible to the surrounding context.
There can be many different type attributes, and they must be included when the
object is declared.
There can be many different type attributes, and they must be included when the
object is declared.
●
An object attribute only has to be specified at the definition, but not at the
declaration, of an object. The object attribute does not affect the object interface.
declaration, of an object. The object attribute does not affect the object interface.