Atmel CAVR-4 Manual De Usuario

Descargar
Página de 323
CAVR-4
Part 2. Compiler reference
IAR language extensions
271
Inline assembler
Inline assembler can be used for inserting assembler instructions in the generated 
function. 
The syntax for inline assembler is:
asm("MOVW R4,R7");
In strict ISO/ANSI mode, the use of inline assembler is disabled.
For more details about inline assembler, see Mixing C and assembler, page 93.
C++ style comments
C++ style comments are accepted. A C++ style comment starts with the character 
sequence 
//
 and continues to the end of the line. For example:
// The length of the bar, in centimeters.
int length;
__ALIGNOF__
For information about alignment, seAlignment, page 137, and __ALIGNOF__(), page 
229
.
Compound literals
To create compound literals you can use the following syntax:
/* Create a pointer to an anonymous array */
int *p = (int []) {1,2,3};
/* Create a pointer to an anonymous structX */
structX *px = &(structX) {5,6,7};
Note:
A compound literal can be modified unless it is declared 
const
Compound literals are not supported in Embedded C++.
Anonymous structs and unions
C++ includes a feature named anonymous unions. The AVR IAR C/C++ Compiler allow 
a similar feature for both structs and unions.
An anonymous structure type (that is, one without a name) defines an unnamed object 
(and not a type) whose members are promoted to the surrounding scope. External 
anonymous structure types are allowed.