[Home]History of C programming language/K and R C

HomePage | Recent Changes | Preferences

Revision 4 . . November 10, 2001 5:47 pm by Uriyan [Moved some of the material to /Evolution; what do you think about it?]
Revision 3 . . November 10, 2001 5:06 pm by (logged).37.81.xxx [some info about the dialect documented in K&R]
  

Difference (from prior major revision) (no other diffs)

Changed: 4c4
This version is frequently regarded as an unofficial standard for the most basic features of a C compiler. Since not all of the currently-used compilers were updated to support ANSI C fully (or have certain bugs that contradict ANSI), K&R C is often seen as the lowest common denominator that should be stuck to if maximal portability is desired. Thus, for example, the bootstrap? of the the GCC compiler (xgcc) is written in K&R C, since many of the platforms that don't have an ANSI C compiler do have an older K&R one.
This version is frequently regarded as an unofficial standard for the most basic features of a C compiler. Since not all of the currently-used compilers were updated to support ANSI C fully (or have certain bugs that contradict ANSI), K&R C is often seen as the lowest common denominator that should be stuck to if maximal portability is desired. Thus, for example, the bootstrap? of the the GCC compiler (xgcc) had been written in K&R C, since many of the platforms which din't have an ANSI C compiler at the time of GCC's writing did have an older K&R one, or their existing ANSI support was incomplete. By 2001, however, this is more an historical fact rather than the current situation, since ANSI C is now supported by almost all the widely used compilers.

Changed: 6,31c6
By 2001, the above paragraph is probably a historical fact rather than the current situation. ANSI C is now supported by almost all the widely used compilers.

K&R C programs, if reasonably well written, are legal in ANSI C, and will normally have the same effect in the two dialects. This was one of aims of the ANSI C standard process, although they added more new features than is normal in programming language standardisation.

The C language evolved fairly continuously from its begining circa 1973 to the first ANSI C standard. K&R is a snapshot from this process. Features that were added between 1973 and K&R:

: struct data type

: long int data type

: unsigned int data type

: =+ (and relatives) had changed to += (and relatives)

Features added after K&R but before the begining of the ANSI C process (IE, these are NOT in K&R):
: void functions

: void * data type

: struct field names in a seperate name space for each struct type

: assignment operator works for struct data type

: the stdio library and some other standard library functions became available with most implementations (these already existed in at least one implementation at the time of K&R, but were not really standard, so not documented in the book).

In addition, several features were added in the ANSI C standardisation process itself. Most notably, function prototypes (borrowed from C++). Therefore, these were also NOT in K&R.
K&R C programs, if reasonably well written, are legal in ANSI C, and will normally have the same effect in the two dialects. This was one of aims of the ANSI C standard process, although they added more new features than is normal in programming language standardization.

Added: 32a8
See [Evolution of C]?

HomePage | Recent Changes | Preferences
Search: