1 .\" Copyright (C) 2007, 2010 Gabor Kovesdan. All rights reserved.
3 .\" Redistribution and use in source and binary forms, with or without
4 .\" modification, are permitted provided that the following conditions
6 .\" 1. Redistributions of source code must retain the above copyright
7 .\" notice, this list of conditions and the following disclaimer.
8 .\" 2. Redistributions in binary form must reproduce the above copyright
9 .\" notice, this list of conditions and the following disclaimer in the
10 .\" documentation and/or other materials provided with the distribution.
12 .\" THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
13 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
14 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
15 .\" ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
16 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
17 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
18 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
19 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
20 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
21 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 .Nd The C programming language
37 C is a general purpose programming language, which has a strong connection
38 with the UNIX operating system and its derivatives, since the vast
39 majority of those systems were written in the C language.
40 The C language contains some basic ideas from the BCPL language through
41 the B language written by Ken Thompson in 1970 for the DEC PDP-7 machines.
42 The development of the UNIX operating system was started on a PDP-7
43 machine in assembly language, but it made very difficult to port the existing
44 code to other systems.
46 In 1972 Dennis M. Ritchie worked out the C programming language for
47 further development of the UNIX operating system.
48 The idea was to implement only the C compiler for different
49 platforms, and implement most part of the operating system
50 in the new programming language to simplify the portability between
51 different architectures.
52 It follows that C is very eligible for (but not limited to) writing
53 operating systems and low-level applications.
55 The C language did not have a specification or standardized version for
57 It went through a lot of changes and improvements for ages.
58 In 1978, Brian W. Kernighan and Dennis M. Ritchie published the
59 first book about C under the title "The C Programming Language".
60 We can think of this book as the first specification of the language.
61 This version is often referred as K&R C after the names of the authors.
62 Sometimes it is referred as C78, as well, after the publishing year of
63 the first edition of the book.
65 It is important to notice, that the instruction set of the language is
66 limited to the most fundamental elements for simplicity.
67 Handling of the standard I/O and such common functions are implemented in
68 the libraries shipped with the compiler.
69 As these functions are also widely used, it was demanded to include into
70 the description what requisites the library should conform to, not just
71 strictly the language itself.
72 Accordingly, the aforementioned standards cover the library elements, as well.
73 The elements of this standard library is still not enough for more
75 In this case the provided system calls of the given operating system can be
77 To not lose the portability by using these system calls, the POSIX
78 (Portable Operating System Interface) standard evolved.
79 It describes what functions should be available to keep portability.
80 Note, that POSIX is not a C standard, but an operating system standard
81 and thus is beyond the scope of this manual.
82 The standards discussed below are all C standards and only cover
83 the C programming language and the accompanying library.
85 After the publication of the book mentioned before,
86 the American National Standards Institute (ANSI) started to work on
87 standardizing the language, and they announced ANSI X3.159-1989
89 It is usually referred as ANSI C or C89.
90 The main difference in this standard were the function prototypes,
91 which is a new way of declaring functions.
92 With the old-style function declarations, the compiler was unable to
93 check the sanity of the actual parameters at a function call.
94 The old syntax was highly error-prone because incompatible parameters
95 were hard to detect in the program code and the problem only showed up
98 In 1990, the International Organization for Standardization (ISO) adopted
99 the ANSI standard as ISO/IEC 9899:1990 in 1990.
100 This is also referred as ISO C or C90.
101 It only contains negligible minor modifications against ANSI C,
102 so the two standards often considered to be fully equivalent.
103 This was a very important milestone in the history of the C language, but the
104 development of the language did not stop.
106 The ISO C standard was later extended with an amendment as
107 ISO/IEC 9899 AM1 in 1995.
108 This contained, for example, the wide-character support in wchar.h and
110 Two corrigenda were also published: Technical Corrigendum 1 as
111 ISO/IEC 9899 TCOR1 in 1995 and Technical Corrigendum 2 as ISO/IEC 9899 TCOR1
113 The continuous development and growth made it necessary to work out a new
114 standard, which contains the new features and fixes the known defects and
115 deficiencies of the language.
116 As a result, ISO/IEC 9899:1999 was born in 1999.
117 Similarly to the other standards, this is referred after the
118 publication year as C99.
119 The improvements include the following:
120 .Bl -bullet -offset indent
124 Support for variable length arrays
126 New high-precision integer type named long long int, and other integer types
129 New boolean data type implemented in stdbool.h
131 One line comments taken from the C++ language
133 Some new preprocessor features
135 New variables can be declared anywhere, not just in the beginning of the
136 program or program blocks
141 Since then new standards have not been published, but the C language is still
143 New and useful features have been showed up in the most famous
145 Most of the UNIX-like operating systems use GNU C as a system compiler,
146 but those addition in GNU C should not be considered as
160 .%T 9899:1990, Programming languages -- C
170 .%T 9899 TCOR1, Programming languages -- C, Technical Corrigendum 1
175 .%T 9899 TCOR2, Programming languages -- C, Technical Corrigendum 2
180 .%T 9899:1999, Programming languages -- C
183 This manual page first appeared in
186 This manual page was originally written by
187 .An Gabor Kovesdan Aq Mt gabor@FreeBSD.org .