Jump to: navigation, search

Warning: page out of date

This page has not been maintained for some time and now is a little out of date. The C1x drafts referred to below have since been ratified as C11, and Technical Corrigendum 1 for that standard since released. Please visit the WG14 "C - Approved Standards" page for more information.

Introduction

This page describes the International Standard that defines the C programming language as a guide to those who are new to either. It's based on what a newcomer to comp.lang.c would find useful to know about the Standard without getting specific about the contents and scope of the Standard. See also questions 11.1, 11.2 and 11.2b of the FAQ.

Versions of the C Standard

There are currently two main versions of the Standard: ISO/IEC 9899:1990 (commonly referred to as C89 or C90) and ISO/IEC 9899:1999 (commonly referred to as C99). As the naming indicates, C99 was ratified in 1999 and supersedes C89/C90, which was ratified in 1990. C99 has not been widely implemented in full so relying on its features for portability is not yet wise, although most C compilers fully implement C89/C90. Many compilers implement a subset of C99's features - sometimes as extensions.

C89/C90 and C99 are ISO standards, however C89/C90 was originally ratified by ANSI as X3.159-1989. The ANSI and ISO C89/C90 Standards are technically equivalent, but the section numbering of the Standard differs in its ANSI and ISO forms.

Prior to ANSI and ISO standardisation, C was unofficially standardised around "The C Programming Language", by Brian Kernighan and Dennis Ritchie (Prentice Hall, 1978). This unofficial C Standard is commonly referred to as K&R, although whether it can be considered to be purely based on the specification within this book (Appendix A of Edition 1) is not clear: actual implementations did not accurately follow the specifications of Appendix A - there were several generally accepted changes and some considered the AT&T reference manual to be more authoritative - hence the need for an official standard (the previous sentence is based on a comp.std.c post, 2 Nov 2005, by Douglas Gwyn).

The Committee (WG14)

The ISO Working Group that currently manages the Standard is known as WG14. Much documentation is available through their website.

Drafts

Drafts of the Standard are circulated for comment prior to ratification and publication. There are freely available drafts of both versions of the Standard, although an accessible C89/C90 draft with ISO section numbering is not known to exist. The drafts, whilst useful, are not definitive: the official versions of the Standard do differ from the draft versions although not dramatically. A commonly referenced draft is N869 (a draft of C99), although many people think that post-C99 drafts are better because there were changes between N869 and the final standard.

The next version of the Standard (not currently being actively worked on) is commonly referred to as C0X. The starting point for this version is the N1124 draft, which incorporates the first two technical corrigenda on top of the C99 Standard and N1256 which contains the first three.

Rationale

Each version of the Standard has a freely available rationale describing the intent of its authors and other helpful background.

Corrections and updates

Each version of the Standard has corrections and updates in the form of amendments and technical corrigenda, detailed on the WG14 homepage.

The terms C89/C90 generally refer to the Standard as corrected by Technical Corrigendum 1 (ISO/IEC 9899 TCOR1), 1994, and Technical Corrigendum 2 (ISO/IEC 9899 TCOR2), 1996.

The term C94 (or C95) is sometimes used to refer to C89/C90 plus Normative Addendum (aka Amendment) 1, whose primary addition was support for international character sets. This amendment was integrated into the later C99 version of the Standard, so it is necessary as a separate document only for C89/C90.

There is a process for proposing amendments or requesting clarification on the Standard. These proposals/requests are known as Defect Reports (DRs).

Obtaining the Standard

Neither the Standard nor its amendments are available free of charge, although its drafts, rationales, technical corrigenda (TCs) and defect report responses are.

The Standard can be purchased in hardcopy and/or downloadable digital format from national affiliates as described on the WG14 website. Two such national bodies are ANSI - through its eStandards Store - and SAI Global (originally Standards Australia) which sells all of the ISO C Standard publications. One international source is Techstreet.

Listed below are direct links to pages for purchase or free download of the Standard, its TCs, amendments, drafts, rationales and defect report responses for each version of the Standard. The set of documents is comprehensive whereas the list of sources obviously is not.

When comparing prices, a tool such as XE.com's currency converter can be useful.

Commentary, differences and incompatibilities

These links document some of the differences between versions of the Standard, as well as with the C++ Standard.

Standards-compliance in compilers

Most C compilers do not yet fully support the C99 standard although C89/C90 support is widespread. See the C Compilers page for a list of compilers that support C89/C90 - C99 support is listed there where known.

There are several commercial validation suites; the owner of one of them, Perennial, maintains a page where it lists compilers and libraries that it has certified to C99.

The vendor of a compiler that claims C99 conformance (though not listed on Perennial's certification page) - Comeau C/C++ - provides the Online Comeau C/C++ Compiler which can be used without charge to syntax-check C89/C90 and C99 code using a web interface.

The vendor of a commercial library listed on Perennial's certification page - Dinkumware - have run tests that purport to show that none of the popular compiler's libraries fully implement C99; the results of these tests are disputed - see this post and its follow-ups in the GNU libc mailing list archives.

Shortcut link for Usenet posting

The page c standard redirects here, so a convenient short url for posting to Usenet is: http://clc-wiki.net/wiki/c_standard (the "c" in c_standard can optionally be capitalised).

Personal tools