Atmel CAVR-4 ユーザーズマニュアル
![Atmel](https://files.manualsbrain.com/attachments/0369829915bda09f9c2e00fb805a7753579683b5/common/fit/150/50/8d2bf08978ec3e5bc63f4343ac5e91ce8d0e40045619fa520d910d64af8f/brand_logo.png)
CAVR-4
274
Descriptions of language extensions
AVR® IAR C/C++ Compiler
Reference Guide
Empty translation units
A translation unit (source file) is allowed to be empty, that is, it does not have to contain
any declarations.
any declarations.
In strict ISO/ANSI mode, a warning is issued if the translation unit is empty.
Example
The following source file is only used in a debug build. (In a debug build, the
NDEBUG
preprocessor flag is undefined.) Since the entire contents of the file is conditionally
compiled using the preprocessor, the translation unit will be empty when the application
is compiled in release mode. Without this extension, this would be considered an error.
compiled using the preprocessor, the translation unit will be empty when the application
is compiled in release mode. Without this extension, this would be considered an error.
#ifndef NDEBUG
void PrintStatusToTerminal()
{
/* Do something */
}
#endif
Comments at the end of preprocessor directives
This extension, which makes it legal to place text after preprocessor directives, is
enabled, unless strict ISO/ANSI mode is used. This language extension exists to support
compilation of old legacy code; we do not recommend that you write new code in this
fashion.
enabled, unless strict ISO/ANSI mode is used. This language extension exists to support
compilation of old legacy code; we do not recommend that you write new code in this
fashion.
Example
#ifdef FOO
... something ...
#endif FOO /* This is allowed but not recommended. */
Forward declaration of enums
The IAR Systems language extensions allow that you first declare the name of an
enum
and later resolve it by specifying the brace-enclosed list.
Extra comma at end of enum list
It is allowed to place an extra comma at the end of an
enum
list. In strict ISO/ANSI
mode, a warning is issued.