### Conflicts Between extended C and Other Levels - AIX info

extended level C, the default language level, adheres to the ANSI/ISO C definition except where adherence conflicts with compatibility with the RT C implementation. In the case of certain obsolete RT C language definitions, adherence to the ANSI/ISO C standard takes precedence over compatibility with RT C.

This page lists the conflicts between:

- extended C and ansi C
- extended C and RT C

Conflicts Between extended C and ansi C
The following are areas where extended level C supports RT C constructs and conventions not supported by ansi level C:

- Macro expansion within quoted strings (either single or double quotation marks):

  Macro parameters found within quoted strings in replacement text are not replaced in ansi mode but are replaced in extended mode.

- Arithmetic conversions (for example, integral promotions):

  extended level C follows the rules outlined in Arithmetic Conversions for langlvl=extended, which differ from the ansi level C conversion rules defined in section 3.2.1.5 of the ANSI/ISO C Standard.

- Scope of external functions declared at block scope:

  In ansi mode, external functions have block scope. In extended mode, they have file scope.

- Implicit pointer conversions:

  extended mode allows assignment of a pointer to an object of a different type. In ansi mode, a cast operation is necessary if conversion is to be done.

- Pointers of different types can be assigned to each other:

  In ansi mode, an attempt to assign pointers of different types to each other produces an error message. extended mode accepts the assignment.

- enum declarations containing a trailing extra comma:

  Accepted in extended mode but not in ansi mode.

- No definition of static function:

  ansi mode requires a function declared static to be defined in the same file as the declaration. In extended mode, a function that is declared static but is not defined in the same file as the declaration is implicitly redeclared extern. An informational message is produced.

- sizeof operator on bit fields:

  Allowed by extended but not by ansi.

- String literals:

  Both ansi and extended modes give you the choice of making string literals either modifiable or unmodifiable, but the defaults are different. The default is modifiable for extended and unmodifiable for ansi.

- Ref/def model:

  The ANSI/ISO C standard defines a relaxed, strict, and initialization ref/def model for objects with external linkage. extended mode supports the relaxed model, whereas ansi mode supports a combination of the strict and initialization models.

- unsigned char and unsigned short bit fields:

  Allowed in extended mode but not in ansi mode. In extended mode, an error message is issued, but compilation continues. Both unsigned char and unsigned short are changed to unsigned int. For bit fields, unsigned char and unsigned short are changed to unsigned int.

- long long int type:

  Allowed in extended mode but not in ansi mode.

- Character data types: char, unsigned char, or signed char:

  In ansi mode the C compiler distinguishes between the three character types; in extended mode, the C compiler does not distinguish between char and unsigned char.

- Macro redefinition:

  ansi level C requires that a macro be undefined before it can be defined again in a #define directive. extended level C allows macros to be redefined without first being undefined. An informational message is issued that states that the second definition is used.

- $ (dollar sign) character in identifiers:

  In extended mode only, the compiler allows the $ (dollar sign) character to be used in identifier names to facilitate calls between different languages. The $ (dollar sign) is not a valid character for identifiers in ansi mode.

- Macro concatenation using /**/:

  Allowed by extended but not by ansi.

Conflicts Between extended C and RT C
Ideally, extended mode should handle all RT C source code without conflict. Certain obsolete RT C definitions do conflict with ANSI/ISO C. For these, extended mode follows ANSI/ISO C and conflicts with RT C.

extended level C does not support the following RT C definitions:

- asm and fortran keywords.
- External data with file scope, even though declared or defined at block scope.
- Array initialization without braces.
- The last member of a structure definition not terminated by a semicolon.
- Type specifier not required when a name that was previously defined as a typedef is redefined.
- =+ and =- operators.
- #ifdef using logical operators or period (.).
- Taking the address of a register variable.
- Function declarations at file scope without type specifiers.
- Variable declarations without type specifiers.
- Structure definition containing an empty structure declaration.
- Predefined macro names unix, and AIX.

Language Levels

Extensions to RT C Provided by extended C
Exceptions to ansi C Addressed by classic C
saal2 C Deviations from SAA Level 2 C
Arithmetic Conversions for extended Level C
Summary of C Language Level Conflicts