Specifications

CAVR-4
278
Descriptions of language extensions
AVR® IAR C/C++ Compiler
Reference Guide
Repeated typedefs
Redeclarations of typedef that occur in the same scope are allowed, but a warning is
issued.
Mixing pointer types
Assignment and pointer difference is allowed between pointers to types that are
interchangeable but not identical; for example, unsigned char * and char *. This
includes pointers to integral types of the same size. A warning is issued.
Assignment of a string constant to a pointer to any kind of character is allowed, and no
warning will be issued.
Non-top level const
Assignment of pointers is allowed in cases where the destination type has added type
qualifiers that are not at the top level (for example, int ** to int const **). It is also
allowed to compare and take the difference of such pointers.
Declarations in other scopes
External and static declarations in other scopes are visible. In the following example, the
variable y can be used at the end of the function, even though it should only be visible
in the body of the if statement. A warning is issued.
int test(int x)
{
if (x)
{
extern int y;
y = 1;
}
return y;
}
Non-lvalue arrays
A non-lvalue array expression is converted to a pointer to the first element of the array
when it is used.