Conformance to the C Standard

You can set the Intel® C++ Compiler to accept either

The compiler is set by default to accept extensions and not be limited to the ANSI/ISO standard.

Understanding the ANSI/ISO Standard C Dialect

The Intel C++ Compiler provides conformance to the ANSI/ISO standard for C language compilation (ISO/IEC 9899:1990). This standard requires that conforming C compilers accept minimum translation limits. This compiler exceeds all of the ANSI/ISO requirements for minimum translation limits.

Understanding the Extensions to ANSI/ISO Standard C Dialect

When you set the compiler to accept extensions to the ANSI/ISO standard, the compiler can process the following extensions:

Extension Type Description
Files and data storage Input files with no declarations. Incomplete array types for the last member of a structure, except when this is the only member of the structure. Incomplete struct or union type file-scope arrays. Note: The struct and union types must be completed before the array is subscripted. In addition, if the array is defined in the compilation, these types must be subscripted by the end of the compilation. enum tag names you define. You can declare an enum tag name and then define it later in the source file. Initializer expressions not enclosed in braces though they initialize any of the following: a full static array, structure, or union. (Standard C required the braces.)
Pointers In initializers, pointer constant values cast to an integral type if the integral type is large enough to contain it. In integral constant expressions, integer constants cast to a pointer type and then cast back to an integral type. Assignments of pointers to integers and to other incompatible pointer types without explicit casts. Fields selected in the form p->m when the p variable is a pointer, including when p does not point to a struct or union that contains m. (All definitions of field must have the same type and offset within their structure or union.) Fields selected in the form x.m, including when x is not a structure or union containing m when (1) variable x is not a structure or union containing m and (2) the x variable is an Ivalue. (All definitions of field must have the same type and offset within their structure or union.)
Types and syntax Bit fields with enum base types or integral types other than int or unsigned int. long float as a synonym for double. Arbitrary text at the end of preprocessing directives. Numbers that do not comply with the pp-number syntax, because numbers are scanned according to the syntax for numbers when extensions are allowed. Example: The compiler would scan 0x123e+1 as three tokens. Under strict ANSI conformance mode, the compiler would use the pp-number syntax and scan this number as one invalid token.
Predicates #assert and #unassert directives to define and test predicate names.
Syntax with warnings No warning given for an extra comma at the end of an enum list. Warning given when omitting the final semicolon preceding the closing brace( } ) of a structure or union. Warning given for a right brace immediately following a label definition. (Normally, a statement must follow a legal definition.) No warning given for an empty declaration, a semicolon with nothing preceding it.
Semantics with warnings Differences in assignments and pointers between pointers to types that are interchangeable but not identical, such as unsigned char* and char*. The compiler will not issue a warning in this case. A string constant assigned to a pointer to any kind of character. Comparison using >, >=, <, or <= operators between pointers to void and other kinds of pointers, without using an explicit type cast. (Strict ANSI dialect mode requires such comparisons using == or != and issues no warnings.) Inline assembly code inserted using the asm keyword. (Strict ANSI dialect mode requires the __asm keyword.) Freestanding tag declarations in the parameter declaration list for a function with old-style parameters.

How to Set the Compiler for Extended C Dialect

You set the compiler to accept extensions to the ANSI/ISO standard C code by using the -Ze option.

Macros Included with the Compiler

The ANSI/ISO standard for C language requires that certain predefined macros be supplied with conforming compilers. The following table lists the macros that the Intel C++ Compiler supplies in accordance with this standard:

Macro Description
__cplusplus Defines C++ programs only.
__DATE__ The date of compilation. As a string literal in the form "Mmm dd yyyy".
__FILE__ A string literal representing the name of the file being compiled.
__LINE__ The current line number as a decimal constant.
__STDC__ The constant 1 when you set the compiler to accept only standard ANSI conformance. This macro is not defined for use when you set the compiler to accept extensions.
__TIME__ The time of compilation. As a string literal in the form "hh:mm:ss".
__TIMESTAMP__ The date and time of the last modification of the current source file in the form:
"Ddd Mmm dd hh:mm:ss yyyy".

The compiler provides predefined macros in addition to the predefined macros required by the standard.