/ ANSIIISO9899-1990
I
for Programming Languages -
c
e- American National Standards Institute
11 West 42nd Street
New York, New York
10036
American
National
Standard
Approval of an American National Standard requires review by ANSI that the
requirements for due process, consensus, and other criteria for approval have
been met by the standards developer.
Consensus is established when, in the judgment of the ANSI Board of Standards
Review, substantial agreement has been reached by directly and materially
affected interests. Substantial agreement means much more than a simple
majority, but not necessarily unanimity. Consensus requires that all views and
objections be considered, and that a concerted effort be made toward their
resolution.
The use of American National Standards is completely voluntary; their existence
does not in any respect preclude anyone, whether he has approved the standards
or not, from manufacturing, marketing, purchasing, or using products, processes,
or procedures not conforming to the standards.
The American National Standards Institute does not develop standards and will in
no circumstances give an interpretation of any American National Standard.
Moreover, no person shall have the right or authority to issue an interpretation of
an American National Standard in the name of the American National Standards
Institute. Requests for interpretations should be addressed to the secretariat or
sponsor whose name appears on the title page of this standard.
CAUTION NOTICE: This American National Standard may be revised or
withdrawn at any time. The procedures of the American National Standards
Institute require that action be taken periodically to reaffirm, revise, or withdraw
this standard. Purchasers of American National Standards may receive current
information on all standards by calling or writing the American National Standards
Institute.
Published by
American National Standards Institute
11 West 42nd Street, New York, New York 10036
Copyright 1990 by Information Technology Industry Council (ITI)
All rights reserved.
These materials are subject to copyright claims of International Standardization Organization (ISO),
American National Standards Institute (ANSI), and Information Technology Industry Council (ITI). Not for
resale. No part of this publication may be reproduced in any form, including an electronic retrieval system,
without the prior written permission of ITI. All requests pertaining to this standard should be submitted to
ITI, 1250 Eye Street NW, Washington, DC 20005.
Printed in the United States of America
(revision
ANSI/IS0 9899-l 990
and redesignation
of
ANSI X3.1 59-I 989)
for Programming
American National Standard
-
C
Languages
Secretariat
Computer and Business Equipment Manufacturers
Association
Approved August 3,1992
American National Standards
Institute,
Inc.
ISO/lEC
9899.1990
(E,
Contents
I Scope
.
.
.
.
.
2 Normative
references
.
.
7 Definitions
and conventions
3 Compliance
5 Environment
.
.
.
.
.
.
.
6 Language
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
environment
environments
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
..I.
................
................
................
................
................
................
.
.
................
................
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
51
5.2
6.1
6.2
63
Conceptual models
Translation
5.1 1
5 1.2
Execution
Environmental
5.2.1
5 3.7
.- -
5.23
5.2.4
Character
Character
Signals and
Environmental
considerations
sets
display
.
.
semantics
interrupts
limits
.
.
............
....................
literals
....................
operands
numbers
.....................
.....................
.....................
.
.
......................
Arithmetic
Other operands
.....................
.....................
.....................
.
.
elements
Keywords
Identifiers
Constants
String
Operators
Punctuators
Header names
Preprocessing
Comments
.
Lexical
6 1.1
6.1.2
6.1 3
6.14
6.1.5
6.1.6
6.1.7
6. I .8
6.1.9
Conversions
6 7.1
63.2
Expressions
6 3 I
6 3.2
6.3.3
6.3 4
6 3.5
6 3 6
6 3 7
6 3 8
6 3 9
6 3 IO Bituise AND operator
6 3 I I Bituise
6 3 12 Bitwise
6 3 13 Logical AND operator
6 3 II
6 3. IS Conditional
....................
,
Primary expressions
Postfix operators
Unary operators
Cast operators
Multiplicative
Additive
Bitwise
Relational
Equality
Logical OR operator
operator
operators
shift operators
....................
....................
operators
operators
operators
exclusive OR operator
inclusive OR operator
...
...................
..................
...................
.................
....................
..................
..................
...................
..................
...............
...............
..................
..................
..................
.................
..................
,
..........
I
I
2
3
s
5
5
6
IO
IO
12
I2
I2
IX
I8
19
19
25
30
31
32
32
33
33
34
34
36
38
39
39
43
45
46
46
48
48
49
50
SO
SO
51
51
51
6.4
65
6.6
6.7
6.8
69
7 Libr
71
7.2
7.3
74
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
operators
Comma operator
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
specifiers
.
.
.
.
.
.
.
.
statement.
or block
and null statements
.
.
.
.
.
.
.
.
.
.
statements
expressions
.
Storage-class
Type specifiers
Type qualifiers
.
Declarators
Type names
.
Type definitions
.
Initialization
.
6.3 16 Assignment
6.3.17
Constant
Declarations
65.1
6.52
6 5.3
6.5 4
6.5.5
6 5.6
6.5 7
Statements
6 6 1
6 6.2
6.6 3
6 6.4
6.6.5
6.6.6
External
6.7
6.72
Preprocessing
6.8.1
6.82
6.8.3
6.8 4
6.8.5
6.8.6
6.8.7
6 X.8
Future
6 Y I
692
6 0.3
6.Y 3
6 Y.5
6 9.6
Function
External
statements
statements
Labeled
Compound
Expression
Selection
Iteration
Jump statements
.
.
.
.
.
.
definitions
.
object definitions
.
.
Conditional
.
file
Source
.
replacement
Macro
.
.
Line control
.
Error directive
.
.
Pragma directive
Null directive
.
Predefined macro names
.
language directions
External
.
.
Character
Storage-class
Function
Function
Array parameters
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
names
escape sequence\
declarators
definitions
inclusion
inclusion
definitions
directives
specifiers
.
.
.
.
.
.
.
.
.
.
.
.
I
.
.
.
.
‘ary
.
.
.
introduction
7 I I
7.1 2
7 I 3
714
7 I 5
7. I .6
7.1.7
Diagnostics
72.1
Character
7.3
I
7 3 2
Localization
7 1.1
7.1 2
identitierk
.
.
.
.
term\
.
.
.
of
.
.
Detinitiom
Standard header5
Reserved
Errors
Limits
Program diagnostics
Locale control
Numeric
.
tormattinp
...............
...............
...............
...............
...............
...............
...............
...............
...............
...............
...............
...............
...............
...............
...............
...............
.
...............
...............
...............
...............
...............
...............
...............
...............
...............
...............
...............
...............
...............
...............
...............
...............
...............
...............
...............
.
.
.
.
.
.
.
.
.
.
.
.
h>
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
h> and
function\
.
.
.
.
.
.
.
.
.
.
.
.
.
inquiry
.
.
.
.
.
.
.
.
.
.
.
............
............
............
............
............
............
............
............
............
............
............
............
............
.............
............
............
............
ISO/IEC 9899 1990 tE)
i
; _
5-I
ST
57
5x
5x
6-i
65
69
70
71
75
75
75
76
77
78
79
81
81
83
85
86
87
89
93
93
93
94
94
95
95
9s
95
95
9.5
9.5
96
96
96
96
97
97
98
9x
99
IO1
101
I02
IO1
104
106
107
108
111
--
ISO/IEC 9899: 1990 (E)
h>
...................
..............
.......
-
...
111
111
111
113
114
115
116
118
118
119
120
120
121
122
122
124
124
125
126
127
128
131
141
144
145
147
149
149
153
154
155
157
158
159
161
162
162
162
163
164
165
168
170
170
170
172
176
176
176
176
176
176
176
176
176
.............
................
...................
jeep. h>
................
.............
...............
...............
. 1
..................
......................
.......................
.................
.................
...............
................
...................
..................
..............
..................
.....................
h>
...................
h>
.....................
Treatment of error conditions
.................
.................
.................
Mathematics 6th.
75.1
7.5.2 Trigonometric functions
7.53 Hyperbolic functions
7.5.4 Exponential and logarithmic functions
7.5.5 Power functions
7.5.6 Nearest integer, absolute value. and remainder functions
Nonlocal jumps
7.7.1 Specify signal handling
7.7.2 Send signal
Variable arguments
7.10.1 String conversion functions
7.10.2 Pseudo-random sequence generation functions
7.10.3 Memory management functions
7.10.4 Communication with the environment
7.10.5 Searching and sorting utilities
7 10.6 Integer arithmetic functions
7.10.7 Multibyte character functions
7.10.8 Multibyte string functions
String handling
7.12.1 Components of time
7.122 Time manipulation functions
7.12.3 Time conversion functions
Future library directions
7.13.1 Errors
7.13.2 Character handling
7.13.4 Mathematics
7.13.5 Signal handling
...............
..............
h>
................
...................
..................
Input/output
................
h>
h>
...............
...............
................
................
...............
................
...............
................
.................
..................
...................
..................
...................
.................
...............
.............
h>
.................
................
...................
................
..........
7.5
7.6
7.7
7.8
7.9
7.10
7.1 I
7.12
7 13
iv
.
.
.
.
h>
.
.
.
.
.
.
.
.
.
h>
Lexical grammar .
C Sequence points
D Library summary
Annexes
A Bibliography
.
B Language syntax summary .
.
.
.
B.1
.
B.2 Phrase structure grammar
B.3 Preprocessing directives
.
.
.
.
.
.
.
.
.
.
D.1 Errors
D.4 Character handling
D.6 Mathematics
D.7 Nonlocal jumps
.
.
.
.
.
Localization
.
.
.
. h>
.
.
.
.
.
.
. h>
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
. h>
h>
.
.
.
.
.
.
Input/output
h>
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
ISO/IEC 9899: 1990 (E)
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
................
................
.
.
................
................
................
.
.
................
................
................
................
................
................
................
................
.
.
.
.
.
.
.
.
.
.
.
.
.
.
................
................
................
................
................
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
177
178
178
182
187
189
190
190
190
190
190
190
191
191
191
192
192
194
195
195
196
198
199
199
200
204
207
208
210
v
Foreword
9899-l 990. This document
paragraphs
are the original
(This
foreword
is not part of American
National
Standard
ANSI/IS0
is identical
to ISO/IEC
foreword as it appeared
9899:1990
and
in that document.)
the following
four
technology,
for Standardization)
(the International Organization
IS0 and IEC technical committees collaborate
in the development of International Standards
and IEC (the
IS0
International Electrotechnical Commission)
form the specialized system for
worldwide standardization. National bodies that are members of IS0 or IEC
participate
through technical
to deal with particular
committees established by the respective organization
fields of technical activity.
in
fields of mutual interest. Other international organizations, governmental
and non-governmental,
in liaison with IS0 and IEC, also take part in the
work.
IS0 and IEC have established a joint
In the field of information
ISO/IEC JTC 1. Draft International Standards adopt-
technical committee,
to national bodies for vot-
ed by the joint technical committee are circulated
ing. Publication as an International Standard requires approval by at least
75% of the national bodies casting a vote.
International Standard
Committee
Annexes A, B, C, D, E, F and G are for information only.
Requests
for improvement or addenda, or
defect
They should be sent to the X3 Secretariat,
Computer and Business Equipment Manufacturers Association, 1250 Eye
Street, NW, Suite 200, Washington, DC 20005.
This standard was processed
to ANSI by
and approved
Accredited Standards Committee on Information Processing Systems, X3.
that all
Committee approval of the standard does not necessarily
committee members voted
this
standard, the X3 Committee had the following members:
ISO/IEC 9899 was prepared by Joint Technical
for its approval. At the time it approved
ISO/IEC JTC 1, information Technology.
for interpretation,
reports are welcome.
for submittal
suggestions
imply
(Position Vacant), Chairman
Donald C. Loughry, Vice-Chairman
Joanne Flanagan, Secretary
Organization
Allen-Bradley
Represented
Company
American
American
Library Association
Nuclear Society
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ronald Reimer
Name of Representative
Joe Lenner (Alt.)
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Geraldine C. Main
(Alt.)
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Paul Peters
Sally Hartzell
Inc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Edward Kelly
AMP,
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Karen Higginbottom
Edward Mikoski
(Alt.)
Apple Computer,
Association
of the
Certification
Inc.
Institute
of Computer
for
Professionals
(AICCP)
. . . . . ..Kenneth
Zemrowski
Eugene Dwyer
(Ah.)
AT&T/NCR
Corporation
Boeing Company
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Thomas W. Kern
Thomas F. Frost
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Catherine Howells
Andrea Vanosdoll
David M. Taylor
James Barnes
Keith Lucke
Pull HN Information
C Jmpaq Computers
Digital Equipment Computer Users Society . . . . . . . . . . . . . . . . . . . Stephen C. Jackson
Systems,
. . . . . . . .._.................................._.........
Inc. . . .._............_...............
(Alt.)
(Alt.)
(Alt.)
Dr. Joseph King
(Alt.)
vi