Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Changed table layout and explained the origin of C94

The C Standard defines a set of predefined macros (see subclause 6.10.8) to help the user determine if the implementation being used is a conforming implementation, and if so, to which version of the C Standard it conforms.  These macros can also help the user to determine which of the standard features are implemented.

The tables below list these macros and which version of the C Standard they were introduced. The following macros are required in C11.

Macro nameC90C99C11

__STDC__C89

C99

C11

__STDC_HOSTED__

  C99

C11

__STDC_VERSION__1

(C94) C99

C11

__DATE__C89

C99

C11

__FILE__C89

C99

C11

__LINE__C89

C99

C11

__TIME__C89

 C99

C11

  1) __STDC_VERSION__ was introduced by an Amendment to C90, this version of the C Standard is commonly call C94 

   The following are optional environment macros in C11.

Macro nameC90C99C11

__STDC_ISO_10646__

 C99

C11

__STDC_MB_MIGHT_NEQ_WC__

 C99

C11

__STDC_UTF_16__

 

 C11

__STDC_UTF_32__

 

 C11

  

 The following are optional feature macros in C11.

Macro nameC90C99C11

__STDC_ANALYZABLE__

 

 C11

__STDC_IEC_559__

 C99

C11

__STDC_IEC_559_COMPLEX__

 C99

C11

__STDC_LIB_EXT1__ 

 

  C11

__STDC_NO_ATOMICS__

 

 C11

__STDC_NO_COMPLEX__

 

 C11

__STDC_NO_THREADS__

 

 C11

__STDC_NO_VLA__ 

 

 C11

 

 The following is optional in C11 and is defined by the user:

Macro nameC90C99C11
__STDC_WANT_LIB_EXT1__    C11 

Noncompliant Code Example (Checking value of predefined macro)

...