Atmel CAVR-4 ユーザーズマニュアル
![Atmel](https://files.manualsbrain.com/attachments/0369829915bda09f9c2e00fb805a7753579683b5/common/fit/150/50/8d2bf08978ec3e5bc63f4343ac5e91ce8d0e40045619fa520d910d64af8f/brand_logo.png)
CAVR-4
Part 2. Compiler reference
IAR language extensions
275
Note: ISO/ANSI C allows extra commas in similar situations, for example after the last
element of the initializers to an array. The reason is, that it is easy to get the commas
wrong if parts of the list are moved using a normal cut-and-paste operation.
element of the initializers to an array. The reason is, that it is easy to get the commas
wrong if parts of the list are moved using a normal cut-and-paste operation.
Example
enum
{
kOne,
kTwo, /* This is now allowed. */
};
Missing semicolon at end of struct or union specifier
A warning is issued if the semicolon at the end of a
struct
or union specifier is missing.
NULL and void
In operations on pointers, a pointer to
void
is always implicitly converted to another
type if necessary, and a null pointer constant is always implicitly converted to a null
pointer of the right type if necessary. In ISO/ANSI C, some operators allow such things,
while others do not allow them.
pointer of the right type if necessary. In ISO/ANSI C, some operators allow such things,
while others do not allow them.
A label preceding a "}"
In ISO/ANSI C, a label must be followed by at least one statement. Therefore, it is illegal
to place the label at the end of a block. In the AVR IAR C/C++ Compiler, a warning is
issued.
to place the label at the end of a block. In the AVR IAR C/C++ Compiler, a warning is
issued.
To create a standard-compliant C program (so that you will not have to see the warning),
you can place an empty statement after the label. An empty statement is a single
you can place an empty statement after the label. An empty statement is a single
;
(semi-colon).
Example
void test()
{
if (...) goto end;
/* Do something */
end: /* Illegal at the end of block. */
}
Note: This also applies to the labels of switch statements.