Expert C Programming

(Jeff_L) #1

Outside the U.S. you can get a copy by writing to:


ISO Sales
Case postale 56
CH-1211 Genève 20
Switzerland


Be sure to specify the English language edition.


Another source is to purchase the book The Annotated ANSI C Standard by Herbert Schildt,
(New York, Osborne McGraw-Hill, 1993). This contains a photographically reduced, but
complete, copy of the standard. Two other advantages of the Schildt book are that at $39.
it is less than one-third the price charged by the standards bodies, and it is available from
your local bookstore which, unlike ANSI or ISO, has probably heard of the twentieth
century, and will take phone orders using credit cards.


In practice, the term "ANSI C" was widely used even before there was an ISO Working Group 14
dedicated to C. It is also appropriate, because the ISO working group left the technical development of
the initial standard in the hands of ANSI committee X3J11. Toward the end, ISO WG14 and X3J
collaborated to resolve technical issues and to ensure that the resulting standard was acceptable to both
groups. In fact, there was a year's delay at the end, caused by amending the draft standard to cover
international issues such as wide characters and locales.


It remains ANSI C to anyone who has been following it for a few years. Having arrived at this good
thing, everyone wanted to endorse the C standard. ANSI C is also a European standard (CEN 29899)
and an X/Open standard. ANSI C was adopted as a Federal Information Processing Standard, FIPS
160, issued by the National Institute of Standards and Technology in March 1991, and updated on
August 24, 1992. Work on C continues—there is talk of adding a complex number type to C.


It's Nice, but Is It Standard?


Save a tree—disband an ISO working group today.


—Anonymous


The ANSI C standard is unique in several interesting ways. It defines the following terms, describing
characteristics of an implementation. A knowledge of these terms will aid in understanding what is
and isn't acceptable in the language. The first two are concerned with unportable code; the next two
deal with bad code; and the last two are about portable code.


Unportable Code:


implementation-defined— The compiler-writer chooses what happens, and has to document it.


Example: whether the sign bit is propagated, when shifting an int right.


unspecified— The behavior for something correct, on which the standard does not impose any
requirements.


Example: the order of argument evaluation.

Free download pdf