4.62 New language features of C99

The 1999 C99 standard introduces several new language features.

These new features include:
  • Some features similar to extensions to C90 offered in the GNU compiler, for example, macros with a variable number of arguments.


    The implementations of extensions to C90 in the GNU compiler are not always compatible with the implementations of similar features in C99.
  • Some features available in C++, such as // comments and the ability to mix declarations and statements.
  • Some entirely new features, for example complex numbers, restricted pointers and designated initializers.
  • New keywords and identifiers.
  • Extended syntax for the existing C90 language.
A selection of new features in C99 that might be of interest to developers using them for the first time are documented.


C90 is compatible with Standard C++ in the sense that the language specified by the standard is a subset of C++, except for a few special cases. New features in the C99 standard mean that C99 is no longer compatible with C++ in this sense.
Some examples of special cases where the language specified by the C90 standard is not a subset of C++ include support for // comments and merging of the typedef and structure tag namespaces. For example, in C90 the following code expands to x = a / b - c; because /* hello world */ is deleted, but in C++ and C99 it expands to x = a - c; because everything from // to the end of the first line is deleted:
x = a //* hello world */ b 
    - c;
The following code demonstrates how typedef and the structure tag are treated differently between C (90 and 99) and C++ because of their merged namespaces:
typedef int a;
  struct a { int x, y; };
  printf("%d\n", sizeof(a));
In C 90 and C99, this code defines two types with separate names whereby a is a typedef for int and struct a is a structure type containing two integer data types. sizeof(a) evaluates to sizeof(int).
In C++, a structure type can be addressed using only its tag. This means that when the definition of struct a is in scope, the name a used on its own refers to the structure type rather than the typedef, so in C++ sizeof(a) is greater than sizeof(int).
Related concepts
4.64 // comments in C99 and C90
4.65 Compound literals in C99
4.66 Designated initializers in C99
4.67 Hexadecimal floating-point numbers in C99
4.68 Flexible array members in C99
4.69 __func__ predefined identifier in C99
4.70 inline functions in C99
4.71 long long data type in C99 and C90
4.72 Macros with a variable number of arguments in C99
4.73 Mixed declarations and statements in C99
4.74 New block scopes for selection and iteration statements in C99
4.75 _Pragma preprocessing operator in C99
4.76 Restricted pointers in C99
4.78 Complex numbers in C99
Non-ConfidentialPDF file icon PDF versionARM DUI0375E
Copyright © 2007, 2008, 2011, 2012, 2014 ARM. All rights reserved.