fix manual n1256 (para, notes)
[c-standard] / n1548.html
1 <html><head><title>N1548   December 2, 2010  ISO/IEC 9899:201x</title></head><body>
2 <pre><!--page 1 -->
3 N1548                    Committee Draft -- December 2, 2010          ISO/IEC 9899:201x
4
5
6
7
8 INTERNATIONAL STANDARD                         (C)ISO/IEC              ISO/IEC 9899:201x
9
10
11
12
13 </pre>
14
15 <h1>Programming languages -- C</h1>
16 <pre>
17
18
19                                        ABSTRACT
20
21
22
23                      (Cover sheet to be provided by ISO Secretariat.)
24
25 This International Standard specifies the form and establishes the interpretation of
26 programs expressed in the programming language C. Its purpose is to promote
27 portability, reliability, maintainability, and efficient execution of C language programs on
28 a variety of computing systems.
29
30 Clauses are included that detail the C language itself and the contents of the C language
31 execution library. Annexes summarize aspects of both of them, and enumerate factors
32 that influence the portability of C programs.
33
34 Although this International Standard is intended to guide knowledgeable C language
35 programmers as well as implementors of C language translation systems, the document
36 itself is not designed to serve as a tutorial.
37
38 Recipients of this draft are invited to submit, with their comments, notification of any
39 relevant patent rights of which they are aware and to provide supporting documentation.
40
41 Changes from the previous draft (N1256) are indicated by ''diff marks'' in the right
42 margin: deleted text is marked with ''*'', new or changed text with '' ''.
43 <!--page 2 -->
44 <!--page 3 -->
45 </pre>
46
47 <h2><a name="Contents" href="#Contents">Contents</a></h2>
48 <ul>
49 <li><a href="#Foreword">Foreword</a>
50 <li><a href="#Introduction">Introduction</a>
51 <li><a href="#1">1. Scope</a>
52 <li><a href="#2">2. Normative references</a>
53 <li><a href="#3">3. Terms, definitions, and symbols</a>
54 <li><a href="#4">4. Conformance</a>
55 <li><a href="#5">5. Environment</a>
56 <ul>
57 <li><a href="#5.1">   5.1 Conceptual models</a>
58 <ul>
59 <li><a href="#5.1.1">        5.1.1  Translation environment</a>
60 <li><a href="#5.1.2">        5.1.2  Execution environments</a>
61 </ul>
62 <li><a href="#5.2">   5.2 Environmental considerations</a>
63 <ul>
64 <li><a href="#5.2.1">        5.2.1  Character sets</a>
65 <li><a href="#5.2.2">        5.2.2  Character display semantics</a>
66 <li><a href="#5.2.3">        5.2.3  Signals and interrupts</a>
67 <li><a href="#5.2.4">        5.2.4  Environmental limits</a>
68 </ul>
69 </ul>
70 <li><a href="#6">6. Language</a>
71 <ul>
72 <li><a href="#6.1">   6.1 Notation</a>
73 <li><a href="#6.2">   6.2 Concepts</a>
74 <ul>
75 <li><a href="#6.2.1">        6.2.1   Scopes of identifiers</a>
76 <li><a href="#6.2.2">        6.2.2   Linkages of identifiers</a>
77 <li><a href="#6.2.3">        6.2.3   Name spaces of identifiers</a>
78 <li><a href="#6.2.4">        6.2.4   Storage durations of objects</a>
79 <li><a href="#6.2.5">        6.2.5   Types</a>
80 <li><a href="#6.2.6">        6.2.6   Representations of types</a>
81 <li><a href="#6.2.7">        6.2.7   Compatible type and composite type</a>
82 <li><a href="#6.2.8">        6.2.8   Alignment of objects</a>
83 </ul>
84 <li><a href="#6.3">   6.3 Conversions</a>
85 <ul>
86 <li><a href="#6.3.1">        6.3.1   Arithmetic operands</a>
87 <li><a href="#6.3.2">        6.3.2   Other operands</a>
88 </ul>
89 <li><a href="#6.4">   6.4 Lexical elements</a>
90 <ul>
91 <li><a href="#6.4.1">        6.4.1   Keywords</a>
92 <li><a href="#6.4.2">        6.4.2   Identifiers</a>
93 <li><a href="#6.4.3">        6.4.3   Universal character names</a>
94 <li><a href="#6.4.4">        6.4.4   Constants</a>
95 <li><a href="#6.4.5">        6.4.5   String literals</a>
96 <li><a href="#6.4.6">        6.4.6   Punctuators</a>
97 <li><a href="#6.4.7">        6.4.7   Header names</a>
98 <li><a href="#6.4.8">        6.4.8   Preprocessing numbers</a>
99 <li><a href="#6.4.9">        6.4.9   Comments</a>
100 <!--page 4 -->
101 </ul>
102 <li><a href="#6.5">     6.5  Expressions</a>
103 <ul>
104 <li><a href="#6.5.1">          6.5.1   Primary expressions</a>
105 <li><a href="#6.5.2">          6.5.2   Postfix operators</a>
106 <li><a href="#6.5.3">          6.5.3   Unary operators</a>
107 <li><a href="#6.5.4">          6.5.4   Cast operators</a>
108 <li><a href="#6.5.5">          6.5.5   Multiplicative operators</a>
109 <li><a href="#6.5.6">          6.5.6   Additive operators</a>
110 <li><a href="#6.5.7">          6.5.7   Bitwise shift operators</a>
111 <li><a href="#6.5.8">          6.5.8   Relational operators</a>
112 <li><a href="#6.5.9">          6.5.9   Equality operators</a>
113 <li><a href="#6.5.10">          6.5.10 Bitwise AND operator</a>
114 <li><a href="#6.5.11">          6.5.11 Bitwise exclusive OR operator</a>
115 <li><a href="#6.5.12">          6.5.12 Bitwise inclusive OR operator</a>
116 <li><a href="#6.5.13">          6.5.13 Logical AND operator</a>
117 <li><a href="#6.5.14">          6.5.14 Logical OR operator</a>
118 <li><a href="#6.5.15">          6.5.15 Conditional operator</a>
119 <li><a href="#6.5.16">          6.5.16 Assignment operators</a>
120 <li><a href="#6.5.17">          6.5.17 Comma operator</a>
121 </ul>
122 <li><a href="#6.6">     6.6 Constant expressions</a>
123 <li><a href="#6.7">     6.7 Declarations</a>
124 <ul>
125 <li><a href="#6.7.1">          6.7.1   Storage-class specifiers</a>
126 <li><a href="#6.7.2">          6.7.2   Type specifiers</a>
127 <li><a href="#6.7.3">          6.7.3   Type qualifiers</a>
128 <li><a href="#6.7.4">          6.7.4   Function specifiers</a>
129 <li><a href="#6.7.5">          6.7.5   Alignment specifier</a>
130 <li><a href="#6.7.6">          6.7.6   Declarators</a>
131 <li><a href="#6.7.7">          6.7.7   Type names</a>
132 <li><a href="#6.7.8">          6.7.8   Type definitions</a>
133 <li><a href="#6.7.9">          6.7.9   Initialization</a>
134 <li><a href="#6.7.10">          6.7.10 Static assertions</a>
135 </ul>
136 <li><a href="#6.8">     6.8 Statements and blocks</a>
137 <ul>
138 <li><a href="#6.8.1">          6.8.1   Labeled statements</a>
139 <li><a href="#6.8.2">          6.8.2   Compound statement</a>
140 <li><a href="#6.8.3">          6.8.3   Expression and null statements</a>
141 <li><a href="#6.8.4">          6.8.4   Selection statements</a>
142 <li><a href="#6.8.5">          6.8.5   Iteration statements</a>
143 <li><a href="#6.8.6">          6.8.6   Jump statements</a>
144 </ul>
145 <li><a href="#6.9">     6.9 External definitions</a>
146 <ul>
147 <li><a href="#6.9.1">          6.9.1   Function definitions</a>
148 <li><a href="#6.9.2">          6.9.2   External object definitions</a>
149 </ul>
150 <li><a href="#6.10">     6.10 Preprocessing directives</a>
151 <ul>
152 <li><a href="#6.10.1">          6.10.1 Conditional inclusion</a>
153 <li><a href="#6.10.2">          6.10.2 Source file inclusion</a>
154 <li><a href="#6.10.3">          6.10.3 Macro replacement</a>
155 <!--page 5 -->
156 <li><a href="#6.10.4">       6.10.4 Line control</a>
157 <li><a href="#6.10.5">       6.10.5 Error directive</a>
158 <li><a href="#6.10.6">       6.10.6 Pragma directive</a>
159 <li><a href="#6.10.7">       6.10.7 Null directive</a>
160 <li><a href="#6.10.8">       6.10.8 Predefined macro names</a>
161 <li><a href="#6.10.9">       6.10.9 Pragma operator</a>
162 </ul>
163 <li><a href="#6.11">  6.11 Future language directions</a>
164 <ul>
165 <li><a href="#6.11.1">       6.11.1 Floating types</a>
166 <li><a href="#6.11.2">       6.11.2 Linkages of identifiers</a>
167 <li><a href="#6.11.3">       6.11.3 External names</a>
168 <li><a href="#6.11.4">       6.11.4 Character escape sequences</a>
169 <li><a href="#6.11.5">       6.11.5 Storage-class specifiers</a>
170 <li><a href="#6.11.6">       6.11.6 Function declarators</a>
171 <li><a href="#6.11.7">       6.11.7 Function definitions</a>
172 <li><a href="#6.11.8">       6.11.8 Pragma directives</a>
173 <li><a href="#6.11.9">       6.11.9 Predefined macro names</a>
174 </ul>
175 </ul>
176 <li><a href="#7">7. Library</a>
177 <ul>
178 <li><a href="#7.1">   7.1 Introduction</a>
179 <ul>
180 <li><a href="#7.1.1">         7.1.1 Definitions of terms</a>
181 <li><a href="#7.1.2">         7.1.2 Standard headers</a>
182 <li><a href="#7.1.3">         7.1.3 Reserved identifiers</a>
183 <li><a href="#7.1.4">         7.1.4 Use of library functions</a>
184 </ul>
185 <li><a href="#7.2">   7.2 Diagnostics &lt;assert.h&gt;</a>
186 <ul>
187 <li><a href="#7.2.1">         7.2.1 Program diagnostics</a>
188 </ul>
189 <li><a href="#7.3">   7.3 Complex arithmetic &lt;complex.h&gt;</a>
190 <ul>
191 <li><a href="#7.3.1">         7.3.1 Introduction</a>
192 <li><a href="#7.3.2">         7.3.2 Conventions</a>
193 <li><a href="#7.3.3">         7.3.3 Branch cuts</a>
194 <li><a href="#7.3.4">         7.3.4 The CX_LIMITED_RANGE pragma</a>
195 <li><a href="#7.3.5">         7.3.5 Trigonometric functions</a>
196 <li><a href="#7.3.6">         7.3.6 Hyperbolic functions</a>
197 <li><a href="#7.3.7">         7.3.7 Exponential and logarithmic functions</a>
198 <li><a href="#7.3.8">         7.3.8 Power and absolute-value functions</a>
199 <li><a href="#7.3.9">         7.3.9 Manipulation functions</a>
200 </ul>
201 <li><a href="#7.4">   7.4 Character handling &lt;ctype.h&gt;</a>
202 <ul>
203 <li><a href="#7.4.1">         7.4.1 Character classification functions</a>
204 <li><a href="#7.4.2">         7.4.2 Character case mapping functions</a>
205 </ul>
206 <li><a href="#7.5">   7.5 Errors &lt;errno.h&gt;</a>
207 <li><a href="#7.6">   7.6 Floating-point environment &lt;fenv.h&gt;</a>
208 <ul>
209 <li><a href="#7.6.1">         7.6.1 The FENV_ACCESS pragma</a>
210 <li><a href="#7.6.2">         7.6.2 Floating-point exceptions</a>
211 <li><a href="#7.6.3">         7.6.3 Rounding</a>
212 <li><a href="#7.6.4">         7.6.4 Environment</a>
213 </ul>
214 <li><a href="#7.7">   7.7 Characteristics of floating types &lt;float.h&gt;</a>
215 <!--page 6 -->
216 <li><a href="#7.8">     7.8    Format conversion of integer types &lt;inttypes.h&gt;</a>
217 <ul>
218 <li><a href="#7.8.1">            7.8.1    Macros for format specifiers</a>
219 <li><a href="#7.8.2">            7.8.2    Functions for greatest-width integer types</a>
220 </ul>
221 <li><a href="#7.9">     7.9    Alternative spellings &lt;iso646.h&gt;</a>
222 <li><a href="#7.10">     7.10   Sizes of integer types &lt;limits.h&gt;</a>
223 <li><a href="#7.11">     7.11   Localization &lt;locale.h&gt;</a>
224 <ul>
225 <li><a href="#7.11.1">            7.11.1 Locale control</a>
226 <li><a href="#7.11.2">            7.11.2 Numeric formatting convention inquiry</a>
227 </ul>
228 <li><a href="#7.12">     7.12   Mathematics &lt;math.h&gt;</a>
229 <ul>
230 <li><a href="#7.12.1">            7.12.1 Treatment of error conditions</a>
231 <li><a href="#7.12.2">            7.12.2 The FP_CONTRACT pragma</a>
232 <li><a href="#7.12.3">            7.12.3 Classification macros</a>
233 <li><a href="#7.12.4">            7.12.4 Trigonometric functions</a>
234 <li><a href="#7.12.5">            7.12.5 Hyperbolic functions</a>
235 <li><a href="#7.12.6">            7.12.6 Exponential and logarithmic functions</a>
236 <li><a href="#7.12.7">            7.12.7 Power and absolute-value functions</a>
237 <li><a href="#7.12.8">            7.12.8 Error and gamma functions</a>
238 <li><a href="#7.12.9">            7.12.9 Nearest integer functions</a>
239 <li><a href="#7.12.10">            7.12.10 Remainder functions</a>
240 <li><a href="#7.12.11">            7.12.11 Manipulation functions</a>
241 <li><a href="#7.12.12">            7.12.12 Maximum, minimum, and positive difference functions</a>
242 <li><a href="#7.12.13">            7.12.13 Floating multiply-add</a>
243 <li><a href="#7.12.14">            7.12.14 Comparison macros</a>
244 </ul>
245 <li><a href="#7.13">     7.13   Nonlocal jumps &lt;setjmp.h&gt;</a>
246 <ul>
247 <li><a href="#7.13.1">            7.13.1 Save calling environment</a>
248 <li><a href="#7.13.2">            7.13.2 Restore calling environment</a>
249 </ul>
250 <li><a href="#7.14">     7.14   Signal handling &lt;signal.h&gt;</a>
251 <ul>
252 <li><a href="#7.14.1">            7.14.1 Specify signal handling</a>
253 <li><a href="#7.14.2">            7.14.2 Send signal</a>
254 </ul>
255 <li><a href="#7.15">     7.15   Alignment &lt;stdalign.h&gt;</a>
256 <li><a href="#7.16">     7.16   Variable arguments &lt;stdarg.h&gt;</a>
257 <ul>
258 <li><a href="#7.16.1">            7.16.1 Variable argument list access macros</a>
259 </ul>
260 <li><a href="#7.17">     7.17   Atomics &lt;stdatomic.h&gt;</a>
261 <ul>
262 <li><a href="#7.17.1">            7.17.1 Introduction</a>
263 <li><a href="#7.17.2">            7.17.2 Initialization</a>
264 <li><a href="#7.17.3">            7.17.3 Order and consistency</a>
265 <li><a href="#7.17.4">            7.17.4 Fences</a>
266 <li><a href="#7.17.5">            7.17.5 Lock-free property</a>
267 <li><a href="#7.17.6">            7.17.6 Atomic integer and address types</a>
268 <li><a href="#7.17.7">            7.17.7 Operations on atomic types</a>
269 <li><a href="#7.17.8">            7.17.8 Atomic flag type and operations</a>
270 </ul>
271 <li><a href="#7.18">     7.18   Boolean type and values &lt;stdbool.h&gt;</a>
272 <li><a href="#7.19">     7.19   Common definitions &lt;stddef.h&gt;</a>
273 <li><a href="#7.20">     7.20   Integer types &lt;stdint.h&gt;</a>
274 <!--page 7 -->
275 <ul>
276 <li><a href="#7.20.1">         7.20.1 Integer types</a>
277 <li><a href="#7.20.2">         7.20.2 Limits of specified-width integer types</a>
278 <li><a href="#7.20.3">         7.20.3 Limits of other integer types</a>
279 <li><a href="#7.20.4">         7.20.4 Macros for integer constants</a>
280 </ul>
281 <li><a href="#7.21">  7.21   Input/output &lt;stdio.h&gt;</a>
282 <ul>
283 <li><a href="#7.21.1">         7.21.1 Introduction</a>
284 <li><a href="#7.21.2">         7.21.2 Streams</a>
285 <li><a href="#7.21.3">         7.21.3 Files</a>
286 <li><a href="#7.21.4">         7.21.4 Operations on files</a>
287 <li><a href="#7.21.5">         7.21.5 File access functions</a>
288 <li><a href="#7.21.6">         7.21.6 Formatted input/output functions</a>
289 <li><a href="#7.21.7">         7.21.7 Character input/output functions</a>
290 <li><a href="#7.21.8">         7.21.8 Direct input/output functions</a>
291 <li><a href="#7.21.9">         7.21.9 File positioning functions</a>
292 <li><a href="#7.21.10">         7.21.10 Error-handling functions</a>
293 </ul>
294 <li><a href="#7.22">  7.22   General utilities &lt;stdlib.h&gt;</a>
295 <ul>
296 <li><a href="#7.22.1">         7.22.1 Numeric conversion functions</a>
297 <li><a href="#7.22.2">         7.22.2 Pseudo-random sequence generation functions</a>
298 <li><a href="#7.22.3">         7.22.3 Memory management functions</a>
299 <li><a href="#7.22.4">         7.22.4 Communication with the environment</a>
300 <li><a href="#7.22.5">         7.22.5 Searching and sorting utilities</a>
301 <li><a href="#7.22.6">         7.22.6 Integer arithmetic functions</a>
302 <li><a href="#7.22.7">         7.22.7 Multibyte/wide character conversion functions</a>
303 <li><a href="#7.22.8">         7.22.8 Multibyte/wide string conversion functions</a>
304 </ul>
305 <li><a href="#7.23">  7.23   String handling &lt;string.h&gt;</a>
306 <ul>
307 <li><a href="#7.23.1">         7.23.1 String function conventions</a>
308 <li><a href="#7.23.2">         7.23.2 Copying functions</a>
309 <li><a href="#7.23.3">         7.23.3 Concatenation functions</a>
310 <li><a href="#7.23.4">         7.23.4 Comparison functions</a>
311 <li><a href="#7.23.5">         7.23.5 Search functions</a>
312 <li><a href="#7.23.6">         7.23.6 Miscellaneous functions</a>
313 </ul>
314 <li><a href="#7.24">  7.24   Type-generic math &lt;tgmath.h&gt;</a>
315 <li><a href="#7.25">  7.25   Threads &lt;threads.h&gt;</a>
316 <ul>
317 <li><a href="#7.25.1">         7.25.1 Introduction</a>
318 <li><a href="#7.25.2">         7.25.2 Initialization functions</a>
319 <li><a href="#7.25.3">         7.25.3 Condition variable functions</a>
320 <li><a href="#7.25.4">         7.25.4 Mutex functions</a>
321 <li><a href="#7.25.5">         7.25.5 Thread functions</a>
322 <li><a href="#7.25.6">         7.25.6 Thread-specific storage functions</a>
323 <li><a href="#7.25.7">         7.25.7 Time functions</a>
324 </ul>
325 <li><a href="#7.26">  7.26   Date and time &lt;time.h&gt;</a>
326 <ul>
327 <li><a href="#7.26.1">         7.26.1 Components of time</a>
328 <li><a href="#7.26.2">         7.26.2 Time manipulation functions</a>
329 <li><a href="#7.26.3">         7.26.3 Time conversion functions</a>
330 <!--page 8 -->
331 </ul>
332 <li><a href="#7.27">   7.27 Unicode utilities &lt;uchar.h&gt;</a>
333 <ul>
334 <li><a href="#7.27.1">        7.27.1 Restartable multibyte/wide character conversion functions</a>
335 </ul>
336 <li><a href="#7.28">   7.28 Extended multibyte and wide character utilities &lt;wchar.h&gt;</a>
337 <ul>
338 <li><a href="#7.28.1">        7.28.1 Introduction</a>
339 <li><a href="#7.28.2">        7.28.2 Formatted wide character input/output functions</a>
340 <li><a href="#7.28.3">        7.28.3 Wide character input/output functions</a>
341 <li><a href="#7.28.4">        7.28.4 General wide string utilities</a>
342 <ul>
343 <li><a href="#7.28.4.1">                 7.28.4.1 Wide string numeric conversion functions</a>
344 <li><a href="#7.28.4.2">                 7.28.4.2 Wide string copying functions</a>
345 <li><a href="#7.28.4.3">                 7.28.4.3 Wide string concatenation functions</a>
346 <li><a href="#7.28.4.4">                 7.28.4.4 Wide string comparison functions</a>
347 <li><a href="#7.28.4.5">                 7.28.4.5 Wide string search functions</a>
348 <li><a href="#7.28.4.6">                 7.28.4.6 Miscellaneous functions</a>
349 </ul>
350 <li><a href="#7.28.5">        7.28.5 Wide character time conversion functions</a>
351 <li><a href="#7.28.6">        7.28.6 Extended multibyte/wide character conversion utilities</a>
352 <ul>
353 <li><a href="#7.28.6.1">                 7.28.6.1 Single-byte/wide character conversion functions</a>
354 <li><a href="#7.28.6.2">                 7.28.6.2 Conversion state functions</a>
355 <li><a href="#7.28.6.3">                 7.28.6.3 Restartable multibyte/wide character conversion functions</a>
356 <li><a href="#7.28.6.4">                 7.28.6.4 Restartable multibyte/wide string conversion functions</a>
357 </ul>
358 </ul>
359 <li><a href="#7.29">   7.29 Wide character classification and mapping utilities &lt;wctype.h&gt;</a>
360 <ul>
361 <li><a href="#7.29.1">        7.29.1 Introduction</a>
362 <li><a href="#7.29.2">        7.29.2 Wide character classification utilities</a>
363 <ul>
364 <li><a href="#7.29.2.1">                 7.29.2.1 Wide character classification functions</a>
365 <li><a href="#7.29.2.2">                 7.29.2.2 Extensible wide character classification functions</a>
366 </ul>
367 <li><a href="#7.29.3">        7.29.3 Wide character case mapping utilities</a>
368 <ul>
369 <li><a href="#7.29.3.1">                 7.29.3.1 Wide character case mapping functions</a>
370 <li><a href="#7.29.3.2">                 7.29.3.2 Extensible wide character case mapping functions</a>
371 </ul>
372 </ul>
373 <li><a href="#7.30">   7.30 Future library directions</a>
374 <ul>
375 <li><a href="#7.30.1">        7.30.1 Complex arithmetic &lt;complex.h&gt;</a>
376 <li><a href="#7.30.2">        7.30.2 Character handling &lt;ctype.h&gt;</a>
377 <li><a href="#7.30.3">        7.30.3 Errors &lt;errno.h&gt;</a>
378 <li><a href="#7.30.4">        7.30.4 Format conversion of integer types &lt;inttypes.h&gt;</a>
379 <li><a href="#7.30.5">        7.30.5 Localization &lt;locale.h&gt;</a>
380 <li><a href="#7.30.6">        7.30.6 Signal handling &lt;signal.h&gt;</a>
381 <li><a href="#7.30.7">        7.30.7 Boolean type and values &lt;stdbool.h&gt;</a>
382 <li><a href="#7.30.8">        7.30.8 Integer types &lt;stdint.h&gt;</a>
383 <li><a href="#7.30.9">        7.30.9 Input/output &lt;stdio.h&gt;</a>
384 <li><a href="#7.30.10">        7.30.10 General utilities &lt;stdlib.h&gt;</a>
385 <li><a href="#7.30.11">        7.30.11 String handling &lt;string.h&gt;</a>
386 <!--page 9 -->
387 <li><a href="#7.30.12">        7.30.12 Extended multibyte and wide character utilities <wchar.h></a>
388 <li><a href="#7.30.13">        7.30.13 Wide character classification and mapping utilities <wctype.h></a>
389 </ul>
390 </ul>
391 <li><a href="#A">Annex A (informative) Language syntax summary</a>
392 <ul>
393 <li><a href="#A.1">  A.1 Lexical grammar</a>
394 <li><a href="#A.2">  A.2 Phrase structure grammar</a>
395 <li><a href="#A.3">  A.3 Preprocessing directives</a>
396 </ul>
397 <li><a href="#B">Annex B (informative) Library summary</a>
398 <ul>
399 <li><a href="#B.1">  B.1 Diagnostics &lt;assert.h&gt;</a>
400 <li><a href="#B.2">  B.2 Complex &lt;complex.h&gt;</a>
401 <li><a href="#B.3">  B.3 Character handling &lt;ctype.h&gt;</a>
402 <li><a href="#B.4">  B.4 Errors &lt;errno.h&gt;</a>
403 <li><a href="#B.5">  B.5 Floating-point environment &lt;fenv.h&gt;</a>
404 <li><a href="#B.6">  B.6 Characteristics of floating types &lt;float.h&gt;</a>
405 <li><a href="#B.7">  B.7 Format conversion of integer types &lt;inttypes.h&gt;</a>
406 <li><a href="#B.8">  B.8 Alternative spellings &lt;iso646.h&gt;</a>
407 <li><a href="#B.9">  B.9 Sizes of integer types &lt;limits.h&gt;</a>
408 <li><a href="#B.10">  B.10 Localization &lt;locale.h&gt;</a>
409 <li><a href="#B.11">  B.11 Mathematics &lt;math.h&gt;</a>
410 <li><a href="#B.12">  B.12 Nonlocal jumps &lt;setjmp.h&gt;</a>
411 <li><a href="#B.13">  B.13 Signal handling &lt;signal.h&gt;</a>
412 <li><a href="#B.14">  B.14 Alignment &lt;stdalign.h&gt;</a>
413 <li><a href="#B.15">  B.15 Variable arguments &lt;stdarg.h&gt;</a>
414 <li><a href="#B.16">  B.16 Atomics &lt;stdatomic.h&gt;</a>
415 <li><a href="#B.17">  B.17 Boolean type and values &lt;stdbool.h&gt;</a>
416 <li><a href="#B.18">  B.18 Common definitions &lt;stddef.h&gt;</a>
417 <li><a href="#B.19">  B.19 Integer types &lt;stdint.h&gt;</a>
418 <li><a href="#B.20">  B.20 Input/output &lt;stdio.h&gt;</a>
419 <li><a href="#B.21">  B.21 General utilities &lt;stdlib.h&gt;</a>
420 <li><a href="#B.22">  B.22 String handling &lt;string.h&gt;</a>
421 <li><a href="#B.23">  B.23 Type-generic math &lt;tgmath.h&gt;</a>
422 <li><a href="#B.24">  B.24 Threads &lt;threads.h&gt;</a>
423 <li><a href="#B.25">  B.25 Date and time &lt;time.h&gt;</a>
424 <li><a href="#B.26">  B.26 Unicode utilities &lt;uchar.h&gt;</a>
425 <li><a href="#B.27">  B.27 Extended multibyte/wide character utilities &lt;wchar.h&gt;</a>
426 <li><a href="#B.28">  B.28 Wide character classification and mapping utilities &lt;wctype.h&gt;</a>
427 </ul>
428 <li><a href="#C">Annex C (informative) Sequence points</a>
429 <li><a href="#D">Annex D (normative) Universal character names for identifiers</a>
430 <ul>
431 <li><a href="#D.1">  D.1 Ranges of characters allowed</a>
432 <li><a href="#D.2">  D.2 Ranges of characters disallowed initially</a>
433 </ul>
434 <li><a href="#E">Annex E (informative) Implementation limits</a>
435 <!--page 10 -->
436 <li><a href="#F">Annex F (normative) IEC 60559 floating-point arithmetic</a>
437 <ul>
438 <li><a href="#F.1">  F.1 Introduction</a>
439 <li><a href="#F.2">  F.2 Types</a>
440 <li><a href="#F.3">  F.3 Operators and functions</a>
441 <li><a href="#F.4">  F.4 Floating to integer conversion</a>
442 <li><a href="#F.5">  F.5 Binary-decimal conversion</a>
443 <li><a href="#F.6">  F.6 The return statement</a>
444 <li><a href="#F.7">  F.7 Contracted expressions</a>
445 <li><a href="#F.8">  F.8 Floating-point environment</a>
446 <li><a href="#F.9">  F.9 Optimization</a>
447 <li><a href="#F.10">  F.10 Mathematics &lt;math.h&gt;</a>
448 <ul>
449 <li><a href="#F.10.1">        F.10.1 Trigonometric functions</a>
450 <li><a href="#F.10.2">        F.10.2 Hyperbolic functions</a>
451 <li><a href="#F.10.3">        F.10.3 Exponential and logarithmic functions</a>
452 <li><a href="#F.10.4">        F.10.4 Power and absolute value functions</a>
453 <li><a href="#F.10.5">        F.10.5 Error and gamma functions</a>
454 <li><a href="#F.10.6">        F.10.6 Nearest integer functions</a>
455 <li><a href="#F.10.7">        F.10.7 Remainder functions</a>
456 <li><a href="#F.10.8">        F.10.8 Manipulation functions</a>
457 <li><a href="#F.10.9">        F.10.9 Maximum, minimum, and positive difference functions</a>
458 <li><a href="#F.10.10">        F.10.10 Floating multiply-add</a>
459 <li><a href="#F.10.11">        F.10.11 Comparison macros</a>
460 </ul>
461 </ul>
462 <li><a href="#G">Annex G (normative) IEC 60559-compatible complex arithmetic</a>
463 <ul>
464 <li><a href="#G.1">  G.1 Introduction</a>
465 <li><a href="#G.2">  G.2 Types</a>
466 <li><a href="#G.3">  G.3 Conventions</a>
467 <li><a href="#G.4">  G.4 Conversions</a>
468 <ul>
469 <li><a href="#G.4.1">       G.4.1 Imaginary types</a>
470 <li><a href="#G.4.2">       G.4.2 Real and imaginary</a>
471 <li><a href="#G.4.3">       G.4.3 Imaginary and complex</a>
472 </ul>
473 <li><a href="#G.5">  G.5 Binary operators</a>
474 <ul>
475 <li><a href="#G.5.1">       G.5.1 Multiplicative operators</a>
476 <li><a href="#G.5.2">       G.5.2 Additive operators</a>
477 </ul>
478 <li><a href="#G.6">  G.6 Complex arithmetic &lt;complex.h&gt;</a>
479 <ul>
480 <li><a href="#G.6.1">       G.6.1 Trigonometric functions</a>
481 <li><a href="#G.6.2">       G.6.2 Hyperbolic functions</a>
482 <li><a href="#G.6.3">       G.6.3 Exponential and logarithmic functions</a>
483 <li><a href="#G.6.4">       G.6.4 Power and absolute-value functions</a>
484 </ul>
485 <li><a href="#G.7">  G.7 Type-generic math &lt;tgmath.h&gt;</a>
486 </ul>
487 <li><a href="#H">Annex H (informative) Language independent arithmetic</a>
488 <ul>
489 <li><a href="#H.1">  H.1 Introduction</a>
490 <li><a href="#H.2">  H.2 Types</a>
491 <li><a href="#H.3">  H.3 Notification</a>
492 <!--page 11 -->
493 </ul>
494 <li><a href="#I">Annex I (informative) Common warnings</a>
495 <li><a href="#J">Annex J (informative) Portability issues</a>
496 <ul>
497 <li><a href="#J.1">  J.1 Unspecified behavior</a>
498 <li><a href="#J.2">  J.2 Undefined behavior</a>
499 <li><a href="#J.3">  J.3 Implementation-defined behavior</a>
500 <li><a href="#J.4">  J.4 Locale-specific behavior</a>
501 <li><a href="#J.5">  J.5 Common extensions</a>
502 </ul>
503 <li><a href="#K">Annex K (normative) Bounds-checking interfaces</a>
504 <ul>
505 <li><a href="#K.1">  K.1 Background</a>
506 <li><a href="#K.2">  K.2 Scope</a>
507 <li><a href="#K.3">  K.3 Library</a>
508 <ul>
509 <li><a href="#K.3.1">       K.3.1 Introduction</a>
510 <ul>
511 <li><a href="#K.3.1.1">                K.3.1.1 Standard headers</a>
512 <li><a href="#K.3.1.2">                K.3.1.2 Reserved identifiers</a>
513 <li><a href="#K.3.1.3">                K.3.1.3 Use of errno</a>
514 <li><a href="#K.3.1.4">                K.3.1.4 Runtime-constraint violations</a>
515 </ul>
516 <li><a href="#K.3.2">       K.3.2 Errors &lt;errno.h&gt;</a>
517 <li><a href="#K.3.3">       K.3.3 Common definitions &lt;stddef.h&gt;</a>
518 <li><a href="#K.3.4">       K.3.4 Integer types &lt;stdint.h&gt;</a>
519 <li><a href="#K.3.5">       K.3.5 Input/output &lt;stdio.h&gt;</a>
520 <ul>
521 <li><a href="#K.3.5.1">                K.3.5.1 Operations on files</a>
522 <li><a href="#K.3.5.2">                K.3.5.2 File access functions</a>
523 <li><a href="#K.3.5.3">                K.3.5.3 Formatted input/output functions</a>
524 <li><a href="#K.3.5.4">                K.3.5.4 Character input/output functions</a>
525 </ul>
526 <li><a href="#K.3.6">       K.3.6 General utilities &lt;stdlib.h&gt;</a>
527 <ul>
528 <li><a href="#K.3.6.1">                K.3.6.1 Runtime-constraint handling</a>
529 <li><a href="#K.3.6.2">                K.3.6.2 Communication with the environment</a>
530 <li><a href="#K.3.6.3">                K.3.6.3 Searching and sorting utilities</a>
531 <li><a href="#K.3.6.4">                K.3.6.4 Multibyte/wide character conversion functions</a>
532 <li><a href="#K.3.6.5">                K.3.6.5 Multibyte/wide string conversion functions</a>
533 </ul>
534 <li><a href="#K.3.7">       K.3.7 String handling &lt;string.h&gt;</a>
535 <ul>
536 <li><a href="#K.3.7.1">                K.3.7.1 Copying functions</a>
537 <li><a href="#K.3.7.2">                K.3.7.2 Concatenation functions</a>
538 <li><a href="#K.3.7.3">                K.3.7.3 Search functions</a>
539 <li><a href="#K.3.7.4">                K.3.7.4 Miscellaneous functions</a>
540 </ul>
541 <li><a href="#K.3.8">       K.3.8 Date and time &lt;time.h&gt;</a>
542 <ul>
543 <li><a href="#K.3.8.1">                K.3.8.1 Components of time</a>
544 <li><a href="#K.3.8.2">                K.3.8.2 Time conversion functions</a>
545 </ul>
546 <li><a href="#K.3.9">       K.3.9 Extended multibyte and wide character utilities <wchar.h></a>
547 <ul>
548 <li><a href="#K.3.9.1">                K.3.9.1 Formatted wide character input/output functions</a>
549 <li><a href="#K.3.9.2">                K.3.9.2 General wide string utilities</a>
550 <!--page 12 -->
551 <li><a href="#K.3.9.3">               K.3.9.3 Extended multibyte/wide character conversion utilities</a>
552 </ul>
553 </ul>
554 </ul>
555 <li><a href="#L">Annex L (normative) Analyzability</a>
556 <ul>
557 <li><a href="#L.1">  L.1 Scope</a>
558 <li><a href="#L.2">  L.2 Definitions</a>
559 <li><a href="#L.3">  L.3 Requirements</a>
560 </ul>
561 <li><a href="#Bibliography">Bibliography</a>
562 <li><a href="#Index">Index</a>
563 <!--page 13 -->
564 </ul>
565
566 <h2><a name="Foreword" href="#Foreword">Foreword</a></h2>
567 <p><!--para 1 -->
568  ISO (the International Organization for Standardization) and IEC (the International
569  Electrotechnical Commission) form the specialized system for worldwide
570  standardization. National bodies that are member of ISO or IEC participate in the
571  development of International Standards through technical committees established by the
572  respective organization to deal with particular fields of technical activity. ISO and IEC
573  technical committees collaborate in fields of mutual interest. Other international
574  organizations, governmental and non-governmental, in liaison with ISO and IEC, also
575  take part in the work.
576 <p><!--para 2 -->
577  International Standards are drafted in accordance with the rules given in the ISO/IEC
578  Directives, Part 2. This International Standard was drafted in accordance with the fifth
579  edition (2004).
580 <p><!--para 3 -->
581  In the field of information technology, ISO and IEC have established a joint technical
582  committee, ISO/IEC JTC 1. Draft International Standards adopted by the joint technical
583  committee are circulated to national bodies for voting. Publication as an International
584  Standard requires approval by at least 75% of the national bodies casting a vote.
585 <p><!--para 4 -->
586  Attention is drawn to the possibility that some of the elements of this document may be
587  the subject of patent rights. ISO and IEC shall not be held responsible for identifying any
588  or all such patent rights.
589 <p><!--para 5 -->
590  This International Standard was prepared by Joint Technical Committee ISO/IEC JTC 1,
591  Information technology, Subcommittee SC 22, Programming languages, their
592  environments and system software interfaces. The Working Group responsible for this
593  standard (WG 14) maintains a site on the World Wide Web at http://www.open-
594  std.org/JTC1/SC22/WG14/ containing additional information relevant to this
595  standard such as a Rationale for many of the decisions made during its preparation and a
596  log of Defect Reports and Responses.
597 <p><!--para 6 -->
598  This third edition cancels and replaces the second edition, ISO/IEC 9899:1999, as
599  corrected by ISO/IEC 9899:1999/Cor 1:2001, ISO/IEC 9899:1999/Cor 2:2004, and
600  ISO/IEC 9899:1999/Cor 3:2007. Major changes from the previous edition include:
601 <ul>
602 <li>  conditional (optional) features (including some that were previously mandatory)
603 <li>  support for multiple threads of execution including an improved memory sequencing
604  model, atomic objects, and thread-local storage (<a href="#7.17">&lt;stdatomic.h&gt;</a> and
605  <a href="#7.25">&lt;threads.h&gt;</a>)
606 <li>  additional floating-point characteristic macros (<a href="#7.7">&lt;float.h&gt;</a>)
607 <li>  querying and specifying alignment of objects (<a href="#7.15">&lt;stdalign.h&gt;</a>, <a href="#7.22">&lt;stdlib.h&gt;</a>)
608 <li>  Unicode characters and           strings   (<a href="#7.27">&lt;uchar.h&gt;</a>)       (originally   specified    in
609  ISO/IEC TR 19769:2004)
610 <li>  type-generic expressions
611 <!--page 14 -->
612 <li>  static assertions
613 <li>  anonymous structures and unions
614 <li>  no-return functions
615 <li>  macros to create complex numbers (<a href="#7.3">&lt;complex.h&gt;</a>)
616 <li>  support for opening files for exclusive access
617 <li>  removed the gets function (<a href="#7.21">&lt;stdio.h&gt;</a>)
618 <li>  added the aligned_alloc, at_quick_exit, and quick_exit functions
619  (<a href="#7.22">&lt;stdlib.h&gt;</a>)
620 <li>  (conditional) support for bounds-checking interfaces (originally specified in
621  ISO/IEC TR 24731-1:2007)
622 <li>  (conditional) support for analyzability
623 </ul>
624 <p><!--para 7 -->
625  Major changes in the second edition included:
626 <ul>
627 <li>  restricted character set support via digraphs and <a href="#7.9">&lt;iso646.h&gt;</a> (originally specified
628  in AMD1)
629 <li>  wide character library support in <a href="#7.28">&lt;wchar.h&gt;</a> and <a href="#7.29">&lt;wctype.h&gt;</a> (originally
630  specified in AMD1)
631 <li>  more precise aliasing rules via effective type
632 <li>  restricted pointers
633 <li>  variable length arrays
634 <li>  flexible array members
635 <li>  static and type qualifiers in parameter array declarators
636 <li>  complex (and imaginary) support in <a href="#7.3">&lt;complex.h&gt;</a>
637 <li>  type-generic math macros in <a href="#7.24">&lt;tgmath.h&gt;</a>
638 <li>  the long long int type and library functions
639 <li>  increased minimum translation limits
640 <li>  additional floating-point characteristics in <a href="#7.7">&lt;float.h&gt;</a>
641 <li>  remove implicit int
642 <li>  reliable integer division
643 <li>  universal character names (\u and \U)
644 <li>  extended identifiers
645 <li>  hexadecimal floating-point constants and %a and %A printf/scanf conversion
646  specifiers
647 <!--page 15 -->
648 <li>  compound literals
649 <li>  designated initializers
650 <li>  // comments
651 <li>  extended integer types and library functions in <a href="#7.8">&lt;inttypes.h&gt;</a> and <a href="#7.20">&lt;stdint.h&gt;</a>
652 <li>  remove implicit function declaration
653 <li>  preprocessor arithmetic done in intmax_t/uintmax_t
654 <li>  mixed declarations and code
655 <li>  new block scopes for selection and iteration statements
656 <li>  integer constant type rules
657 <li>  integer promotion rules
658 <li>  macros with a variable number of arguments
659 <li>  the vscanf family of functions in <a href="#7.21">&lt;stdio.h&gt;</a> and <a href="#7.28">&lt;wchar.h&gt;</a>
660 <li>  additional math library functions in <a href="#7.12">&lt;math.h&gt;</a>
661 <li>  treatment of error conditions by math library functions (math_errhandling)
662 <li>  floating-point environment access in <a href="#7.6">&lt;fenv.h&gt;</a>
663 <li>  IEC 60559 (also known as IEC 559 or IEEE arithmetic) support
664 <li>  trailing comma allowed in enum declaration
665 <li>  %lf conversion specifier allowed in printf
666 <li>  inline functions
667 <li>  the snprintf family of functions in <a href="#7.21">&lt;stdio.h&gt;</a>
668 <li>  boolean type in <a href="#7.18">&lt;stdbool.h&gt;</a>
669 <li>  idempotent type qualifiers
670 <li>  empty macro arguments
671 <li>  new structure type compatibility rules (tag compatibility)
672 <li>  additional predefined macro names
673 <li>  _Pragma preprocessing operator
674 <li>  standard pragmas
675 <li>  __func__ predefined identifier
676 <li>  va_copy macro
677 <li>  additional strftime conversion specifiers
678 <li>  LIA compatibility annex
679 <!--page 16 -->
680 <li>  deprecate ungetc at the beginning of a binary file
681 <li>  remove deprecation of aliased array parameters
682 <li>  conversion of array to pointer not limited to lvalues
683 <li>  relaxed constraints on aggregate and union initialization
684 <li>  relaxed restrictions on portable header names
685 <li>  return without expression not permitted in function that returns a value (and vice
686  versa)
687 </ul>
688 <p><!--para 8 -->
689  Annexes D, F, G, K, and L form a normative part of this standard; annexes A, B, C, E, H, *
690  I, J, the bibliography, and the index are for information only. In accordance with Part 2 of
691  the ISO/IEC Directives, this foreword, the introduction, notes, footnotes, and examples
692  are also for information only.
693 <!--page 17 -->
694
695 <h2><a name="Introduction" href="#Introduction">Introduction</a></h2>
696 <p><!--para 1 -->
697  With the introduction of new devices and extended character sets, new features may be
698  added to this International Standard. Subclauses in the language and library clauses warn
699  implementors and programmers of usages which, though valid in themselves, may
700  conflict with future additions.
701 <p><!--para 2 -->
702  Certain features are obsolescent, which means that they may be considered for
703  withdrawal in future revisions of this International Standard. They are retained because
704  of their widespread use, but their use in new implementations (for implementation
705  features) or new programs (for language [<a href="#6.11">6.11</a>] or library features [<a href="#7.30">7.30</a>]) is discouraged.
706 <p><!--para 3 -->
707  This International Standard is divided into four major subdivisions:
708 <ul>
709 <li>  preliminary elements (clauses 1-4);
710 <li>  the characteristics of environments that translate and execute C programs (clause 5);
711 <li>  the language syntax, constraints, and semantics (clause 6);
712 <li>  the library facilities (clause 7).
713 </ul>
714 <p><!--para 4 -->
715  Examples are provided to illustrate possible forms of the constructions described.
716  Footnotes are provided to emphasize consequences of the rules described in that
717  subclause or elsewhere in this International Standard. References are used to refer to
718  other related subclauses. Recommendations are provided to give advice or guidance to
719  implementors. Annexes provide additional information and summarize the information
720  contained in this International Standard. A bibliography lists documents that were
721  referred to during the preparation of the standard.
722 <p><!--para 5 -->
723  The language clause (clause 6) is derived from ''The C Reference Manual''.
724 <p><!--para 6 -->
725  The library clause (clause 7) is based on the 1984 /usr/group Standard.
726 <!--page 18 -->
727 <!--page 19 -->
728
729 <h1>Programming languages -- C</h1>
730  
731  
732  
733
734 <h2><a name="1" href="#1">1. Scope</a></h2>
735 <p><!--para 1 -->
736  This International Standard specifies the form and establishes the interpretation of
737  programs written in the C programming language.<sup><a href="#note1"><b>1)</b></a></sup> It specifies
738 <ul>
739 <li>  the representation of C programs;
740 <li>  the syntax and constraints of the C language;
741 <li>  the semantic rules for interpreting C programs;
742 <li>  the representation of input data to be processed by C programs;
743 <li>  the representation of output data produced by C programs;
744 <li>  the restrictions and limits imposed by a conforming implementation of C.
745 </ul>
746 <p><!--para 2 -->
747  This International Standard does not specify
748 <ul>
749 <li>  the mechanism by which C programs are transformed for use by a data-processing
750  system;
751 <li>  the mechanism by which C programs are invoked for use by a data-processing
752  system;
753 <li>  the mechanism by which input data are transformed for use by a C program;
754 <li>  the mechanism by which output data are transformed after being produced by a C
755  program;
756 <li>  the size or complexity of a program and its data that will exceed the capacity of any
757  specific data-processing system or the capacity of a particular processor;
758 <li>  all minimal requirements of a data-processing system that is capable of supporting a
759  conforming implementation.
760  
761  
762 <!--page 20 -->
763 </ul>
764
765 <h6>footnotes</h6>
766 <p><small><a name="note1" href="#note1">1)</a> This International Standard is designed to promote the portability of C programs among a variety of
767  data-processing systems. It is intended for use by implementors and programmers.
768 </small>
769
770 <h2><a name="2" href="#2">2. Normative references</a></h2>
771 <p><!--para 1 -->
772  The following referenced documents are indispensable for the application of this
773  document. For dated references, only the edition cited applies. For undated references,
774  the latest edition of the referenced document (including any amendments) applies.
775 <p><!--para 2 -->
776  ISO 31-11:1992, Quantities and units -- Part 11: Mathematical signs and symbols for
777  use in the physical sciences and technology.
778 <p><!--para 3 -->
779  ISO/IEC 646, Information technology -- ISO 7-bit coded character set for information
780  interchange.
781 <p><!--para 4 -->
782  ISO/IEC 2382-1:1993, Information technology -- Vocabulary -- Part 1: Fundamental
783  terms.
784 <p><!--para 5 -->
785  ISO 4217, Codes for the representation of currencies and funds.
786 <p><!--para 6 -->
787  ISO 8601, Data elements and interchange formats -- Information interchange --
788  Representation of dates and times.
789 <p><!--para 7 -->
790  ISO/IEC 10646 (all parts), Information technology -- Universal Multiple-Octet Coded
791  Character Set (UCS).
792 <p><!--para 8 -->
793  IEC 60559:1989, Binary floating-point arithmetic for microprocessor systems (previously
794  designated IEC 559:1989).
795 <!--page 21 -->
796
797 <h2><a name="3" href="#3">3. Terms, definitions, and symbols</a></h2>
798 <p><!--para 1 -->
799  For the purposes of this International Standard, the following definitions apply. Other
800  terms are defined where they appear in italic type or on the left side of a syntax rule.
801  Terms explicitly defined in this International Standard are not to be presumed to refer
802  implicitly to similar terms defined elsewhere. Terms not defined in this International
803  Standard are to be interpreted according to ISO/IEC 2382-1. Mathematical symbols not
804  defined in this International Standard are to be interpreted according to ISO 31-11.
805
806 <h3><a name="3.1" href="#3.1">3.1</a></h3>
807 <p><!--para 1 -->
808 <b> access</b><br>
809  &lt;execution-time action&gt; to read or modify the value of an object
810 <p><!--para 2 -->
811  NOTE 1   Where only one of these two actions is meant, ''read'' or ''modify'' is used.
812  
813 <p><!--para 3 -->
814  NOTE 2   ''Modify'' includes the case where the new value being stored is the same as the previous value.
815  
816 <p><!--para 4 -->
817  NOTE 3   Expressions that are not evaluated do not access objects.
818  
819
820 <h3><a name="3.2" href="#3.2">3.2</a></h3>
821 <p><!--para 1 -->
822 <b> alignment</b><br>
823  requirement that objects of a particular type be located on storage boundaries with
824  addresses that are particular multiples of a byte address
825
826 <h3><a name="3.3" href="#3.3">3.3</a></h3>
827 <p><!--para 1 -->
828 <b> argument</b><br>
829  actual argument
830  actual parameter (deprecated)
831  expression in the comma-separated list bounded by the parentheses in a function call
832  expression, or a sequence of preprocessing tokens in the comma-separated list bounded
833  by the parentheses in a function-like macro invocation
834
835 <h3><a name="3.4" href="#3.4">3.4</a></h3>
836 <p><!--para 1 -->
837 <b> behavior</b><br>
838  external appearance or action
839
840 <h4><a name="3.4.1" href="#3.4.1">3.4.1</a></h4>
841 <p><!--para 1 -->
842 <b> implementation-defined behavior</b><br>
843  unspecified behavior where each implementation documents how the choice is made
844 <p><!--para 2 -->
845  EXAMPLE An example of implementation-defined behavior is the propagation of the high-order bit
846  when a signed integer is shifted right.
847  
848
849 <h4><a name="3.4.2" href="#3.4.2">3.4.2</a></h4>
850 <p><!--para 1 -->
851 <b> locale-specific behavior</b><br>
852  behavior that depends on local conventions of nationality, culture, and language that each
853  implementation documents
854 <!--page 22 -->
855 <p><!--para 2 -->
856  EXAMPLE An example of locale-specific behavior is whether the islower function returns true for
857  characters other than the 26 lowercase Latin letters.
858  
859
860 <h4><a name="3.4.3" href="#3.4.3">3.4.3</a></h4>
861 <p><!--para 1 -->
862 <b> undefined behavior</b><br>
863  behavior, upon use of a nonportable or erroneous program construct or of erroneous data,
864  for which this International Standard imposes no requirements
865 <p><!--para 2 -->
866  NOTE Possible undefined behavior ranges from ignoring the situation completely with unpredictable
867  results, to behaving during translation or program execution in a documented manner characteristic of the
868  environment (with or without the issuance of a diagnostic message), to terminating a translation or
869  execution (with the issuance of a diagnostic message).
870  
871 <p><!--para 3 -->
872  EXAMPLE        An example of undefined behavior is the behavior on integer overflow.
873  
874
875 <h4><a name="3.4.4" href="#3.4.4">3.4.4</a></h4>
876 <p><!--para 1 -->
877 <b> unspecified behavior</b><br>
878  use of an unspecified value, or other behavior where this International Standard provides
879  two or more possibilities and imposes no further requirements on which is chosen in any
880  instance
881 <p><!--para 2 -->
882  EXAMPLE        An example of unspecified behavior is the order in which the arguments to a function are
883  evaluated.
884  
885
886 <h3><a name="3.5" href="#3.5">3.5</a></h3>
887 <p><!--para 1 -->
888 <b> bit</b><br>
889  unit of data storage in the execution environment large enough to hold an object that may
890  have one of two values
891 <p><!--para 2 -->
892  NOTE     It need not be possible to express the address of each individual bit of an object.
893  
894
895 <h3><a name="3.6" href="#3.6">3.6</a></h3>
896 <p><!--para 1 -->
897 <b> byte</b><br>
898  addressable unit of data storage large enough to hold any member of the basic character
899  set of the execution environment
900 <p><!--para 2 -->
901  NOTE 1     It is possible to express the address of each individual byte of an object uniquely.
902  
903 <p><!--para 3 -->
904  NOTE 2 A byte is composed of a contiguous sequence of bits, the number of which is implementation-
905  defined. The least significant bit is called the low-order bit; the most significant bit is called the high-order
906  bit.
907  
908
909 <h3><a name="3.7" href="#3.7">3.7</a></h3>
910 <p><!--para 1 -->
911 <b> character</b><br>
912  &lt;abstract&gt; member of a set of elements used for the organization, control, or
913  representation of data
914
915 <h4><a name="3.7.1" href="#3.7.1">3.7.1</a></h4>
916 <p><!--para 1 -->
917 <b> character</b><br>
918  single-byte character
919  &lt;C&gt; bit representation that fits in a byte
920 <!--page 23 -->
921
922 <h4><a name="3.7.2" href="#3.7.2">3.7.2</a></h4>
923 <p><!--para 1 -->
924 <b> multibyte character</b><br>
925  sequence of one or more bytes representing a member of the extended character set of
926  either the source or the execution environment
927 <p><!--para 2 -->
928  NOTE    The extended character set is a superset of the basic character set.
929  
930
931 <h4><a name="3.7.3" href="#3.7.3">3.7.3</a></h4>
932 <p><!--para 1 -->
933 <b> wide character</b><br>
934  bit representation that fits in an object of type wchar_t, capable of representing any
935  character in the current locale
936
937 <h3><a name="3.8" href="#3.8">3.8</a></h3>
938 <p><!--para 1 -->
939 <b> constraint</b><br>
940  restriction, either syntactic or semantic, by which the exposition of language elements is
941  to be interpreted
942
943 <h3><a name="3.9" href="#3.9">3.9</a></h3>
944 <p><!--para 1 -->
945 <b> correctly rounded result</b><br>
946  representation in the result format that is nearest in value, subject to the current rounding
947  mode, to what the result would be given unlimited range and precision
948
949 <h3><a name="3.10" href="#3.10">3.10</a></h3>
950 <p><!--para 1 -->
951 <b> diagnostic message</b><br>
952  message belonging to an implementation-defined subset of the implementation's message
953  output
954
955 <h3><a name="3.11" href="#3.11">3.11</a></h3>
956 <p><!--para 1 -->
957 <b> forward reference</b><br>
958  reference to a later subclause of this International Standard that contains additional
959  information relevant to this subclause
960
961 <h3><a name="3.12" href="#3.12">3.12</a></h3>
962 <p><!--para 1 -->
963 <b> implementation</b><br>
964  particular set of software, running in a particular translation environment under particular
965  control options, that performs translation of programs for, and supports execution of
966  functions in, a particular execution environment
967
968 <h3><a name="3.13" href="#3.13">3.13</a></h3>
969 <p><!--para 1 -->
970 <b> implementation limit</b><br>
971  restriction imposed upon programs by the implementation
972
973 <h3><a name="3.14" href="#3.14">3.14</a></h3>
974 <p><!--para 1 -->
975 <b> memory location</b><br>
976  either an object of scalar type, or a maximal sequence of adjacent bit-fields all having
977  nonzero width
978 <!--page 24 -->
979 <p><!--para 2 -->
980  NOTE 1 Two threads of execution can update and access separate memory locations without interfering
981  with each other.
982  
983 <p><!--para 3 -->
984  NOTE 2 A bit-field and an adjacent non-bit-field member are in separate memory locations. The same
985  applies to two bit-fields, if one is declared inside a nested structure declaration and the other is not, or if the
986  two are separated by a zero-length bit-field declaration, or if they are separated by a non-bit-field member
987  declaration. It is not safe to concurrently update two non-atomic bit-fields in the same structure if all
988  members declared between them are also (non-zero-length) bit-fields, no matter what the sizes of those
989  intervening bit-fields happen to be.
990  
991 <p><!--para 4 -->
992  EXAMPLE        A structure declared as
993 <pre>
994           struct {
995                 char a;
996                 int b:5, c:11, :0, d:8;
997                 struct { int ee:8; } e;
998           }
999 </pre>
1000  contains four separate memory locations: The member a, and bit-fields d and e.ee are each separate
1001  memory locations, and can be modified concurrently without interfering with each other. The bit-fields b
1002  and c together constitute the fourth memory location. The bit-fields b and c cannot be concurrently
1003  modified, but b and a, for example, can be.
1004  
1005
1006 <h3><a name="3.15" href="#3.15">3.15</a></h3>
1007 <p><!--para 1 -->
1008 <b> object</b><br>
1009  region of data storage in the execution environment, the contents of which can represent
1010  values
1011 <p><!--para 2 -->
1012  NOTE      When referenced, an object may be interpreted as having a particular type; see <a href="#6.3.2.1">6.3.2.1</a>.
1013  
1014
1015 <h3><a name="3.16" href="#3.16">3.16</a></h3>
1016 <p><!--para 1 -->
1017 <b> parameter</b><br>
1018  formal parameter
1019  formal argument (deprecated)
1020  object declared as part of a function declaration or definition that acquires a value on
1021  entry to the function, or an identifier from the comma-separated list bounded by the
1022  parentheses immediately following the macro name in a function-like macro definition
1023
1024 <h3><a name="3.17" href="#3.17">3.17</a></h3>
1025 <p><!--para 1 -->
1026 <b> recommended practice</b><br>
1027  specification that is strongly recommended as being in keeping with the intent of the
1028  standard, but that may be impractical for some implementations
1029
1030 <h3><a name="3.18" href="#3.18">3.18</a></h3>
1031 <p><!--para 1 -->
1032 <b> runtime-constraint</b><br>
1033  requirement on a program when calling a library function
1034 <p><!--para 2 -->
1035  NOTE 1 Despite the similar terms, a runtime-constraint is not a kind of constraint as defined by <a href="#3.8">3.8</a>, and
1036  need not be diagnosed at translation time.
1037  
1038 <p><!--para 3 -->
1039  NOTE 2 Implementations that support the extensions in <a href="#K">annex K</a> are required to verify that the runtime-
1040  constraints for a library function are not violated by the program; see <a href="#K.3.1.4">K.3.1.4</a>.
1041 <!--page 25 -->
1042
1043 <h3><a name="3.19" href="#3.19">3.19</a></h3>
1044 <p><!--para 1 -->
1045 <b> value</b><br>
1046  precise meaning of the contents of an object when interpreted as having a specific type
1047
1048 <h4><a name="3.19.1" href="#3.19.1">3.19.1</a></h4>
1049 <p><!--para 1 -->
1050 <b> implementation-defined value</b><br>
1051  unspecified value where each implementation documents how the choice is made
1052
1053 <h4><a name="3.19.2" href="#3.19.2">3.19.2</a></h4>
1054 <p><!--para 1 -->
1055 <b> indeterminate value</b><br>
1056  either an unspecified value or a trap representation
1057
1058 <h4><a name="3.19.3" href="#3.19.3">3.19.3</a></h4>
1059 <p><!--para 1 -->
1060 <b> unspecified value</b><br>
1061  valid value of the relevant type where this International Standard imposes no
1062  requirements on which value is chosen in any instance
1063 <p><!--para 2 -->
1064  NOTE     An unspecified value cannot be a trap representation.
1065  
1066
1067 <h4><a name="3.19.4" href="#3.19.4">3.19.4</a></h4>
1068 <p><!--para 1 -->
1069 <b> trap representation</b><br>
1070  an object representation that need not represent a value of the object type
1071
1072 <h4><a name="3.19.5" href="#3.19.5">3.19.5</a></h4>
1073 <p><!--para 1 -->
1074 <b> perform a trap</b><br>
1075  interrupt execution of the program such that no further operations are performed
1076 <p><!--para 2 -->
1077  NOTE In this International Standard, when the word ''trap'' is not immediately followed by
1078  ''representation'', this is the intended usage.<sup><a href="#note2"><b>2)</b></a></sup>
1079  
1080
1081 <h6>footnotes</h6>
1082 <p><small><a name="note2" href="#note2">2)</a> For example, ''Trapping or stopping (if supported) is disabled...'' (<a href="#F.8.2">F.8.2</a>). Note that fetching a trap
1083  representation might perform a trap but is not required to (see <a href="#6.2.6.1">6.2.6.1</a>).
1084 </small>
1085
1086 <h3><a name="3.20" href="#3.20">3.20</a></h3>
1087 <p><!--para 1 -->
1088 <b> [^ x^]</b><br>
1089  ceiling of x: the least integer greater than or equal to x
1090 <p><!--para 2 -->
1091  EXAMPLE       [^2.4^] is 3, [^-2.4^] is -2.
1092  
1093
1094 <h3><a name="3.21" href="#3.21">3.21</a></h3>
1095 <p><!--para 1 -->
1096 <b> [_ x_]</b><br>
1097  floor of x: the greatest integer less than or equal to x
1098 <p><!--para 2 -->
1099  EXAMPLE       [_2.4_] is 2, [_-2.4_] is -3.
1100  
1101  
1102  
1103  
1104 <!--page 26 -->
1105
1106 <h2><a name="4" href="#4">4. Conformance</a></h2>
1107 <p><!--para 1 -->
1108  In this International Standard, ''shall'' is to be interpreted as a requirement on an
1109  implementation or on a program; conversely, ''shall not'' is to be interpreted as a
1110  prohibition.
1111 <p><!--para 2 -->
1112  If a ''shall'' or ''shall not'' requirement that appears outside of a constraint or runtime-
1113  constraint is violated, the behavior is undefined. Undefined behavior is otherwise
1114  indicated in this International Standard by the words ''undefined behavior'' or by the
1115  omission of any explicit definition of behavior. There is no difference in emphasis among
1116  these three; they all describe ''behavior that is undefined''.
1117 <p><!--para 3 -->
1118  A program that is correct in all other aspects, operating on correct data, containing
1119  unspecified behavior shall be a correct program and act in accordance with <a href="#5.1.2.3">5.1.2.3</a>.
1120 <p><!--para 4 -->
1121  The implementation shall not successfully translate a preprocessing translation unit
1122  containing a #error preprocessing directive unless it is part of a group skipped by
1123  conditional inclusion.
1124 <p><!--para 5 -->
1125  A strictly conforming program shall use only those features of the language and library
1126  specified in this International Standard.<sup><a href="#note3"><b>3)</b></a></sup> It shall not produce output dependent on any
1127  unspecified, undefined, or implementation-defined behavior, and shall not exceed any
1128  minimum implementation limit.
1129 <p><!--para 6 -->
1130  The two forms of conforming implementation are hosted and freestanding. A conforming
1131  hosted implementation shall accept any strictly conforming program. A conforming
1132  freestanding implementation shall accept any strictly conforming program that does not
1133  use complex types and in which the use of the features specified in the library clause
1134  (clause 7) is confined to the contents of the standard headers <a href="#7.7">&lt;float.h&gt;</a>,
1135  <a href="#7.9">&lt;iso646.h&gt;</a>, <a href="#7.10">&lt;limits.h&gt;</a>, <a href="#7.15">&lt;stdalign.h&gt;</a>, <a href="#7.16">&lt;stdarg.h&gt;</a>, <a href="#7.18">&lt;stdbool.h&gt;</a>,
1136  <a href="#7.19">&lt;stddef.h&gt;</a>, and <a href="#7.20">&lt;stdint.h&gt;</a>. A conforming implementation may have extensions
1137  (including additional library functions), provided they do not alter the behavior of any
1138  strictly conforming program.<sup><a href="#note4"><b>4)</b></a></sup>
1139  
1140  
1141  
1142 <!--page 27 -->
1143 <p><!--para 7 -->
1144  A conforming program is one that is acceptable to a conforming implementation.<sup><a href="#note5"><b>5)</b></a></sup>
1145 <p><!--para 8 -->
1146  An implementation shall be accompanied by a document that defines all implementation-
1147  defined and locale-specific characteristics and all extensions.
1148 <p><b> Forward references</b>: conditional inclusion (<a href="#6.10.1">6.10.1</a>), error directive (<a href="#6.10.5">6.10.5</a>),
1149  characteristics of floating types <a href="#7.7">&lt;float.h&gt;</a> (<a href="#7.7">7.7</a>), alternative spellings <a href="#7.9">&lt;iso646.h&gt;</a>
1150  (<a href="#7.9">7.9</a>), sizes of integer types <a href="#7.10">&lt;limits.h&gt;</a> (<a href="#7.10">7.10</a>), alignment <a href="#7.15">&lt;stdalign.h&gt;</a> (<a href="#7.15">7.15</a>),
1151  variable arguments <a href="#7.16">&lt;stdarg.h&gt;</a> (<a href="#7.16">7.16</a>), boolean type and values <a href="#7.18">&lt;stdbool.h&gt;</a>
1152  (<a href="#7.18">7.18</a>), common definitions <a href="#7.19">&lt;stddef.h&gt;</a> (<a href="#7.19">7.19</a>), integer types <a href="#7.20">&lt;stdint.h&gt;</a> (<a href="#7.20">7.20</a>).
1153  
1154  
1155  
1156  
1157 <!--page 28 -->
1158
1159 <h6>footnotes</h6>
1160 <p><small><a name="note3" href="#note3">3)</a> A strictly conforming program can use conditional features (see <a href="#6.10.8.3">6.10.8.3</a>) provided the use is guarded
1161  by an appropriate conditional inclusion preprocessing directive using the related macro. For example:
1162
1163 <pre>
1164          #ifdef __STDC_IEC_559__ /* FE_UPWARD defined */
1165             /* ... */
1166             fesetround(FE_UPWARD);
1167             /* ... */
1168          #endif
1169 </pre>
1170  
1171 </small>
1172 <p><small><a name="note4" href="#note4">4)</a> This implies that a conforming implementation reserves no identifiers other than those explicitly
1173  reserved in this International Standard.
1174 </small>
1175 <p><small><a name="note5" href="#note5">5)</a> Strictly conforming programs are intended to be maximally portable among conforming
1176  implementations. Conforming programs may depend upon nonportable features of a conforming
1177  implementation.
1178 </small>
1179
1180 <h2><a name="5" href="#5">5. Environment</a></h2>
1181 <p><!--para 1 -->
1182  An implementation translates C source files and executes C programs in two data-
1183  processing-system environments, which will be called the translation environment and
1184  the execution environment in this International Standard. Their characteristics define and
1185  constrain the results of executing conforming C programs constructed according to the
1186  syntactic and semantic rules for conforming implementations.
1187 <p><b> Forward references</b>: In this clause, only a few of many possible forward references
1188  have been noted.
1189
1190 <h3><a name="5.1" href="#5.1">5.1 Conceptual models</a></h3>
1191
1192 <h4><a name="5.1.1" href="#5.1.1">5.1.1 Translation environment</a></h4>
1193
1194 <h5><a name="5.1.1.1" href="#5.1.1.1">5.1.1.1 Program structure</a></h5>
1195 <p><!--para 1 -->
1196  A C program need not all be translated at the same time. The text of the program is kept
1197  in units called source files, (or preprocessing files) in this International Standard. A
1198  source file together with all the headers and source files included via the preprocessing
1199  directive #include is known as a preprocessing translation unit. After preprocessing, a
1200  preprocessing translation unit is called a translation unit. Previously translated translation
1201  units may be preserved individually or in libraries. The separate translation units of a
1202  program communicate by (for example) calls to functions whose identifiers have external
1203  linkage, manipulation of objects whose identifiers have external linkage, or manipulation
1204  of data files. Translation units may be separately translated and then later linked to
1205  produce an executable program.
1206 <p><b> Forward references</b>: linkages of identifiers (<a href="#6.2.2">6.2.2</a>), external definitions (<a href="#6.9">6.9</a>),
1207  preprocessing directives (<a href="#6.10">6.10</a>).
1208
1209 <h5><a name="5.1.1.2" href="#5.1.1.2">5.1.1.2 Translation phases</a></h5>
1210 <p><!--para 1 -->
1211  The precedence among the syntax rules of translation is specified by the following
1212  phases.<sup><a href="#note6"><b>6)</b></a></sup>
1213 <ol>
1214 <li>  Physical source file multibyte characters are mapped, in an implementation-
1215  defined manner, to the source character set (introducing new-line characters for
1216  end-of-line indicators) if necessary. Trigraph sequences are replaced by
1217  corresponding single-character internal representations.
1218  
1219  
1220  
1221 <!--page 29 -->
1222 <li>  Each instance of a backslash character (\) immediately followed by a new-line
1223  character is deleted, splicing physical source lines to form logical source lines.
1224  Only the last backslash on any physical source line shall be eligible for being part
1225  of such a splice. A source file that is not empty shall end in a new-line character,
1226  which shall not be immediately preceded by a backslash character before any such
1227  splicing takes place.
1228 <li>  The source file is decomposed into preprocessing tokens<sup><a href="#note7"><b>7)</b></a></sup> and sequences of
1229  white-space characters (including comments). A source file shall not end in a
1230  partial preprocessing token or in a partial comment. Each comment is replaced by
1231  one space character. New-line characters are retained. Whether each nonempty
1232  sequence of white-space characters other than new-line is retained or replaced by
1233  one space character is implementation-defined.
1234 <li>  Preprocessing directives are executed, macro invocations are expanded, and
1235  _Pragma unary operator expressions are executed. If a character sequence that
1236  matches the syntax of a universal character name is produced by token
1237  concatenation (<a href="#6.10.3.3">6.10.3.3</a>), the behavior is undefined. A #include preprocessing
1238  directive causes the named header or source file to be processed from phase 1
1239  through phase 4, recursively. All preprocessing directives are then deleted.
1240 <li>  Each source character set member and escape sequence in character constants and
1241  string literals is converted to the corresponding member of the execution character
1242  set; if there is no corresponding member, it is converted to an implementation-
1243  defined member other than the null (wide) character.<sup><a href="#note8"><b>8)</b></a></sup>
1244 <li>  Adjacent string literal tokens are concatenated.
1245 <li>  White-space characters separating tokens are no longer significant. Each
1246  preprocessing token is converted into a token. The resulting tokens are
1247  syntactically and semantically analyzed and translated as a translation unit.
1248 <li>  All external object and function references are resolved. Library components are
1249  linked to satisfy external references to functions and objects not defined in the
1250  current translation. All such translator output is collected into a program image
1251  which contains information needed for execution in its execution environment.
1252 </ol>
1253 <p><b> Forward references</b>: universal character names (<a href="#6.4.3">6.4.3</a>), lexical elements (<a href="#6.4">6.4</a>),
1254  preprocessing directives (<a href="#6.10">6.10</a>), trigraph sequences (<a href="#5.2.1.1">5.2.1.1</a>), external definitions (<a href="#6.9">6.9</a>).
1255  
1256  
1257  
1258 <!--page 30 -->
1259
1260 <h6>footnotes</h6>
1261 <p><small><a name="note6" href="#note6">6)</a> Implementations shall behave as if these separate phases occur, even though many are typically folded
1262  together in practice. Source files, translation units, and translated translation units need not
1263  necessarily be stored as files, nor need there be any one-to-one correspondence between these entities
1264  and any external representation. The description is conceptual only, and does not specify any
1265  particular implementation.
1266 </small>
1267 <p><small><a name="note7" href="#note7">7)</a> As described in <a href="#6.4">6.4</a>, the process of dividing a source file's characters into preprocessing tokens is
1268  context-dependent. For example, see the handling of &lt; within a #include preprocessing directive.
1269 </small>
1270 <p><small><a name="note8" href="#note8">8)</a> An implementation need not convert all non-corresponding source characters to the same execution
1271  character.
1272 </small>
1273
1274 <h5><a name="5.1.1.3" href="#5.1.1.3">5.1.1.3 Diagnostics</a></h5>
1275 <p><!--para 1 -->
1276  A conforming implementation shall produce at least one diagnostic message (identified in
1277  an implementation-defined manner) if a preprocessing translation unit or translation unit
1278  contains a violation of any syntax rule or constraint, even if the behavior is also explicitly
1279  specified as undefined or implementation-defined. Diagnostic messages need not be
1280  produced in other circumstances.<sup><a href="#note9"><b>9)</b></a></sup>
1281 <p><!--para 2 -->
1282  EXAMPLE        An implementation shall issue a diagnostic for the translation unit:
1283 <pre>
1284           char i;
1285           int i;
1286 </pre>
1287  because in those cases where wording in this International Standard describes the behavior for a construct
1288  as being both a constraint error and resulting in undefined behavior, the constraint error shall be diagnosed.
1289  
1290
1291 <h6>footnotes</h6>
1292 <p><small><a name="note9" href="#note9">9)</a> The intent is that an implementation should identify the nature of, and where possible localize, each
1293  violation. Of course, an implementation is free to produce any number of diagnostics as long as a
1294  valid program is still correctly translated. It may also successfully translate an invalid program.
1295 </small>
1296
1297 <h4><a name="5.1.2" href="#5.1.2">5.1.2 Execution environments</a></h4>
1298 <p><!--para 1 -->
1299  Two execution environments are defined: freestanding and hosted. In both cases,
1300  program startup occurs when a designated C function is called by the execution
1301  environment. All objects with static storage duration shall be initialized (set to their
1302  initial values) before program startup. The manner and timing of such initialization are
1303  otherwise unspecified. Program termination returns control to the execution
1304  environment.
1305 <p><b> Forward references</b>: storage durations of objects (<a href="#6.2.4">6.2.4</a>), initialization (<a href="#6.7.9">6.7.9</a>).
1306
1307 <h5><a name="5.1.2.1" href="#5.1.2.1">5.1.2.1 Freestanding environment</a></h5>
1308 <p><!--para 1 -->
1309  In a freestanding environment (in which C program execution may take place without any
1310  benefit of an operating system), the name and type of the function called at program
1311  startup are implementation-defined. Any library facilities available to a freestanding
1312  program, other than the minimal set required by clause 4, are implementation-defined.
1313 <p><!--para 2 -->
1314  The effect of program termination in a freestanding environment is implementation-
1315  defined.
1316
1317 <h5><a name="5.1.2.2" href="#5.1.2.2">5.1.2.2 Hosted environment</a></h5>
1318 <p><!--para 1 -->
1319  A hosted environment need not be provided, but shall conform to the following
1320  specifications if present.
1321  
1322  
1323  
1324  
1325 <!--page 31 -->
1326
1327 <h5><a name="5.1.2.2.1" href="#5.1.2.2.1">5.1.2.2.1 Program startup</a></h5>
1328 <p><!--para 1 -->
1329  The function called at program startup is named main. The implementation declares no
1330  prototype for this function. It shall be defined with a return type of int and with no
1331  parameters:
1332 <pre>
1333          int main(void) { /* ... */ }
1334 </pre>
1335  or with two parameters (referred to here as argc and argv, though any names may be
1336  used, as they are local to the function in which they are declared):
1337 <pre>
1338          int main(int argc, char *argv[]) { /* ... */ }
1339 </pre>
1340  or equivalent;<sup><a href="#note10"><b>10)</b></a></sup> or in some other implementation-defined manner.
1341 <p><!--para 2 -->
1342  If they are declared, the parameters to the main function shall obey the following
1343  constraints:
1344 <ul>
1345 <li>  The value of argc shall be nonnegative.
1346 <li>  argv[argc] shall be a null pointer.
1347 <li>  If the value of argc is greater than zero, the array members argv[0] through
1348  argv[argc-1] inclusive shall contain pointers to strings, which are given
1349  implementation-defined values by the host environment prior to program startup. The
1350  intent is to supply to the program information determined prior to program startup
1351  from elsewhere in the hosted environment. If the host environment is not capable of
1352  supplying strings with letters in both uppercase and lowercase, the implementation
1353  shall ensure that the strings are received in lowercase.
1354 <li>  If the value of argc is greater than zero, the string pointed to by argv[0]
1355  represents the program name; argv[0][0] shall be the null character if the
1356  program name is not available from the host environment. If the value of argc is
1357  greater than one, the strings pointed to by argv[1] through argv[argc-1]
1358  represent the program parameters.
1359 <li>  The parameters argc and argv and the strings pointed to by the argv array shall
1360  be modifiable by the program, and retain their last-stored values between program
1361  startup and program termination.
1362 </ul>
1363
1364 <h6>footnotes</h6>
1365 <p><small><a name="note10" href="#note10">10)</a> Thus, int can be replaced by a typedef name defined as int, or the type of argv can be written as
1366  char ** argv, and so on.
1367 </small>
1368
1369 <h5><a name="5.1.2.2.2" href="#5.1.2.2.2">5.1.2.2.2 Program execution</a></h5>
1370 <p><!--para 1 -->
1371  In a hosted environment, a program may use all the functions, macros, type definitions,
1372  and objects described in the library clause (clause 7).
1373  
1374  
1375  
1376  
1377 <!--page 32 -->
1378
1379 <h5><a name="5.1.2.2.3" href="#5.1.2.2.3">5.1.2.2.3 Program termination</a></h5>
1380 <p><!--para 1 -->
1381  If the return type of the main function is a type compatible with int, a return from the
1382  initial call to the main function is equivalent to calling the exit function with the value
1383  returned by the main function as its argument;<sup><a href="#note11"><b>11)</b></a></sup> reaching the } that terminates the
1384  main function returns a value of 0. If the return type is not compatible with int, the
1385  termination status returned to the host environment is unspecified.
1386 <p><b> Forward references</b>: definition of terms (<a href="#7.1.1">7.1.1</a>), the exit function (<a href="#7.22.4.4">7.22.4.4</a>).
1387
1388 <h6>footnotes</h6>
1389 <p><small><a name="note11" href="#note11">11)</a> In accordance with <a href="#6.2.4">6.2.4</a>, the lifetimes of objects with automatic storage duration declared in main
1390  will have ended in the former case, even where they would not have in the latter.
1391 </small>
1392
1393 <h5><a name="5.1.2.3" href="#5.1.2.3">5.1.2.3 Program execution</a></h5>
1394 <p><!--para 1 -->
1395  The semantic descriptions in this International Standard describe the behavior of an
1396  abstract machine in which issues of optimization are irrelevant.
1397 <p><!--para 2 -->
1398  Accessing a volatile object, modifying an object, modifying a file, or calling a function
1399  that does any of those operations are all side effects,<sup><a href="#note12"><b>12)</b></a></sup> which are changes in the state of
1400  the execution environment. Evaluation of an expression in general includes both value
1401  computations and initiation of side effects. Value computation for an lvalue expression
1402  includes determining the identity of the designated object.
1403 <p><!--para 3 -->
1404  Sequenced before is an asymmetric, transitive, pair-wise relation between evaluations
1405  executed by a single thread, which induces a partial order among those evaluations.
1406  Given any two evaluations A and B, if A is sequenced before B, then the execution of A
1407  shall precede the execution of B. (Conversely, if A is sequenced before B, then B is
1408  sequenced after A.) If A is not sequenced before or after B, then A and B are
1409  unsequenced. Evaluations A and B are indeterminately sequenced when A is sequenced
1410  either before or after B, but it is unspecified which.<sup><a href="#note13"><b>13)</b></a></sup> The presence of a sequence point
1411  between the evaluation of expressions A and B implies that every value computation and
1412  side effect associated with A is sequenced before every value computation and side effect
1413  associated with B. (A summary of the sequence points is given in <a href="#C">annex C</a>.)
1414 <p><!--para 4 -->
1415  In the abstract machine, all expressions are evaluated as specified by the semantics. An
1416  actual implementation need not evaluate part of an expression if it can deduce that its
1417  value is not used and that no needed side effects are produced (including any caused by
1418  
1419 <!--page 33 -->
1420  calling a function or accessing a volatile object).
1421 <p><!--para 5 -->
1422  When the processing of the abstract machine is interrupted by receipt of a signal, the
1423  values of objects that are neither lock-free atomic objects nor of type volatile
1424  sig_atomic_t are unspecified, and the value of any object that is modified by the
1425  handler that is neither a lock-free atomic object nor of type volatile
1426  sig_atomic_t becomes undefined.
1427 <p><!--para 6 -->
1428  The least requirements on a conforming implementation are:
1429 <ul>
1430 <li>  Accesses to volatile objects are evaluated strictly according to the rules of the abstract
1431  machine.
1432 <li>  At program termination, all data written into files shall be identical to the result that
1433  execution of the program according to the abstract semantics would have produced.
1434 <li>  The input and output dynamics of interactive devices shall take place as specified in
1435  <a href="#7.21.3">7.21.3</a>. The intent of these requirements is that unbuffered or line-buffered output
1436  appear as soon as possible, to ensure that prompting messages actually appear prior to
1437  a program waiting for input.
1438 </ul>
1439  This is the observable behavior of the program.
1440 <p><!--para 7 -->
1441  What constitutes an interactive device is implementation-defined.
1442 <p><!--para 8 -->
1443  More stringent correspondences between abstract and actual semantics may be defined by
1444  each implementation.
1445 <p><!--para 9 -->
1446  EXAMPLE 1 An implementation might define a one-to-one correspondence between abstract and actual
1447  semantics: at every sequence point, the values of the actual objects would agree with those specified by the
1448  abstract semantics. The keyword volatile would then be redundant.
1449 <p><!--para 10 -->
1450  Alternatively, an implementation might perform various optimizations within each translation unit, such
1451  that the actual semantics would agree with the abstract semantics only when making function calls across
1452  translation unit boundaries. In such an implementation, at the time of each function entry and function
1453  return where the calling function and the called function are in different translation units, the values of all
1454  externally linked objects and of all objects accessible via pointers therein would agree with the abstract
1455  semantics. Furthermore, at the time of each such function entry the values of the parameters of the called
1456  function and of all objects accessible via pointers therein would agree with the abstract semantics. In this
1457  type of implementation, objects referred to by interrupt service routines activated by the signal function
1458  would require explicit specification of volatile storage, as well as other implementation-defined
1459  restrictions.
1460  
1461 <p><!--para 11 -->
1462  EXAMPLE 2       In executing the fragment
1463 <pre>
1464           char c1, c2;
1465           /* ... */
1466           c1 = c1 + c2;
1467 </pre>
1468  the ''integer promotions'' require that the abstract machine promote the value of each variable to int size
1469  and then add the two ints and truncate the sum. Provided the addition of two chars can be done without
1470  overflow, or with overflow wrapping silently to produce the correct result, the actual execution need only
1471  produce the same result, possibly omitting the promotions.
1472 <!--page 34 -->
1473 <p><!--para 12 -->
1474  EXAMPLE 3       Similarly, in the fragment
1475 <pre>
1476           float f1, f2;
1477           double d;
1478           /* ... */
1479           f1 = f2 * d;
1480 </pre>
1481  the multiplication may be executed using single-precision arithmetic if the implementation can ascertain
1482  that the result would be the same as if it were executed using double-precision arithmetic (for example, if d
1483  were replaced by the constant 2.0, which has type double).
1484  
1485 <p><!--para 13 -->
1486  EXAMPLE 4 Implementations employing wide registers have to take care to honor appropriate
1487  semantics. Values are independent of whether they are represented in a register or in memory. For
1488  example, an implicit spilling of a register is not permitted to alter the value. Also, an explicit store and load
1489  is required to round to the precision of the storage type. In particular, casts and assignments are required to
1490  perform their specified conversion. For the fragment
1491 <pre>
1492           double d1, d2;
1493           float f;
1494           d1 = f = expression;
1495           d2 = (float) expression;
1496 </pre>
1497  the values assigned to d1 and d2 are required to have been converted to float.
1498  
1499 <p><!--para 14 -->
1500  EXAMPLE 5 Rearrangement for floating-point expressions is often restricted because of limitations in
1501  precision as well as range. The implementation cannot generally apply the mathematical associative rules
1502  for addition or multiplication, nor the distributive rule, because of roundoff error, even in the absence of
1503  overflow and underflow. Likewise, implementations cannot generally replace decimal constants in order to
1504  rearrange expressions. In the following fragment, rearrangements suggested by mathematical rules for real
1505  numbers are often not valid (see <a href="#F.9">F.9</a>).
1506 <pre>
1507           double x, y, z;
1508           /* ... */
1509           x = (x * y) * z;            //   not equivalent to x   *= y * z;
1510           z = (x - y) + y ;           //   not equivalent to z   = x;
1511           z = x + x * y;              //   not equivalent to z   = x * (1.0 + y);
1512           y = x / 5.0;                //   not equivalent to y   = x * 0.2;
1513 </pre>
1514  
1515 <p><!--para 15 -->
1516  EXAMPLE 6       To illustrate the grouping behavior of expressions, in the following fragment
1517 <pre>
1518           int a, b;
1519           /* ... */
1520           a = a + 32760 + b + 5;
1521 </pre>
1522  the expression statement behaves exactly the same as
1523 <pre>
1524           a = (((a + 32760) + b) + 5);
1525 </pre>
1526  due to the associativity and precedence of these operators. Thus, the result of the sum (a + 32760) is
1527  next added to b, and that result is then added to 5 which results in the value assigned to a. On a machine in
1528  which overflows produce an explicit trap and in which the range of values representable by an int is
1529  [-32768, +32767], the implementation cannot rewrite this expression as
1530 <pre>
1531           a = ((a + b) + 32765);
1532 </pre>
1533  since if the values for a and b were, respectively, -32754 and -15, the sum a + b would produce a trap
1534  while the original expression would not; nor can the expression be rewritten either as
1535 <!--page 35 -->
1536 <pre>
1537           a = ((a + 32765) + b);
1538 </pre>
1539  or
1540 <pre>
1541           a = (a + (b + 32765));
1542 </pre>
1543  since the values for a and b might have been, respectively, 4 and -8 or -17 and 12. However, on a machine
1544  in which overflow silently generates some value and where positive and negative overflows cancel, the
1545  above expression statement can be rewritten by the implementation in any of the above ways because the
1546  same result will occur.
1547  
1548 <p><!--para 16 -->
1549  EXAMPLE 7 The grouping of an expression does not completely determine its evaluation. In the
1550  following fragment
1551 <pre>
1552           #include <a href="#7.21">&lt;stdio.h&gt;</a>
1553           int sum;
1554           char *p;
1555           /* ... */
1556           sum = sum * 10 - '0' + (*p++ = getchar());
1557 </pre>
1558  the expression statement is grouped as if it were written as
1559 <pre>
1560           sum = (((sum * 10) - '0') + ((*(p++)) = (getchar())));
1561 </pre>
1562  but the actual increment of p can occur at any time between the previous sequence point and the next
1563  sequence point (the ;), and the call to getchar can occur at any point prior to the need of its returned
1564  value.
1565  
1566 <p><b> Forward references</b>: expressions (<a href="#6.5">6.5</a>), type qualifiers (<a href="#6.7.3">6.7.3</a>), statements (<a href="#6.8">6.8</a>), the
1567  signal function (<a href="#7.14">7.14</a>), files (<a href="#7.21.3">7.21.3</a>).
1568
1569 <h6>footnotes</h6>
1570 <p><small><a name="note12" href="#note12">12)</a> The IEC 60559 standard for binary floating-point arithmetic requires certain user-accessible status
1571  flags and control modes. Floating-point operations implicitly set the status flags; modes affect result
1572  values of floating-point operations. Implementations that support such floating-point state are
1573  required to regard changes to it as side effects -- see <a href="#F">annex F</a> for details. The floating-point
1574  environment library <a href="#7.6">&lt;fenv.h&gt;</a> provides a programming facility for indicating when these side
1575  effects matter, freeing the implementations in other cases.
1576 </small>
1577 <p><small><a name="note13" href="#note13">13)</a> The executions of unsequenced evaluations can interleave. Indeterminately sequenced evaluations
1578  cannot interleave, but can be executed in any order.
1579 </small>
1580
1581 <h5><a name="5.1.2.4" href="#5.1.2.4">5.1.2.4 Multi-threaded executions and data races</a></h5>
1582 <p><!--para 1 -->
1583  Under a hosted implementation, a program can have more than one thread of execution
1584  (or thread) running concurrently. The execution of each thread proceeds as defined by
1585  the remainder of this standard. The execution of the entire program consists of an
1586  execution of all of its threads.<sup><a href="#note14"><b>14)</b></a></sup> Under a freestanding implementation, it is
1587  implementation-defined whether a program can have more than one thread of execution.
1588 <p><!--para 2 -->
1589  The value of an object visible to a thread T at a particular point is the initial value of the
1590  object, a value stored in the object by T , or a value stored in the object by another thread,
1591  according to the rules below.
1592 <p><!--para 3 -->
1593  NOTE 1 In some cases, there may instead be undefined behavior. Much of this section is motivated by
1594  the desire to support atomic operations with explicit and detailed visibility constraints. However, it also
1595  implicitly supports a simpler view for more restricted programs.
1596  
1597 <p><!--para 4 -->
1598  Two expression evaluations conflict if one of them modifies a memory location and the
1599  other one reads or modifies the same memory location.
1600  
1601  
1602  
1603  
1604 <!--page 36 -->
1605 <p><!--para 5 -->
1606  The library defines a number of atomic operations (<a href="#7.17">7.17</a>) and operations on mutexes
1607  (<a href="#7.25.4">7.25.4</a>) that are specially identified as synchronization operations. These operations play
1608  a special role in making assignments in one thread visible to another. A synchronization
1609  operation on one or more memory locations is either an acquire operation, a release
1610  operation, both an acquire and release operation, or a consume operation. A
1611  synchronization operation without an associated memory location is a fence and can be
1612  either an acquire fence, a release fence, or both an acquire and release fence. In addition,
1613  there are relaxed atomic operations, which are not synchronization operations, and
1614  atomic read-modify-write operations, which have special characteristics.
1615 <p><!--para 6 -->
1616  NOTE 2 For example, a call that acquires a mutex will perform an acquire operation on the locations
1617  composing the mutex. Correspondingly, a call that releases the same mutex will perform a release
1618  operation on those same locations. Informally, performing a release operation on A forces prior side effects
1619  on other memory locations to become visible to other threads that later perform an acquire or consume
1620  operation on A. We do not include relaxed atomic operations as synchronization operations although, like
1621  synchronization operations, they cannot contribute to data races.
1622  
1623 <p><!--para 7 -->
1624  All modifications to a particular atomic object M occur in some particular total order,
1625  called the modification order of M. If A and B are modifications of an atomic object M,
1626  and A happens before B, then A shall precede B in the modification order of M, which is
1627  defined below.
1628 <p><!--para 8 -->
1629  NOTE 3     This states that the modification orders must respect the ''happens before'' relation.
1630  
1631 <p><!--para 9 -->
1632  NOTE 4 There is a separate order for each atomic object. There is no requirement that these can be
1633  combined into a single total order for all objects. In general this will be impossible since different threads
1634  may observe modifications to different variables in inconsistent orders.
1635  
1636 <p><!--para 10 -->
1637  A release sequence on an atomic object M is a maximal contiguous sub-sequence of side
1638  effects in the modification order of M, where the first operation is a release and every
1639  subsequent operation either is performed by the same thread that performed the release or
1640  is an atomic read-modify-write operation.
1641 <p><!--para 11 -->
1642  Certain library calls synchronize with other library calls performed by another thread. In
1643  particular, an atomic operation A that performs a release operation on an object M
1644  synchronizes with an atomic operation B that performs an acquire operation on M and
1645  reads a value written by any side effect in the release sequence headed by A.
1646 <p><!--para 12 -->
1647  NOTE 5 Except in the specified cases, reading a later value does not necessarily ensure visibility as
1648  described below. Such a requirement would sometimes interfere with efficient implementation.
1649  
1650 <p><!--para 13 -->
1651  NOTE 6 The specifications of the synchronization operations define when one reads the value written by
1652  another. For atomic variables, the definition is clear. All operations on a given mutex occur in a single total
1653  order. Each mutex acquisition ''reads the value written'' by the last mutex release.
1654  
1655 <p><!--para 14 -->
1656  An evaluation A carries a dependency <sup><a href="#note15"><b>15)</b></a></sup> to an evaluation B if:
1657  
1658  
1659 <!--page 37 -->
1660 <ul>
1661 <li>  the value of A is used as an operand of B, unless:
1662 <ul>
1663 <li> B is an invocation of the kill_dependency macro,
1664  
1665 <li> A is the left operand of a &amp;&amp; or || operator,
1666  
1667 <li> A is the left operand of a ? : operator, or
1668  
1669 <li> A is the left operand of a , operator;
1670 </ul>
1671    or
1672 <li>  A writes a scalar object or bit-field M, B reads from M the value written by A, and A
1673  is sequenced before B, or
1674 <li>  for some evaluation X, A carries a dependency to X and X carries a dependency to B.
1675 </ul>
1676 <p><!--para 15 -->
1677  An evaluation A is dependency-ordered before<sup><a href="#note16"><b>16)</b></a></sup> an evaluation B if:
1678 <ul>
1679 <li>  A performs a release operation on an atomic object M, and B performs a consume
1680  operation on M and reads a value written by any side effect in the release sequence
1681  headed by A, or
1682 <li>  for some evaluation X, A is dependency-ordered before X and X carries a
1683  dependency to B.
1684 </ul>
1685 <p><!--para 16 -->
1686  An evaluation A inter-thread happens before an evaluation B if A synchronizes with B, A
1687  is dependency-ordered before B, or, for some evaluation X:
1688 <ul>
1689 <li>  A synchronizes with X and X is sequenced before B,
1690 <li>  A is sequenced before X and X inter-thread happens before B, or
1691 <li>  A inter-thread happens before X and X inter-thread happens before B.
1692 </ul>
1693 <p><!--para 17 -->
1694  NOTE 7 The ''inter-thread happens before'' relation describes arbitrary concatenations of ''sequenced
1695  before'', ''synchronizes with'', and ''dependency-ordered before'' relationships, with two exceptions. The
1696  first exception is that a concatenation is not permitted to end with ''dependency-ordered before'' followed
1697  by ''sequenced before''. The reason for this limitation is that a consume operation participating in a
1698  ''dependency-ordered before'' relationship provides ordering only with respect to operations to which this
1699  consume operation actually carries a dependency. The reason that this limitation applies only to the end of
1700  such a concatenation is that any subsequent release operation will provide the required ordering for a prior
1701  consume operation. The second exception is that a concatenation is not permitted to consist entirely of
1702  ''sequenced before''. The reasons for this limitation are (1) to permit ''inter-thread happens before'' to be
1703  transitively closed and (2) the ''happens before'' relation, defined below, provides for relationships
1704  consisting entirely of ''sequenced before''.
1705  
1706 <p><!--para 18 -->
1707  An evaluation A happens before an evaluation B if A is sequenced before B or A inter-
1708  thread happens before B.
1709  
1710  
1711  
1712 <!--page 38 -->
1713 <p><!--para 19 -->
1714  A visible side effect A on an object M with respect to a value computation B of M
1715  satisfies the conditions:
1716 <ul>
1717 <li>  A happens before B, and
1718 <li>  there is no other side effect X to M such that A happens before X and X happens
1719    before B.
1720 </ul>
1721  The value of a non-atomic scalar object M, as determined by evaluation B, shall be the
1722  value stored by the visible side effect A.
1723 <p><!--para 20 -->
1724  NOTE 8 If there is ambiguity about which side effect to a non-atomic object is visible, then there is a data
1725  race and the behavior is undefined.
1726  
1727 <p><!--para 21 -->
1728  NOTE 9 This states that operations on ordinary variables are not visibly reordered. This is not actually
1729  detectable without data races, but it is necessary to ensure that data races, as defined here, and with suitable
1730  restrictions on the use of atomics, correspond to data races in a simple interleaved (sequentially consistent)
1731  execution.
1732  
1733 <p><!--para 22 -->
1734  The visible sequence of side effects on an atomic object M, with respect to a value
1735  computation B of M, is a maximal contiguous sub-sequence of side effects in the
1736  modification order of M, where the first side effect is visible with respect to B, and for
1737  every subsequent side effect, it is not the case that B happens before it. The value of an
1738  atomic object M, as determined by evaluation B, shall be the value stored by some
1739  operation in the visible sequence of M with respect to B. Furthermore, if a value
1740  computation A of an atomic object M happens before a value computation B of M, and
1741  the value computed by A corresponds to the value stored by side effect X, then the value
1742  computed by B shall either equal the value computed by A, or be the value stored by side
1743  effect Y , where Y follows X in the modification order of M.
1744 <p><!--para 23 -->
1745  NOTE 10 This effectively disallows compiler reordering of atomic operations to a single object, even if
1746  both operations are ''relaxed'' loads. By doing so, we effectively make the ''cache coherence'' guarantee
1747  provided by most hardware available to C atomic operations.
1748  
1749 <p><!--para 24 -->
1750  NOTE 11 The visible sequence depends on the ''happens before'' relation, which in turn depends on the
1751  values observed by loads of atomics, which we are restricting here. The intended reading is that there must
1752  exist an association of atomic loads with modifications they observe that, together with suitably chosen
1753  modification orders and the ''happens before'' relation derived as described above, satisfy the resulting
1754  constraints as imposed here.
1755  
1756 <p><!--para 25 -->
1757  The execution of a program contains a data race if it contains two conflicting actions in
1758  different threads, at least one of which is not atomic, and neither happens before the
1759  other. Any such data race results in undefined behavior.
1760 <p><!--para 26 -->
1761  NOTE 12 It can be shown that programs that correctly use simple mutexes and
1762  memory_order_seq_cst operations to prevent all data races, and use no other synchronization
1763  operations, behave as though the operations executed by their constituent threads were simply interleaved,
1764  with each value computation of an object being the last value stored in that interleaving. This is normally
1765  referred to as ''sequential consistency''. However, this applies only to data-race-free programs, and data-
1766  race-free programs cannot observe most program transformations that do not change single-threaded
1767  program semantics. In fact, most single-threaded program transformations continue to be allowed, since
1768  any program that behaves differently as a result must contain undefined behavior.
1769 <!--page 39 -->
1770 <p><!--para 27 -->
1771  NOTE 13 Compiler transformations that introduce assignments to a potentially shared memory location
1772  that would not be modified by the abstract machine are generally precluded by this standard, since such an
1773  assignment might overwrite another assignment by a different thread in cases in which an abstract machine
1774  execution would not have encountered a data race. This includes implementations of data member
1775  assignment that overwrite adjacent members in separate memory locations. We also generally preclude
1776  reordering of atomic loads in cases in which the atomics in question may alias, since this may violate the
1777  "visible sequence" rules.
1778  
1779 <p><!--para 28 -->
1780  NOTE 14 Transformations that introduce a speculative read of a potentially shared memory location may
1781  not preserve the semantics of the program as defined in this standard, since they potentially introduce a data
1782  race. However, they are typically valid in the context of an optimizing compiler that targets a specific
1783  machine with well-defined semantics for data races. They would be invalid for a hypothetical machine that
1784  is not tolerant of races or provides hardware race detection.
1785 <!--page 40 -->
1786
1787 <h6>footnotes</h6>
1788 <p><small><a name="note14" href="#note14">14)</a> The execution can usually be viewed as an interleaving of all of the threads. However, some kinds of
1789  atomic operations, for example, allow executions inconsistent with a simple interleaving as described
1790  below.
1791 </small>
1792 <p><small><a name="note15" href="#note15">15)</a> The ''carries a dependency'' relation is a subset of the ''sequenced before'' relation, and is similarly
1793  strictly intra-thread.
1794 </small>
1795 <p><small><a name="note16" href="#note16">16)</a> The ''dependency-ordered before'' relation is analogous to the ''synchronizes with'' relation, but uses
1796  release/consume in place of release/acquire.
1797 </small>
1798
1799 <h3><a name="5.2" href="#5.2">5.2 Environmental considerations</a></h3>
1800
1801 <h4><a name="5.2.1" href="#5.2.1">5.2.1 Character sets</a></h4>
1802 <p><!--para 1 -->
1803  Two sets of characters and their associated collating sequences shall be defined: the set in
1804  which source files are written (the source character set), and the set interpreted in the
1805  execution environment (the execution character set). Each set is further divided into a
1806  basic character set, whose contents are given by this subclause, and a set of zero or more
1807  locale-specific members (which are not members of the basic character set) called
1808  extended characters. The combined set is also called the extended character set. The
1809  values of the members of the execution character set are implementation-defined.
1810 <p><!--para 2 -->
1811  In a character constant or string literal, members of the execution character set shall be
1812  represented by corresponding members of the source character set or by escape
1813  sequences consisting of the backslash \ followed by one or more characters. A byte with
1814  all bits set to 0, called the null character, shall exist in the basic execution character set; it
1815  is used to terminate a character string.
1816 <p><!--para 3 -->
1817  Both the basic source and basic execution character sets shall have the following
1818  members: the 26 uppercase letters of the Latin alphabet
1819 <pre>
1820          A    B   C      D   E   F    G    H    I    J    K    L   M
1821          N    O   P      Q   R   S    T    U    V    W    X    Y   Z
1822 </pre>
1823  the 26 lowercase letters of the Latin alphabet
1824 <pre>
1825          a    b   c      d   e   f    g    h    i    j    k    l   m
1826          n    o   p      q   r   s    t    u    v    w    x    y   z
1827 </pre>
1828  the 10 decimal digits
1829 <pre>
1830          0    1   2      3   4   5    6    7    8    9
1831 </pre>
1832  the following 29 graphic characters
1833 <pre>
1834          !    "   #      %   &amp;   '    (    )    *    +    ,    -   .    /    :
1835          ;    &lt;   =      &gt;   ?   [    \    ]    ^    _    {    |   }    ~
1836 </pre>
1837  the space character, and control characters representing horizontal tab, vertical tab, and
1838  form feed. The representation of each member of the source and execution basic
1839  character sets shall fit in a byte. In both the source and execution basic character sets, the
1840  value of each character after 0 in the above list of decimal digits shall be one greater than
1841  the value of the previous. In source files, there shall be some way of indicating the end of
1842  each line of text; this International Standard treats such an end-of-line indicator as if it
1843  were a single new-line character. In the basic execution character set, there shall be
1844  control characters representing alert, backspace, carriage return, and new line. If any
1845  other characters are encountered in a source file (except in an identifier, a character
1846  constant, a string literal, a header name, a comment, or a preprocessing token that is never
1847 <!--page 41 -->
1848  converted to a token), the behavior is undefined.
1849 <p><!--para 4 -->
1850  A letter is an uppercase letter or a lowercase letter as defined above; in this International
1851  Standard the term does not include other characters that are letters in other alphabets.
1852 <p><!--para 5 -->
1853  The universal character name construct provides a way to name other characters.
1854 <p><b> Forward references</b>: universal character names (<a href="#6.4.3">6.4.3</a>), character constants (<a href="#6.4.4.4">6.4.4.4</a>),
1855  preprocessing directives (<a href="#6.10">6.10</a>), string literals (<a href="#6.4.5">6.4.5</a>), comments (<a href="#6.4.9">6.4.9</a>), string (<a href="#7.1.1">7.1.1</a>).
1856
1857 <h5><a name="5.2.1.1" href="#5.2.1.1">5.2.1.1 Trigraph sequences</a></h5>
1858 <p><!--para 1 -->
1859  Before any other processing takes place, each occurrence of one of the following
1860  sequences of three characters (called trigraph sequences<sup><a href="#note17"><b>17)</b></a></sup>) is replaced with the
1861  corresponding single character.
1862 <pre>
1863         ??=      #                       ??)      ]                       ??!     |
1864         ??(      [                       ??'      ^                       ??&gt;     }
1865         ??/      \                       ??&lt;      {                       ??-     ~
1866 </pre>
1867  No other trigraph sequences exist. Each ? that does not begin one of the trigraphs listed
1868  above is not changed.
1869 <p><!--para 2 -->
1870  EXAMPLE 1
1871 <pre>
1872            ??=define arraycheck(a, b) a??(b??) ??!??! b??(a??)
1873 </pre>
1874  becomes
1875 <pre>
1876            #define arraycheck(a, b) a[b] || b[a]
1877 </pre>
1878  
1879 <p><!--para 3 -->
1880  EXAMPLE 2      The following source line
1881 <pre>
1882            printf("Eh???/n");
1883 </pre>
1884  becomes (after replacement of the trigraph sequence ??/)
1885 <pre>
1886            printf("Eh?\n");
1887 </pre>
1888  
1889
1890 <h6>footnotes</h6>
1891 <p><small><a name="note17" href="#note17">17)</a> The trigraph sequences enable the input of characters that are not defined in the Invariant Code Set as
1892  described in ISO/IEC 646, which is a subset of the seven-bit US ASCII code set.
1893 </small>
1894
1895 <h5><a name="5.2.1.2" href="#5.2.1.2">5.2.1.2 Multibyte characters</a></h5>
1896 <p><!--para 1 -->
1897  The source character set may contain multibyte characters, used to represent members of
1898  the extended character set. The execution character set may also contain multibyte
1899  characters, which need not have the same encoding as for the source character set. For
1900  both character sets, the following shall hold:
1901 <ul>
1902 <li>  The basic character set shall be present and each character shall be encoded as a
1903  single byte.
1904 <li>  The presence, meaning, and representation of any additional members is locale-
1905  specific.
1906  
1907 <!--page 42 -->
1908 <li>  A multibyte character set may have a state-dependent encoding, wherein each
1909  sequence of multibyte characters begins in an initial shift state and enters other
1910  locale-specific shift states when specific multibyte characters are encountered in the
1911  sequence. While in the initial shift state, all single-byte characters retain their usual
1912  interpretation and do not alter the shift state. The interpretation for subsequent bytes
1913  in the sequence is a function of the current shift state.
1914 <li>  A byte with all bits zero shall be interpreted as a null character independent of shift
1915  state. Such a byte shall not occur as part of any other multibyte character.
1916 </ul>
1917 <p><!--para 2 -->
1918  For source files, the following shall hold:
1919 <ul>
1920 <li>  An identifier, comment, string literal, character constant, or header name shall begin
1921  and end in the initial shift state.
1922 <li>  An identifier, comment, string literal, character constant, or header name shall consist
1923  of a sequence of valid multibyte characters.
1924 </ul>
1925
1926 <h4><a name="5.2.2" href="#5.2.2">5.2.2 Character display semantics</a></h4>
1927 <p><!--para 1 -->
1928  The active position is that location on a display device where the next character output by
1929  the fputc function would appear. The intent of writing a printing character (as defined
1930  by the isprint function) to a display device is to display a graphic representation of
1931  that character at the active position and then advance the active position to the next
1932  position on the current line. The direction of writing is locale-specific. If the active
1933  position is at the final position of a line (if there is one), the behavior of the display device
1934  is unspecified.
1935 <p><!--para 2 -->
1936  Alphabetic escape sequences representing nongraphic characters in the execution
1937  character set are intended to produce actions on display devices as follows:
1938  \a (alert) Produces an audible or visible alert without changing the active position.
1939  \b (backspace) Moves the active position to the previous position on the current line. If
1940 <pre>
1941     the active position is at the initial position of a line, the behavior of the display
1942     device is unspecified.
1943 </pre>
1944  \f ( form feed) Moves the active position to the initial position at the start of the next
1945 <pre>
1946     logical page.
1947 </pre>
1948  \n (new line) Moves the active position to the initial position of the next line.
1949  \r (carriage return) Moves the active position to the initial position of the current line.
1950  \t (horizontal tab) Moves the active position to the next horizontal tabulation position
1951 <pre>
1952     on the current line. If the active position is at or past the last defined horizontal
1953     tabulation position, the behavior of the display device is unspecified.
1954 </pre>
1955  \v (vertical tab) Moves the active position to the initial position of the next vertical
1956 <!--page 43 -->
1957 <pre>
1958     tabulation position. If the active position is at or past the last defined vertical
1959       tabulation position, the behavior of the display device is unspecified.
1960 </pre>
1961 <p><!--para 3 -->
1962  Each of these escape sequences shall produce a unique implementation-defined value
1963  which can be stored in a single char object. The external representations in a text file
1964  need not be identical to the internal representations, and are outside the scope of this
1965  International Standard.
1966 <p><b> Forward references</b>: the isprint function (<a href="#7.4.1.8">7.4.1.8</a>), the fputc function (<a href="#7.21.7.3">7.21.7.3</a>).
1967
1968 <h4><a name="5.2.3" href="#5.2.3">5.2.3 Signals and interrupts</a></h4>
1969 <p><!--para 1 -->
1970  Functions shall be implemented such that they may be interrupted at any time by a signal,
1971  or may be called by a signal handler, or both, with no alteration to earlier, but still active,
1972  invocations' control flow (after the interruption), function return values, or objects with
1973  automatic storage duration. All such objects shall be maintained outside the function
1974  image (the instructions that compose the executable representation of a function) on a
1975  per-invocation basis.
1976
1977 <h4><a name="5.2.4" href="#5.2.4">5.2.4 Environmental limits</a></h4>
1978 <p><!--para 1 -->
1979  Both the translation and execution environments constrain the implementation of
1980  language translators and libraries. The following summarizes the language-related
1981  environmental limits on a conforming implementation; the library-related limits are
1982  discussed in clause 7.
1983
1984 <h5><a name="5.2.4.1" href="#5.2.4.1">5.2.4.1 Translation limits</a></h5>
1985 <p><!--para 1 -->
1986  The implementation shall be able to translate and execute at least one program that
1987  contains at least one instance of every one of the following limits:<sup><a href="#note18"><b>18)</b></a></sup>
1988 <ul>
1989 <li>  127 nesting levels of blocks
1990 <li>  63 nesting levels of conditional inclusion
1991 <li>  12 pointer, array, and function declarators (in any combinations) modifying an
1992  arithmetic, structure, union, or void type in a declaration
1993 <li>  63 nesting levels of parenthesized declarators within a full declarator
1994 <li>  63 nesting levels of parenthesized expressions within a full expression
1995 <li>  63 significant initial characters in an internal identifier or a macro name (each
1996  universal character name or extended source character is considered a single
1997  character)
1998 <li>  31 significant initial characters in an external identifier (each universal character name
1999  specifying a short identifier of 0000FFFF or less is considered 6 characters, each
2000  
2001  
2002 <!--page 44 -->
2003 <pre>
2004     universal character name specifying a short identifier of 00010000 or more is
2005     considered 10 characters, and each extended source character is considered the same
2006     number of characters as the corresponding universal character name, if any)<sup><a href="#note19"><b>19)</b></a></sup>
2007 </pre>
2008 <li>  4095 external identifiers in one translation unit
2009 <li>  511 identifiers with block scope declared in one block
2010 <li>  4095 macro identifiers simultaneously defined in one preprocessing translation unit
2011 <li>  127 parameters in one function definition
2012 <li>  127 arguments in one function call
2013 <li>  127 parameters in one macro definition
2014 <li>  127 arguments in one macro invocation
2015 <li>  4095 characters in a logical source line
2016 <li>  4095 characters in a string literal (after concatenation)
2017 <li>  65535 bytes in an object (in a hosted environment only)
2018 <li>  15 nesting levels for #included files
2019 <li>  1023 case labels for a switch statement (excluding those for any nested switch
2020  statements)
2021 <li>  1023 members in a single structure or union
2022 <li>  1023 enumeration constants in a single enumeration
2023 <li>  63 levels of nested structure or union definitions in a single struct-declaration-list
2024 </ul>
2025
2026 <h6>footnotes</h6>
2027 <p><small><a name="note18" href="#note18">18)</a> Implementations should avoid imposing fixed translation limits whenever possible.
2028 </small>
2029 <p><small><a name="note19" href="#note19">19)</a> See ''future language directions'' (<a href="#6.11.3">6.11.3</a>).
2030 </small>
2031
2032 <h5><a name="5.2.4.2" href="#5.2.4.2">5.2.4.2 Numerical limits</a></h5>
2033 <p><!--para 1 -->
2034  An implementation is required to document all the limits specified in this subclause,
2035  which are specified in the headers <a href="#7.10">&lt;limits.h&gt;</a> and <a href="#7.7">&lt;float.h&gt;</a>. Additional limits are
2036  specified in <a href="#7.20">&lt;stdint.h&gt;</a>.
2037 <p><b> Forward references</b>: integer types <a href="#7.20">&lt;stdint.h&gt;</a> (<a href="#7.20">7.20</a>).
2038
2039 <h5><a name="5.2.4.2.1" href="#5.2.4.2.1">5.2.4.2.1 Sizes of integer types <limits.h></a></h5>
2040 <p><!--para 1 -->
2041  The values given below shall be replaced by constant expressions suitable for use in #if
2042  preprocessing directives. Moreover, except for CHAR_BIT and MB_LEN_MAX, the
2043  following shall be replaced by expressions that have the same type as would an
2044  expression that is an object of the corresponding type converted according to the integer
2045  promotions. Their implementation-defined values shall be equal or greater in magnitude
2046  
2047  
2048 <!--page 45 -->
2049  (absolute value) to those shown, with the same sign.
2050 <ul>
2051 <li>  number of bits for smallest object that is not a bit-field (byte)
2052  CHAR_BIT                                            8
2053 <li>  minimum value for an object of type signed char
2054  SCHAR_MIN                                -127 // -(27 - 1)
2055 <li>  maximum value for an object of type signed char
2056  SCHAR_MAX                                +127 // 27 - 1
2057 <li>  maximum value for an object of type unsigned char
2058  UCHAR_MAX                                 255 // 28 - 1
2059 <li>  minimum value for an object of type char
2060  CHAR_MIN                               see below
2061 <li>  maximum value for an object of type char
2062  CHAR_MAX                              see below
2063 <li>  maximum number of bytes in a multibyte character, for any supported locale
2064  MB_LEN_MAX                                    1
2065 <li>  minimum value for an object of type short int
2066  SHRT_MIN                               -32767 // -(215 - 1)
2067 <li>  maximum value for an object of type short int
2068  SHRT_MAX                               +32767 // 215 - 1
2069 <li>  maximum value for an object of type unsigned short int
2070  USHRT_MAX                               65535 // 216 - 1
2071 <li>  minimum value for an object of type int
2072  INT_MIN                                 -32767 // -(215 - 1)
2073 <li>  maximum value for an object of type int
2074  INT_MAX                                +32767 // 215 - 1
2075 <li>  maximum value for an object of type unsigned int
2076  UINT_MAX                                65535 // 216 - 1
2077 <li>  minimum value for an object of type long int
2078  LONG_MIN                         -2147483647 // -(231 - 1)
2079 <li>  maximum value for an object of type long int
2080  LONG_MAX                         +2147483647 // 231 - 1
2081 <li>  maximum value for an object of type unsigned long int
2082  ULONG_MAX                         4294967295 // 232 - 1
2083 <!--page 46 -->
2084 <li>  minimum value for an object of type long long int
2085  LLONG_MIN          -9223372036854775807 // -(263 - 1)
2086 <li>  maximum value for an object of type long long int
2087  LLONG_MAX          +9223372036854775807 // 263 - 1
2088 <li>  maximum value for an object of type unsigned long long int
2089  ULLONG_MAX         18446744073709551615 // 264 - 1
2090 </ul>
2091 <p><!--para 2 -->
2092  If the value of an object of type char is treated as a signed integer when used in an
2093  expression, the value of CHAR_MIN shall be the same as that of SCHAR_MIN and the
2094  value of CHAR_MAX shall be the same as that of SCHAR_MAX. Otherwise, the value of
2095  CHAR_MIN shall be 0 and the value of CHAR_MAX shall be the same as that of
2096  UCHAR_MAX.<sup><a href="#note20"><b>20)</b></a></sup> The value UCHAR_MAX shall equal 2CHAR_BIT - 1.
2097 <p><b> Forward references</b>: representations of types (<a href="#6.2.6">6.2.6</a>), conditional inclusion (<a href="#6.10.1">6.10.1</a>).
2098
2099 <h6>footnotes</h6>
2100 <p><small><a name="note20" href="#note20">20)</a> See <a href="#6.2.5">6.2.5</a>.
2101 </small>
2102
2103 <h5><a name="5.2.4.2.2" href="#5.2.4.2.2">5.2.4.2.2 Characteristics of floating types <float.h></a></h5>
2104 <p><!--para 1 -->
2105  The characteristics of floating types are defined in terms of a model that describes a
2106  representation of floating-point numbers and values that provide information about an
2107  implementation's floating-point arithmetic.<sup><a href="#note21"><b>21)</b></a></sup> The following parameters are used to
2108  define the model for each floating-point type:
2109 <pre>
2110         s          sign ((+-)1)
2111         b          base or radix of exponent representation (an integer &gt; 1)
2112         e          exponent (an integer between a minimum emin and a maximum emax )
2113         p          precision (the number of base-b digits in the significand)
2114          fk        nonnegative integers less than b (the significand digits)
2115 </pre>
2116 <p><!--para 2 -->
2117  A floating-point number (x) is defined by the following model:
2118 <pre>
2119                     p
2120         x = sb e   (Sum) f k b-k ,
2121                    k=1
2122                                  emin &lt;= e &lt;= emax
2123 </pre>
2124  
2125 <p><!--para 3 -->
2126  In addition to normalized floating-point numbers ( f 1 &gt; 0 if x != 0), floating types may be
2127  able to contain other kinds of floating-point numbers, such as subnormal floating-point
2128  numbers (x != 0, e = emin , f 1 = 0) and unnormalized floating-point numbers (x != 0,
2129  e &gt; emin , f 1 = 0), and values that are not floating-point numbers, such as infinities and
2130  NaNs. A NaN is an encoding signifying Not-a-Number. A quiet NaN propagates
2131  through almost every arithmetic operation without raising a floating-point exception; a
2132  signaling NaN generally raises a floating-point exception when occurring as an
2133  
2134  
2135 <!--page 47 -->
2136  arithmetic operand.<sup><a href="#note22"><b>22)</b></a></sup>
2137 <p><!--para 4 -->
2138  An implementation may give zero and values that are not floating-point numbers (such as
2139  infinities and NaNs) a sign or may leave them unsigned. Wherever such values are
2140  unsigned, any requirement in this International Standard to retrieve the sign shall produce
2141  an unspecified sign, and any requirement to set the sign shall be ignored.
2142 <p><!--para 5 -->
2143  The minimum range of representable values for a floating type is the most negative finite
2144  floating-point number representable in that type through the most positive finite floating-
2145  point number representable in that type. In addition, if negative infinity is representable
2146  in a type, the range of that type is extended to all negative real numbers; likewise, if
2147  positive infinity is representable in a type, the range of that type is extended to all positive
2148  real numbers.
2149 <p><!--para 6 -->
2150  The accuracy of the floating-point operations (+, -, *, /) and of the library functions in
2151  <a href="#7.12">&lt;math.h&gt;</a> and <a href="#7.3">&lt;complex.h&gt;</a> that return floating-point results is implementation-
2152  defined, as is the accuracy of the conversion between floating-point internal
2153  representations and string representations performed by the library functions in
2154  <a href="#7.21">&lt;stdio.h&gt;</a>, <a href="#7.22">&lt;stdlib.h&gt;</a>, and <a href="#7.28">&lt;wchar.h&gt;</a>. The implementation may state that the
2155  accuracy is unknown.
2156 <p><!--para 7 -->
2157  All integer values in the <a href="#7.7">&lt;float.h&gt;</a> header, except FLT_ROUNDS, shall be constant
2158  expressions suitable for use in #if preprocessing directives; all floating values shall be
2159  constant expressions. All except DECIMAL_DIG, FLT_EVAL_METHOD, FLT_RADIX,
2160  and FLT_ROUNDS have separate names for all three floating-point types. The floating-
2161  point model representation is provided for all values except FLT_EVAL_METHOD and
2162  FLT_ROUNDS.
2163 <p><!--para 8 -->
2164  The rounding mode for floating-point addition is characterized by the implementation-
2165  defined value of FLT_ROUNDS:<sup><a href="#note23"><b>23)</b></a></sup>
2166 <pre>
2167        -1      indeterminable
2168         0      toward zero
2169         1      to nearest
2170         2      toward positive infinity
2171         3      toward negative infinity
2172 </pre>
2173  All other values for FLT_ROUNDS characterize implementation-defined rounding
2174  behavior.
2175  
2176  
2177 <!--page 48 -->
2178 <p><!--para 9 -->
2179  Except for assignment and cast (which remove all extra range and precision), the values
2180  yielded by operators with floating operands and values subject to the usual arithmetic
2181  conversions and of floating constants are evaluated to a format whose range and precision
2182  may be greater than required by the type. The use of evaluation formats is characterized
2183  by the implementation-defined value of FLT_EVAL_METHOD:<sup><a href="#note24"><b>24)</b></a></sup>
2184 <pre>
2185         -1         indeterminable;
2186           0        evaluate all operations and constants just to the range and precision of the
2187                    type;
2188           1        evaluate operations and constants of type float and double to the
2189                    range and precision of the double type, evaluate long double
2190                    operations and constants to the range and precision of the long double
2191                    type;
2192           2        evaluate all operations and constants to the range and precision of the
2193                    long double type.
2194 </pre>
2195  All other negative values for FLT_EVAL_METHOD characterize implementation-defined
2196  behavior.
2197 <p><!--para 10 -->
2198  The presence or absence of subnormal numbers is characterized by the implementation-
2199  defined     values     of    FLT_HAS_SUBNORM,          DBL_HAS_SUBNORM,           and
2200  LDBL_HAS_SUBNORM:
2201 <pre>
2202         -1       indeterminable<sup><a href="#note25"><b>25)</b></a></sup>
2203          0       absent<sup><a href="#note26"><b>26)</b></a></sup> (type does not support subnormal numbers)
2204          1       present (type does support subnormal numbers)
2205 </pre>
2206 <p><!--para 11 -->
2207  The values given in the following list shall be replaced by constant expressions with
2208  implementation-defined values that are greater or equal in magnitude (absolute value) to
2209  those shown, with the same sign:
2210 <ul>
2211 <li>  radix of exponent representation, b
2212  FLT_RADIX                                                    2
2213  
2214  
2215  
2216  
2217 <!--page 49 -->
2218 <li>  number of base-FLT_RADIX digits in the floating-point significand, p
2219   FLT_MANT_DIG
2220   DBL_MANT_DIG
2221   LDBL_MANT_DIG
2222 <li>  number of decimal digits, n, such that any floating-point number with p radix b digits
2223  can be rounded to a floating-point number with n decimal digits and back again
2224  without change to the value,
2225 <pre>
2226       { p log10 b        if b is a power of 10
2227       {
2228       { [^1 + p log10 b^] otherwise
2229 </pre>
2230   FLT_DECIMAL_DIG                                   6
2231   DBL_DECIMAL_DIG                                  10
2232   LDBL_DECIMAL_DIG                                 10
2233 <li>  number of decimal digits, n, such that any floating-point number in the widest
2234  supported floating type with pmax radix b digits can be rounded to a floating-point
2235  number with n decimal digits and back again without change to the value,
2236 <pre>
2237       { pmax log10 b       if b is a power of 10
2238       {
2239       { [^1 + pmax log10 b^] otherwise
2240 </pre>
2241   DECIMAL_DIG                                     10
2242 <li>  number of decimal digits, q, such that any floating-point number with q decimal digits
2243  can be rounded into a floating-point number with p radix b digits and back again
2244  without change to the q decimal digits,
2245 <pre>
2246       { p log10 b          if b is a power of 10
2247       {
2248       { [_( p - 1) log10 b_] otherwise
2249 </pre>
2250   FLT_DIG                                          6
2251   DBL_DIG                                         10
2252   LDBL_DIG                                        10
2253 <li>  minimum negative integer such that FLT_RADIX raised to one less than that power is
2254  a normalized floating-point number, emin
2255   FLT_MIN_EXP
2256   DBL_MIN_EXP
2257   LDBL_MIN_EXP
2258 <!--page 50 -->
2259 <li>  minimum negative integer such that 10 raised to that power is in the range of
2260  normalized floating-point numbers, [^log10 b emin -1 ^]
2261 <pre>
2262                                    [                  ]
2263 </pre>
2264  FLT_MIN_10_EXP                                 -37
2265  DBL_MIN_10_EXP                                 -37
2266  LDBL_MIN_10_EXP                                -37
2267 <li>  maximum integer such that FLT_RADIX raised to one less than that power is a
2268  representable finite floating-point number, emax
2269 <pre>
2270     FLT_MAX_EXP
2271     DBL_MAX_EXP
2272     LDBL_MAX_EXP
2273 </pre>
2274 <li>  maximum integer such that 10 raised to that power is in the range of representable
2275  finite floating-point numbers, [_log10 ((1 - b- p )b emax )_]
2276 <pre>
2277     FLT_MAX_10_EXP                               +37
2278     DBL_MAX_10_EXP                               +37
2279     LDBL_MAX_10_EXP                              +37
2280 </pre>
2281 </ul>
2282 <p><!--para 12 -->
2283  The values given in the following list shall be replaced by constant expressions with
2284  implementation-defined values that are greater than or equal to those shown:
2285 <ul>
2286 <li>  maximum representable finite floating-point number, (1 - b- p )b emax
2287 <pre>
2288     FLT_MAX                                   1E+37
2289     DBL_MAX                                   1E+37
2290     LDBL_MAX                                  1E+37
2291 </pre>
2292 </ul>
2293 <p><!--para 13 -->
2294  The values given in the following list shall be replaced by constant expressions with
2295  implementation-defined (positive) values that are less than or equal to those shown:
2296 <ul>
2297 <li>  the difference between 1 and the least value greater than 1 that is representable in the
2298  given floating point type, b1- p
2299 <pre>
2300     FLT_EPSILON                                1E-5
2301     DBL_EPSILON                                1E-9
2302     LDBL_EPSILON                               1E-9
2303 </pre>
2304 <li>  minimum normalized positive floating-point number, b emin -1
2305 <!--page 51 -->
2306 <pre>
2307     FLT_MIN                                   1E-37
2308     DBL_MIN                                   1E-37
2309     LDBL_MIN                                  1E-37
2310 </pre>
2311 <li>  minimum positive floating-point number<sup><a href="#note27"><b>27)</b></a></sup>
2312    FLT_TRUE_MIN                                       1E-37
2313    DBL_TRUE_MIN                                       1E-37
2314    LDBL_TRUE_MIN                                      1E-37
2315 </ul>
2316 <h6>Recommended practice</h6>
2317 <p><!--para 14 -->
2318  Conversion from (at least) double to decimal with DECIMAL_DIG digits and back
2319  should be the identity function.
2320 <p><!--para 15 -->
2321  EXAMPLE 1 The following describes an artificial floating-point representation that meets the minimum
2322  requirements of this International Standard, and the appropriate values in a <a href="#7.7">&lt;float.h&gt;</a> header for type
2323  float:
2324 <pre>
2325                     6
2326        x = s16e    (Sum) f k 16-k ,
2327                    k=1
2328                                    -31 &lt;= e &lt;= +32
2329 </pre>
2330  
2331 <pre>
2332          FLT_RADIX                                    16
2333          FLT_MANT_DIG                                  6
2334          FLT_EPSILON                     9.53674316E-07F
2335          FLT_DECIMAL_DIG                               9
2336          FLT_DIG                                       6
2337          FLT_MIN_EXP                                 -31
2338          FLT_MIN                         2.93873588E-39F
2339          FLT_MIN_10_EXP                              -38
2340          FLT_MAX_EXP                                 +32
2341          FLT_MAX                         3.40282347E+38F
2342          FLT_MAX_10_EXP                              +38
2343 </pre>
2344  
2345 <p><!--para 16 -->
2346  EXAMPLE 2 The following describes floating-point representations that also meet the requirements for
2347  single-precision and double-precision numbers in IEC 60559,<sup><a href="#note28"><b>28)</b></a></sup> and the appropriate values in a
2348  <a href="#7.7">&lt;float.h&gt;</a> header for types float and double:
2349 <pre>
2350                    24
2351        x f = s2e   (Sum) f k 2-k ,
2352                    k=1
2353                                   -125 &lt;= e &lt;= +128
2354 </pre>
2355  
2356 <pre>
2357                    53
2358        x d = s2e   (Sum) f k 2-k ,
2359                    k=1
2360                                   -1021 &lt;= e &lt;= +1024
2361 </pre>
2362  
2363 <pre>
2364          FLT_RADIX                                     2
2365          DECIMAL_DIG                                  17
2366          FLT_MANT_DIG                                 24
2367          FLT_EPSILON                     1.19209290E-07F // decimal constant
2368          FLT_EPSILON                            0X1P-23F // hex constant
2369          FLT_DECIMAL_DIG                               9
2370 </pre>
2371  
2372  
2373 <!--page 52 -->
2374 <pre>
2375          FLT_DIG                             6
2376          FLT_MIN_EXP                      -125
2377          FLT_MIN               1.17549435E-38F               //   decimal constant
2378          FLT_MIN                     0X1P-126F               //   hex constant
2379          FLT_TRUE_MIN          1.40129846E-45F               //   decimal constant
2380          FLT_TRUE_MIN                0X1P-149F               //   hex constant
2381          FLT_HAS_SUBNORM                     1
2382          FLT_MIN_10_EXP                    -37
2383          FLT_MAX_EXP                      +128
2384          FLT_MAX               3.40282347E+38F               // decimal constant
2385          FLT_MAX               0X1.fffffeP127F               // hex constant
2386          FLT_MAX_10_EXP                    +38
2387          DBL_MANT_DIG                       53
2388          DBL_EPSILON    2.2204460492503131E-16               // decimal constant
2389          DBL_EPSILON                   0X1P-52               // hex constant
2390          DBL_DECIMAL_DIG                    17
2391          DBL_DIG                            15
2392          DBL_MIN_EXP                     -1021
2393          DBL_MIN      2.2250738585072014E-308                //   decimal constant
2394          DBL_MIN                     0X1P-1022               //   hex constant
2395          DBL_TRUE_MIN 4.9406564584124654E-324                //   decimal constant
2396          DBL_TRUE_MIN                0X1P-1074               //   hex constant
2397          DBL_HAS_SUBNORM                     1
2398          DBL_MIN_10_EXP                   -307
2399          DBL_MAX_EXP                     +1024
2400          DBL_MAX      1.7976931348623157E+308                // decimal constant
2401          DBL_MAX        0X1.fffffffffffffP1023               // hex constant
2402          DBL_MAX_10_EXP                   +308
2403 </pre>
2404  If a type wider than double were supported, then DECIMAL_DIG would be greater than 17. For
2405  example, if the widest type were to use the minimal-width IEC 60559 double-extended format (64 bits of
2406  precision), then DECIMAL_DIG would be 21.
2407  
2408 <p><b> Forward references</b>:        conditional inclusion (<a href="#6.10.1">6.10.1</a>), complex arithmetic
2409  <a href="#7.3">&lt;complex.h&gt;</a> (<a href="#7.3">7.3</a>), extended multibyte and wide character utilities <a href="#7.28">&lt;wchar.h&gt;</a>
2410  (<a href="#7.28">7.28</a>), floating-point environment <a href="#7.6">&lt;fenv.h&gt;</a> (<a href="#7.6">7.6</a>), general utilities <a href="#7.22">&lt;stdlib.h&gt;</a>
2411  (<a href="#7.22">7.22</a>), input/output <a href="#7.21">&lt;stdio.h&gt;</a> (<a href="#7.21">7.21</a>), mathematics <a href="#7.12">&lt;math.h&gt;</a> (<a href="#7.12">7.12</a>).
2412 <!--page 53 -->
2413
2414 <h6>footnotes</h6>
2415 <p><small><a name="note21" href="#note21">21)</a> The floating-point model is intended to clarify the description of each floating-point characteristic and
2416  does not require the floating-point arithmetic of the implementation to be identical.
2417 </small>
2418 <p><small><a name="note22" href="#note22">22)</a> IEC 60559:1989 specifies quiet and signaling NaNs. For implementations that do not support
2419  IEC 60559:1989, the terms quiet NaN and signaling NaN are intended to apply to encodings with
2420  similar behavior.
2421 </small>
2422 <p><small><a name="note23" href="#note23">23)</a> Evaluation of FLT_ROUNDS correctly reflects any execution-time change of rounding mode through
2423  the function fesetround in <a href="#7.6">&lt;fenv.h&gt;</a>.
2424 </small>
2425 <p><small><a name="note24" href="#note24">24)</a> The evaluation method determines evaluation formats of expressions involving all floating types, not
2426  just real types. For example, if FLT_EVAL_METHOD is 1, then the product of two float
2427  _Complex operands is represented in the double _Complex format, and its parts are evaluated to
2428  double.
2429 </small>
2430 <p><small><a name="note25" href="#note25">25)</a> Characterization as indeterminable is intended if floating-point operations do not consistently interpret
2431  subnormal representations as zero, nor as nonzero.
2432 </small>
2433 <p><small><a name="note26" href="#note26">26)</a> Characterization as absent is intended if no floating-point operations produce subnormal results from
2434  non-subnormal inputs, even if the type format includes representations of subnormal numbers.
2435 </small>
2436 <p><small><a name="note27" href="#note27">27)</a> If the presence or absence of subnormal numbers is indeterminable, then the value is intended to be a
2437  positive number no greater than the minimum normalized positive number for the type.
2438 </small>
2439 <p><small><a name="note28" href="#note28">28)</a> The floating-point model in that standard sums powers of b from zero, so the values of the exponent
2440  limits are one less than shown here.
2441 </small>
2442
2443 <h2><a name="6" href="#6">6. Language</a></h2>
2444
2445 <h3><a name="6.1" href="#6.1">6.1 Notation</a></h3>
2446 <p><!--para 1 -->
2447  In the syntax notation used in this clause, syntactic categories (nonterminals) are
2448  indicated by italic type, and literal words and character set members (terminals) by bold
2449  type. A colon (:) following a nonterminal introduces its definition. Alternative
2450  definitions are listed on separate lines, except when prefaced by the words ''one of''. An
2451  optional symbol is indicated by the subscript ''opt'', so that
2452 <pre>
2453           { expression<sub>opt</sub> }
2454 </pre>
2455  indicates an optional expression enclosed in braces.
2456 <p><!--para 2 -->
2457  When syntactic categories are referred to in the main text, they are not italicized and
2458  words are separated by spaces instead of hyphens.
2459 <p><!--para 3 -->
2460  A summary of the language syntax is given in <a href="#A">annex A</a>.
2461
2462 <h3><a name="6.2" href="#6.2">6.2 Concepts</a></h3>
2463
2464 <h4><a name="6.2.1" href="#6.2.1">6.2.1 Scopes of identifiers</a></h4>
2465 <p><!--para 1 -->
2466  An identifier can denote an object; a function; a tag or a member of a structure, union, or
2467  enumeration; a typedef name; a label name; a macro name; or a macro parameter. The
2468  same identifier can denote different entities at different points in the program. A member
2469  of an enumeration is called an enumeration constant. Macro names and macro
2470  parameters are not considered further here, because prior to the semantic phase of
2471  program translation any occurrences of macro names in the source file are replaced by the
2472  preprocessing token sequences that constitute their macro definitions.
2473 <p><!--para 2 -->
2474  For each different entity that an identifier designates, the identifier is visible (i.e., can be
2475  used) only within a region of program text called its scope. Different entities designated
2476  by the same identifier either have different scopes, or are in different name spaces. There
2477  are four kinds of scopes: function, file, block, and function prototype. (A function
2478  prototype is a declaration of a function that declares the types of its parameters.)
2479 <p><!--para 3 -->
2480  A label name is the only kind of identifier that has function scope. It can be used (in a
2481  goto statement) anywhere in the function in which it appears, and is declared implicitly
2482  by its syntactic appearance (followed by a : and a statement).
2483 <p><!--para 4 -->
2484  Every other identifier has scope determined by the placement of its declaration (in a
2485  declarator or type specifier). If the declarator or type specifier that declares the identifier
2486  appears outside of any block or list of parameters, the identifier has file scope, which
2487  terminates at the end of the translation unit. If the declarator or type specifier that
2488  declares the identifier appears inside a block or within the list of parameter declarations in
2489  a function definition, the identifier has block scope, which terminates at the end of the
2490  associated block. If the declarator or type specifier that declares the identifier appears
2491 <!--page 54 -->
2492  within the list of parameter declarations in a function prototype (not part of a function
2493  definition), the identifier has function prototype scope, which terminates at the end of the
2494  function declarator. If an identifier designates two different entities in the same name
2495  space, the scopes might overlap. If so, the scope of one entity (the inner scope) will end
2496  strictly before the scope of the other entity (the outer scope). Within the inner scope, the
2497  identifier designates the entity declared in the inner scope; the entity declared in the outer
2498  scope is hidden (and not visible) within the inner scope.
2499 <p><!--para 5 -->
2500  Unless explicitly stated otherwise, where this International Standard uses the term
2501  ''identifier'' to refer to some entity (as opposed to the syntactic construct), it refers to the
2502  entity in the relevant name space whose declaration is visible at the point the identifier
2503  occurs.
2504 <p><!--para 6 -->
2505  Two identifiers have the same scope if and only if their scopes terminate at the same
2506  point.
2507 <p><!--para 7 -->
2508  Structure, union, and enumeration tags have scope that begins just after the appearance of
2509  the tag in a type specifier that declares the tag. Each enumeration constant has scope that
2510  begins just after the appearance of its defining enumerator in an enumerator list. Any
2511  other identifier has scope that begins just after the completion of its declarator.
2512 <p><!--para 8 -->
2513  As a special case, a type name (which is not a declaration of an identifier) is considered to
2514  have a scope that begins just after the place within the type name where the omitted
2515  identifier would appear were it not omitted.
2516 <p><b> Forward references</b>: declarations (<a href="#6.7">6.7</a>), function calls (<a href="#6.5.2.2">6.5.2.2</a>), function definitions
2517  (<a href="#6.9.1">6.9.1</a>), identifiers (<a href="#6.4.2">6.4.2</a>), macro replacement (<a href="#6.10.3">6.10.3</a>), name spaces of identifiers (<a href="#6.2.3">6.2.3</a>),
2518  source file inclusion (<a href="#6.10.2">6.10.2</a>), statements (<a href="#6.8">6.8</a>).
2519
2520 <h4><a name="6.2.2" href="#6.2.2">6.2.2 Linkages of identifiers</a></h4>
2521 <p><!--para 1 -->
2522  An identifier declared in different scopes or in the same scope more than once can be
2523  made to refer to the same object or function by a process called linkage.<sup><a href="#note29"><b>29)</b></a></sup> There are
2524  three kinds of linkage: external, internal, and none.
2525 <p><!--para 2 -->
2526  In the set of translation units and libraries that constitutes an entire program, each
2527  declaration of a particular identifier with external linkage denotes the same object or
2528  function. Within one translation unit, each declaration of an identifier with internal
2529  linkage denotes the same object or function. Each declaration of an identifier with no
2530  linkage denotes a unique entity.
2531 <p><!--para 3 -->
2532  If the declaration of a file scope identifier for an object or a function contains the storage-
2533  class specifier static, the identifier has internal linkage.<sup><a href="#note30"><b>30)</b></a></sup>
2534  
2535  
2536  
2537 <!--page 55 -->
2538 <p><!--para 4 -->
2539  For an identifier declared with the storage-class specifier extern in a scope in which a
2540  prior declaration of that identifier is visible,<sup><a href="#note31"><b>31)</b></a></sup> if the prior declaration specifies internal or
2541  external linkage, the linkage of the identifier at the later declaration is the same as the
2542  linkage specified at the prior declaration. If no prior declaration is visible, or if the prior
2543  declaration specifies no linkage, then the identifier has external linkage.
2544 <p><!--para 5 -->
2545  If the declaration of an identifier for a function has no storage-class specifier, its linkage
2546  is determined exactly as if it were declared with the storage-class specifier extern. If
2547  the declaration of an identifier for an object has file scope and no storage-class specifier,
2548  its linkage is external.
2549 <p><!--para 6 -->
2550  The following identifiers have no linkage: an identifier declared to be anything other than
2551  an object or a function; an identifier declared to be a function parameter; a block scope
2552  identifier for an object declared without the storage-class specifier extern.
2553 <p><!--para 7 -->
2554  If, within a translation unit, the same identifier appears with both internal and external
2555  linkage, the behavior is undefined.
2556 <p><b> Forward references</b>: declarations (<a href="#6.7">6.7</a>), expressions (<a href="#6.5">6.5</a>), external definitions (<a href="#6.9">6.9</a>),
2557  statements (<a href="#6.8">6.8</a>).
2558
2559 <h6>footnotes</h6>
2560 <p><small><a name="note29" href="#note29">29)</a> There is no linkage between different identifiers.
2561 </small>
2562 <p><small><a name="note30" href="#note30">30)</a> A function declaration can contain the storage-class specifier static only if it is at file scope; see
2563  <a href="#6.7.1">6.7.1</a>.
2564 </small>
2565 <p><small><a name="note31" href="#note31">31)</a> As specified in <a href="#6.2.1">6.2.1</a>, the later declaration might hide the prior declaration.
2566 </small>
2567
2568 <h4><a name="6.2.3" href="#6.2.3">6.2.3 Name spaces of identifiers</a></h4>
2569 <p><!--para 1 -->
2570  If more than one declaration of a particular identifier is visible at any point in a
2571  translation unit, the syntactic context disambiguates uses that refer to different entities.
2572  Thus, there are separate name spaces for various categories of identifiers, as follows:
2573 <ul>
2574 <li>  label names (disambiguated by the syntax of the label declaration and use);
2575 <li>  the tags of structures, unions, and enumerations (disambiguated by following any<sup><a href="#note32"><b>32)</b></a></sup>
2576  of the keywords struct, union, or enum);
2577 <li>  the members of structures or unions; each structure or union has a separate name
2578  space for its members (disambiguated by the type of the expression used to access the
2579  member via the . or -&gt; operator);
2580 <li>  all other identifiers, called ordinary identifiers (declared in ordinary declarators or as
2581  enumeration constants).
2582 </ul>
2583 <p><b> Forward references</b>: enumeration specifiers (<a href="#6.7.2.2">6.7.2.2</a>), labeled statements (<a href="#6.8.1">6.8.1</a>),
2584  structure and union specifiers (<a href="#6.7.2.1">6.7.2.1</a>), structure and union members (<a href="#6.5.2.3">6.5.2.3</a>), tags
2585  (<a href="#6.7.2.3">6.7.2.3</a>), the goto statement (<a href="#6.8.6.1">6.8.6.1</a>).
2586  
2587 <!--page 56 -->
2588
2589 <h6>footnotes</h6>
2590 <p><small><a name="note32" href="#note32">32)</a> There is only one name space for tags even though three are possible.
2591 </small>
2592
2593 <h4><a name="6.2.4" href="#6.2.4">6.2.4 Storage durations of objects</a></h4>
2594 <p><!--para 1 -->
2595  An object has a storage duration that determines its lifetime. There are four storage
2596  durations: static, thread, automatic, and allocated. Allocated storage is described in
2597  <a href="#7.22.3">7.22.3</a>.
2598 <p><!--para 2 -->
2599  The lifetime of an object is the portion of program execution during which storage is
2600  guaranteed to be reserved for it. An object exists, has a constant address,<sup><a href="#note33"><b>33)</b></a></sup> and retains
2601  its last-stored value throughout its lifetime.<sup><a href="#note34"><b>34)</b></a></sup> If an object is referred to outside of its
2602  lifetime, the behavior is undefined. The value of a pointer becomes indeterminate when
2603  the object it points to (or just past) reaches the end of its lifetime.
2604 <p><!--para 3 -->
2605  An object whose identifier is declared without the storage-class specifier
2606  _Thread_local, and either with external or internal linkage or with the storage-class
2607  specifier static, has static storage duration. Its lifetime is the entire execution of the
2608  program and its stored value is initialized only once, prior to program startup.
2609 <p><!--para 4 -->
2610  An object whose identifier is declared with the storage-class specifier _Thread_local
2611  has thread storage duration. Its lifetime is the entire execution of the thread for which it
2612  is created, and its stored value is initialized when the thread is started. There is a distinct
2613  object per thread, and use of the declared name in an expression refers to the object
2614  associated with the thread evaluating the expression. The result of attempting to
2615  indirectly access an object with thread storage duration from a thread other than the one
2616  with which the object is associated is implementation-defined.
2617 <p><!--para 5 -->
2618  An object whose identifier is declared with no linkage and without the storage-class
2619  specifier static has automatic storage duration, as do some compound literals. The
2620  result of attempting to indirectly access an object with automatic storage duration from a
2621  thread other than the one with which the object is associated is implementation-defined.
2622 <p><!--para 6 -->
2623  For such an object that does not have a variable length array type, its lifetime extends
2624  from entry into the block with which it is associated until execution of that block ends in
2625  any way. (Entering an enclosed block or calling a function suspends, but does not end,
2626  execution of the current block.) If the block is entered recursively, a new instance of the
2627  object is created each time. The initial value of the object is indeterminate. If an
2628  initialization is specified for the object, it is performed each time the declaration or
2629  compound literal is reached in the execution of the block; otherwise, the value becomes
2630  indeterminate each time the declaration is reached.
2631  
2632  
2633  
2634 <!--page 57 -->
2635 <p><!--para 7 -->
2636  For such an object that does have a variable length array type, its lifetime extends from
2637  the declaration of the object until execution of the program leaves the scope of the
2638  declaration.<sup><a href="#note35"><b>35)</b></a></sup> If the scope is entered recursively, a new instance of the object is created
2639  each time. The initial value of the object is indeterminate.
2640 <p><!--para 8 -->
2641  A non-lvalue expression with structure or union type, where the structure or union
2642  contains a member with array type (including, recursively, members of all contained
2643  structures and unions) refers to an object with automatic storage duration and temporary
2644  lifetime.<sup><a href="#note36"><b>36)</b></a></sup> Its lifetime begins when the expression is evaluated and its initial value is the
2645  value of the expression. Its lifetime ends when the evaluation of the containing full
2646  expression or full declarator ends. Any attempt to modify an object with temporary
2647  lifetime results in undefined behavior.
2648 <p><b> Forward references</b>: array declarators (<a href="#6.7.6.2">6.7.6.2</a>), compound literals (<a href="#6.5.2.5">6.5.2.5</a>), declarators
2649  (<a href="#6.7.6">6.7.6</a>), function calls (<a href="#6.5.2.2">6.5.2.2</a>), initialization (<a href="#6.7.9">6.7.9</a>), statements (<a href="#6.8">6.8</a>).
2650
2651 <h6>footnotes</h6>
2652 <p><small><a name="note33" href="#note33">33)</a> The term ''constant address'' means that two pointers to the object constructed at possibly different
2653  times will compare equal. The address may be different during two different executions of the same
2654  program.
2655 </small>
2656 <p><small><a name="note34" href="#note34">34)</a> In the case of a volatile object, the last store need not be explicit in the program.
2657 </small>
2658 <p><small><a name="note35" href="#note35">35)</a> Leaving the innermost block containing the declaration, or jumping to a point in that block or an
2659  embedded block prior to the declaration, leaves the scope of the declaration.
2660 </small>
2661 <p><small><a name="note36" href="#note36">36)</a> The address of such an object is taken implicitly when an array member is accessed.
2662 </small>
2663
2664 <h4><a name="6.2.5" href="#6.2.5">6.2.5 Types</a></h4>
2665 <p><!--para 1 -->
2666  The meaning of a value stored in an object or returned by a function is determined by the
2667  type of the expression used to access it. (An identifier declared to be an object is the
2668  simplest such expression; the type is specified in the declaration of the identifier.) Types
2669  are partitioned into object types (types that describe objects) and function types (types
2670  that describe functions). At various points within a translation unit an object type may be
2671  incomplete (lacking sufficient information to determine the size of objects of that type) or
2672  complete (having sufficient information).<sup><a href="#note37"><b>37)</b></a></sup>
2673 <p><!--para 2 -->
2674  An object declared as type _Bool is large enough to store the values 0 and 1.
2675 <p><!--para 3 -->
2676  An object declared as type char is large enough to store any member of the basic
2677  execution character set. If a member of the basic execution character set is stored in a
2678  char object, its value is guaranteed to be nonnegative. If any other character is stored in
2679  a char object, the resulting value is implementation-defined but shall be within the range
2680  of values that can be represented in that type.
2681 <p><!--para 4 -->
2682  There are five standard signed integer types, designated as signed char, short
2683  int, int, long int, and long long int. (These and other types may be
2684  designated in several additional ways, as described in <a href="#6.7.2">6.7.2</a>.) There may also be
2685  implementation-defined extended signed integer types.<sup><a href="#note38"><b>38)</b></a></sup> The standard and extended
2686  signed integer types are collectively called signed integer types.<sup><a href="#note39"><b>39)</b></a></sup>
2687  
2688 <!--page 58 -->
2689 <p><!--para 5 -->
2690  An object declared as type signed char occupies the same amount of storage as a
2691  ''plain'' char object. A ''plain'' int object has the natural size suggested by the
2692  architecture of the execution environment (large enough to contain any value in the range
2693  INT_MIN to INT_MAX as defined in the header <a href="#7.10">&lt;limits.h&gt;</a>).
2694 <p><!--para 6 -->
2695  For each of the signed integer types, there is a corresponding (but different) unsigned
2696  integer type (designated with the keyword unsigned) that uses the same amount of
2697  storage (including sign information) and has the same alignment requirements. The type
2698  _Bool and the unsigned integer types that correspond to the standard signed integer
2699  types are the standard unsigned integer types. The unsigned integer types that
2700  correspond to the extended signed integer types are the extended unsigned integer types.
2701  The standard and extended unsigned integer types are collectively called unsigned integer
2702  types.<sup><a href="#note40"><b>40)</b></a></sup>
2703 <p><!--para 7 -->
2704  The standard signed integer types and standard unsigned integer types are collectively
2705  called the standard integer types, the extended signed integer types and extended
2706  unsigned integer types are collectively called the extended integer types.
2707 <p><!--para 8 -->
2708  For any two integer types with the same signedness and different integer conversion rank
2709  (see <a href="#6.3.1.1">6.3.1.1</a>), the range of values of the type with smaller integer conversion rank is a
2710  subrange of the values of the other type.
2711 <p><!--para 9 -->
2712  The range of nonnegative values of a signed integer type is a subrange of the
2713  corresponding unsigned integer type, and the representation of the same value in each
2714  type is the same.<sup><a href="#note41"><b>41)</b></a></sup> A computation involving unsigned operands can never overflow,
2715  because a result that cannot be represented by the resulting unsigned integer type is
2716  reduced modulo the number that is one greater than the largest value that can be
2717  represented by the resulting type.
2718 <p><!--para 10 -->
2719  There are three real floating types, designated as float, double, and long
2720  double.<sup><a href="#note42"><b>42)</b></a></sup> The set of values of the type float is a subset of the set of values of the
2721  type double; the set of values of the type double is a subset of the set of values of the
2722  type long double.
2723  
2724  
2725 <!--page 59 -->
2726 <p><!--para 11 -->
2727  There are three complex types, designated as float _Complex, double
2728  _Complex, and long double _Complex.<sup><a href="#note43"><b>43)</b></a></sup> (Complex types are a conditional
2729  feature that implementations need not support; see <a href="#6.10.8.3">6.10.8.3</a>.) The real floating and
2730  complex types are collectively called the floating types.
2731 <p><!--para 12 -->
2732  For each floating type there is a corresponding real type, which is always a real floating
2733  type. For real floating types, it is the same type. For complex types, it is the type given
2734  by deleting the keyword _Complex from the type name.
2735 <p><!--para 13 -->
2736  Each complex type has the same representation and alignment requirements as an array
2737  type containing exactly two elements of the corresponding real type; the first element is
2738  equal to the real part, and the second element to the imaginary part, of the complex
2739  number.
2740 <p><!--para 14 -->
2741  The type char, the signed and unsigned integer types, and the floating types are
2742  collectively called the basic types. The basic types are complete object types. Even if the
2743  implementation defines two or more basic types to have the same representation, they are
2744  nevertheless different types.<sup><a href="#note44"><b>44)</b></a></sup>
2745 <p><!--para 15 -->
2746  The three types char, signed char, and unsigned char are collectively called
2747  the character types. The implementation shall define char to have the same range,
2748  representation, and behavior as either signed char or unsigned char.<sup><a href="#note45"><b>45)</b></a></sup>
2749 <p><!--para 16 -->
2750  An enumeration comprises a set of named integer constant values. Each distinct
2751  enumeration constitutes a different enumerated type.
2752 <p><!--para 17 -->
2753  The type char, the signed and unsigned integer types, and the enumerated types are
2754  collectively called integer types. The integer and real floating types are collectively called
2755  real types.
2756 <p><!--para 18 -->
2757  Integer and floating types are collectively called arithmetic types. Each arithmetic type
2758  belongs to one type domain: the real type domain comprises the real types, the complex
2759  type domain comprises the complex types.
2760 <p><!--para 19 -->
2761  The void type comprises an empty set of values; it is an incomplete object type that
2762  cannot be completed.
2763  
2764  
2765  
2766 <!--page 60 -->
2767 <p><!--para 20 -->
2768  Any number of derived types can be constructed from the object and function types, as
2769  follows:
2770 <ul>
2771 <li>  An array type describes a contiguously allocated nonempty set of objects with a
2772  particular member object type, called the element type. The element type shall be
2773  complete whenever the array type is specified. Array types are characterized by their
2774  element type and by the number of elements in the array. An array type is said to be
2775  derived from its element type, and if its element type is T , the array type is sometimes
2776  called ''array of T ''. The construction of an array type from an element type is called
2777  ''array type derivation''.
2778 <li>  A structure type describes a sequentially allocated nonempty set of member objects
2779  (and, in certain circumstances, an incomplete array), each of which has an optionally
2780  specified name and possibly distinct type.
2781 <li>  A union type describes an overlapping nonempty set of member objects, each of
2782  which has an optionally specified name and possibly distinct type.
2783 <li>  A function type describes a function with specified return type. A function type is
2784  characterized by its return type and the number and types of its parameters. A
2785  function type is said to be derived from its return type, and if its return type is T , the
2786  function type is sometimes called ''function returning T ''. The construction of a
2787  function type from a return type is called ''function type derivation''.
2788 <li>  A pointer type may be derived from a function type or an object type, called the
2789  referenced type. A pointer type describes an object whose value provides a reference
2790  to an entity of the referenced type. A pointer type derived from the referenced type T
2791  is sometimes called ''pointer to T ''. The construction of a pointer type from a
2792  referenced type is called ''pointer type derivation''. A pointer type is a complete
2793  object type.
2794 <li>  An atomic type describes the type designated by the construct _Atomic ( type-
2795  name ). (Atomic types are a conditional feature that implementations need not
2796  support; see <a href="#6.10.8.3">6.10.8.3</a>.)
2797 </ul>
2798  These methods of constructing derived types can be applied recursively.
2799 <p><!--para 21 -->
2800  Arithmetic types and pointer types are collectively called scalar types. Array and
2801  structure types are collectively called aggregate types.<sup><a href="#note46"><b>46)</b></a></sup>
2802 <p><!--para 22 -->
2803  An array type of unknown size is an incomplete type. It is completed, for an identifier of
2804  that type, by specifying the size in a later declaration (with internal or external linkage).
2805  A structure or union type of unknown content (as described in <a href="#6.7.2.3">6.7.2.3</a>) is an incomplete
2806  
2807  
2808 <!--page 61 -->
2809  type. It is completed, for all declarations of that type, by declaring the same structure or
2810  union tag with its defining content later in the same scope.
2811 <p><!--para 23 -->
2812  A type has known constant size if the type is not incomplete and is not a variable length
2813  array type.
2814 <p><!--para 24 -->
2815  Array, function, and pointer types are collectively called derived declarator types. A
2816  declarator type derivation from a type T is the construction of a derived declarator type
2817  from T by the application of an array-type, a function-type, or a pointer-type derivation to
2818  T.
2819 <p><!--para 25 -->
2820  A type is characterized by its type category, which is either the outermost derivation of a
2821  derived type (as noted above in the construction of derived types), or the type itself if the
2822  type consists of no derived types.
2823 <p><!--para 26 -->
2824  Any type so far mentioned is an unqualified type. Each unqualified type has several
2825  qualified versions of its type,<sup><a href="#note47"><b>47)</b></a></sup> corresponding to the combinations of one, two, or all
2826  three of the const, volatile, and restrict qualifiers. The qualified or unqualified
2827  versions of a type are distinct types that belong to the same type category and have the
2828  same representation and alignment requirements.<sup><a href="#note48"><b>48)</b></a></sup> A derived type is not qualified by the
2829  qualifiers (if any) of the type from which it is derived.
2830 <p><!--para 27 -->
2831  Further, there is the _Atomic qualifier. The presence of the _Atomic qualifier
2832  designates an atomic type. The size, representation, and alignment of an atomic type
2833  need not be the same as those of the corresponding unqualified type. Therefore, this
2834  Standard explicitly uses the phrase ''atomic, qualified or unqualified type'' whenever the
2835  atomic version of a type is permitted along with the other qualified versions of a type.
2836  The phrase ''qualified or unqualified type'', without specific mention of atomic, does not
2837  include the atomic types.
2838 <p><!--para 28 -->
2839  A pointer to void shall have the same representation and alignment requirements as a
2840  pointer to a character type.<sup><a href="#note48"><b>48)</b></a></sup> Similarly, pointers to qualified or unqualified versions of
2841  compatible types shall have the same representation and alignment requirements. All
2842  pointers to structure types shall have the same representation and alignment requirements
2843  as each other. All pointers to union types shall have the same representation and
2844  alignment requirements as each other. Pointers to other types need not have the same
2845  representation or alignment requirements.
2846 <p><!--para 29 -->
2847  EXAMPLE 1 The type designated as ''float *'' has type ''pointer to float''. Its type category is
2848  pointer, not a floating type. The const-qualified version of this type is designated as ''float * const''
2849  whereas the type designated as ''const float *'' is not a qualified type -- its type is ''pointer to const-
2850  
2851  
2852 <!--page 62 -->
2853  qualified float'' and is a pointer to a qualified type.
2854  
2855 <p><!--para 30 -->
2856  EXAMPLE 2 The type designated as ''struct tag (*[5])(float)'' has type ''array of pointer to
2857  function returning struct tag''. The array has length five and the function has a single parameter of type
2858  float. Its type category is array.
2859  
2860 <p><b> Forward references</b>: compatible type and composite type (<a href="#6.2.7">6.2.7</a>), declarations (<a href="#6.7">6.7</a>).
2861
2862 <h6>footnotes</h6>
2863 <p><small><a name="note37" href="#note37">37)</a> A type may be incomplete or complete throughout an entire translation unit, or it may change states at
2864  different points within a translation unit.
2865 </small>
2866 <p><small><a name="note38" href="#note38">38)</a> Implementation-defined keywords shall have the form of an identifier reserved for any use as
2867  described in <a href="#7.1.3">7.1.3</a>.
2868 </small>
2869 <p><small><a name="note39" href="#note39">39)</a> Therefore, any statement in this Standard about signed integer types also applies to the extended
2870  signed integer types.
2871 </small>
2872 <p><small><a name="note40" href="#note40">40)</a> Therefore, any statement in this Standard about unsigned integer types also applies to the extended
2873  unsigned integer types.
2874 </small>
2875 <p><small><a name="note41" href="#note41">41)</a> The same representation and alignment requirements are meant to imply interchangeability as
2876  arguments to functions, return values from functions, and members of unions.
2877 </small>
2878 <p><small><a name="note42" href="#note42">42)</a> See ''future language directions'' (<a href="#6.11.1">6.11.1</a>).
2879 </small>
2880 <p><small><a name="note43" href="#note43">43)</a> A specification for imaginary types is in <a href="#G">annex G</a>.
2881 </small>
2882 <p><small><a name="note44" href="#note44">44)</a> An implementation may define new keywords that provide alternative ways to designate a basic (or
2883  any other) type; this does not violate the requirement that all basic types be different.
2884  Implementation-defined keywords shall have the form of an identifier reserved for any use as
2885  described in <a href="#7.1.3">7.1.3</a>.
2886 </small>
2887 <p><small><a name="note45" href="#note45">45)</a> CHAR_MIN, defined in <a href="#7.10">&lt;limits.h&gt;</a>, will have one of the values 0 or SCHAR_MIN, and this can be
2888  used to distinguish the two options. Irrespective of the choice made, char is a separate type from the
2889  other two and is not compatible with either.
2890 </small>
2891 <p><small><a name="note46" href="#note46">46)</a> Note that aggregate type does not include union type because an object with union type can only
2892  contain one member at a time.
2893 </small>
2894 <p><small><a name="note47" href="#note47">47)</a> See <a href="#6.7.3">6.7.3</a> regarding qualified array and function types.
2895 </small>
2896 <p><small><a name="note48" href="#note48">48)</a> The same representation and alignment requirements are meant to imply interchangeability as
2897  arguments to functions, return values from functions, and members of unions.
2898 </small>
2899
2900 <h4><a name="6.2.6" href="#6.2.6">6.2.6 Representations of types</a></h4>
2901
2902 <h5><a name="6.2.6.1" href="#6.2.6.1">6.2.6.1 General</a></h5>
2903 <p><!--para 1 -->
2904  The representations of all types are unspecified except as stated in this subclause.
2905 <p><!--para 2 -->
2906  Except for bit-fields, objects are composed of contiguous sequences of one or more bytes,
2907  the number, order, and encoding of which are either explicitly specified or
2908  implementation-defined.
2909 <p><!--para 3 -->
2910  Values stored in unsigned bit-fields and objects of type unsigned char shall be
2911  represented using a pure binary notation.<sup><a href="#note49"><b>49)</b></a></sup>
2912 <p><!--para 4 -->
2913  Values stored in non-bit-field objects of any other object type consist of n x CHAR_BIT
2914  bits, where n is the size of an object of that type, in bytes. The value may be copied into
2915  an object of type unsigned char [n] (e.g., by memcpy); the resulting set of bytes is
2916  called the object representation of the value. Values stored in bit-fields consist of m bits,
2917  where m is the size specified for the bit-field. The object representation is the set of m
2918  bits the bit-field comprises in the addressable storage unit holding it. Two values (other
2919  than NaNs) with the same object representation compare equal, but values that compare
2920  equal may have different object representations.
2921 <p><!--para 5 -->
2922  Certain object representations need not represent a value of the object type. If the stored
2923  value of an object has such a representation and is read by an lvalue expression that does
2924  not have character type, the behavior is undefined. If such a representation is produced
2925  by a side effect that modifies all or any part of the object by an lvalue expression that
2926  does not have character type, the behavior is undefined.<sup><a href="#note50"><b>50)</b></a></sup> Such a representation is called
2927  a trap representation.
2928 <p><!--para 6 -->
2929  When a value is stored in an object of structure or union type, including in a member
2930  object, the bytes of the object representation that correspond to any padding bytes take
2931  unspecified values.<sup><a href="#note51"><b>51)</b></a></sup> The value of a structure or union object is never a trap
2932  
2933  
2934 <!--page 63 -->
2935  representation, even though the value of a member of the structure or union object may be
2936  a trap representation.
2937 <p><!--para 7 -->
2938  When a value is stored in a member of an object of union type, the bytes of the object
2939  representation that do not correspond to that member but do correspond to other members
2940  take unspecified values.
2941 <p><!--para 8 -->
2942  Where an operator is applied to a value that has more than one object representation,
2943  which object representation is used shall not affect the value of the result.<sup><a href="#note52"><b>52)</b></a></sup> Where a
2944  value is stored in an object using a type that has more than one object representation for
2945  that value, it is unspecified which representation is used, but a trap representation shall
2946  not be generated.
2947 <p><!--para 9 -->
2948  Loads and stores of objects with                            atomic       types     are     done      with
2949  memory_order_seq_cst semantics.
2950 <p><b> Forward references</b>: declarations (<a href="#6.7">6.7</a>), expressions (<a href="#6.5">6.5</a>), lvalues, arrays, and function
2951  designators (<a href="#6.3.2.1">6.3.2.1</a>), order and consistency (<a href="#7.17.3">7.17.3</a>).
2952
2953 <h6>footnotes</h6>
2954 <p><small><a name="note49" href="#note49">49)</a> A positional representation for integers that uses the binary digits 0 and 1, in which the values
2955  represented by successive bits are additive, begin with 1, and are multiplied by successive integral
2956  powers of 2, except perhaps the bit with the highest position. (Adapted from the American National
2957  Dictionary for Information Processing Systems.) A byte contains CHAR_BIT bits, and the values of
2958  type unsigned char range from 0 to 2
2959
2960 <pre>
2961                                            CHAR_BIT
2962                                                      - 1.
2963 </pre>
2964 </small>
2965 <p><small><a name="note50" href="#note50">50)</a> Thus, an automatic variable can be initialized to a trap representation without causing undefined
2966  behavior, but the value of the variable cannot be used until a proper value is stored in it.
2967 </small>
2968 <p><small><a name="note51" href="#note51">51)</a> Thus, for example, structure assignment need not copy any padding bits.
2969 </small>
2970 <p><small><a name="note52" href="#note52">52)</a> It is possible for objects x and y with the same effective type T to have the same value when they are
2971  accessed as objects of type T, but to have different values in other contexts. In particular, if == is
2972  defined for type T, then x == y does not imply that memcmp(&amp;x, &amp;y, sizeof (T)) == 0.
2973  Furthermore, x == y does not necessarily imply that x and y have the same value; other operations
2974  on values of type T may distinguish between them.
2975 </small>
2976
2977 <h5><a name="6.2.6.2" href="#6.2.6.2">6.2.6.2 Integer types</a></h5>
2978 <p><!--para 1 -->
2979  For unsigned integer types other than unsigned char, the bits of the object
2980  representation shall be divided into two groups: value bits and padding bits (there need
2981  not be any of the latter). If there are N value bits, each bit shall represent a different
2982  power of 2 between 1 and 2 N -1 , so that objects of that type shall be capable of
2983  representing values from 0 to 2 N - 1 using a pure binary representation; this shall be
2984  known as the value representation. The values of any padding bits are unspecified.<sup><a href="#note53"><b>53)</b></a></sup>
2985 <p><!--para 2 -->
2986  For signed integer types, the bits of the object representation shall be divided into three
2987  groups: value bits, padding bits, and the sign bit. There need not be any padding bits;
2988  signed char shall not have any padding bits. There shall be exactly one sign bit.
2989  Each bit that is a value bit shall have the same value as the same bit in the object
2990  representation of the corresponding unsigned type (if there are M value bits in the signed
2991  type and N in the unsigned type, then M &lt;= N ). If the sign bit is zero, it shall not affect
2992  
2993 <!--page 64 -->
2994  the resulting value. If the sign bit is one, the value shall be modified in one of the
2995  following ways:
2996 <ul>
2997 <li>  the corresponding value with sign bit 0 is negated (sign and magnitude);
2998 <li>  the sign bit has the value -(2 M ) (two's complement);
2999 <li>  the sign bit has the value -(2 M - 1) (ones' complement).
3000 </ul>
3001  Which of these applies is implementation-defined, as is whether the value with sign bit 1
3002  and all value bits zero (for the first two), or with sign bit and all value bits 1 (for ones'
3003  complement), is a trap representation or a normal value. In the case of sign and
3004  magnitude and ones' complement, if this representation is a normal value it is called a
3005  negative zero.
3006 <p><!--para 3 -->
3007  If the implementation supports negative zeros, they shall be generated only by:
3008 <ul>
3009 <li>  the &amp;, |, ^, ~, &lt;&lt;, and &gt;&gt; operators with operands that produce such a value;
3010 <li>  the +, -, *, /, and % operators where one operand is a negative zero and the result is
3011  zero;
3012 <li>  compound assignment operators based on the above cases.
3013 </ul>
3014  It is unspecified whether these cases actually generate a negative zero or a normal zero,
3015  and whether a negative zero becomes a normal zero when stored in an object.
3016 <p><!--para 4 -->
3017  If the implementation does not support negative zeros, the behavior of the &amp;, |, ^, ~, &lt;&lt;,
3018  and &gt;&gt; operators with operands that would produce such a value is undefined.
3019 <p><!--para 5 -->
3020  The values of any padding bits are unspecified.<sup><a href="#note54"><b>54)</b></a></sup> A valid (non-trap) object representation
3021  of a signed integer type where the sign bit is zero is a valid object representation of the
3022  corresponding unsigned type, and shall represent the same value. For any integer type,
3023  the object representation where all the bits are zero shall be a representation of the value
3024  zero in that type.
3025 <p><!--para 6 -->
3026  The precision of an integer type is the number of bits it uses to represent values,
3027  excluding any sign and padding bits. The width of an integer type is the same but
3028  including any sign bit; thus for unsigned integer types the two values are the same, while
3029  for signed integer types the width is one greater than the precision.
3030  
3031  
3032  
3033  
3034 <!--page 65 -->
3035
3036 <h6>footnotes</h6>
3037 <p><small><a name="note53" href="#note53">53)</a> Some combinations of padding bits might generate trap representations, for example, if one padding
3038  bit is a parity bit. Regardless, no arithmetic operation on valid values can generate a trap
3039  representation other than as part of an exceptional condition such as an overflow, and this cannot occur
3040  with unsigned types. All other combinations of padding bits are alternative object representations of
3041  the value specified by the value bits.
3042 </small>
3043 <p><small><a name="note54" href="#note54">54)</a> Some combinations of padding bits might generate trap representations, for example, if one padding
3044  bit is a parity bit. Regardless, no arithmetic operation on valid values can generate a trap
3045  representation other than as part of an exceptional condition such as an overflow. All other
3046  combinations of padding bits are alternative object representations of the value specified by the value
3047  bits.
3048 </small>
3049
3050 <h4><a name="6.2.7" href="#6.2.7">6.2.7 Compatible type and composite type</a></h4>
3051 <p><!--para 1 -->
3052  Two types have compatible type if their types are the same. Additional rules for
3053  determining whether two types are compatible are described in <a href="#6.7.2">6.7.2</a> for type specifiers,
3054  in <a href="#6.7.3">6.7.3</a> for type qualifiers, and in <a href="#6.7.6">6.7.6</a> for declarators.<sup><a href="#note55"><b>55)</b></a></sup> Moreover, two structure,
3055  union, or enumerated types declared in separate translation units are compatible if their
3056  tags and members satisfy the following requirements: If one is declared with a tag, the
3057  other shall be declared with the same tag. If both are completed anywhere within their
3058  respective translation units, then the following additional requirements apply: there shall
3059  be a one-to-one correspondence between their members such that each pair of
3060  corresponding members are declared with compatible types; if one member of the pair is
3061  declared with an alignment specifier, the other is declared with an equivalent alignment
3062  specifier; and if one member of the pair is declared with a name, the other is declared
3063  with the same name. For two structures, corresponding members shall be declared in the
3064  same order. For two structures or unions, corresponding bit-fields shall have the same
3065  widths. For two enumerations, corresponding members shall have the same values.
3066 <p><!--para 2 -->
3067  All declarations that refer to the same object or function shall have compatible type;
3068  otherwise, the behavior is undefined.
3069 <p><!--para 3 -->
3070  A composite type can be constructed from two types that are compatible; it is a type that
3071  is compatible with both of the two types and satisfies the following conditions:
3072 <ul>
3073 <li>  If both types are array types, the following rules are applied:
3074 <ul>
3075 <li> If one type is an array of known constant size, the composite type is an array of
3076  that size.
3077 <li> Otherwise, if one type is a variable length array whose size is specified by an
3078  expression that is not evaluated, the behavior is undefined.
3079 <li> Otherwise, if one type is a variable length array whose size is specified, the
3080  composite type is a variable length array of that size.
3081 <li> Otherwise, if one type is a variable length array of unspecified size, the composite
3082  type is a variable length array of unspecified size.
3083 <li> Otherwise, both types are arrays of unknown size and the composite type is an
3084  array of unknown size.
3085 </ul>
3086    The element type of the composite type is the composite type of the two element
3087    types.
3088 <li>  If only one type is a function type with a parameter type list (a function prototype),
3089  the composite type is a function prototype with the parameter type list.
3090  
3091  
3092 <!--page 66 -->
3093 <li>  If both types are function types with parameter type lists, the type of each parameter
3094  in the composite parameter type list is the composite type of the corresponding
3095  parameters.
3096 </ul>
3097  These rules apply recursively to the types from which the two types are derived.
3098 <p><!--para 4 -->
3099  For an identifier with internal or external linkage declared in a scope in which a prior
3100  declaration of that identifier is visible,<sup><a href="#note56"><b>56)</b></a></sup> if the prior declaration specifies internal or
3101  external linkage, the type of the identifier at the later declaration becomes the composite
3102  type.
3103 <p><b> Forward references</b>: array declarators (<a href="#6.7.6.2">6.7.6.2</a>).
3104 <p><!--para 5 -->
3105  EXAMPLE        Given the following two file scope declarations:
3106 <pre>
3107           int f(int (*)(), double (*)[3]);
3108           int f(int (*)(char *), double (*)[]);
3109 </pre>
3110  The resulting composite type for the function is:
3111 <pre>
3112           int f(int (*)(char *), double (*)[3]);
3113 </pre>
3114  
3115
3116 <h6>footnotes</h6>
3117 <p><small><a name="note55" href="#note55">55)</a> Two types need not be identical to be compatible.
3118 </small>
3119 <p><small><a name="note56" href="#note56">56)</a> As specified in <a href="#6.2.1">6.2.1</a>, the later declaration might hide the prior declaration.
3120 </small>
3121
3122 <h4><a name="6.2.8" href="#6.2.8">6.2.8 Alignment of objects</a></h4>
3123 <p><!--para 1 -->
3124  Complete object types have alignment requirements which place restrictions on the
3125  addresses at which objects of that type may be allocated. An alignment is an
3126  implementation-defined integer value representing the number of bytes between
3127  successive addresses at which a given object can be allocated. An object type imposes an
3128  alignment requirement on every object of that type: stricter alignment can be requested
3129  using the _Alignas keyword.
3130 <p><!--para 2 -->
3131  A fundamental alignment is represented by an alignment less than or equal to the greatest
3132  alignment supported by the implementation in all contexts, which is equal to
3133  alignof(max_align_t).
3134 <p><!--para 3 -->
3135  An extended alignment is represented by an alignment greater than
3136  alignof(max_align_t). It is implementation-defined whether any extended
3137  alignments are supported and the contexts in which they are supported. A type having an
3138  extended alignment requirement is an over-aligned type.<sup><a href="#note57"><b>57)</b></a></sup>
3139 <p><!--para 4 -->
3140  Alignments are represented as values of the type size_t. Valid alignments include only
3141  those values returned by an alignof expression for fundamental types, plus an
3142  additional implementation-defined set of values, which may be empty. Every valid
3143  alignment value shall be a nonnegative integral power of two.
3144  
3145  
3146 <!--page 67 -->
3147 <p><!--para 5 -->
3148  Alignments have an order from weaker to stronger or stricter alignments. Stricter
3149  alignments have larger alignment values. An address that satisfies an alignment
3150  requirement also satisfies any weaker valid alignment requirement.
3151 <p><!--para 6 -->
3152  The alignment requirement of a complete type can be queried using an alignof
3153  expression. The types char, signed char, and unsigned char shall have the
3154  weakest alignment requirement.
3155 <p><!--para 7 -->
3156  Comparing alignments is meaningful and provides the obvious results:
3157 <ul>
3158 <li>  Two alignments are equal when their numeric values are equal.
3159 <li>  Two alignments are different when their numeric values are not equal.
3160 <li>  When an alignment is larger than another it represents a stricter alignment.
3161 <!--page 68 -->
3162 </ul>
3163
3164 <h6>footnotes</h6>
3165 <p><small><a name="note57" href="#note57">57)</a> Every over-aligned type is, or contains, a structure or union type with a member to which an extended
3166  alignment has been applied.
3167 </small>
3168
3169 <h3><a name="6.3" href="#6.3">6.3 Conversions</a></h3>
3170 <p><!--para 1 -->
3171  Several operators convert operand values from one type to another automatically. This
3172  subclause specifies the result required from such an implicit conversion, as well as those
3173  that result from a cast operation (an explicit conversion). The list in <a href="#6.3.1.8">6.3.1.8</a> summarizes
3174  the conversions performed by most ordinary operators; it is supplemented as required by
3175  the discussion of each operator in <a href="#6.5">6.5</a>.
3176 <p><!--para 2 -->
3177  Conversion of an operand value to a compatible type causes no change to the value or the
3178  representation.
3179 <p><b> Forward references</b>: cast operators (<a href="#6.5.4">6.5.4</a>).
3180
3181 <h4><a name="6.3.1" href="#6.3.1">6.3.1 Arithmetic operands</a></h4>
3182
3183 <h5><a name="6.3.1.1" href="#6.3.1.1">6.3.1.1 Boolean, characters, and integers</a></h5>
3184 <p><!--para 1 -->
3185  Every integer type has an integer conversion rank defined as follows:
3186 <ul>
3187 <li>  No two signed integer types shall have the same rank, even if they have the same
3188  representation.
3189 <li>  The rank of a signed integer type shall be greater than the rank of any signed integer
3190  type with less precision.
3191 <li>  The rank of long long int shall be greater than the rank of long int, which
3192  shall be greater than the rank of int, which shall be greater than the rank of short
3193  int, which shall be greater than the rank of signed char.
3194 <li>  The rank of any unsigned integer type shall equal the rank of the corresponding
3195  signed integer type, if any.
3196 <li>  The rank of any standard integer type shall be greater than the rank of any extended
3197  integer type with the same width.
3198 <li>  The rank of char shall equal the rank of signed char and unsigned char.
3199 <li>  The rank of _Bool shall be less than the rank of all other standard integer types.
3200 <li>  The rank of any enumerated type shall equal the rank of the compatible integer type
3201  (see <a href="#6.7.2.2">6.7.2.2</a>).
3202 <li>  The rank of any extended signed integer type relative to another extended signed
3203  integer type with the same precision is implementation-defined, but still subject to the
3204  other rules for determining the integer conversion rank.
3205 <li>  For all integer types T1, T2, and T3, if T1 has greater rank than T2 and T2 has
3206  greater rank than T3, then T1 has greater rank than T3.
3207 </ul>
3208 <p><!--para 2 -->
3209  The following may be used in an expression wherever an int or unsigned int may
3210  be used:
3211 <!--page 69 -->
3212 <ul>
3213 <li>  An object or expression with an integer type (other than int or unsigned int)
3214  whose integer conversion rank is less than or equal to the rank of int and
3215  unsigned int.
3216 <li>  A bit-field of type _Bool, int, signed int, or unsigned int.
3217 </ul>
3218  If an int can represent all values of the original type (as restricted by the width, for a
3219  bit-field), the value is converted to an int; otherwise, it is converted to an unsigned
3220  int. These are called the integer promotions.<sup><a href="#note58"><b>58)</b></a></sup> All other types are unchanged by the
3221  integer promotions.
3222 <p><!--para 3 -->
3223  The integer promotions preserve value including sign. As discussed earlier, whether a
3224  ''plain'' char is treated as signed is implementation-defined.
3225 <p><b> Forward references</b>: enumeration specifiers (<a href="#6.7.2.2">6.7.2.2</a>), structure and union specifiers
3226  (<a href="#6.7.2.1">6.7.2.1</a>).
3227
3228 <h6>footnotes</h6>
3229 <p><small><a name="note58" href="#note58">58)</a> The integer promotions are applied only: as part of the usual arithmetic conversions, to certain
3230  argument expressions, to the operands of the unary +, -, and ~ operators, and to both operands of the
3231  shift operators, as specified by their respective subclauses.
3232 </small>
3233
3234 <h5><a name="6.3.1.2" href="#6.3.1.2">6.3.1.2 Boolean type</a></h5>
3235 <p><!--para 1 -->
3236  When any scalar value is converted to _Bool, the result is 0 if the value compares equal
3237  to 0; otherwise, the result is 1.<sup><a href="#note59"><b>59)</b></a></sup>
3238
3239 <h6>footnotes</h6>
3240 <p><small><a name="note59" href="#note59">59)</a> NaNs do not compare equal to 0 and thus convert to 1.
3241 </small>
3242
3243 <h5><a name="6.3.1.3" href="#6.3.1.3">6.3.1.3 Signed and unsigned integers</a></h5>
3244 <p><!--para 1 -->
3245  When a value with integer type is converted to another integer type other than _Bool, if
3246  the value can be represented by the new type, it is unchanged.
3247 <p><!--para 2 -->
3248  Otherwise, if the new type is unsigned, the value is converted by repeatedly adding or
3249  subtracting one more than the maximum value that can be represented in the new type
3250  until the value is in the range of the new type.<sup><a href="#note60"><b>60)</b></a></sup>
3251 <p><!--para 3 -->
3252  Otherwise, the new type is signed and the value cannot be represented in it; either the
3253  result is implementation-defined or an implementation-defined signal is raised.
3254
3255 <h6>footnotes</h6>
3256 <p><small><a name="note60" href="#note60">60)</a> The rules describe arithmetic on the mathematical value, not the value of a given type of expression.
3257 </small>
3258
3259 <h5><a name="6.3.1.4" href="#6.3.1.4">6.3.1.4 Real floating and integer</a></h5>
3260 <p><!--para 1 -->
3261  When a finite value of real floating type is converted to an integer type other than _Bool,
3262  the fractional part is discarded (i.e., the value is truncated toward zero). If the value of
3263  the integral part cannot be represented by the integer type, the behavior is undefined.<sup><a href="#note61"><b>61)</b></a></sup>
3264  
3265  
3266 <!--page 70 -->
3267 <p><!--para 2 -->
3268  When a value of integer type is converted to a real floating type, if the value being
3269  converted can be represented exactly in the new type, it is unchanged. If the value being
3270  converted is in the range of values that can be represented but cannot be represented
3271  exactly, the result is either the nearest higher or nearest lower representable value, chosen
3272  in an implementation-defined manner. If the value being converted is outside the range of
3273  values that can be represented, the behavior is undefined. Results of some implicit
3274  conversions (<a href="#6.3.1.8">6.3.1.8</a>, <a href="#6.8.6.4">6.8.6.4</a>) may be represented in greater precision and range than that
3275  required by the new type.
3276
3277 <h6>footnotes</h6>
3278 <p><small><a name="note61" href="#note61">61)</a> The remaindering operation performed when a value of integer type is converted to unsigned type
3279  need not be performed when a value of real floating type is converted to unsigned type. Thus, the
3280  range of portable real floating values is (-1, Utype_MAX+1).
3281 </small>
3282
3283 <h5><a name="6.3.1.5" href="#6.3.1.5">6.3.1.5 Real floating types</a></h5>
3284 <p><!--para 1 -->
3285  When a value of real floating type is converted to a real floating type, if the value being
3286  converted can be represented exactly in the new type, it is unchanged. If the value being
3287  converted is in the range of values that can be represented but cannot be represented
3288  exactly, the result is either the nearest higher or nearest lower representable value, chosen
3289  in an implementation-defined manner. If the value being converted is outside the range of
3290  values that can be represented, the behavior is undefined. Results of some implicit
3291  conversions (<a href="#6.3.1.8">6.3.1.8</a>, <a href="#6.8.6.4">6.8.6.4</a>) may be represented in greater precision and range than that
3292  required by the new type.
3293
3294 <h5><a name="6.3.1.6" href="#6.3.1.6">6.3.1.6 Complex types</a></h5>
3295 <p><!--para 1 -->
3296  When a value of complex type is converted to another complex type, both the real and
3297  imaginary parts follow the conversion rules for the corresponding real types.
3298
3299 <h5><a name="6.3.1.7" href="#6.3.1.7">6.3.1.7 Real and complex</a></h5>
3300 <p><!--para 1 -->
3301  When a value of real type is converted to a complex type, the real part of the complex
3302  result value is determined by the rules of conversion to the corresponding real type and
3303  the imaginary part of the complex result value is a positive zero or an unsigned zero.
3304 <p><!--para 2 -->
3305  When a value of complex type is converted to a real type, the imaginary part of the
3306  complex value is discarded and the value of the real part is converted according to the
3307  conversion rules for the corresponding real type.
3308
3309 <h5><a name="6.3.1.8" href="#6.3.1.8">6.3.1.8 Usual arithmetic conversions</a></h5>
3310 <p><!--para 1 -->
3311  Many operators that expect operands of arithmetic type cause conversions and yield result
3312  types in a similar way. The purpose is to determine a common real type for the operands
3313  and result. For the specified operands, each operand is converted, without change of type
3314  domain, to a type whose corresponding real type is the common real type. Unless
3315  explicitly stated otherwise, the common real type is also the corresponding real type of
3316  the result, whose type domain is the type domain of the operands if they are the same,
3317  and complex otherwise. This pattern is called the usual arithmetic conversions:
3318 <!--page 71 -->
3319 <pre>
3320        First, if the corresponding real type of either operand is long double, the other
3321        operand is converted, without change of type domain, to a type whose
3322         corresponding real type is long double.
3323         Otherwise, if the corresponding real type of either operand is double, the other
3324         operand is converted, without change of type domain, to a type whose
3325         corresponding real type is double.
3326         Otherwise, if the corresponding real type of either operand is float, the other
3327         operand is converted, without change of type domain, to a type whose
3328         corresponding real type is float.<sup><a href="#note62"><b>62)</b></a></sup>
3329         Otherwise, the integer promotions are performed on both operands. Then the
3330         following rules are applied to the promoted operands:
3331                If both operands have the same type, then no further conversion is needed.
3332                Otherwise, if both operands have signed integer types or both have unsigned
3333                integer types, the operand with the type of lesser integer conversion rank is
3334                converted to the type of the operand with greater rank.
3335                Otherwise, if the operand that has unsigned integer type has rank greater or
3336                equal to the rank of the type of the other operand, then the operand with
3337                signed integer type is converted to the type of the operand with unsigned
3338                integer type.
3339                Otherwise, if the type of the operand with signed integer type can represent
3340                all of the values of the type of the operand with unsigned integer type, then
3341                the operand with unsigned integer type is converted to the type of the
3342                operand with signed integer type.
3343                Otherwise, both operands are converted to the unsigned integer type
3344                corresponding to the type of the operand with signed integer type.
3345 </pre>
3346 <p><!--para 2 -->
3347  The values of floating operands and of the results of floating expressions may be
3348  represented in greater precision and range than that required by the type; the types are not
3349  changed thereby.<sup><a href="#note63"><b>63)</b></a></sup>
3350  
3351  
3352  
3353  
3354 <!--page 72 -->
3355
3356 <h6>footnotes</h6>
3357 <p><small><a name="note62" href="#note62">62)</a> For example, addition of a double _Complex and a float entails just the conversion of the
3358  float operand to double (and yields a double _Complex result).
3359 </small>
3360 <p><small><a name="note63" href="#note63">63)</a> The cast and assignment operators are still required to remove extra range and precision.
3361 </small>
3362
3363 <h4><a name="6.3.2" href="#6.3.2">6.3.2 Other operands</a></h4>
3364
3365 <h5><a name="6.3.2.1" href="#6.3.2.1">6.3.2.1 Lvalues, arrays, and function designators</a></h5>
3366 <p><!--para 1 -->
3367  An lvalue is an expression (with an object type other than void) that potentially
3368  designates an object;<sup><a href="#note64"><b>64)</b></a></sup> if an lvalue does not designate an object when it is evaluated, the
3369  behavior is undefined. When an object is said to have a particular type, the type is
3370  specified by the lvalue used to designate the object. A modifiable lvalue is an lvalue that
3371  does not have array type, does not have an incomplete type, does not have a const-
3372  qualified type, and if it is a structure or union, does not have any member (including,
3373  recursively, any member or element of all contained aggregates or unions) with a const-
3374  qualified type.
3375 <p><!--para 2 -->
3376  Except when it is the operand of the sizeof operator, the unary &amp; operator, the ++
3377  operator, the -- operator, or the left operand of the . operator or an assignment operator,
3378  an lvalue that does not have array type is converted to the value stored in the designated
3379  object (and is no longer an lvalue); this is called lvalue conversion. If the lvalue has
3380  qualified type, the value has the unqualified version of the type of the lvalue; additionally,
3381  if the lvalue has atomic type, the value has the non-atomic version of the type of the
3382  lvalue; otherwise, the value has the type of the lvalue. If the lvalue has an incomplete
3383  type and does not have array type, the behavior is undefined. If the lvalue designates an
3384  object of automatic storage duration that could have been declared with the register
3385  storage class (never had its address taken), and that object is uninitialized (not declared
3386  with an initializer and no assignment to it has been performed prior to use), the behavior
3387  is undefined.
3388 <p><!--para 3 -->
3389  Except when it is the operand of the sizeof operator or the unary &amp; operator, or is a
3390  string literal used to initialize an array, an expression that has type ''array of type'' is
3391  converted to an expression with type ''pointer to type'' that points to the initial element of
3392  the array object and is not an lvalue. If the array object has register storage class, the
3393  behavior is undefined.
3394 <p><!--para 4 -->
3395  A function designator is an expression that has function type. Except when it is the
3396  operand of the sizeof operator<sup><a href="#note65"><b>65)</b></a></sup> or the unary &amp; operator, a function designator with
3397  type ''function returning type'' is converted to an expression that has type ''pointer to
3398  
3399  
3400 <!--page 73 -->
3401  function returning type''.
3402 <p><b> Forward references</b>: address and indirection operators (<a href="#6.5.3.2">6.5.3.2</a>), assignment operators
3403  (<a href="#6.5.16">6.5.16</a>), common definitions <a href="#7.19">&lt;stddef.h&gt;</a> (<a href="#7.19">7.19</a>), initialization (<a href="#6.7.9">6.7.9</a>), postfix
3404  increment and decrement operators (<a href="#6.5.2.4">6.5.2.4</a>), prefix increment and decrement operators
3405  (<a href="#6.5.3.1">6.5.3.1</a>), the sizeof operator (<a href="#6.5.3.4">6.5.3.4</a>), structure and union members (<a href="#6.5.2.3">6.5.2.3</a>).
3406
3407 <h6>footnotes</h6>
3408 <p><small><a name="note64" href="#note64">64)</a> The name ''lvalue'' comes originally from the assignment expression E1 = E2, in which the left
3409  operand E1 is required to be a (modifiable) lvalue. It is perhaps better considered as representing an
3410  object ''locator value''. What is sometimes called ''rvalue'' is in this International Standard described
3411  as the ''value of an expression''.
3412   An obvious example of an lvalue is an identifier of an object. As a further example, if E is a unary
3413   expression that is a pointer to an object, *E is an lvalue that designates the object to which E points.
3414 </small>
3415 <p><small><a name="note65" href="#note65">65)</a> Because this conversion does not occur, the operand of the sizeof operator remains a function
3416  designator and violates the constraint in <a href="#6.5.3.4">6.5.3.4</a>.
3417 </small>
3418
3419 <h5><a name="6.3.2.2" href="#6.3.2.2">6.3.2.2 void</a></h5>
3420 <p><!--para 1 -->
3421  The (nonexistent) value of a void expression (an expression that has type void) shall not
3422  be used in any way, and implicit or explicit conversions (except to void) shall not be
3423  applied to such an expression. If an expression of any other type is evaluated as a void
3424  expression, its value or designator is discarded. (A void expression is evaluated for its
3425  side effects.)
3426
3427 <h5><a name="6.3.2.3" href="#6.3.2.3">6.3.2.3 Pointers</a></h5>
3428 <p><!--para 1 -->
3429  A pointer to void may be converted to or from a pointer to any object type. A pointer to
3430  any object type may be converted to a pointer to void and back again; the result shall
3431  compare equal to the original pointer.
3432 <p><!--para 2 -->
3433  For any qualifier q, a pointer to a non-q-qualified type may be converted to a pointer to
3434  the q-qualified version of the type; the values stored in the original and converted pointers
3435  shall compare equal.
3436 <p><!--para 3 -->
3437  An integer constant expression with the value 0, or such an expression cast to type
3438  void *, is called a null pointer constant.<sup><a href="#note66"><b>66)</b></a></sup> If a null pointer constant is converted to a
3439  pointer type, the resulting pointer, called a null pointer, is guaranteed to compare unequal
3440  to a pointer to any object or function.
3441 <p><!--para 4 -->
3442  Conversion of a null pointer to another pointer type yields a null pointer of that type.
3443  Any two null pointers shall compare equal.
3444 <p><!--para 5 -->
3445  An integer may be converted to any pointer type. Except as previously specified, the
3446  result is implementation-defined, might not be correctly aligned, might not point to an
3447  entity of the referenced type, and might be a trap representation.<sup><a href="#note67"><b>67)</b></a></sup>
3448 <p><!--para 6 -->
3449  Any pointer type may be converted to an integer type. Except as previously specified, the
3450  result is implementation-defined. If the result cannot be represented in the integer type,
3451  the behavior is undefined. The result need not be in the range of values of any integer
3452  type.
3453  
3454  
3455  
3456  
3457 <!--page 74 -->
3458 <p><!--para 7 -->
3459  A pointer to an object type may be converted to a pointer to a different object type. If the
3460  resulting pointer is not correctly aligned<sup><a href="#note68"><b>68)</b></a></sup> for the referenced type, the behavior is
3461  undefined. Otherwise, when converted back again, the result shall compare equal to the
3462  original pointer. When a pointer to an object is converted to a pointer to a character type,
3463  the result points to the lowest addressed byte of the object. Successive increments of the
3464  result, up to the size of the object, yield pointers to the remaining bytes of the object.
3465 <p><!--para 8 -->
3466  A pointer to a function of one type may be converted to a pointer to a function of another
3467  type and back again; the result shall compare equal to the original pointer. If a converted
3468  pointer is used to call a function whose type is not compatible with the referenced type,
3469  the behavior is undefined.
3470 <p><b> Forward references</b>: cast operators (<a href="#6.5.4">6.5.4</a>), equality operators (<a href="#6.5.9">6.5.9</a>), integer types
3471  capable of holding object pointers (<a href="#7.20.1.4">7.20.1.4</a>), simple assignment (<a href="#6.5.16.1">6.5.16.1</a>).
3472  
3473  
3474  
3475  
3476 <!--page 75 -->
3477
3478 <h6>footnotes</h6>
3479 <p><small><a name="note66" href="#note66">66)</a> The macro NULL is defined in <a href="#7.19">&lt;stddef.h&gt;</a> (and other headers) as a null pointer constant; see <a href="#7.19">7.19</a>.
3480 </small>
3481 <p><small><a name="note67" href="#note67">67)</a> The mapping functions for converting a pointer to an integer or an integer to a pointer are intended to
3482  be consistent with the addressing structure of the execution environment.
3483 </small>
3484 <p><small><a name="note68" href="#note68">68)</a> In general, the concept ''correctly aligned'' is transitive: if a pointer to type A is correctly aligned for a
3485  pointer to type B, which in turn is correctly aligned for a pointer to type C, then a pointer to type A is
3486  correctly aligned for a pointer to type C.
3487 </small>
3488
3489 <h3><a name="6.4" href="#6.4">6.4 Lexical elements</a></h3>
3490 <h6>Syntax</h6>
3491 <p><!--para 1 -->
3492 <pre>
3493           token:
3494                    keyword
3495                    identifier
3496                    constant
3497                    string-literal
3498                    punctuator
3499           preprocessing-token:
3500                  header-name
3501                  identifier
3502                  pp-number
3503                  character-constant
3504                  string-literal
3505                  punctuator
3506                  each non-white-space character that cannot be one of the above
3507 </pre>
3508 <h6>Constraints</h6>
3509 <p><!--para 2 -->
3510  Each preprocessing token that is converted to a token shall have the lexical form of a
3511  keyword, an identifier, a constant, a string literal, or a punctuator.
3512 <h6>Semantics</h6>
3513 <p><!--para 3 -->
3514  A token is the minimal lexical element of the language in translation phases 7 and 8. The
3515  categories of tokens are: keywords, identifiers, constants, string literals, and punctuators.
3516  A preprocessing token is the minimal lexical element of the language in translation
3517  phases 3 through 6. The categories of preprocessing tokens are: header names,
3518  identifiers, preprocessing numbers, character constants, string literals, punctuators, and
3519  single non-white-space characters that do not lexically match the other preprocessing
3520  token categories.<sup><a href="#note69"><b>69)</b></a></sup> If a ' or a " character matches the last category, the behavior is
3521  undefined. Preprocessing tokens can be separated by white space; this consists of
3522  comments (described later), or white-space characters (space, horizontal tab, new-line,
3523  vertical tab, and form-feed), or both. As described in <a href="#6.10">6.10</a>, in certain circumstances
3524  during translation phase 4, white space (or the absence thereof) serves as more than
3525  preprocessing token separation. White space may appear within a preprocessing token
3526  only as part of a header name or between the quotation characters in a character constant
3527  or string literal.
3528  
3529  
3530  
3531 <!--page 76 -->
3532 <p><!--para 4 -->
3533  If the input stream has been parsed into preprocessing tokens up to a given character, the
3534  next preprocessing token is the longest sequence of characters that could constitute a
3535  preprocessing token. There is one exception to this rule: header name preprocessing
3536  tokens are recognized only within #include preprocessing directives and in
3537  implementation-defined locations within #pragma directives. In such contexts, a
3538  sequence of characters that could be either a header name or a string literal is recognized
3539  as the former.
3540 <p><!--para 5 -->
3541  EXAMPLE 1 The program fragment 1Ex is parsed as a preprocessing number token (one that is not a
3542  valid floating or integer constant token), even though a parse as the pair of preprocessing tokens 1 and Ex
3543  might produce a valid expression (for example, if Ex were a macro defined as +1). Similarly, the program
3544  fragment 1E1 is parsed as a preprocessing number (one that is a valid floating constant token), whether or
3545  not E is a macro name.
3546  
3547 <p><!--para 6 -->
3548  EXAMPLE 2 The program fragment x+++++y is parsed as x ++ ++ + y, which violates a constraint on
3549  increment operators, even though the parse x ++ + ++ y might yield a correct expression.
3550  
3551 <p><b> Forward references</b>: character constants (<a href="#6.4.4.4">6.4.4.4</a>), comments (<a href="#6.4.9">6.4.9</a>), expressions (<a href="#6.5">6.5</a>),
3552  floating constants (<a href="#6.4.4.2">6.4.4.2</a>), header names (<a href="#6.4.7">6.4.7</a>), macro replacement (<a href="#6.10.3">6.10.3</a>), postfix
3553  increment and decrement operators (<a href="#6.5.2.4">6.5.2.4</a>), prefix increment and decrement operators
3554  (<a href="#6.5.3.1">6.5.3.1</a>), preprocessing directives (<a href="#6.10">6.10</a>), preprocessing numbers (<a href="#6.4.8">6.4.8</a>), string literals
3555  (<a href="#6.4.5">6.4.5</a>).
3556
3557 <h6>footnotes</h6>
3558 <p><small><a name="note69" href="#note69">69)</a> An additional category, placemarkers, is used internally in translation phase 4 (see <a href="#6.10.3.3">6.10.3.3</a>); it cannot
3559  occur in source files.
3560 </small>
3561
3562 <h4><a name="6.4.1" href="#6.4.1">6.4.1 Keywords</a></h4>
3563 <h6>Syntax</h6>
3564 <p><!--para 1 -->
3565 <pre>
3566           keyword: one of
3567                 alignof                         goto                         union
3568                 auto                            if                           unsigned
3569                 break                           inline                       void
3570                 case                            int                          volatile
3571                 char                            long                         while
3572                 const                           register                     _Alignas
3573                 continue                        restrict                     _Atomic
3574                 default                         return                       _Bool
3575                 do                              short                        _Complex
3576                 double                          signed                       _Generic
3577                 else                            sizeof                       _Imaginary
3578                 enum                            static                       _Noreturn
3579                 extern                          struct                       _Static_assert
3580                 float                           switch                       _Thread_local
3581                 for                             typedef
3582 </pre>
3583 <h6>Semantics</h6>
3584 <p><!--para 2 -->
3585  The above tokens (case sensitive) are reserved (in translation phases 7 and 8) for use as
3586  keywords, and shall not be used otherwise. The keyword _Imaginary is reserved for
3587 <!--page 77 -->
3588  specifying imaginary types.<sup><a href="#note70"><b>70)</b></a></sup>
3589
3590 <h6>footnotes</h6>
3591 <p><small><a name="note70" href="#note70">70)</a> One possible specification for imaginary types appears in <a href="#G">annex G</a>.
3592 </small>
3593
3594 <h4><a name="6.4.2" href="#6.4.2">6.4.2 Identifiers</a></h4>
3595
3596 <h5><a name="6.4.2.1" href="#6.4.2.1">6.4.2.1 General</a></h5>
3597 <h6>Syntax</h6>
3598 <p><!--para 1 -->
3599 <pre>
3600           identifier:
3601                  identifier-nondigit
3602                  identifier identifier-nondigit
3603                  identifier digit
3604           identifier-nondigit:
3605                  nondigit
3606                  universal-character-name
3607                  other implementation-defined characters
3608           nondigit: one of
3609                  _ a b            c    d    e    f     g    h    i    j     k    l    m
3610                      n o          p    q    r    s     t    u    v    w     x    y    z
3611                      A B          C    D    E    F     G    H    I    J     K    L    M
3612                      N O          P    Q    R    S     T    U    V    W     X    Y    Z
3613           digit: one of
3614                  0 1        2     3    4    5    6     7    8    9
3615 </pre>
3616 <h6>Semantics</h6>
3617 <p><!--para 2 -->
3618  An identifier is a sequence of nondigit characters (including the underscore _, the
3619  lowercase and uppercase Latin letters, and other characters) and digits, which designates
3620  one or more entities as described in <a href="#6.2.1">6.2.1</a>. Lowercase and uppercase letters are distinct.
3621  There is no specific limit on the maximum length of an identifier.
3622 <p><!--para 3 -->
3623  Each universal character name in an identifier shall designate a character whose encoding
3624  in ISO/IEC 10646 falls into one of the ranges specified in D.1.<sup><a href="#note71"><b>71)</b></a></sup> The initial character
3625  shall not be a universal character name designating a character whose encoding falls into
3626  one of the ranges specified in <a href="#D.2">D.2</a>. An implementation may allow multibyte characters
3627  that are not part of the basic source character set to appear in identifiers; which characters
3628  and their correspondence to universal character names is implementation-defined.
3629  
3630  
3631  
3632 <!--page 78 -->
3633 <p><!--para 4 -->
3634  When preprocessing tokens are converted to tokens during translation phase 7, if a
3635  preprocessing token could be converted to either a keyword or an identifier, it is converted
3636  to a keyword.
3637 <h6>Implementation limits</h6>
3638 <p><!--para 5 -->
3639  As discussed in <a href="#5.2.4.1">5.2.4.1</a>, an implementation may limit the number of significant initial
3640  characters in an identifier; the limit for an external name (an identifier that has external
3641  linkage) may be more restrictive than that for an internal name (a macro name or an
3642  identifier that does not have external linkage). The number of significant characters in an
3643  identifier is implementation-defined.
3644 <p><!--para 6 -->
3645  Any identifiers that differ in a significant character are different identifiers. If two
3646  identifiers differ only in nonsignificant characters, the behavior is undefined.
3647 <p><b> Forward references</b>: universal character names (<a href="#6.4.3">6.4.3</a>), macro replacement (<a href="#6.10.3">6.10.3</a>).
3648
3649 <h6>footnotes</h6>
3650 <p><small><a name="note71" href="#note71">71)</a> On systems in which linkers cannot accept extended characters, an encoding of the universal character
3651  name may be used in forming valid external identifiers. For example, some otherwise unused
3652  character or sequence of characters may be used to encode the \u in a universal character name.
3653  Extended characters may produce a long external identifier.
3654 </small>
3655
3656 <h5><a name="6.4.2.2" href="#6.4.2.2">6.4.2.2 Predefined identifiers</a></h5>
3657 <h6>Semantics</h6>
3658 <p><!--para 1 -->
3659  The identifier __func__ shall be implicitly declared by the translator as if,
3660  immediately following the opening brace of each function definition, the declaration
3661 <pre>
3662           static const char __func__[] = "function-name";
3663 </pre>
3664  appeared, where function-name is the name of the lexically-enclosing function.<sup><a href="#note72"><b>72)</b></a></sup>
3665 <p><!--para 2 -->
3666  This name is encoded as if the implicit declaration had been written in the source
3667  character set and then translated into the execution character set as indicated in translation
3668  phase 5.
3669 <p><!--para 3 -->
3670  EXAMPLE        Consider the code fragment:
3671 <pre>
3672           #include <a href="#7.21">&lt;stdio.h&gt;</a>
3673           void myfunc(void)
3674           {
3675                 printf("%s\n", __func__);
3676                 /* ... */
3677           }
3678 </pre>
3679  Each time the function is called, it will print to the standard output stream:
3680 <pre>
3681           myfunc
3682 </pre>
3683  
3684 <p><b> Forward references</b>: function definitions (<a href="#6.9.1">6.9.1</a>).
3685  
3686  
3687  
3688  
3689 <!--page 79 -->
3690
3691 <h6>footnotes</h6>
3692 <p><small><a name="note72" href="#note72">72)</a> Since the name __func__ is reserved for any use by the implementation (<a href="#7.1.3">7.1.3</a>), if any other
3693  identifier is explicitly declared using the name __func__, the behavior is undefined.
3694 </small>
3695
3696 <h4><a name="6.4.3" href="#6.4.3">6.4.3 Universal character names</a></h4>
3697 <h6>Syntax</h6>
3698 <p><!--para 1 -->
3699 <pre>
3700           universal-character-name:
3701                  \u hex-quad
3702                  \U hex-quad hex-quad
3703           hex-quad:
3704                  hexadecimal-digit hexadecimal-digit
3705                               hexadecimal-digit hexadecimal-digit
3706 </pre>
3707 <h6>Constraints</h6>
3708 <p><!--para 2 -->
3709  A universal character name shall not specify a character whose short identifier is less than
3710  00A0 other than 0024 ($), 0040 (@), or 0060 ('), nor one in the range D800 through
3711  DFFF inclusive.<sup><a href="#note73"><b>73)</b></a></sup>
3712 <h6>Description</h6>
3713 <p><!--para 3 -->
3714  Universal character names may be used in identifiers, character constants, and string
3715  literals to designate characters that are not in the basic character set.
3716 <h6>Semantics</h6>
3717 <p><!--para 4 -->
3718  The universal character name \Unnnnnnnn designates the character whose eight-digit
3719  short identifier (as specified by ISO/IEC 10646) is nnnnnnnn.<sup><a href="#note74"><b>74)</b></a></sup> Similarly, the universal
3720  character name \unnnn designates the character whose four-digit short identifier is nnnn
3721  (and whose eight-digit short identifier is 0000nnnn).
3722  
3723  
3724  
3725  
3726 <!--page 80 -->
3727
3728 <h6>footnotes</h6>
3729 <p><small><a name="note73" href="#note73">73)</a> The disallowed characters are the characters in the basic character set and the code positions reserved
3730  by ISO/IEC 10646 for control characters, the character DELETE, and the S-zone (reserved for use by
3731  UTF-16).
3732  
3733 </small>
3734 <p><small><a name="note74" href="#note74">74)</a> Short identifiers for characters were first specified in ISO/IEC 10646-1/AMD9:1997.
3735 </small>
3736
3737 <h4><a name="6.4.4" href="#6.4.4">6.4.4 Constants</a></h4>
3738 <h6>Syntax</h6>
3739 <p><!--para 1 -->
3740 <pre>
3741           constant:
3742                  integer-constant
3743                  floating-constant
3744                  enumeration-constant
3745                  character-constant
3746 </pre>
3747 <h6>Constraints</h6>
3748 <p><!--para 2 -->
3749  Each constant shall have a type and the value of a constant shall be in the range of
3750  representable values for its type.
3751 <h6>Semantics</h6>
3752 <p><!--para 3 -->
3753  Each constant has a type, determined by its form and value, as detailed later.
3754
3755 <h5><a name="6.4.4.1" href="#6.4.4.1">6.4.4.1 Integer constants</a></h5>
3756 <h6>Syntax</h6>
3757 <p><!--para 1 -->
3758 <!--page 81 -->
3759 <pre>
3760           integer-constant:
3761                   decimal-constant integer-suffix<sub>opt</sub>
3762                   octal-constant integer-suffix<sub>opt</sub>
3763                   hexadecimal-constant integer-suffix<sub>opt</sub>
3764           decimal-constant:
3765                 nonzero-digit
3766                 decimal-constant digit
3767           octal-constant:
3768                  0
3769                  octal-constant octal-digit
3770           hexadecimal-constant:
3771                 hexadecimal-prefix hexadecimal-digit
3772                 hexadecimal-constant hexadecimal-digit
3773           hexadecimal-prefix: one of
3774                 0x 0X
3775           nonzero-digit: one of
3776                  1 2 3 4          5     6     7   8    9
3777           octal-digit: one of
3778                   0 1 2 3         4     5     6   7
3779          hexadecimal-digit:   one of
3780                0 1 2           3 4     5    6   7     8   9
3781                a b c           d e     f
3782                A B C           D E     F
3783          integer-suffix:
3784                  unsigned-suffix long-suffix<sub>opt</sub>
3785                  unsigned-suffix long-long-suffix
3786                  long-suffix unsigned-suffix<sub>opt</sub>
3787                  long-long-suffix unsigned-suffix<sub>opt</sub>
3788          unsigned-suffix: one of
3789                 u U
3790          long-suffix: one of
3791                 l L
3792          long-long-suffix: one of
3793                 ll LL
3794 </pre>
3795 <h6>Description</h6>
3796 <p><!--para 2 -->
3797  An integer constant begins with a digit, but has no period or exponent part. It may have a
3798  prefix that specifies its base and a suffix that specifies its type.
3799 <p><!--para 3 -->
3800  A decimal constant begins with a nonzero digit and consists of a sequence of decimal
3801  digits. An octal constant consists of the prefix 0 optionally followed by a sequence of the
3802  digits 0 through 7 only. A hexadecimal constant consists of the prefix 0x or 0X followed
3803  by a sequence of the decimal digits and the letters a (or A) through f (or F) with values
3804  10 through 15 respectively.
3805 <h6>Semantics</h6>
3806 <p><!--para 4 -->
3807  The value of a decimal constant is computed base 10; that of an octal constant, base 8;
3808  that of a hexadecimal constant, base 16. The lexically first digit is the most significant.
3809 <p><!--para 5 -->
3810  The type of an integer constant is the first of the corresponding list in which its value can
3811  be represented.
3812 <!--page 82 -->
3813 <pre>
3814                                                                   Octal or Hexadecimal
3815 </pre>
3816  Suffix                       Decimal Constant                           Constant
3817  
3818  none                int                                    int
3819 <pre>
3820                      long int                               unsigned int
3821                      long long int                          long int
3822                                                             unsigned long int
3823                                                             long long int
3824                                                             unsigned long long int
3825 </pre>
3826  
3827  u or U              unsigned int                           unsigned int
3828 <pre>
3829                      unsigned long int                      unsigned long int
3830                      unsigned long long int                 unsigned long long int
3831 </pre>
3832  
3833  l or L              long int                               long int
3834 <pre>
3835                      long long int                          unsigned long int
3836                                                             long long int
3837                                                             unsigned long long int
3838 </pre>
3839  
3840  Both u or U         unsigned long int                      unsigned long int
3841  and l or L          unsigned long long int                 unsigned long long int
3842  
3843  ll or LL            long long int                          long long int
3844 <pre>
3845                                                             unsigned long long int
3846 </pre>
3847  
3848  Both u or U         unsigned long long int                 unsigned long long int
3849  and ll or LL
3850 <p><!--para 6 -->
3851  If an integer constant cannot be represented by any type in its list, it may have an
3852  extended integer type, if the extended integer type can represent its value. If all of the
3853  types in the list for the constant are signed, the extended integer type shall be signed. If
3854  all of the types in the list for the constant are unsigned, the extended integer type shall be
3855  unsigned. If the list contains both signed and unsigned types, the extended integer type
3856  may be signed or unsigned. If an integer constant cannot be represented by any type in
3857  its list and has no extended integer type, then the integer constant has no type.
3858 <!--page 83 -->
3859
3860 <h5><a name="6.4.4.2" href="#6.4.4.2">6.4.4.2 Floating constants</a></h5>
3861 <h6>Syntax</h6>
3862 <p><!--para 1 -->
3863 <!--page 84 -->
3864 <pre>
3865           floating-constant:
3866                  decimal-floating-constant
3867                  hexadecimal-floating-constant
3868           decimal-floating-constant:
3869                 fractional-constant exponent-part<sub>opt</sub> floating-suffix<sub>opt</sub>
3870                 digit-sequence exponent-part floating-suffix<sub>opt</sub>
3871           hexadecimal-floating-constant:
3872                 hexadecimal-prefix hexadecimal-fractional-constant
3873                                binary-exponent-part floating-suffix<sub>opt</sub>
3874                 hexadecimal-prefix hexadecimal-digit-sequence
3875                                binary-exponent-part floating-suffix<sub>opt</sub>
3876           fractional-constant:
3877                   digit-sequence<sub>opt</sub> . digit-sequence
3878                   digit-sequence .
3879           exponent-part:
3880                 e sign<sub>opt</sub> digit-sequence
3881                 E sign<sub>opt</sub> digit-sequence
3882           sign: one of
3883                  + -
3884           digit-sequence:
3885                   digit
3886                   digit-sequence digit
3887           hexadecimal-fractional-constant:
3888                 hexadecimal-digit-sequence<sub>opt</sub> .
3889                                hexadecimal-digit-sequence
3890                 hexadecimal-digit-sequence .
3891           binary-exponent-part:
3892                  p sign<sub>opt</sub> digit-sequence
3893                  P sign<sub>opt</sub> digit-sequence
3894           hexadecimal-digit-sequence:
3895                 hexadecimal-digit
3896                 hexadecimal-digit-sequence hexadecimal-digit
3897           floating-suffix: one of
3898                  f l F L
3899 </pre>
3900 <h6>Description</h6>
3901 <p><!--para 2 -->
3902  A floating constant has a significand part that may be followed by an exponent part and a
3903  suffix that specifies its type. The components of the significand part may include a digit
3904  sequence representing the whole-number part, followed by a period (.), followed by a
3905  digit sequence representing the fraction part. The components of the exponent part are an
3906  e, E, p, or P followed by an exponent consisting of an optionally signed digit sequence.
3907  Either the whole-number part or the fraction part has to be present; for decimal floating
3908  constants, either the period or the exponent part has to be present.
3909 <h6>Semantics</h6>
3910 <p><!--para 3 -->
3911  The significand part is interpreted as a (decimal or hexadecimal) rational number; the
3912  digit sequence in the exponent part is interpreted as a decimal integer. For decimal
3913  floating constants, the exponent indicates the power of 10 by which the significand part is
3914  to be scaled. For hexadecimal floating constants, the exponent indicates the power of 2
3915  by which the significand part is to be scaled. For decimal floating constants, and also for
3916  hexadecimal floating constants when FLT_RADIX is not a power of 2, the result is either
3917  the nearest representable value, or the larger or smaller representable value immediately
3918  adjacent to the nearest representable value, chosen in an implementation-defined manner.
3919  For hexadecimal floating constants when FLT_RADIX is a power of 2, the result is
3920  correctly rounded.
3921 <p><!--para 4 -->
3922  An unsuffixed floating constant has type double. If suffixed by the letter f or F, it has
3923  type float. If suffixed by the letter l or L, it has type long double.
3924 <p><!--para 5 -->
3925  Floating constants are converted to internal format as if at translation-time. The
3926  conversion of a floating constant shall not raise an exceptional condition or a floating-
3927  point exception at execution time. All floating constants of the same source form<sup><a href="#note75"><b>75)</b></a></sup> shall
3928  convert to the same internal format with the same value.
3929 <h6>Recommended practice</h6>
3930 <p><!--para 6 -->
3931  The implementation should produce a diagnostic message if a hexadecimal constant
3932  cannot be represented exactly in its evaluation format; the implementation should then
3933  proceed with the translation of the program.
3934 <p><!--para 7 -->
3935  The translation-time conversion of floating constants should match the execution-time
3936  conversion of character strings by library functions, such as strtod, given matching
3937  inputs suitable for both conversions, the same result format, and default execution-time
3938  rounding.<sup><a href="#note76"><b>76)</b></a></sup>
3939  
3940 <!--page 85 -->
3941
3942 <h6>footnotes</h6>
3943 <p><small><a name="note75" href="#note75">75)</a> <a href="#1.23">1.23</a>, 1.230, 123e-2, 123e-02, and 1.23L are all different source forms and thus need not
3944  convert to the same internal format and value.
3945 </small>
3946 <p><small><a name="note76" href="#note76">76)</a> The specification for the library functions recommends more accurate conversion than required for
3947  floating constants (see <a href="#7.22.1.3">7.22.1.3</a>).
3948 </small>
3949
3950 <h5><a name="6.4.4.3" href="#6.4.4.3">6.4.4.3 Enumeration constants</a></h5>
3951 <h6>Syntax</h6>
3952 <p><!--para 1 -->
3953 <pre>
3954           enumeration-constant:
3955                 identifier
3956 </pre>
3957 <h6>Semantics</h6>
3958 <p><!--para 2 -->
3959  An identifier declared as an enumeration constant has type int.
3960 <p><b> Forward references</b>: enumeration specifiers (<a href="#6.7.2.2">6.7.2.2</a>).
3961
3962 <h5><a name="6.4.4.4" href="#6.4.4.4">6.4.4.4 Character constants</a></h5>
3963 <h6>Syntax</h6>
3964 <p><!--para 1 -->
3965 <!--page 86 -->
3966 <pre>
3967           character-constant:
3968                  ' c-char-sequence '
3969                  L' c-char-sequence '
3970                  u' c-char-sequence '
3971                  U' c-char-sequence '
3972           c-char-sequence:
3973                  c-char
3974                  c-char-sequence c-char
3975           c-char:
3976                     any member of the source character set except
3977                                  the single-quote ', backslash \, or new-line character
3978                     escape-sequence
3979           escape-sequence:
3980                  simple-escape-sequence
3981                  octal-escape-sequence
3982                  hexadecimal-escape-sequence
3983                  universal-character-name
3984           simple-escape-sequence: one of
3985                  \' \" \? \\
3986                  \a \b \f \n \r                  \t    \v
3987           octal-escape-sequence:
3988                   \ octal-digit
3989                   \ octal-digit octal-digit
3990                   \ octal-digit octal-digit octal-digit
3991         hexadecimal-escape-sequence:
3992               \x hexadecimal-digit
3993               hexadecimal-escape-sequence hexadecimal-digit
3994 </pre>
3995 <h6>Description</h6>
3996 <p><!--para 2 -->
3997  An integer character constant is a sequence of one or more multibyte characters enclosed
3998  in single-quotes, as in 'x'. A wide character constant is the same, except prefixed by the
3999  letter L, u, or U. With a few exceptions detailed later, the elements of the sequence are
4000  any members of the source character set; they are mapped in an implementation-defined
4001  manner to members of the execution character set.
4002 <p><!--para 3 -->
4003  The single-quote ', the double-quote ", the question-mark ?, the backslash \, and
4004  arbitrary integer values are representable according to the following table of escape
4005  sequences:
4006 <pre>
4007        single quote '            \'
4008        double quote "            \"
4009        question mark ?           \?
4010        backslash \               \\
4011        octal character           \octal digits
4012        hexadecimal character     \x hexadecimal digits
4013 </pre>
4014 <p><!--para 4 -->
4015  The double-quote " and question-mark ? are representable either by themselves or by the
4016  escape sequences \" and \?, respectively, but the single-quote ' and the backslash \
4017  shall be represented, respectively, by the escape sequences \' and \\.
4018 <p><!--para 5 -->
4019  The octal digits that follow the backslash in an octal escape sequence are taken to be part
4020  of the construction of a single character for an integer character constant or of a single
4021  wide character for a wide character constant. The numerical value of the octal integer so
4022  formed specifies the value of the desired character or wide character.
4023 <p><!--para 6 -->
4024  The hexadecimal digits that follow the backslash and the letter x in a hexadecimal escape
4025  sequence are taken to be part of the construction of a single character for an integer
4026  character constant or of a single wide character for a wide character constant. The
4027  numerical value of the hexadecimal integer so formed specifies the value of the desired
4028  character or wide character.
4029 <p><!--para 7 -->
4030  Each octal or hexadecimal escape sequence is the longest sequence of characters that can
4031  constitute the escape sequence.
4032 <p><!--para 8 -->
4033  In addition, characters not in the basic character set are representable by universal
4034  character names and certain nongraphic characters are representable by escape sequences
4035  consisting of the backslash \ followed by a lowercase letter: \a, \b, \f, \n, \r, \t,
4036  and \v.<sup><a href="#note77"><b>77)</b></a></sup>
4037 <!--page 87 -->
4038 <h6>Constraints</h6>
4039 <p><!--para 9 -->
4040  The value of an octal or hexadecimal escape sequence shall be in the range of
4041  representable values for the corresponding type:
4042 <pre>
4043         Prefix      Corresponding Type
4044         none       unsigned char
4045         L          the unsigned type corresponding to wchar_t
4046         u          char16_t
4047         U          char32_t
4048 </pre>
4049 <h6>Semantics</h6>
4050 <p><!--para 10 -->
4051  An integer character constant has type int. The value of an integer character constant
4052  containing a single character that maps to a single-byte execution character is the
4053  numerical value of the representation of the mapped character interpreted as an integer.
4054  The value of an integer character constant containing more than one character (e.g.,
4055  'ab'), or containing a character or escape sequence that does not map to a single-byte
4056  execution character, is implementation-defined. If an integer character constant contains
4057  a single character or escape sequence, its value is the one that results when an object with
4058  type char whose value is that of the single character or escape sequence is converted to
4059  type int.
4060 <p><!--para 11 -->
4061  A wide character constant prefixed by the letter L has type wchar_t, an integer type
4062  defined in the <a href="#7.19">&lt;stddef.h&gt;</a> header; a wide character constant prefixed by the letter u or
4063  U has type char16_t or char32_t, respectively, unsigned integer types defined in the
4064  <a href="#7.27">&lt;uchar.h&gt;</a> header. The value of a wide character constant containing a single
4065  multibyte character that maps to a single member of the extended execution character set
4066  is the wide character corresponding to that multibyte character, as defined by the
4067  mbtowc, mbrtoc16, or mbrtoc32 function as appropriate for its type, with an
4068  implementation-defined current locale. The value of a wide character constant containing
4069  more than one multibyte character or a single multibyte character that maps to multiple
4070  members of the extended execution character set, or containing a multibyte character or
4071  escape sequence not represented in the extended execution character set, is
4072  implementation-defined.
4073 <p><!--para 12 -->
4074  EXAMPLE 1      The construction '\0' is commonly used to represent the null character.
4075  
4076 <p><!--para 13 -->
4077  EXAMPLE 2 Consider implementations that use two's complement representation for integers and eight
4078  bits for objects that have type char. In an implementation in which type char has the same range of
4079  values as signed char, the integer character constant '\xFF' has the value -1; if type char has the
4080  same range of values as unsigned char, the character constant '\xFF' has the value +255.
4081  
4082  
4083  
4084  
4085 <!--page 88 -->
4086 <p><!--para 14 -->
4087  EXAMPLE 3 Even if eight bits are used for objects that have type char, the construction '\x123'
4088  specifies an integer character constant containing only one character, since a hexadecimal escape sequence
4089  is terminated only by a non-hexadecimal character. To specify an integer character constant containing the
4090  two characters whose values are '\x12' and '3', the construction '\0223' may be used, since an octal
4091  escape sequence is terminated after three octal digits. (The value of this two-character integer character
4092  constant is implementation-defined.)
4093  
4094 <p><!--para 15 -->
4095  EXAMPLE 4 Even if 12 or more bits are used for objects that have type wchar_t, the construction
4096  L'\1234' specifies the implementation-defined value that results from the combination of the values
4097  0123 and '4'.
4098  
4099 <p><b> Forward references</b>: common definitions <a href="#7.19">&lt;stddef.h&gt;</a> (<a href="#7.19">7.19</a>), the mbtowc function
4100  (<a href="#7.22.7.2">7.22.7.2</a>), Unicode utilities <a href="#7.27">&lt;uchar.h&gt;</a> (<a href="#7.27">7.27</a>).
4101
4102 <h6>footnotes</h6>
4103 <p><small><a name="note77" href="#note77">77)</a> The semantics of these characters were discussed in <a href="#5.2.2">5.2.2</a>. If any other character follows a backslash,
4104  the result is not a token and a diagnostic is required. See ''future language directions'' (<a href="#6.11.4">6.11.4</a>).
4105 </small>
4106
4107 <h4><a name="6.4.5" href="#6.4.5">6.4.5 String literals</a></h4>
4108 <h6>Syntax</h6>
4109 <p><!--para 1 -->
4110 <pre>
4111           string-literal:
4112                   encoding-prefix<sub>opt</sub> " s-char-sequence<sub>opt</sub> "
4113           encoding-prefix:
4114                  u8
4115                  u
4116                  U
4117                  L
4118           s-char-sequence:
4119                  s-char
4120                  s-char-sequence s-char
4121           s-char:
4122                     any member of the source character set except
4123                                  the double-quote ", backslash \, or new-line character
4124                     escape-sequence
4125 </pre>
4126 <h6>Constraints</h6>
4127 <p><!--para 2 -->
4128  A sequence of adjacent string literal tokens shall not include both a wide string literal and
4129  a UTF-8 string literal.
4130 <h6>Description</h6>
4131 <p><!--para 3 -->
4132  A character string literal is a sequence of zero or more multibyte characters enclosed in
4133  double-quotes, as in "xyz". A UTF-8 string literal is the same, except prefixed by u8.
4134  A wide string literal is the same, except prefixed by the letter L, u, or U.
4135 <p><!--para 4 -->
4136  The same considerations apply to each element of the sequence in a string literal as if it
4137  were in an integer character constant (for a character or UTF-8 string literal) or a wide
4138  character constant (for a wide string literal), except that the single-quote ' is
4139  representable either by itself or by the escape sequence \', but the double-quote " shall
4140 <!--page 89 -->
4141  be represented by the escape sequence \".
4142 <h6>Semantics</h6>
4143 <p><!--para 5 -->
4144  In translation phase 6, the multibyte character sequences specified by any sequence of
4145  adjacent character and identically-prefixed string literal tokens are concatenated into a
4146  single multibyte character sequence. If any of the tokens has an encoding prefix, the
4147  resulting multibyte character sequence is treated as having the same prefix; otherwise, it
4148  is treated as a character string literal. Whether differently-prefixed wide string literal
4149  tokens can be concatenated and, if so, the treatment of the resulting multibyte character
4150  sequence are implementation-defined.
4151 <p><!--para 6 -->
4152  In translation phase 7, a byte or code of value zero is appended to each multibyte
4153  character sequence that results from a string literal or literals.<sup><a href="#note78"><b>78)</b></a></sup> The multibyte character
4154  sequence is then used to initialize an array of static storage duration and length just
4155  sufficient to contain the sequence. For character string literals, the array elements have
4156  type char, and are initialized with the individual bytes of the multibyte character
4157  sequence. For UTF-8 string literals, the array elements have type char, and are
4158  initialized with the characters of the multibyte character sequence, as encoded in UTF-8.
4159  For wide string literals prefixed by the letter L, the array elements have type wchar_t
4160  and are initialized with the sequence of wide characters corresponding to the multibyte
4161  character sequence, as defined by the mbstowcs function with an implementation-
4162  defined current locale. For wide string literals prefixed by the letter u or U, the array
4163  elements have type char16_t or char32_t, respectively, and are initialized with the
4164  sequence of wide characters corresponding to the multibyte character sequence, as
4165  defined by successive calls to the mbrtoc16, or mbrtoc32 function as appropriate for
4166  its type, with an implementation-defined current locale. The value of a string literal
4167  containing a multibyte character or escape sequence not represented in the execution
4168  character set is implementation-defined.
4169 <p><!--para 7 -->
4170  It is unspecified whether these arrays are distinct provided their elements have the
4171  appropriate values. If the program attempts to modify such an array, the behavior is
4172  undefined.
4173 <p><!--para 8 -->
4174  EXAMPLE 1      This pair of adjacent character string literals
4175 <pre>
4176           "\x12" "3"
4177 </pre>
4178  produces a single character string literal containing the two characters whose values are '\x12' and '3',
4179  because escape sequences are converted into single members of the execution character set just prior to
4180  adjacent string literal concatenation.
4181  
4182 <p><!--para 9 -->
4183  EXAMPLE 2      Each of the sequences of adjacent string literal tokens
4184  
4185  
4186  
4187 <!--page 90 -->
4188 <pre>
4189           "a" "b" L"c"
4190           "a" L"b" "c"
4191           L"a" "b" L"c"
4192           L"a" L"b" L"c"
4193 </pre>
4194  is equivalent to the string literal
4195 <pre>
4196           L"abc"
4197 </pre>
4198  Likewise, each of the sequences
4199 <pre>
4200           "a" "b" u"c"
4201           "a" u"b" "c"
4202           u"a" "b" u"c"
4203           u"a" u"b" u"c"
4204 </pre>
4205  is equivalent to
4206 <pre>
4207           u"abc"
4208 </pre>
4209  
4210 <p><b> Forward references</b>: common definitions <a href="#7.19">&lt;stddef.h&gt;</a> (<a href="#7.19">7.19</a>), the mbstowcs
4211  function (<a href="#7.22.8.1">7.22.8.1</a>), Unicode utilities <a href="#7.27">&lt;uchar.h&gt;</a> (<a href="#7.27">7.27</a>).
4212
4213 <h6>footnotes</h6>
4214 <p><small><a name="note78" href="#note78">78)</a> A string literal need not be a string (see <a href="#7.1.1">7.1.1</a>), because a null character may be embedded in it by a
4215  \0 escape sequence.
4216 </small>
4217
4218 <h4><a name="6.4.6" href="#6.4.6">6.4.6 Punctuators</a></h4>
4219 <h6>Syntax</h6>
4220 <p><!--para 1 -->
4221 <pre>
4222           punctuator: one of
4223                  [ ] ( ) { } . -&gt;
4224                  ++ -- &amp; * + - ~ !
4225                  / % &lt;&lt; &gt;&gt; &lt; &gt; &lt;= &gt;=                         ==    !=    ^    |   &amp;&amp;   ||
4226                  ? : ; ...
4227                  = *= /= %= += -= &lt;&lt;=                        &gt;&gt;=    &amp;=       ^=   |=
4228                  , # ##
4229                  &lt;: :&gt; &lt;% %&gt; %: %:%:
4230 </pre>
4231 <h6>Semantics</h6>
4232 <p><!--para 2 -->
4233  A punctuator is a symbol that has independent syntactic and semantic significance.
4234  Depending on context, it may specify an operation to be performed (which in turn may
4235  yield a value or a function designator, produce a side effect, or some combination thereof)
4236  in which case it is known as an operator (other forms of operator also exist in some
4237  contexts). An operand is an entity on which an operator acts.
4238 <!--page 91 -->
4239 <p><!--para 3 -->
4240  In all aspects of the language, the six tokens<sup><a href="#note79"><b>79)</b></a></sup>
4241 <pre>
4242           &lt;:    :&gt;      &lt;%    %&gt;     %:     %:%:
4243 </pre>
4244  behave, respectively, the same as the six tokens
4245 <pre>
4246           [     ]       {     }      #      ##
4247 </pre>
4248  except for their spelling.<sup><a href="#note80"><b>80)</b></a></sup>
4249 <p><b> Forward references</b>: expressions (<a href="#6.5">6.5</a>), declarations (<a href="#6.7">6.7</a>), preprocessing directives
4250  (<a href="#6.10">6.10</a>), statements (<a href="#6.8">6.8</a>).
4251
4252 <h6>footnotes</h6>
4253 <p><small><a name="note79" href="#note79">79)</a> These tokens are sometimes called ''digraphs''.
4254 </small>
4255 <p><small><a name="note80" href="#note80">80)</a> Thus [ and &lt;: behave differently when ''stringized'' (see <a href="#6.10.3.2">6.10.3.2</a>), but can otherwise be freely
4256  interchanged.
4257 </small>
4258
4259 <h4><a name="6.4.7" href="#6.4.7">6.4.7 Header names</a></h4>
4260 <h6>Syntax</h6>
4261 <p><!--para 1 -->
4262 <pre>
4263           header-name:
4264                  &lt; h-char-sequence &gt;
4265                  " q-char-sequence "
4266           h-char-sequence:
4267                  h-char
4268                  h-char-sequence h-char
4269           h-char:
4270                     any member of the source character set except
4271                                  the new-line character and &gt;
4272           q-char-sequence:
4273                  q-char
4274                  q-char-sequence q-char
4275           q-char:
4276                     any member of the source character set except
4277                                  the new-line character and "
4278 </pre>
4279 <h6>Semantics</h6>
4280 <p><!--para 2 -->
4281  The sequences in both forms of header names are mapped in an implementation-defined
4282  manner to headers or external source file names as specified in <a href="#6.10.2">6.10.2</a>.
4283 <p><!--para 3 -->
4284  If the characters ', \, ", //, or /* occur in the sequence between the &lt; and &gt; delimiters,
4285  the behavior is undefined. Similarly, if the characters ', \, //, or /* occur in the
4286  
4287  
4288  
4289  
4290 <!--page 92 -->
4291  sequence between the " delimiters, the behavior is undefined.<sup><a href="#note81"><b>81)</b></a></sup> Header name
4292  preprocessing tokens are recognized only within #include preprocessing directives and
4293  in implementation-defined locations within #pragma directives.<sup><a href="#note82"><b>82)</b></a></sup>
4294 <p><!--para 4 -->
4295  EXAMPLE       The following sequence of characters:
4296 <pre>
4297           0x3&lt;1/a.h&gt;1e2
4298           #include &lt;1/a.h&gt;
4299           #define const.member@$
4300 </pre>
4301  forms the following sequence of preprocessing tokens (with each individual preprocessing token delimited
4302  by a { on the left and a } on the right).
4303 <pre>
4304           {0x3}{&lt;}{1}{/}{a}{.}{h}{&gt;}{1e2}
4305           {#}{include} {&lt;1/a.h&gt;}
4306           {#}{define} {const}{.}{member}{@}{$}
4307 </pre>
4308  
4309 <p><b> Forward references</b>: source file inclusion (<a href="#6.10.2">6.10.2</a>).
4310
4311 <h6>footnotes</h6>
4312 <p><small><a name="note81" href="#note81">81)</a> Thus, sequences of characters that resemble escape sequences cause undefined behavior.
4313 </small>
4314 <p><small><a name="note82" href="#note82">82)</a> For an example of a header name preprocessing token used in a #pragma directive, see <a href="#6.10.9">6.10.9</a>.
4315 </small>
4316
4317 <h4><a name="6.4.8" href="#6.4.8">6.4.8 Preprocessing numbers</a></h4>
4318 <h6>Syntax</h6>
4319 <p><!--para 1 -->
4320 <pre>
4321           pp-number:
4322                 digit
4323                 . digit
4324                 pp-number       digit
4325                 pp-number       identifier-nondigit
4326                 pp-number       e sign
4327                 pp-number       E sign
4328                 pp-number       p sign
4329                 pp-number       P sign
4330                 pp-number       .
4331 </pre>
4332 <h6>Description</h6>
4333 <p><!--para 2 -->
4334  A preprocessing number begins with a digit optionally preceded by a period (.) and may
4335  be followed by valid identifier characters and the character sequences e+, e-, E+, E-,
4336  p+, p-, P+, or P-.
4337 <p><!--para 3 -->
4338  Preprocessing number tokens lexically include all floating and integer constant tokens.
4339 <h6>Semantics</h6>
4340 <p><!--para 4 -->
4341  A preprocessing number does not have type or a value; it acquires both after a successful
4342  conversion (as part of translation phase 7) to a floating constant token or an integer
4343  constant token.
4344  
4345  
4346 <!--page 93 -->
4347
4348 <h4><a name="6.4.9" href="#6.4.9">6.4.9 Comments</a></h4>
4349 <p><!--para 1 -->
4350  Except within a character constant, a string literal, or a comment, the characters /*
4351  introduce a comment. The contents of such a comment are examined only to identify
4352  multibyte characters and to find the characters */ that terminate it.<sup><a href="#note83"><b>83)</b></a></sup>
4353 <p><!--para 2 -->
4354  Except within a character constant, a string literal, or a comment, the characters //
4355  introduce a comment that includes all multibyte characters up to, but not including, the
4356  next new-line character. The contents of such a comment are examined only to identify
4357  multibyte characters and to find the terminating new-line character.
4358 <p><!--para 3 -->
4359  EXAMPLE
4360 <pre>
4361           "a//b"                             //   four-character string literal
4362           #include "//e"                     //   undefined behavior
4363           // */                              //   comment, not syntax error
4364           f = g/**//h;                       //   equivalent to f = g / h;
4365           //\
4366           i();                               // part of a two-line comment
4367           /\
4368           / j();                             // part of a two-line comment
4369           #define glue(x,y) x##y
4370           glue(/,/) k();                     // syntax error, not comment
4371           /*//*/ l();                        // equivalent to l();
4372           m = n//**/o
4373              + p;                            // equivalent to m = n + p;
4374 </pre>
4375  
4376  
4377  
4378  
4379 <!--page 94 -->
4380
4381 <h6>footnotes</h6>
4382 <p><small><a name="note83" href="#note83">83)</a> Thus, /* ... */ comments do not nest.
4383 </small>
4384
4385 <h3><a name="6.5" href="#6.5">6.5 Expressions</a></h3>
4386 <p><!--para 1 -->
4387  An expression is a sequence of operators and operands that specifies computation of a
4388  value, or that designates an object or a function, or that generates side effects, or that
4389  performs a combination thereof. The value computations of the operands of an operator
4390  are sequenced before the value computation of the result of the operator.
4391 <p><!--para 2 -->
4392  If a side effect on a scalar object is unsequenced relative to either a different side effect
4393  on the same scalar object or a value computation using the value of the same scalar
4394  object, the behavior is undefined. If there are multiple allowable orderings of the
4395  subexpressions of an expression, the behavior is undefined if such an unsequenced side
4396  effect occurs in any of the orderings.<sup><a href="#note84"><b>84)</b></a></sup>
4397 <p><!--para 3 -->
4398  The grouping of operators and operands is indicated by the syntax.<sup><a href="#note85"><b>85)</b></a></sup> Except as specified
4399  later, side effects and value computations of subexpressions are unsequenced.<sup><a href="#note86"><b>86)</b></a></sup>         *
4400 <p><!--para 4 -->
4401  Some operators (the unary operator ~, and the binary operators &lt;&lt;, &gt;&gt;, &amp;, ^, and |,
4402  collectively described as bitwise operators) are required to have operands that have
4403  integer type. These operators yield values that depend on the internal representations of
4404  integers, and have implementation-defined and undefined aspects for signed types.
4405 <p><!--para 5 -->
4406  If an exceptional condition occurs during the evaluation of an expression (that is, if the
4407  result is not mathematically defined or not in the range of representable values for its
4408  type), the behavior is undefined.
4409  
4410  
4411  
4412 <!--page 95 -->
4413 <p><!--para 6 -->
4414  The effective type of an object for an access to its stored value is the declared type of the
4415  object, if any.<sup><a href="#note87"><b>87)</b></a></sup> If a value is stored into an object having no declared type through an
4416  lvalue having a type that is not a character type, then the type of the lvalue becomes the
4417  effective type of the object for that access and for subsequent accesses that do not modify
4418  the stored value. If a value is copied into an object having no declared type using
4419  memcpy or memmove, or is copied as an array of character type, then the effective type
4420  of the modified object for that access and for subsequent accesses that do not modify the
4421  value is the effective type of the object from which the value is copied, if it has one. For
4422  all other accesses to an object having no declared type, the effective type of the object is
4423  simply the type of the lvalue used for the access.
4424 <p><!--para 7 -->
4425  An object shall have its stored value accessed only by an lvalue expression that has one of
4426  the following types:<sup><a href="#note88"><b>88)</b></a></sup>
4427 <ul>
4428 <li>  a type compatible with the effective type of the object,
4429 <li>  a qualified version of a type compatible with the effective type of the object,
4430 <li>  a type that is the signed or unsigned type corresponding to the effective type of the
4431  object,
4432 <li>  a type that is the signed or unsigned type corresponding to a qualified version of the
4433  effective type of the object,
4434 <li>  an aggregate or union type that includes one of the aforementioned types among its
4435  members (including, recursively, a member of a subaggregate or contained union), or
4436 <li>  a character type.
4437 </ul>
4438 <p><!--para 8 -->
4439  A floating expression may be contracted, that is, evaluated as though it were a single
4440  operation, thereby omitting rounding errors implied by the source code and the
4441  expression evaluation method.<sup><a href="#note89"><b>89)</b></a></sup> The FP_CONTRACT pragma in <a href="#7.12">&lt;math.h&gt;</a> provides a
4442  way to disallow contracted expressions. Otherwise, whether and how expressions are
4443  contracted is implementation-defined.<sup><a href="#note90"><b>90)</b></a></sup>
4444 <p><b> Forward references</b>: the FP_CONTRACT pragma (<a href="#7.12.2">7.12.2</a>), copying functions (<a href="#7.23.2">7.23.2</a>).
4445  
4446  
4447 <!--page 96 -->
4448
4449 <h6>footnotes</h6>
4450 <p><small><a name="note84" href="#note84">84)</a> This paragraph renders undefined statement expressions such as
4451
4452 <pre>
4453            i = ++i + 1;
4454            a[i++] = i;
4455 </pre>
4456   while allowing
4457
4458 <pre>
4459            i = i + 1;
4460            a[i] = i;
4461 </pre>
4462  
4463 </small>
4464 <p><small><a name="note85" href="#note85">85)</a> The syntax specifies the precedence of operators in the evaluation of an expression, which is the same
4465  as the order of the major subclauses of this subclause, highest precedence first. Thus, for example, the
4466  expressions allowed as the operands of the binary + operator (<a href="#6.5.6">6.5.6</a>) are those expressions defined in
4467  <a href="#6.5.1">6.5.1</a> through <a href="#6.5.6">6.5.6</a>. The exceptions are cast expressions (<a href="#6.5.4">6.5.4</a>) as operands of unary operators
4468  (<a href="#6.5.3">6.5.3</a>), and an operand contained between any of the following pairs of operators: grouping
4469  parentheses () (<a href="#6.5.1">6.5.1</a>), subscripting brackets [] (<a href="#6.5.2.1">6.5.2.1</a>), function-call parentheses () (<a href="#6.5.2.2">6.5.2.2</a>), and
4470  the conditional operator ? : (<a href="#6.5.15">6.5.15</a>).
4471   Within each major subclause, the operators have the same precedence. Left- or right-associativity is
4472   indicated in each subclause by the syntax for the expressions discussed therein.
4473 </small>
4474 <p><small><a name="note86" href="#note86">86)</a> In an expression that is evaluated more than once during the execution of a program, unsequenced and
4475  indeterminately sequenced evaluations of its subexpressions need not be performed consistently in
4476  different evaluations.
4477 </small>
4478 <p><small><a name="note87" href="#note87">87)</a> Allocated objects have no declared type.
4479 </small>
4480 <p><small><a name="note88" href="#note88">88)</a> The intent of this list is to specify those circumstances in which an object may or may not be aliased.
4481 </small>
4482 <p><small><a name="note89" href="#note89">89)</a> The intermediate operations in the contracted expression are evaluated as if to infinite precision and
4483  range, while the final operation is rounded to the format determined by the expression evaluation
4484  method. A contracted expression might also omit the raising of floating-point exceptions.
4485 </small>
4486 <p><small><a name="note90" href="#note90">90)</a> This license is specifically intended to allow implementations to exploit fast machine instructions that
4487  combine multiple C operators. As contractions potentially undermine predictability, and can even
4488  decrease accuracy for containing expressions, their use needs to be well-defined and clearly
4489  documented.
4490 </small>
4491
4492 <h4><a name="6.5.1" href="#6.5.1">6.5.1 Primary expressions</a></h4>
4493 <h6>Syntax</h6>
4494 <p><!--para 1 -->
4495 <pre>
4496           primary-expression:
4497                  identifier
4498                  constant
4499                  string-literal
4500                  ( expression )
4501                  generic-selection
4502 </pre>
4503 <h6>Semantics</h6>
4504 <p><!--para 2 -->
4505  An identifier is a primary expression, provided it has been declared as designating an
4506  object (in which case it is an lvalue) or a function (in which case it is a function
4507  designator).<sup><a href="#note91"><b>91)</b></a></sup>
4508 <p><!--para 3 -->
4509  A constant is a primary expression. Its type depends on its form and value, as detailed in
4510  <a href="#6.4.4">6.4.4</a>.
4511 <p><!--para 4 -->
4512  A string literal is a primary expression. It is an lvalue with type as detailed in <a href="#6.4.5">6.4.5</a>.
4513 <p><!--para 5 -->
4514  A parenthesized expression is a primary expression. Its type and value are identical to
4515  those of the unparenthesized expression. It is an lvalue, a function designator, or a void
4516  expression if the unparenthesized expression is, respectively, an lvalue, a function
4517  designator, or a void expression.
4518 <p><b> Forward references</b>: declarations (<a href="#6.7">6.7</a>).
4519
4520 <h6>footnotes</h6>
4521 <p><small><a name="note91" href="#note91">91)</a> Thus, an undeclared identifier is a violation of the syntax.
4522 </small>
4523
4524 <h5><a name="6.5.1.1" href="#6.5.1.1">6.5.1.1 Generic selection</a></h5>
4525 <h6>Syntax</h6>
4526 <p><!--para 1 -->
4527 <pre>
4528           generic-selection:
4529                  _Generic ( assignment-expression , generic-assoc-list )
4530           generic-assoc-list:
4531                  generic-association
4532                  generic-assoc-list , generic-association
4533           generic-association:
4534                  type-name : assignment-expression
4535                  default : assignment-expression
4536 </pre>
4537 <h6>Constraints</h6>
4538 <p><!--para 2 -->
4539  A generic selection shall have no more than one default generic association. The type
4540  name in a generic association shall specify a complete object type other than a variably
4541  
4542 <!--page 97 -->
4543  modified type. No two generic associations in the same generic selection shall specify
4544  compatible types. The controlling expression of a generic selection shall have type
4545  compatible with at most one of the types named in its generic association list. If a
4546  generic selection has no default generic association, its controlling expression shall
4547  have type compatible with exactly one of the types named in its generic association list.
4548 <h6>Semantics</h6>
4549 <p><!--para 3 -->
4550  The controlling expression of a generic selection is not evaluated. If a generic selection
4551  has a generic association with a type name that is compatible with the type of the
4552  controlling expression, then the result expression of the generic selection is the
4553  expression in that generic association. Otherwise, the result expression of the generic
4554  selection is the expression in the default generic association. None of the expressions
4555  from any other generic association of the generic selection is evaluated.
4556 <p><!--para 4 -->
4557  The type and value of a generic selection are identical to those of its result expression. It
4558  is an lvalue, a function designator, or a void expression if its result expression is,
4559  respectively, an lvalue, a function designator, or a void expression.
4560 <p><!--para 5 -->
4561  EXAMPLE      The cbrt type-generic macro could be implemented as follows:
4562 <pre>
4563           #define cbrt(X) _Generic((X),                                      \
4564                                   long double: cbrtl,                        \
4565                                   default: cbrt,                             \
4566                                   float: cbrtf                               \
4567                                   )(X)
4568 </pre>
4569  
4570
4571 <h4><a name="6.5.2" href="#6.5.2">6.5.2 Postfix operators</a></h4>
4572 <h6>Syntax</h6>
4573 <p><!--para 1 -->
4574 <!--page 98 -->
4575 <pre>
4576           postfix-expression:
4577                  primary-expression
4578                  postfix-expression [ expression ]
4579                  postfix-expression ( argument-expression-list<sub>opt</sub> )
4580                  postfix-expression . identifier
4581                  postfix-expression -&gt; identifier
4582                  postfix-expression ++
4583                  postfix-expression --
4584                  ( type-name ) { initializer-list }
4585                  ( type-name ) { initializer-list , }
4586           argument-expression-list:
4587                 assignment-expression
4588                 argument-expression-list , assignment-expression
4589 </pre>
4590
4591 <h5><a name="6.5.2.1" href="#6.5.2.1">6.5.2.1 Array subscripting</a></h5>
4592 <h6>Constraints</h6>
4593 <p><!--para 1 -->
4594  One of the expressions shall have type ''pointer to complete object type'', the other
4595  expression shall have integer type, and the result has type ''type''.
4596 <h6>Semantics</h6>
4597 <p><!--para 2 -->
4598  A postfix expression followed by an expression in square brackets [] is a subscripted
4599  designation of an element of an array object. The definition of the subscript operator []
4600  is that E1[E2] is identical to (*((E1)+(E2))). Because of the conversion rules that
4601  apply to the binary + operator, if E1 is an array object (equivalently, a pointer to the
4602  initial element of an array object) and E2 is an integer, E1[E2] designates the E2-th
4603  element of E1 (counting from zero).
4604 <p><!--para 3 -->
4605  Successive subscript operators designate an element of a multidimensional array object.
4606  If E is an n-dimensional array (n &gt;= 2) with dimensions i x j x . . . x k, then E (used as
4607  other than an lvalue) is converted to a pointer to an (n - 1)-dimensional array with
4608  dimensions j x . . . x k. If the unary * operator is applied to this pointer explicitly, or
4609  implicitly as a result of subscripting, the result is the referenced (n - 1)-dimensional
4610  array, which itself is converted into a pointer if used as other than an lvalue. It follows
4611  from this that arrays are stored in row-major order (last subscript varies fastest).
4612 <p><!--para 4 -->
4613  EXAMPLE        Consider the array object defined by the declaration
4614 <pre>
4615           int x[3][5];
4616 </pre>
4617  Here x is a 3 x 5 array of ints; more precisely, x is an array of three element objects, each of which is an
4618  array of five ints. In the expression x[i], which is equivalent to (*((x)+(i))), x is first converted to
4619  a pointer to the initial array of five ints. Then i is adjusted according to the type of x, which conceptually
4620  entails multiplying i by the size of the object to which the pointer points, namely an array of five int
4621  objects. The results are added and indirection is applied to yield an array of five ints. When used in the
4622  expression x[i][j], that array is in turn converted to a pointer to the first of the ints, so x[i][j]
4623  yields an int.
4624  
4625 <p><b> Forward references</b>: additive operators (<a href="#6.5.6">6.5.6</a>), address and indirection operators
4626  (<a href="#6.5.3.2">6.5.3.2</a>), array declarators (<a href="#6.7.6.2">6.7.6.2</a>).
4627
4628 <h5><a name="6.5.2.2" href="#6.5.2.2">6.5.2.2 Function calls</a></h5>
4629 <h6>Constraints</h6>
4630 <p><!--para 1 -->
4631  The expression that denotes the called function<sup><a href="#note92"><b>92)</b></a></sup> shall have type pointer to function
4632  returning void or returning a complete object type other than an array type.
4633 <p><!--para 2 -->
4634  If the expression that denotes the called function has a type that includes a prototype, the
4635  number of arguments shall agree with the number of parameters. Each argument shall
4636  
4637  
4638 <!--page 99 -->
4639  have a type such that its value may be assigned to an object with the unqualified version
4640  of the type of its corresponding parameter.
4641 <h6>Semantics</h6>
4642 <p><!--para 3 -->
4643  A postfix expression followed by parentheses () containing a possibly empty, comma-
4644  separated list of expressions is a function call. The postfix expression denotes the called
4645  function. The list of expressions specifies the arguments to the function.
4646 <p><!--para 4 -->
4647  An argument may be an expression of any complete object type. In preparing for the call
4648  to a function, the arguments are evaluated, and each parameter is assigned the value of the
4649  corresponding argument.<sup><a href="#note93"><b>93)</b></a></sup>
4650 <p><!--para 5 -->
4651  If the expression that denotes the called function has type pointer to function returning an
4652  object type, the function call expression has the same type as that object type, and has the
4653  value determined as specified in <a href="#6.8.6.4">6.8.6.4</a>. Otherwise, the function call has type void.         *
4654 <p><!--para 6 -->
4655  If the expression that denotes the called function has a type that does not include a
4656  prototype, the integer promotions are performed on each argument, and arguments that
4657  have type float are promoted to double. These are called the default argument
4658  promotions. If the number of arguments does not equal the number of parameters, the
4659  behavior is undefined. If the function is defined with a type that includes a prototype, and
4660  either the prototype ends with an ellipsis (, ...) or the types of the arguments after
4661  promotion are not compatible with the types of the parameters, the behavior is undefined.
4662  If the function is defined with a type that does not include a prototype, and the types of
4663  the arguments after promotion are not compatible with those of the parameters after
4664  promotion, the behavior is undefined, except for the following cases:
4665 <ul>
4666 <li>  one promoted type is a signed integer type, the other promoted type is the
4667  corresponding unsigned integer type, and the value is representable in both types;
4668 <li>  both types are pointers to qualified or unqualified versions of a character type or
4669  void.
4670 </ul>
4671 <p><!--para 7 -->
4672  If the expression that denotes the called function has a type that does include a prototype,
4673  the arguments are implicitly converted, as if by assignment, to the types of the
4674  corresponding parameters, taking the type of each parameter to be the unqualified version
4675  of its declared type. The ellipsis notation in a function prototype declarator causes
4676  argument type conversion to stop after the last declared parameter. The default argument
4677  promotions are performed on trailing arguments.
4678  
4679  
4680  
4681 <!--page 100 -->
4682 <p><!--para 8 -->
4683  No other conversions are performed implicitly; in particular, the number and types of
4684  arguments are not compared with those of the parameters in a function definition that
4685  does not include a function prototype declarator.
4686 <p><!--para 9 -->
4687  If the function is defined with a type that is not compatible with the type (of the
4688  expression) pointed to by the expression that denotes the called function, the behavior is
4689  undefined.
4690 <p><!--para 10 -->
4691  There is a sequence point after the evaluations of the function designator and the actual
4692  arguments but before the actual call. Every evaluation in the calling function (including
4693  other function calls) that is not otherwise specifically sequenced before or after the
4694  execution of the body of the called function is indeterminately sequenced with respect to
4695  the execution of the called function.<sup><a href="#note94"><b>94)</b></a></sup>
4696 <p><!--para 11 -->
4697  Recursive function calls shall be permitted, both directly and indirectly through any chain
4698  of other functions.
4699 <p><!--para 12 -->
4700  EXAMPLE        In the function call
4701 <pre>
4702           (*pf[f1()]) (f2(), f3() + f4())
4703 </pre>
4704  the functions f1, f2, f3, and f4 may be called in any order. All side effects have to be completed before
4705  the function pointed to by pf[f1()] is called.
4706  
4707 <p><b> Forward references</b>: function declarators (including prototypes) (<a href="#6.7.6.3">6.7.6.3</a>), function
4708  definitions (<a href="#6.9.1">6.9.1</a>), the return statement (<a href="#6.8.6.4">6.8.6.4</a>), simple assignment (<a href="#6.5.16.1">6.5.16.1</a>).
4709
4710 <h6>footnotes</h6>
4711 <p><small><a name="note92" href="#note92">92)</a> Most often, this is the result of converting an identifier that is a function designator.
4712 </small>
4713 <p><small><a name="note93" href="#note93">93)</a> A function may change the values of its parameters, but these changes cannot affect the values of the
4714  arguments. On the other hand, it is possible to pass a pointer to an object, and the function may
4715  change the value of the object pointed to. A parameter declared to have array or function type is
4716  adjusted to have a pointer type as described in <a href="#6.9.1">6.9.1</a>.
4717 </small>
4718 <p><small><a name="note94" href="#note94">94)</a> In other words, function executions do not ''interleave'' with each other.
4719 </small>
4720
4721 <h5><a name="6.5.2.3" href="#6.5.2.3">6.5.2.3 Structure and union members</a></h5>
4722 <h6>Constraints</h6>
4723 <p><!--para 1 -->
4724  The first operand of the . operator shall have an atomic, qualified, or unqualified
4725  structure or union type, and the second operand shall name a member of that type.
4726 <p><!--para 2 -->
4727  The first operand of the -&gt; operator shall have type ''pointer to atomic, qualified, or
4728  unqualified structure'' or ''pointer to atomic, qualified, or unqualified union'', and the
4729  second operand shall name a member of the type pointed to.
4730 <h6>Semantics</h6>
4731 <p><!--para 3 -->
4732  A postfix expression followed by the . operator and an identifier designates a member of
4733  a structure or union object. The value is that of the named member,<sup><a href="#note95"><b>95)</b></a></sup> and is an lvalue if
4734  the first expression is an lvalue. If the first expression has qualified type, the result has
4735  the so-qualified version of the type of the designated member.
4736  
4737 <!--page 101 -->
4738 <p><!--para 4 -->
4739  A postfix expression followed by the -&gt; operator and an identifier designates a member
4740  of a structure or union object. The value is that of the named member of the object to
4741  which the first expression points, and is an lvalue.<sup><a href="#note96"><b>96)</b></a></sup> If the first expression is a pointer to
4742  a qualified type, the result has the so-qualified version of the type of the designated
4743  member.
4744 <p><!--para 5 -->
4745  Accessing a member of an atomic structure or union object results in undefined
4746  behavior.<sup><a href="#note97"><b>97)</b></a></sup>
4747 <p><!--para 6 -->
4748  One special guarantee is made in order to simplify the use of unions: if a union contains
4749  several structures that share a common initial sequence (see below), and if the union
4750  object currently contains one of these structures, it is permitted to inspect the common
4751  initial part of any of them anywhere that a declaration of the completed type of the union
4752  is visible. Two structures share a common initial sequence if corresponding members
4753  have compatible types (and, for bit-fields, the same widths) for a sequence of one or more
4754  initial members.
4755 <p><!--para 7 -->
4756  EXAMPLE 1 If f is a function returning a structure or union, and x is a member of that structure or
4757  union, f().x is a valid postfix expression but is not an lvalue.
4758  
4759 <p><!--para 8 -->
4760  EXAMPLE 2       In:
4761 <pre>
4762           struct s { int i; const int ci; };
4763           struct s s;
4764           const struct s cs;
4765           volatile struct s vs;
4766 </pre>
4767  the various members have the types:
4768 <pre>
4769           s.i          int
4770           s.ci         const int
4771           cs.i         const int
4772           cs.ci        const int
4773           vs.i         volatile int
4774           vs.ci        volatile const int
4775 </pre>
4776  
4777  
4778  
4779  
4780 <!--page 102 -->
4781 <p><!--para 9 -->
4782  EXAMPLE 3       The following is a valid fragment:
4783 <pre>
4784           union {
4785                   struct {
4786                         int      alltypes;
4787                   } n;
4788                   struct {
4789                         int      type;
4790                         int      intnode;
4791                   } ni;
4792                   struct {
4793                         int      type;
4794                         double doublenode;
4795                   } nf;
4796           } u;
4797           u.nf.type = 1;
4798           u.nf.doublenode = <a href="#3.14">3.14</a>;
4799           /* ... */
4800           if (u.n.alltypes == 1)
4801                   if (sin(u.nf.doublenode) == 0.0)
4802                         /* ... */
4803 </pre>
4804  The following is not a valid fragment (because the union type is not visible within function f):
4805 <pre>
4806           struct t1 { int m; };
4807           struct t2 { int m; };
4808           int f(struct t1 *p1, struct t2 *p2)
4809           {
4810                 if (p1-&gt;m &lt; 0)
4811                         p2-&gt;m = -p2-&gt;m;
4812                 return p1-&gt;m;
4813           }
4814           int g()
4815           {
4816                 union {
4817                         struct t1 s1;
4818                         struct t2 s2;
4819                 } u;
4820                 /* ... */
4821                 return f(&amp;u.s1, &amp;u.s2);
4822           }
4823 </pre>
4824  
4825 <p><b> Forward references</b>: address and indirection operators (<a href="#6.5.3.2">6.5.3.2</a>), structure and union
4826  specifiers (<a href="#6.7.2.1">6.7.2.1</a>).
4827 <!--page 103 -->
4828
4829 <h6>footnotes</h6>
4830 <p><small><a name="note95" href="#note95">95)</a> If the member used to read the contents of a union object is not the same as the member last used to
4831  store a value in the object, the appropriate part of the object representation of the value is reinterpreted
4832  as an object representation in the new type as described in <a href="#6.2.6">6.2.6</a> (a process sometimes called ''type
4833  punning''). This might be a trap representation.
4834 </small>
4835 <p><small><a name="note96" href="#note96">96)</a> If &amp;E is a valid pointer expression (where &amp; is the ''address-of '' operator, which generates a pointer to
4836  its operand), the expression (&amp;E)-&gt;MOS is the same as E.MOS.
4837 </small>
4838 <p><small><a name="note97" href="#note97">97)</a> For example, a data race would occur if access to the entire structure or union in one thread conflicts
4839  with access to a member from another thread, where at least one access is a modification. Members
4840  can be safely accessed using a non-atomic object which is assigned to or from the atomic object.
4841 </small>
4842
4843 <h5><a name="6.5.2.4" href="#6.5.2.4">6.5.2.4 Postfix increment and decrement operators</a></h5>
4844 <h6>Constraints</h6>
4845 <p><!--para 1 -->
4846  The operand of the postfix increment or decrement operator shall have atomic, qualified,
4847  or unqualified real or pointer type, and shall be a modifiable lvalue.
4848 <h6>Semantics</h6>
4849 <p><!--para 2 -->
4850  The result of the postfix ++ operator is the value of the operand. As a side effect, the
4851  value of the operand object is incremented (that is, the value 1 of the appropriate type is
4852  added to it). See the discussions of additive operators and compound assignment for
4853  information on constraints, types, and conversions and the effects of operations on
4854  pointers. The value computation of the result is sequenced before the side effect of
4855  updating the stored value of the operand. With respect to an indeterminately-sequenced
4856  function call, the operation of postfix ++ is a single evaluation. Postfix ++ on an object
4857  with atomic type is a read-modify-write operation with memory_order_seq_cst
4858  memory order semantics.<sup><a href="#note98"><b>98)</b></a></sup>
4859 <p><!--para 3 -->
4860  The postfix -- operator is analogous to the postfix ++ operator, except that the value of
4861  the operand is decremented (that is, the value 1 of the appropriate type is subtracted from
4862  it).
4863 <p><b> Forward references</b>: additive operators (<a href="#6.5.6">6.5.6</a>), compound assignment (<a href="#6.5.16.2">6.5.16.2</a>).
4864
4865 <h6>footnotes</h6>
4866 <p><small><a name="note98" href="#note98">98)</a> Where a pointer to an atomic object can be formed, this is equivalent to the following code sequence
4867  where T is the type of E:
4868
4869 <pre>
4870           T tmp;
4871           T result = E;
4872           do {
4873                  tmp = result + 1;
4874           } while (!atomic_compare_exchange_strong(&amp;E, &amp;result, tmp));
4875 </pre>
4876   with result being the result of the operation.
4877 </small>
4878
4879 <h5><a name="6.5.2.5" href="#6.5.2.5">6.5.2.5 Compound literals</a></h5>
4880 <h6>Constraints</h6>
4881 <p><!--para 1 -->
4882  The type name shall specify a complete object type or an array of unknown size, but not a
4883  variable length array type.
4884 <p><!--para 2 -->
4885  All the constraints for initializer lists in <a href="#6.7.9">6.7.9</a> also apply to compound literals.
4886 <h6>Semantics</h6>
4887 <p><!--para 3 -->
4888  A postfix expression that consists of a parenthesized type name followed by a brace-
4889  enclosed list of initializers is a compound literal. It provides an unnamed object whose
4890  value is given by the initializer list.<sup><a href="#note99"><b>99)</b></a></sup>
4891  
4892  
4893 <!--page 104 -->
4894 <p><!--para 4 -->
4895  If the type name specifies an array of unknown size, the size is determined by the
4896  initializer list as specified in <a href="#6.7.9">6.7.9</a>, and the type of the compound literal is that of the
4897  completed array type. Otherwise (when the type name specifies an object type), the type
4898  of the compound literal is that specified by the type name. In either case, the result is an
4899  lvalue.
4900 <p><!--para 5 -->
4901  The value of the compound literal is that of an unnamed object initialized by the
4902  initializer list. If the compound literal occurs outside the body of a function, the object
4903  has static storage duration; otherwise, it has automatic storage duration associated with
4904  the enclosing block.
4905 <p><!--para 6 -->
4906  All the semantic rules for initializer lists in <a href="#6.7.9">6.7.9</a> also apply to compound literals.<sup><a href="#note100"><b>100)</b></a></sup>
4907 <p><!--para 7 -->
4908  String literals, and compound literals with const-qualified types, need not designate
4909  distinct objects.<sup><a href="#note101"><b>101)</b></a></sup>
4910 <p><!--para 8 -->
4911  EXAMPLE 1       The file scope definition
4912 <pre>
4913           int *p = (int []){2, 4};
4914 </pre>
4915  initializes p to point to the first element of an array of two ints, the first having the value two and the
4916  second, four. The expressions in this compound literal are required to be constant. The unnamed object
4917  has static storage duration.
4918  
4919 <p><!--para 9 -->
4920  EXAMPLE 2       In contrast, in
4921 <pre>
4922           void f(void)
4923           {
4924                 int *p;
4925                 /*...*/
4926                 p = (int [2]){*p};
4927                 /*...*/
4928           }
4929 </pre>
4930  p is assigned the address of the first element of an array of two ints, the first having the value previously
4931  pointed to by p and the second, zero. The expressions in this compound literal need not be constant. The
4932  unnamed object has automatic storage duration.
4933  
4934 <p><!--para 10 -->
4935  EXAMPLE 3 Initializers with designations can be combined with compound literals. Structure objects
4936  created using compound literals can be passed to functions without depending on member order:
4937 <pre>
4938           drawline((struct point){.x=1, .y=1},
4939                 (struct point){.x=3, .y=4});
4940 </pre>
4941  Or, if drawline instead expected pointers to struct point:
4942  
4943  
4944  
4945 <!--page 105 -->
4946 <pre>
4947           drawline(&amp;(struct point){.x=1, .y=1},
4948                 &amp;(struct point){.x=3, .y=4});
4949 </pre>
4950  
4951 <p><!--para 11 -->
4952  EXAMPLE 4        A read-only compound literal can be specified through constructions like:
4953 <pre>
4954           (const float []){1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6}
4955 </pre>
4956  
4957 <p><!--para 12 -->
4958  EXAMPLE 5        The following three expressions have different meanings:
4959 <pre>
4960           "/tmp/fileXXXXXX"
4961           (char []){"/tmp/fileXXXXXX"}
4962           (const char []){"/tmp/fileXXXXXX"}
4963 </pre>
4964  The first always has static storage duration and has type array of char, but need not be modifiable; the last
4965  two have automatic storage duration when they occur within the body of a function, and the first of these
4966  two is modifiable.
4967  
4968 <p><!--para 13 -->
4969  EXAMPLE 6 Like string literals, const-qualified compound literals can be placed into read-only memory
4970  and can even be shared. For example,
4971 <pre>
4972           (const char []){"abc"} == "abc"
4973 </pre>
4974  might yield 1 if the literals' storage is shared.
4975  
4976 <p><!--para 14 -->
4977  EXAMPLE 7 Since compound literals are unnamed, a single compound literal cannot specify a circularly
4978  linked object. For example, there is no way to write a self-referential compound literal that could be used
4979  as the function argument in place of the named object endless_zeros below:
4980 <pre>
4981           struct int_list { int car; struct int_list *cdr; };
4982           struct int_list endless_zeros = {0, &amp;endless_zeros};
4983           eval(endless_zeros);
4984 </pre>
4985  
4986 <p><!--para 15 -->
4987  EXAMPLE 8        Each compound literal creates only a single object in a given scope:
4988 <pre>
4989           struct s { int i; };
4990           int f (void)
4991           {
4992                 struct s *p = 0, *q;
4993                 int j = 0;
4994           again:
4995                     q = p, p = &amp;((struct s){ j++ });
4996                     if (j &lt; 2) goto again;
4997                     return p == q &amp;&amp; q-&gt;i == 1;
4998           }
4999 </pre>
5000  The function f() always returns the value 1.
5001 <p><!--para 16 -->
5002  Note that if an iteration statement were used instead of an explicit goto and a labeled statement, the
5003  lifetime of the unnamed object would be the body of the loop only, and on entry next time around p would
5004  have an indeterminate value, which would result in undefined behavior.
5005  
5006 <p><b> Forward references</b>: type names (<a href="#6.7.7">6.7.7</a>), initialization (<a href="#6.7.9">6.7.9</a>).
5007 <!--page 106 -->
5008
5009 <h6>footnotes</h6>
5010 <p><small><a name="note99" href="#note99">99)</a> Note that this differs from a cast expression. For example, a cast specifies a conversion to scalar types
5011  or void only, and the result of a cast expression is not an lvalue.
5012 </small>
5013 <p><small><a name="note100" href="#note100">100)</a> For example, subobjects without explicit initializers are initialized to zero.
5014 </small>
5015 <p><small><a name="note101" href="#note101">101)</a> This allows implementations to share storage for string literals and constant compound literals with
5016  the same or overlapping representations.
5017 </small>
5018
5019 <h4><a name="6.5.3" href="#6.5.3">6.5.3 Unary operators</a></h4>
5020 <h6>Syntax</h6>
5021 <p><!--para 1 -->
5022 <pre>
5023           unary-expression:
5024                  postfix-expression
5025                  ++ unary-expression
5026                  -- unary-expression
5027                  unary-operator cast-expression
5028                  sizeof unary-expression
5029                  sizeof ( type-name )
5030                  alignof ( type-name )
5031           unary-operator: one of
5032                  &amp; * + - ~             !
5033 </pre>
5034
5035 <h5><a name="6.5.3.1" href="#6.5.3.1">6.5.3.1 Prefix increment and decrement operators</a></h5>
5036 <h6>Constraints</h6>
5037 <p><!--para 1 -->
5038  The operand of the prefix increment or decrement operator shall have atomic, qualified,
5039  or unqualified real or pointer type, and shall be a modifiable lvalue.
5040 <h6>Semantics</h6>
5041 <p><!--para 2 -->
5042  The value of the operand of the prefix ++ operator is incremented. The result is the new
5043  value of the operand after incrementation. The expression ++E is equivalent to (E+=1).
5044  See the discussions of additive operators and compound assignment for information on
5045  constraints, types, side effects, and conversions and the effects of operations on pointers.
5046 <p><!--para 3 -->
5047  The prefix -- operator is analogous to the prefix ++ operator, except that the value of the
5048  operand is decremented.
5049 <p><b> Forward references</b>: additive operators (<a href="#6.5.6">6.5.6</a>), compound assignment (<a href="#6.5.16.2">6.5.16.2</a>).
5050
5051 <h5><a name="6.5.3.2" href="#6.5.3.2">6.5.3.2 Address and indirection operators</a></h5>
5052 <h6>Constraints</h6>
5053 <p><!--para 1 -->
5054  The operand of the unary &amp; operator shall be either a function designator, the result of a
5055  [] or unary * operator, or an lvalue that designates an object that is not a bit-field and is
5056  not declared with the register storage-class specifier.
5057 <p><!--para 2 -->
5058  The operand of the unary * operator shall have pointer type.
5059 <h6>Semantics</h6>
5060 <p><!--para 3 -->
5061  The unary &amp; operator yields the address of its operand. If the operand has type ''type'',
5062  the result has type ''pointer to type''. If the operand is the result of a unary * operator,
5063  neither that operator nor the &amp; operator is evaluated and the result is as if both were
5064  omitted, except that the constraints on the operators still apply and the result is not an
5065 <!--page 107 -->
5066  lvalue. Similarly, if the operand is the result of a [] operator, neither the &amp; operator nor
5067  the unary * that is implied by the [] is evaluated and the result is as if the &amp; operator
5068  were removed and the [] operator were changed to a + operator. Otherwise, the result is
5069  a pointer to the object or function designated by its operand.
5070 <p><!--para 4 -->
5071  The unary * operator denotes indirection. If the operand points to a function, the result is
5072  a function designator; if it points to an object, the result is an lvalue designating the
5073  object. If the operand has type ''pointer to type'', the result has type ''type''. If an
5074  invalid value has been assigned to the pointer, the behavior of the unary * operator is
5075  undefined.<sup><a href="#note102"><b>102)</b></a></sup>
5076 <p><b> Forward references</b>: storage-class specifiers (<a href="#6.7.1">6.7.1</a>), structure and union specifiers
5077  (<a href="#6.7.2.1">6.7.2.1</a>).
5078
5079 <h6>footnotes</h6>
5080 <p><small><a name="note102" href="#note102">102)</a> Thus, &amp;*E is equivalent to E (even if E is a null pointer), and &amp;(E1[E2]) to ((E1)+(E2)). It is
5081  always true that if E is a function designator or an lvalue that is a valid operand of the unary &amp;
5082  operator, *&amp;E is a function designator or an lvalue equal to E. If *P is an lvalue and T is the name of
5083  an object pointer type, *(T)P is an lvalue that has a type compatible with that to which T points.
5084  Among the invalid values for dereferencing a pointer by the unary * operator are a null pointer, an
5085  address inappropriately aligned for the type of object pointed to, and the address of an object after the
5086  end of its lifetime.
5087 </small>
5088
5089 <h5><a name="6.5.3.3" href="#6.5.3.3">6.5.3.3 Unary arithmetic operators</a></h5>
5090 <h6>Constraints</h6>
5091 <p><!--para 1 -->
5092  The operand of the unary + or - operator shall have arithmetic type; of the ~ operator,
5093  integer type; of the ! operator, scalar type.
5094 <h6>Semantics</h6>
5095 <p><!--para 2 -->
5096  The result of the unary + operator is the value of its (promoted) operand. The integer
5097  promotions are performed on the operand, and the result has the promoted type.
5098 <p><!--para 3 -->
5099  The result of the unary - operator is the negative of its (promoted) operand. The integer
5100  promotions are performed on the operand, and the result has the promoted type.
5101 <p><!--para 4 -->
5102  The result of the ~ operator is the bitwise complement of its (promoted) operand (that is,
5103  each bit in the result is set if and only if the corresponding bit in the converted operand is
5104  not set). The integer promotions are performed on the operand, and the result has the
5105  promoted type. If the promoted type is an unsigned type, the expression ~E is equivalent
5106  to the maximum value representable in that type minus E.
5107 <p><!--para 5 -->
5108  The result of the logical negation operator ! is 0 if the value of its operand compares
5109  unequal to 0, 1 if the value of its operand compares equal to 0. The result has type int.
5110  The expression !E is equivalent to (0==E).
5111  
5112  
5113  
5114 <!--page 108 -->
5115
5116 <h5><a name="6.5.3.4" href="#6.5.3.4">6.5.3.4 The sizeof and alignof operators</a></h5>
5117 <h6>Constraints</h6>
5118 <p><!--para 1 -->
5119  The sizeof operator shall not be applied to an expression that has function type or an
5120  incomplete type, to the parenthesized name of such a type, or to an expression that
5121  designates a bit-field member. The alignof operator shall not be applied to a function
5122  type or an incomplete type.
5123 <h6>Semantics</h6>
5124 <p><!--para 2 -->
5125  The sizeof operator yields the size (in bytes) of its operand, which may be an
5126  expression or the parenthesized name of a type. The size is determined from the type of
5127  the operand. The result is an integer. If the type of the operand is a variable length array
5128  type, the operand is evaluated; otherwise, the operand is not evaluated and the result is an
5129  integer constant.
5130 <p><!--para 3 -->
5131  The alignof operator yields the alignment requirement of its operand type. The result
5132  is an integer constant. When applied to an array type, the result is the alignment
5133  requirement of the element type.
5134 <p><!--para 4 -->
5135  When sizeof is applied to an operand that has type char, unsigned char, or
5136  signed char, (or a qualified version thereof) the result is 1. When applied to an
5137  operand that has array type, the result is the total number of bytes in the array.<sup><a href="#note103"><b>103)</b></a></sup> When
5138  applied to an operand that has structure or union type, the result is the total number of
5139  bytes in such an object, including internal and trailing padding.
5140 <p><!--para 5 -->
5141  The value of the result of both operators is implementation-defined, and its type (an
5142  unsigned integer type) is size_t, defined in <a href="#7.19">&lt;stddef.h&gt;</a> (and other headers).
5143 <p><!--para 6 -->
5144  EXAMPLE 1 A principal use of the sizeof operator is in communication with routines such as storage
5145  allocators and I/O systems. A storage-allocation function might accept a size (in bytes) of an object to
5146  allocate and return a pointer to void. For example:
5147 <pre>
5148          extern void *alloc(size_t);
5149          double *dp = alloc(sizeof *dp);
5150 </pre>
5151  The implementation of the alloc function should ensure that its return value is aligned suitably for
5152  conversion to a pointer to double.
5153  
5154 <p><!--para 7 -->
5155  EXAMPLE 2      Another use of the sizeof operator is to compute the number of elements in an array:
5156 <pre>
5157          sizeof array / sizeof array[0]
5158 </pre>
5159  
5160 <p><!--para 8 -->
5161  EXAMPLE 3      In this example, the size of a variable length array is computed and returned from a
5162  function:
5163 <pre>
5164          #include <a href="#7.19">&lt;stddef.h&gt;</a>
5165 </pre>
5166  
5167  
5168  
5169 <!--page 109 -->
5170 <pre>
5171           size_t fsize3(int n)
5172           {
5173                 char b[n+3];                  // variable length array
5174                 return sizeof b;              // execution time sizeof
5175           }
5176           int main()
5177           {
5178                 size_t size;
5179                 size = fsize3(10); // fsize3 returns 13
5180                 return 0;
5181           }
5182 </pre>
5183  
5184 <p><b> Forward references</b>: common definitions <a href="#7.19">&lt;stddef.h&gt;</a> (<a href="#7.19">7.19</a>), declarations (<a href="#6.7">6.7</a>),
5185  structure and union specifiers (<a href="#6.7.2.1">6.7.2.1</a>), type names (<a href="#6.7.7">6.7.7</a>), array declarators (<a href="#6.7.6.2">6.7.6.2</a>).
5186
5187 <h6>footnotes</h6>
5188 <p><small><a name="note103" href="#note103">103)</a> When applied to a parameter declared to have array or function type, the sizeof operator yields the
5189  size of the adjusted (pointer) type (see <a href="#6.9.1">6.9.1</a>).
5190 </small>
5191
5192 <h4><a name="6.5.4" href="#6.5.4">6.5.4 Cast operators</a></h4>
5193 <h6>Syntax</h6>
5194 <p><!--para 1 -->
5195 <pre>
5196           cast-expression:
5197                  unary-expression
5198                  ( type-name ) cast-expression
5199 </pre>
5200 <h6>Constraints</h6>
5201 <p><!--para 2 -->
5202  Unless the type name specifies a void type, the type name shall specify atomic, qualified,
5203  or unqualified scalar type, and the operand shall have scalar type.
5204 <p><!--para 3 -->
5205  Conversions that involve pointers, other than where permitted by the constraints of
5206  <a href="#6.5.16.1">6.5.16.1</a>, shall be specified by means of an explicit cast.
5207 <p><!--para 4 -->
5208  A pointer type shall not be converted to any floating type. A floating type shall not be
5209  converted to any pointer type.
5210 <h6>Semantics</h6>
5211 <p><!--para 5 -->
5212  Preceding an expression by a parenthesized type name converts the value of the
5213  expression to the named type. This construction is called a cast.<sup><a href="#note104"><b>104)</b></a></sup> A cast that specifies
5214  no conversion has no effect on the type or value of an expression.
5215 <p><!--para 6 -->
5216  If the value of the expression is represented with greater precision or range than required
5217  by the type named by the cast (<a href="#6.3.1.8">6.3.1.8</a>), then the cast specifies a conversion even if the
5218  type of the expression is the same as the named type and removes any extra range and
5219  precision.
5220 <p><b> Forward references</b>: equality operators (<a href="#6.5.9">6.5.9</a>), function declarators (including
5221  prototypes) (<a href="#6.7.6.3">6.7.6.3</a>), simple assignment (<a href="#6.5.16.1">6.5.16.1</a>), type names (<a href="#6.7.7">6.7.7</a>).
5222  
5223 <!--page 110 -->
5224
5225 <h6>footnotes</h6>
5226 <p><small><a name="note104" href="#note104">104)</a> A cast does not yield an lvalue. Thus, a cast to a qualified type has the same effect as a cast to the
5227  unqualified version of the type.
5228 </small>
5229
5230 <h4><a name="6.5.5" href="#6.5.5">6.5.5 Multiplicative operators</a></h4>
5231 <h6>Syntax</h6>
5232 <p><!--para 1 -->
5233 <pre>
5234           multiplicative-expression:
5235                   cast-expression
5236                   multiplicative-expression * cast-expression
5237                   multiplicative-expression / cast-expression
5238                   multiplicative-expression % cast-expression
5239 </pre>
5240 <h6>Constraints</h6>
5241 <p><!--para 2 -->
5242  Each of the operands shall have arithmetic type. The operands of the % operator shall
5243  have integer type.
5244 <h6>Semantics</h6>
5245 <p><!--para 3 -->
5246  The usual arithmetic conversions are performed on the operands.
5247 <p><!--para 4 -->
5248  The result of the binary * operator is the product of the operands.
5249 <p><!--para 5 -->
5250  The result of the / operator is the quotient from the division of the first operand by the
5251  second; the result of the % operator is the remainder. In both operations, if the value of
5252  the second operand is zero, the behavior is undefined.
5253 <p><!--para 6 -->
5254  When integers are divided, the result of the / operator is the algebraic quotient with any
5255  fractional part discarded.<sup><a href="#note105"><b>105)</b></a></sup> If the quotient a/b is representable, the expression
5256  (a/b)*b + a%b shall equal a; otherwise, the behavior of both a/b and a%b is
5257  undefined.
5258
5259 <h6>footnotes</h6>
5260 <p><small><a name="note105" href="#note105">105)</a> This is often called ''truncation toward zero''.
5261 </small>
5262
5263 <h4><a name="6.5.6" href="#6.5.6">6.5.6 Additive operators</a></h4>
5264 <h6>Syntax</h6>
5265 <p><!--para 1 -->
5266 <pre>
5267           additive-expression:
5268                  multiplicative-expression
5269                  additive-expression + multiplicative-expression
5270                  additive-expression - multiplicative-expression
5271 </pre>
5272 <h6>Constraints</h6>
5273 <p><!--para 2 -->
5274  For addition, either both operands shall have arithmetic type, or one operand shall be a
5275  pointer to a complete object type and the other shall have integer type. (Incrementing is
5276  equivalent to adding 1.)
5277 <p><!--para 3 -->
5278  For subtraction, one of the following shall hold:
5279  
5280  
5281  
5282  
5283 <!--page 111 -->
5284 <ul>
5285 <li>  both operands have arithmetic type;
5286 <li>  both operands are pointers to qualified or unqualified versions of compatible complete
5287  object types; or
5288 <li>  the left operand is a pointer to a complete object type and the right operand has
5289  integer type.
5290 </ul>
5291  (Decrementing is equivalent to subtracting 1.)
5292 <h6>Semantics</h6>
5293 <p><!--para 4 -->
5294  If both operands have arithmetic type, the usual arithmetic conversions are performed on
5295  them.
5296 <p><!--para 5 -->
5297  The result of the binary + operator is the sum of the operands.
5298 <p><!--para 6 -->
5299  The result of the binary - operator is the difference resulting from the subtraction of the
5300  second operand from the first.
5301 <p><!--para 7 -->
5302  For the purposes of these operators, a pointer to an object that is not an element of an
5303  array behaves the same as a pointer to the first element of an array of length one with the
5304  type of the object as its element type.
5305 <p><!--para 8 -->
5306  When an expression that has integer type is added to or subtracted from a pointer, the
5307  result has the type of the pointer operand. If the pointer operand points to an element of
5308  an array object, and the array is large enough, the result points to an element offset from
5309  the original element such that the difference of the subscripts of the resulting and original
5310  array elements equals the integer expression. In other words, if the expression P points to
5311  the i-th element of an array object, the expressions (P)+N (equivalently, N+(P)) and
5312  (P)-N (where N has the value n) point to, respectively, the i+n-th and i-n-th elements of
5313  the array object, provided they exist. Moreover, if the expression P points to the last
5314  element of an array object, the expression (P)+1 points one past the last element of the
5315  array object, and if the expression Q points one past the last element of an array object,
5316  the expression (Q)-1 points to the last element of the array object. If both the pointer
5317  operand and the result point to elements of the same array object, or one past the last
5318  element of the array object, the evaluation shall not produce an overflow; otherwise, the
5319  behavior is undefined. If the result points one past the last element of the array object, it
5320  shall not be used as the operand of a unary * operator that is evaluated.
5321 <p><!--para 9 -->
5322  When two pointers are subtracted, both shall point to elements of the same array object,
5323  or one past the last element of the array object; the result is the difference of the
5324  subscripts of the two array elements. The size of the result is implementation-defined,
5325  and its type (a signed integer type) is ptrdiff_t defined in the <a href="#7.19">&lt;stddef.h&gt;</a> header.
5326  If the result is not representable in an object of that type, the behavior is undefined. In
5327  other words, if the expressions P and Q point to, respectively, the i-th and j-th elements of
5328  an array object, the expression (P)-(Q) has the value i-j provided the value fits in an
5329 <!--page 112 -->
5330  object of type ptrdiff_t. Moreover, if the expression P points either to an element of
5331  an array object or one past the last element of an array object, and the expression Q points
5332  to the last element of the same array object, the expression ((Q)+1)-(P) has the same
5333  value as ((Q)-(P))+1 and as -((P)-((Q)+1)), and has the value zero if the
5334  expression P points one past the last element of the array object, even though the
5335  expression (Q)+1 does not point to an element of the array object.<sup><a href="#note106"><b>106)</b></a></sup>
5336 <p><!--para 10 -->
5337  EXAMPLE        Pointer arithmetic is well defined with pointers to variable length array types.
5338 <pre>
5339           {
5340                    int n = 4, m = 3;
5341                    int a[n][m];
5342                    int (*p)[m] = a;            //   p == &amp;a[0]
5343                    p += 1;                     //   p == &amp;a[1]
5344                    (*p)[2] = 99;               //   a[1][2] == 99
5345                    n = p - a;                  //   n == 1
5346           }
5347 </pre>
5348 <p><!--para 11 -->
5349  If array a in the above example were declared to be an array of known constant size, and pointer p were
5350  declared to be a pointer to an array of the same known constant size (pointing to a), the results would be
5351  the same.
5352  
5353 <p><b> Forward references</b>: array declarators (<a href="#6.7.6.2">6.7.6.2</a>), common definitions <a href="#7.19">&lt;stddef.h&gt;</a>
5354  (<a href="#7.19">7.19</a>).
5355
5356 <h6>footnotes</h6>
5357 <p><small><a name="note106" href="#note106">106)</a> Another way to approach pointer arithmetic is first to convert the pointer(s) to character pointer(s): In
5358  this scheme the integer expression added to or subtracted from the converted pointer is first multiplied
5359  by the size of the object originally pointed to, and the resulting pointer is converted back to the
5360  original type. For pointer subtraction, the result of the difference between the character pointers is
5361  similarly divided by the size of the object originally pointed to.
5362  When viewed in this way, an implementation need only provide one extra byte (which may overlap
5363  another object in the program) just after the end of the object in order to satisfy the ''one past the last
5364  element'' requirements.
5365 </small>
5366
5367 <h4><a name="6.5.7" href="#6.5.7">6.5.7 Bitwise shift operators</a></h4>
5368 <h6>Syntax</h6>
5369 <p><!--para 1 -->
5370 <pre>
5371           shift-expression:
5372                   additive-expression
5373                   shift-expression &lt;&lt; additive-expression
5374                   shift-expression &gt;&gt; additive-expression
5375 </pre>
5376 <h6>Constraints</h6>
5377 <p><!--para 2 -->
5378  Each of the operands shall have integer type.
5379 <h6>Semantics</h6>
5380 <p><!--para 3 -->
5381  The integer promotions are performed on each of the operands. The type of the result is
5382  that of the promoted left operand. If the value of the right operand is negative or is
5383  
5384 <!--page 113 -->
5385  greater than or equal to the width of the promoted left operand, the behavior is undefined.
5386 <p><!--para 4 -->
5387  The result of E1 &lt;&lt; E2 is E1 left-shifted E2 bit positions; vacated bits are filled with
5388  zeros. If E1 has an unsigned type, the value of the result is E1 x 2E2 , reduced modulo
5389  one more than the maximum value representable in the result type. If E1 has a signed
5390  type and nonnegative value, and E1 x 2E2 is representable in the result type, then that is
5391  the resulting value; otherwise, the behavior is undefined.
5392 <p><!--para 5 -->
5393  The result of E1 &gt;&gt; E2 is E1 right-shifted E2 bit positions. If E1 has an unsigned type
5394  or if E1 has a signed type and a nonnegative value, the value of the result is the integral
5395  part of the quotient of E1 / 2E2 . If E1 has a signed type and a negative value, the
5396  resulting value is implementation-defined.
5397
5398 <h4><a name="6.5.8" href="#6.5.8">6.5.8 Relational operators</a></h4>
5399 <h6>Syntax</h6>
5400 <p><!--para 1 -->
5401 <pre>
5402           relational-expression:
5403                   shift-expression
5404                   relational-expression   &lt;    shift-expression
5405                   relational-expression   &gt;    shift-expression
5406                   relational-expression   &lt;=   shift-expression
5407                   relational-expression   &gt;=   shift-expression
5408 </pre>
5409 <h6>Constraints</h6>
5410 <p><!--para 2 -->
5411  One of the following shall hold:
5412 <ul>
5413 <li>  both operands have real type; or                                                            *
5414 <li>  both operands are pointers to qualified or unqualified versions of compatible object
5415  types.
5416 </ul>
5417 <h6>Semantics</h6>
5418 <p><!--para 3 -->
5419  If both of the operands have arithmetic type, the usual arithmetic conversions are
5420  performed.
5421 <p><!--para 4 -->
5422  For the purposes of these operators, a pointer to an object that is not an element of an
5423  array behaves the same as a pointer to the first element of an array of length one with the
5424  type of the object as its element type.
5425 <p><!--para 5 -->
5426  When two pointers are compared, the result depends on the relative locations in the
5427  address space of the objects pointed to. If two pointers to object types both point to the
5428  same object, or both point one past the last element of the same array object, they
5429  compare equal. If the objects pointed to are members of the same aggregate object,
5430  pointers to structure members declared later compare greater than pointers to members
5431  declared earlier in the structure, and pointers to array elements with larger subscript
5432  values compare greater than pointers to elements of the same array with lower subscript
5433 <!--page 114 -->
5434  values. All pointers to members of the same union object compare equal. If the
5435  expression P points to an element of an array object and the expression Q points to the
5436  last element of the same array object, the pointer expression Q+1 compares greater than
5437  P. In all other cases, the behavior is undefined.
5438 <p><!--para 6 -->
5439  Each of the operators &lt; (less than), &gt; (greater than), &lt;= (less than or equal to), and &gt;=
5440  (greater than or equal to) shall yield 1 if the specified relation is true and 0 if it is
5441  false.<sup><a href="#note107"><b>107)</b></a></sup> The result has type int.
5442
5443 <h6>footnotes</h6>
5444 <p><small><a name="note107" href="#note107">107)</a> The expression a&lt;b&lt;c is not interpreted as in ordinary mathematics. As the syntax indicates, it
5445  means (a&lt;b)&lt;c; in other words, ''if a is less than b, compare 1 to c; otherwise, compare 0 to c''.
5446 </small>
5447
5448 <h4><a name="6.5.9" href="#6.5.9">6.5.9 Equality operators</a></h4>
5449 <h6>Syntax</h6>
5450 <p><!--para 1 -->
5451 <pre>
5452           equality-expression:
5453                  relational-expression
5454                  equality-expression == relational-expression
5455                  equality-expression != relational-expression
5456 </pre>
5457 <h6>Constraints</h6>
5458 <p><!--para 2 -->
5459  One of the following shall hold:
5460 <ul>
5461 <li>  both operands have arithmetic type;
5462 <li>  both operands are pointers to qualified or unqualified versions of compatible types;
5463 <li>  one operand is a pointer to an object type and the other is a pointer to a qualified or
5464  unqualified version of void; or
5465 <li>  one operand is a pointer and the other is a null pointer constant.
5466 </ul>
5467 <h6>Semantics</h6>
5468 <p><!--para 3 -->
5469  The == (equal to) and != (not equal to) operators are analogous to the relational
5470  operators except for their lower precedence.<sup><a href="#note108"><b>108)</b></a></sup> Each of the operators yields 1 if the
5471  specified relation is true and 0 if it is false. The result has type int. For any pair of
5472  operands, exactly one of the relations is true.
5473 <p><!--para 4 -->
5474  If both of the operands have arithmetic type, the usual arithmetic conversions are
5475  performed. Values of complex types are equal if and only if both their real parts are equal
5476  and also their imaginary parts are equal. Any two values of arithmetic types from
5477  different type domains are equal if and only if the results of their conversions to the
5478  (complex) result type determined by the usual arithmetic conversions are equal.
5479  
5480  
5481  
5482 <!--page 115 -->
5483 <p><!--para 5 -->
5484  Otherwise, at least one operand is a pointer. If one operand is a pointer and the other is a
5485  null pointer constant, the null pointer constant is converted to the type of the pointer. If
5486  one operand is a pointer to an object type and the other is a pointer to a qualified or
5487  unqualified version of void, the former is converted to the type of the latter.
5488 <p><!--para 6 -->
5489  Two pointers compare equal if and only if both are null pointers, both are pointers to the
5490  same object (including a pointer to an object and a subobject at its beginning) or function,
5491  both are pointers to one past the last element of the same array object, or one is a pointer
5492  to one past the end of one array object and the other is a pointer to the start of a different
5493  array object that happens to immediately follow the first array object in the address
5494  space.<sup><a href="#note109"><b>109)</b></a></sup>
5495 <p><!--para 7 -->
5496  For the purposes of these operators, a pointer to an object that is not an element of an
5497  array behaves the same as a pointer to the first element of an array of length one with the
5498  type of the object as its element type.
5499
5500 <h6>footnotes</h6>
5501 <p><small><a name="note108" href="#note108">108)</a> Because of the precedences, a&lt;b == c&lt;d is 1 whenever a&lt;b and c&lt;d have the same truth-value.
5502 </small>
5503 <p><small><a name="note109" href="#note109">109)</a> Two objects may be adjacent in memory because they are adjacent elements of a larger array or
5504  adjacent members of a structure with no padding between them, or because the implementation chose
5505  to place them so, even though they are unrelated. If prior invalid pointer operations (such as accesses
5506  outside array bounds) produced undefined behavior, subsequent comparisons also produce undefined
5507  behavior.
5508 </small>
5509
5510 <h4><a name="6.5.10" href="#6.5.10">6.5.10 Bitwise AND operator</a></h4>
5511 <h6>Syntax</h6>
5512 <p><!--para 1 -->
5513 <pre>
5514           AND-expression:
5515                 equality-expression
5516                 AND-expression &amp; equality-expression
5517 </pre>
5518 <h6>Constraints</h6>
5519 <p><!--para 2 -->
5520  Each of the operands shall have integer type.
5521 <h6>Semantics</h6>
5522 <p><!--para 3 -->
5523  The usual arithmetic conversions are performed on the operands.
5524 <p><!--para 4 -->
5525  The result of the binary &amp; operator is the bitwise AND of the operands (that is, each bit in
5526  the result is set if and only if each of the corresponding bits in the converted operands is
5527  set).
5528  
5529  
5530  
5531  
5532 <!--page 116 -->
5533
5534 <h4><a name="6.5.11" href="#6.5.11">6.5.11 Bitwise exclusive OR operator</a></h4>
5535 <h6>Syntax</h6>
5536 <p><!--para 1 -->
5537 <pre>
5538           exclusive-OR-expression:
5539                   AND-expression
5540                   exclusive-OR-expression ^ AND-expression
5541 </pre>
5542 <h6>Constraints</h6>
5543 <p><!--para 2 -->
5544  Each of the operands shall have integer type.
5545 <h6>Semantics</h6>
5546 <p><!--para 3 -->
5547  The usual arithmetic conversions are performed on the operands.
5548 <p><!--para 4 -->
5549  The result of the ^ operator is the bitwise exclusive OR of the operands (that is, each bit
5550  in the result is set if and only if exactly one of the corresponding bits in the converted
5551  operands is set).
5552
5553 <h4><a name="6.5.12" href="#6.5.12">6.5.12 Bitwise inclusive OR operator</a></h4>
5554 <h6>Syntax</h6>
5555 <p><!--para 1 -->
5556 <pre>
5557           inclusive-OR-expression:
5558                   exclusive-OR-expression
5559                   inclusive-OR-expression | exclusive-OR-expression
5560 </pre>
5561 <h6>Constraints</h6>
5562 <p><!--para 2 -->
5563  Each of the operands shall have integer type.
5564 <h6>Semantics</h6>
5565 <p><!--para 3 -->
5566  The usual arithmetic conversions are performed on the operands.
5567 <p><!--para 4 -->
5568  The result of the | operator is the bitwise inclusive OR of the operands (that is, each bit in
5569  the result is set if and only if at least one of the corresponding bits in the converted
5570  operands is set).
5571 <!--page 117 -->
5572
5573 <h4><a name="6.5.13" href="#6.5.13">6.5.13 Logical AND operator</a></h4>
5574 <h6>Syntax</h6>
5575 <p><!--para 1 -->
5576 <pre>
5577           logical-AND-expression:
5578                   inclusive-OR-expression
5579                   logical-AND-expression &amp;&amp; inclusive-OR-expression
5580 </pre>
5581 <h6>Constraints</h6>
5582 <p><!--para 2 -->
5583  Each of the operands shall have scalar type.
5584 <h6>Semantics</h6>
5585 <p><!--para 3 -->
5586  The &amp;&amp; operator shall yield 1 if both of its operands compare unequal to 0; otherwise, it
5587  yields 0. The result has type int.
5588 <p><!--para 4 -->
5589  Unlike the bitwise binary &amp; operator, the &amp;&amp; operator guarantees left-to-right evaluation;
5590  if the second operand is evaluated, there is a sequence point between the evaluations of
5591  the first and second operands. If the first operand compares equal to 0, the second
5592  operand is not evaluated.
5593
5594 <h4><a name="6.5.14" href="#6.5.14">6.5.14 Logical OR operator</a></h4>
5595 <h6>Syntax</h6>
5596 <p><!--para 1 -->
5597 <pre>
5598           logical-OR-expression:
5599                   logical-AND-expression
5600                   logical-OR-expression || logical-AND-expression
5601 </pre>
5602 <h6>Constraints</h6>
5603 <p><!--para 2 -->
5604  Each of the operands shall have scalar type.
5605 <h6>Semantics</h6>
5606 <p><!--para 3 -->
5607  The || operator shall yield 1 if either of its operands compare unequal to 0; otherwise, it
5608  yields 0. The result has type int.
5609 <p><!--para 4 -->
5610  Unlike the bitwise | operator, the || operator guarantees left-to-right evaluation; if the
5611  second operand is evaluated, there is a sequence point between the evaluations of the first
5612  and second operands. If the first operand compares unequal to 0, the second operand is
5613  not evaluated.
5614 <!--page 118 -->
5615
5616 <h4><a name="6.5.15" href="#6.5.15">6.5.15 Conditional operator</a></h4>
5617 <h6>Syntax</h6>
5618 <p><!--para 1 -->
5619 <pre>
5620           conditional-expression:
5621                  logical-OR-expression
5622                  logical-OR-expression ? expression : conditional-expression
5623 </pre>
5624 <h6>Constraints</h6>
5625 <p><!--para 2 -->
5626  The first operand shall have scalar type.
5627 <p><!--para 3 -->
5628  One of the following shall hold for the second and third operands:
5629 <ul>
5630 <li>  both operands have arithmetic type;
5631 <li>  both operands have the same structure or union type;
5632 <li>  both operands have void type;
5633 <li>  both operands are pointers to qualified or unqualified versions of compatible types;
5634 <li>  one operand is a pointer and the other is a null pointer constant; or
5635 <li>  one operand is a pointer to an object type and the other is a pointer to a qualified or
5636  unqualified version of void.
5637 </ul>
5638 <h6>Semantics</h6>
5639 <p><!--para 4 -->
5640  The first operand is evaluated; there is a sequence point between its evaluation and the
5641  evaluation of the second or third operand (whichever is evaluated). The second operand
5642  is evaluated only if the first compares unequal to 0; the third operand is evaluated only if
5643  the first compares equal to 0; the result is the value of the second or third operand
5644  (whichever is evaluated), converted to the type described below.<sup><a href="#note110"><b>110)</b></a></sup>                        *
5645 <p><!--para 5 -->
5646  If both the second and third operands have arithmetic type, the result type that would be
5647  determined by the usual arithmetic conversions, were they applied to those two operands,
5648  is the type of the result. If both the operands have structure or union type, the result has
5649  that type. If both operands have void type, the result has void type.
5650 <p><!--para 6 -->
5651  If both the second and third operands are pointers or one is a null pointer constant and the
5652  other is a pointer, the result type is a pointer to a type qualified with all the type qualifiers
5653  of the types referenced by both operands. Furthermore, if both operands are pointers to
5654  compatible types or to differently qualified versions of compatible types, the result type is
5655  a pointer to an appropriately qualified version of the composite type; if one operand is a
5656  null pointer constant, the result has the type of the other operand; otherwise, one operand
5657  is a pointer to void or a qualified version of void, in which case the result type is a
5658  pointer to an appropriately qualified version of void.
5659  
5660 <!--page 119 -->
5661 <p><!--para 7 -->
5662  EXAMPLE The common type that results when the second and third operands are pointers is determined
5663  in two independent stages. The appropriate qualifiers, for example, do not depend on whether the two
5664  pointers have compatible types.
5665 <p><!--para 8 -->
5666  Given the declarations
5667 <pre>
5668            const void *c_vp;
5669            void *vp;
5670            const int *c_ip;
5671            volatile int *v_ip;
5672            int *ip;
5673            const char *c_cp;
5674 </pre>
5675  the third column in the following table is the common type that is the result of a conditional expression in
5676  which the first two columns are the second and third operands (in either order):
5677 <pre>
5678            c_vp    c_ip      const void *
5679            v_ip    0         volatile int *
5680            c_ip    v_ip      const volatile int *
5681            vp      c_cp      const void *
5682            ip      c_ip      const int *
5683            vp      ip        void *
5684 </pre>
5685  
5686
5687 <h6>footnotes</h6>
5688 <p><small><a name="note110" href="#note110">110)</a> A conditional expression does not yield an lvalue.
5689 </small>
5690
5691 <h4><a name="6.5.16" href="#6.5.16">6.5.16 Assignment operators</a></h4>
5692 <h6>Syntax</h6>
5693 <p><!--para 1 -->
5694 <pre>
5695           assignment-expression:
5696                  conditional-expression
5697                  unary-expression assignment-operator assignment-expression
5698           assignment-operator: one of
5699                  = *= /= %= +=                       -=     &lt;&lt;=      &gt;&gt;=      &amp;=     ^=     |=
5700 </pre>
5701 <h6>Constraints</h6>
5702 <p><!--para 2 -->
5703  An assignment operator shall have a modifiable lvalue as its left operand.
5704 <h6>Semantics</h6>
5705 <p><!--para 3 -->
5706  An assignment operator stores a value in the object designated by the left operand. An
5707  assignment expression has the value of the left operand after the assignment,<sup><a href="#note111"><b>111)</b></a></sup> but is not
5708  an lvalue. The type of an assignment expression is the type the left operand would have
5709  after lvalue conversion. The side effect of updating the stored value of the left operand is
5710  sequenced after the value computations of the left and right operands. The evaluations of
5711  the operands are unsequenced.
5712  
5713  
5714  
5715  
5716 <!--page 120 -->
5717
5718 <h6>footnotes</h6>
5719 <p><small><a name="note111" href="#note111">111)</a> The implementation is permitted to read the object to determine the value but is not required to, even
5720  when the object has volatile-qualified type.
5721 </small>
5722
5723 <h5><a name="6.5.16.1" href="#6.5.16.1">6.5.16.1 Simple assignment</a></h5>
5724 <h6>Constraints</h6>
5725 <p><!--para 1 -->
5726  One of the following shall hold:<sup><a href="#note112"><b>112)</b></a></sup>
5727 <ul>
5728 <li>  the left operand has atomic, qualified, or unqualified arithmetic type, and the right has
5729  arithmetic type;
5730 <li>  the left operand has an atomic, qualified, or unqualified version of a structure or union
5731  type compatible with the type of the right;
5732 <li>  the left operand has atomic, qualified, or unqualified pointer type, and (considering
5733  the type the left operand would have after lvalue conversion) both operands are
5734  pointers to qualified or unqualified versions of compatible types, and the type pointed
5735  to by the left has all the qualifiers of the type pointed to by the right;
5736 <li>  the left operand has atomic, qualified, or unqualified pointer type, and (considering
5737  the type the left operand would have after lvalue conversion) one operand is a pointer
5738  to an object type, and the other is a pointer to a qualified or unqualified version of
5739  void, and the type pointed to by the left has all the qualifiers of the type pointed to
5740  by the right;
5741 <li>  the left operand is an atomic, qualified, or unqualified pointer, and the right is a null
5742  pointer constant; or
5743 <li>  the left operand has type atomic, qualified, or unqualified _Bool, and the right is a
5744  pointer.
5745 </ul>
5746 <h6>Semantics</h6>
5747 <p><!--para 2 -->
5748  In simple assignment (=), the value of the right operand is converted to the type of the
5749  assignment expression and replaces the value stored in the object designated by the left
5750  operand.
5751 <p><!--para 3 -->
5752  If the value being stored in an object is read from another object that overlaps in any way
5753  the storage of the first object, then the overlap shall be exact and the two objects shall
5754  have qualified or unqualified versions of a compatible type; otherwise, the behavior is
5755  undefined.
5756 <p><!--para 4 -->
5757  EXAMPLE 1       In the program fragment
5758  
5759  
5760  
5761  
5762 <!--page 121 -->
5763 <pre>
5764          int f(void);
5765          char c;
5766          /* ... */
5767          if ((c = f()) == -1)
5768                  /* ... */
5769 </pre>
5770  the int value returned by the function may be truncated when stored in the char, and then converted back
5771  to int width prior to the comparison. In an implementation in which ''plain'' char has the same range of
5772  values as unsigned char (and char is narrower than int), the result of the conversion cannot be
5773  negative, so the operands of the comparison can never compare equal. Therefore, for full portability, the
5774  variable c should be declared as int.
5775  
5776 <p><!--para 5 -->
5777  EXAMPLE 2       In the fragment:
5778 <pre>
5779          char c;
5780          int i;
5781          long l;
5782          l = (c = i);
5783 </pre>
5784  the value of i is converted to the type of the assignment expression c = i, that is, char type. The value
5785  of the expression enclosed in parentheses is then converted to the type of the outer assignment expression,
5786  that is, long int type.
5787  
5788 <p><!--para 6 -->
5789  EXAMPLE 3       Consider the fragment:
5790 <pre>
5791          const char **cpp;
5792          char *p;
5793          const char c = 'A';
5794          cpp = &amp;p;                  // constraint violation
5795          *cpp = &amp;c;                 // valid
5796          *p = 0;                    // valid
5797 </pre>
5798  The first assignment is unsafe because it would allow the following valid code to attempt to change the
5799  value of the const object c.
5800  
5801
5802 <h6>footnotes</h6>
5803 <p><small><a name="note112" href="#note112">112)</a> The asymmetric appearance of these constraints with respect to type qualifiers is due to the conversion
5804  (specified in <a href="#6.3.2.1">6.3.2.1</a>) that changes lvalues to ''the value of the expression'' and thus removes any type
5805  qualifiers that were applied to the type category of the expression (for example, it removes const but
5806  not volatile from the type int volatile * const).
5807 </small>
5808
5809 <h5><a name="6.5.16.2" href="#6.5.16.2">6.5.16.2 Compound assignment</a></h5>
5810 <h6>Constraints</h6>
5811 <p><!--para 1 -->
5812  For the operators += and -= only, either the left operand shall be an atomic, qualified, or
5813  unqualified pointer to a complete object type, and the right shall have integer type; or the
5814  left operand shall have atomic, qualified, or unqualified arithmetic type, and the right
5815  shall have arithmetic type.
5816 <p><!--para 2 -->
5817  For the other operators, the left operand shall have atomic, qualified, or unqualified
5818  arithmetic type, and (considering the type the left operand would have after lvalue
5819  conversion) each operand shall have arithmetic type consistent with those allowed by the
5820  corresponding binary operator.
5821 <h6>Semantics</h6>
5822 <p><!--para 3 -->
5823  A compound assignment of the form E1 op = E2 is equivalent to the simple assignment
5824  expression E1 = E1 op (E2), except that the lvalue E1 is evaluated only once, and with
5825  respect to an indeterminately-sequenced function call, the operation of a compound
5826 <!--page 122 -->
5827  assignment is a single evaluation. If E1 has an atomic type, compound assignment is a
5828  read-modify-write operation with memory_order_seq_cst memory order
5829  semantics.<sup><a href="#note113"><b>113)</b></a></sup>
5830
5831 <h6>footnotes</h6>
5832 <p><small><a name="note113" href="#note113">113)</a> Where a pointer to an atomic object can be formed, this is equivalent to the following code sequence
5833  where T is the type of E1:
5834
5835 <pre>
5836           T tmp = E1;
5837           T result;
5838           do {
5839                 result = tmp op (E2);
5840           } while (!atomic_compare_exchange_strong(&amp;E1, &amp;tmp, result));
5841 </pre>
5842   with result being the result of the operation.
5843 </small>
5844
5845 <h4><a name="6.5.17" href="#6.5.17">6.5.17 Comma operator</a></h4>
5846 <h6>Syntax</h6>
5847 <p><!--para 1 -->
5848 <pre>
5849           expression:
5850                  assignment-expression
5851                  expression , assignment-expression
5852 </pre>
5853 <h6>Semantics</h6>
5854 <p><!--para 2 -->
5855  The left operand of a comma operator is evaluated as a void expression; there is a
5856  sequence point between its evaluation and that of the right operand. Then the right
5857  operand is evaluated; the result has its type and value.<sup><a href="#note114"><b>114)</b></a></sup>                        *
5858 <p><!--para 3 -->
5859  EXAMPLE As indicated by the syntax, the comma operator (as described in this subclause) cannot
5860  appear in contexts where a comma is used to separate items in a list (such as arguments to functions or lists
5861  of initializers). On the other hand, it can be used within a parenthesized expression or within the second
5862  expression of a conditional operator in such contexts. In the function call
5863 <pre>
5864           f(a, (t=3, t+2), c)
5865 </pre>
5866  the function has three arguments, the second of which has the value 5.
5867  
5868 <p><b> Forward references</b>: initialization (<a href="#6.7.9">6.7.9</a>).
5869  
5870  
5871  
5872  
5873 <!--page 123 -->
5874
5875 <h6>footnotes</h6>
5876 <p><small><a name="note114" href="#note114">114)</a> A comma operator does not yield an lvalue.
5877 </small>
5878
5879 <h3><a name="6.6" href="#6.6">6.6 Constant expressions</a></h3>
5880 <h6>Syntax</h6>
5881 <p><!--para 1 -->
5882 <pre>
5883           constant-expression:
5884                  conditional-expression
5885 </pre>
5886 <h6>Description</h6>
5887 <p><!--para 2 -->
5888  A constant expression can be evaluated during translation rather than runtime, and
5889  accordingly may be used in any place that a constant may be.
5890 <h6>Constraints</h6>
5891 <p><!--para 3 -->
5892  Constant expressions shall not contain assignment, increment, decrement, function-call,
5893  or comma operators, except when they are contained within a subexpression that is not
5894  evaluated.<sup><a href="#note115"><b>115)</b></a></sup>
5895 <p><!--para 4 -->
5896  Each constant expression shall evaluate to a constant that is in the range of representable
5897  values for its type.
5898 <h6>Semantics</h6>
5899 <p><!--para 5 -->
5900  An expression that evaluates to a constant is required in several contexts. If a floating
5901  expression is evaluated in the translation environment, the arithmetic precision and range
5902  shall be at least as great as if the expression were being evaluated in the execution
5903  environment.<sup><a href="#note116"><b>116)</b></a></sup>
5904 <p><!--para 6 -->
5905  An integer constant expression<sup><a href="#note117"><b>117)</b></a></sup> shall have integer type and shall only have operands
5906  that are integer constants, enumeration constants, character constants, sizeof
5907  expressions whose results are integer constants, and floating constants that are the
5908  immediate operands of casts. Cast operators in an integer constant expression shall only
5909  convert arithmetic types to integer types, except as part of an operand to the sizeof
5910  operator.
5911 <p><!--para 7 -->
5912  More latitude is permitted for constant expressions in initializers. Such a constant
5913  expression shall be, or evaluate to, one of the following:
5914 <ul>
5915 <li>  an arithmetic constant expression,
5916  
5917  
5918  
5919 <!--page 124 -->
5920 <li>  a null pointer constant,
5921 <li>  an address constant, or
5922 <li>  an address constant for a complete object type plus or minus an integer constant
5923  expression.
5924 </ul>
5925 <p><!--para 8 -->
5926  An arithmetic constant expression shall have arithmetic type and shall only have
5927  operands that are integer constants, floating constants, enumeration constants, character
5928  constants, and sizeof expressions. Cast operators in an arithmetic constant expression
5929  shall only convert arithmetic types to arithmetic types, except as part of an operand to a
5930  sizeof operator whose result is an integer constant.
5931 <p><!--para 9 -->
5932  An address constant is a null pointer, a pointer to an lvalue designating an object of static
5933  storage duration, or a pointer to a function designator; it shall be created explicitly using
5934  the unary &amp; operator or an integer constant cast to pointer type, or implicitly by the use of
5935  an expression of array or function type. The array-subscript [] and member-access .
5936  and -&gt; operators, the address &amp; and indirection * unary operators, and pointer casts may
5937  be used in the creation of an address constant, but the value of an object shall not be
5938  accessed by use of these operators.
5939 <p><!--para 10 -->
5940  An implementation may accept other forms of constant expressions.
5941 <p><!--para 11 -->
5942  The semantic rules for the evaluation of a constant expression are the same as for
5943  nonconstant expressions.<sup><a href="#note118"><b>118)</b></a></sup>
5944 <p><b> Forward references</b>: array declarators (<a href="#6.7.6.2">6.7.6.2</a>), initialization (<a href="#6.7.9">6.7.9</a>).
5945  
5946  
5947  
5948  
5949 <!--page 125 -->
5950
5951 <h6>footnotes</h6>
5952 <p><small><a name="note115" href="#note115">115)</a> The operand of a sizeof operator is usually not evaluated (<a href="#6.5.3.4">6.5.3.4</a>).
5953 </small>
5954 <p><small><a name="note116" href="#note116">116)</a> The use of evaluation formats as characterized by FLT_EVAL_METHOD also applies to evaluation in
5955  the translation environment.
5956 </small>
5957 <p><small><a name="note117" href="#note117">117)</a> An integer constant expression is required in a number of contexts such as the size of a bit-field
5958  member of a structure, the value of an enumeration constant, and the size of a non-variable length
5959  array. Further constraints that apply to the integer constant expressions used in conditional-inclusion
5960  preprocessing directives are discussed in <a href="#6.10.1">6.10.1</a>.
5961 </small>
5962 <p><small><a name="note118" href="#note118">118)</a> Thus, in the following initialization,
5963
5964 <pre>
5965            static int i = 2 || 1 / 0;
5966 </pre>
5967   the expression is a valid integer constant expression with value one.
5968 </small>
5969
5970 <h3><a name="6.7" href="#6.7">6.7 Declarations</a></h3>
5971 <h6>Syntax</h6>
5972 <p><!--para 1 -->
5973 <pre>
5974           declaration:
5975                  declaration-specifiers init-declarator-list<sub>opt</sub> ;
5976                  static_assert-declaration
5977           declaration-specifiers:
5978                  storage-class-specifier declaration-specifiers<sub>opt</sub>
5979                  type-specifier declaration-specifiers<sub>opt</sub>
5980                  type-qualifier declaration-specifiers<sub>opt</sub>
5981                  function-specifier declaration-specifiers<sub>opt</sub>
5982                  alignment-specifier declaration-specifiers<sub>opt</sub>
5983           init-declarator-list:
5984                   init-declarator
5985                   init-declarator-list , init-declarator
5986           init-declarator:
5987                   declarator
5988                   declarator = initializer
5989 </pre>
5990 <h6>Constraints</h6>
5991 <p><!--para 2 -->
5992  A declaration other than a static_assert declaration shall declare at least a declarator
5993  (other than the parameters of a function or the members of a structure or union), a tag, or
5994  the members of an enumeration.
5995 <p><!--para 3 -->
5996  If an identifier has no linkage, there shall be no more than one declaration of the identifier
5997  (in a declarator or type specifier) with the same scope and in the same name space, except
5998  that a typedef name can be redefined to denote the same type as it currently does and tags
5999  may be redeclared as specified in <a href="#6.7.2.3">6.7.2.3</a>.
6000 <p><!--para 4 -->
6001  All declarations in the same scope that refer to the same object or function shall specify
6002  compatible types.
6003 <h6>Semantics</h6>
6004 <p><!--para 5 -->
6005  A declaration specifies the interpretation and attributes of a set of identifiers. A definition
6006  of an identifier is a declaration for that identifier that:
6007 <ul>
6008 <li>  for an object, causes storage to be reserved for that object;
6009 <li>  for a function, includes the function body;<sup><a href="#note119"><b>119)</b></a></sup>
6010  
6011  
6012  
6013 <!--page 126 -->
6014 <li>  for an enumeration constant or typedef name, is the (only) declaration of the
6015  identifier.
6016 </ul>
6017 <p><!--para 6 -->
6018  The declaration specifiers consist of a sequence of specifiers that indicate the linkage,
6019  storage duration, and part of the type of the entities that the declarators denote. The init-
6020  declarator-list is a comma-separated sequence of declarators, each of which may have
6021  additional type information, or an initializer, or both. The declarators contain the
6022  identifiers (if any) being declared.
6023 <p><!--para 7 -->
6024  If an identifier for an object is declared with no linkage, the type for the object shall be
6025  complete by the end of its declarator, or by the end of its init-declarator if it has an
6026  initializer; in the case of function parameters (including in prototypes), it is the adjusted
6027  type (see <a href="#6.7.6.3">6.7.6.3</a>) that is required to be complete.
6028 <p><b> Forward references</b>: declarators (<a href="#6.7.6">6.7.6</a>), enumeration specifiers (<a href="#6.7.2.2">6.7.2.2</a>), initialization
6029  (<a href="#6.7.9">6.7.9</a>), type names (<a href="#6.7.7">6.7.7</a>), type qualifiers (<a href="#6.7.3">6.7.3</a>).
6030
6031 <h6>footnotes</h6>
6032 <p><small><a name="note119" href="#note119">119)</a> Function definitions have a different syntax, described in <a href="#6.9.1">6.9.1</a>.
6033 </small>
6034
6035 <h4><a name="6.7.1" href="#6.7.1">6.7.1 Storage-class specifiers</a></h4>
6036 <h6>Syntax</h6>
6037 <p><!--para 1 -->
6038 <pre>
6039           storage-class-specifier:
6040                  typedef
6041                  extern
6042                  static
6043                  _Thread_local
6044                  auto
6045                  register
6046 </pre>
6047 <h6>Constraints</h6>
6048 <p><!--para 2 -->
6049  At most, one storage-class specifier may be given in the declaration specifiers in a
6050  declaration, except that _Thread_local may appear with static or extern.<sup><a href="#note120"><b>120)</b></a></sup>
6051 <p><!--para 3 -->
6052  In the declaration of an object with block scope, if the declaration specifiers include
6053  _Thread_local, they shall also include either static or extern. If
6054  _Thread_local appears in any declaration of an object, it shall be present in every
6055  declaration of that object.
6056 <h6>Semantics</h6>
6057 <p><!--para 4 -->
6058  The typedef specifier is called a ''storage-class specifier'' for syntactic convenience
6059  only; it is discussed in <a href="#6.7.8">6.7.8</a>. The meanings of the various linkages and storage durations
6060  were discussed in <a href="#6.2.2">6.2.2</a> and <a href="#6.2.4">6.2.4</a>.
6061  
6062  
6063  
6064 <!--page 127 -->
6065 <p><!--para 5 -->
6066  A declaration of an identifier for an object with storage-class specifier register
6067  suggests that access to the object be as fast as possible. The extent to which such
6068  suggestions are effective is implementation-defined.<sup><a href="#note121"><b>121)</b></a></sup>
6069 <p><!--para 6 -->
6070  The declaration of an identifier for a function that has block scope shall have no explicit
6071  storage-class specifier other than extern.
6072 <p><!--para 7 -->
6073  If an aggregate or union object is declared with a storage-class specifier other than
6074  typedef, the properties resulting from the storage-class specifier, except with respect to
6075  linkage, also apply to the members of the object, and so on recursively for any aggregate
6076  or union member objects.
6077 <p><b> Forward references</b>: type definitions (<a href="#6.7.8">6.7.8</a>).
6078
6079 <h6>footnotes</h6>
6080 <p><small><a name="note120" href="#note120">120)</a> See ''future language directions'' (<a href="#6.11.5">6.11.5</a>).
6081 </small>
6082 <p><small><a name="note121" href="#note121">121)</a> The implementation may treat any register declaration simply as an auto declaration. However,
6083  whether or not addressable storage is actually used, the address of any part of an object declared with
6084  storage-class specifier register cannot be computed, either explicitly (by use of the unary &amp;
6085  operator as discussed in <a href="#6.5.3.2">6.5.3.2</a>) or implicitly (by converting an array name to a pointer as discussed in
6086  <a href="#6.3.2.1">6.3.2.1</a>). Thus, the only operator that can be applied to an array declared with storage-class specifier
6087  register is sizeof.
6088 </small>
6089
6090 <h4><a name="6.7.2" href="#6.7.2">6.7.2 Type specifiers</a></h4>
6091 <h6>Syntax</h6>
6092 <p><!--para 1 -->
6093 <pre>
6094           type-specifier:
6095                  void
6096                  char
6097                  short
6098                  int
6099                  long
6100                  float
6101                  double
6102                  signed
6103                  unsigned
6104                  _Bool
6105                  _Complex
6106                  atomic-type-specifier
6107                  struct-or-union-specifier
6108                  enum-specifier
6109                  typedef-name
6110 </pre>
6111 <h6>Constraints</h6>
6112 <p><!--para 2 -->
6113  At least one type specifier shall be given in the declaration specifiers in each declaration,
6114  and in the specifier-qualifier list in each struct declaration and type name. Each list of
6115  
6116  
6117 <!--page 128 -->
6118  type specifiers shall be one of the following multisets (delimited by commas, when there
6119  is more than one multiset per item); the type specifiers may occur in any order, possibly
6120  intermixed with the other declaration specifiers.
6121 <ul>
6122 <li>  void
6123 <li>  char
6124 <li>  signed char
6125 <li>  unsigned char
6126 <li>  short, signed short, short int, or signed short int
6127 <li>  unsigned short, or unsigned short int
6128 <li>  int, signed, or signed int
6129 <li>  unsigned, or unsigned int
6130 <li>  long, signed long, long int, or signed long int
6131 <li>  unsigned long, or unsigned long int
6132 <li>  long long, signed long long, long long int, or
6133  signed long long int
6134 <li>  unsigned long long, or unsigned long long int
6135 <li>  float
6136 <li>  double
6137 <li>  long double
6138 <li>  _Bool
6139 <li>  float _Complex
6140 <li>  double _Complex
6141 <li>  long double _Complex
6142 <li>  atomic type specifier
6143 <li>  struct or union specifier
6144 <li>  enum specifier
6145 <li>  typedef name
6146 </ul>
6147 <p><!--para 3 -->
6148  The type specifier _Complex shall not be used if the implementation does not support
6149  complex types (see <a href="#6.10.8.3">6.10.8.3</a>).
6150 <!--page 129 -->
6151 <h6>Semantics</h6>
6152 <p><!--para 4 -->
6153  Specifiers for structures, unions, enumerations, and atomic types are discussed in <a href="#6.7.2.1">6.7.2.1</a>
6154  through <a href="#6.7.2.4">6.7.2.4</a>. Declarations of typedef names are discussed in <a href="#6.7.8">6.7.8</a>. The
6155  characteristics of the other types are discussed in <a href="#6.2.5">6.2.5</a>.
6156 <p><!--para 5 -->
6157  Each of the comma-separated multisets designates the same type, except that for bit-
6158  fields, it is implementation-defined whether the specifier int designates the same type as
6159  signed int or the same type as unsigned int.
6160 <p><b> Forward references</b>: atomic type specifiers (<a href="#6.7.2.4">6.7.2.4</a>), enumeration specifiers (<a href="#6.7.2.2">6.7.2.2</a>),
6161  structure and union specifiers (<a href="#6.7.2.1">6.7.2.1</a>), tags (<a href="#6.7.2.3">6.7.2.3</a>), type definitions (<a href="#6.7.8">6.7.8</a>).
6162
6163 <h5><a name="6.7.2.1" href="#6.7.2.1">6.7.2.1 Structure and union specifiers</a></h5>
6164 <h6>Syntax</h6>
6165 <p><!--para 1 -->
6166 <pre>
6167           struct-or-union-specifier:
6168                   struct-or-union identifier<sub>opt</sub> { struct-declaration-list }
6169                   struct-or-union identifier
6170           struct-or-union:
6171                   struct
6172                   union
6173           struct-declaration-list:
6174                   struct-declaration
6175                   struct-declaration-list struct-declaration
6176           struct-declaration:
6177                   specifier-qualifier-list struct-declarator-list<sub>opt</sub> ;
6178                   static_assert-declaration
6179           specifier-qualifier-list:
6180                  type-specifier specifier-qualifier-list<sub>opt</sub>
6181                  type-qualifier specifier-qualifier-list<sub>opt</sub>
6182           struct-declarator-list:
6183                   struct-declarator
6184                   struct-declarator-list , struct-declarator
6185           struct-declarator:
6186                   declarator
6187                   declarator<sub>opt</sub> : constant-expression
6188 </pre>
6189 <h6>Constraints</h6>
6190 <p><!--para 2 -->
6191  A struct-declaration that does not declare an anonymous structure or anonymous union
6192  shall contain a struct-declarator-list.
6193 <!--page 130 -->
6194 <p><!--para 3 -->
6195  A structure or union shall not contain a member with incomplete or function type (hence,
6196  a structure shall not contain an instance of itself, but may contain a pointer to an instance
6197  of itself), except that the last member of a structure with more than one named member
6198  may have incomplete array type; such a structure (and any union containing, possibly
6199  recursively, a member that is such a structure) shall not be a member of a structure or an
6200  element of an array.
6201 <p><!--para 4 -->
6202  The expression that specifies the width of a bit-field shall be an integer constant
6203  expression with a nonnegative value that does not exceed the width of an object of the
6204  type that would be specified were the colon and expression omitted.<sup><a href="#note122"><b>122)</b></a></sup> If the value is
6205  zero, the declaration shall have no declarator.
6206 <p><!--para 5 -->
6207  A bit-field shall have a type that is a qualified or unqualified version of _Bool, signed
6208  int, unsigned int, or some other implementation-defined type. It is
6209  implementation-defined whether atomic types are permitted.
6210 <h6>Semantics</h6>
6211 <p><!--para 6 -->
6212  As discussed in <a href="#6.2.5">6.2.5</a>, a structure is a type consisting of a sequence of members, whose
6213  storage is allocated in an ordered sequence, and a union is a type consisting of a sequence
6214  of members whose storage overlap.
6215 <p><!--para 7 -->
6216  Structure and union specifiers have the same form. The keywords struct and union
6217  indicate that the type being specified is, respectively, a structure type or a union type.
6218 <p><!--para 8 -->
6219  The presence of a struct-declaration-list in a struct-or-union-specifier declares a new type,
6220  within a translation unit. The struct-declaration-list is a sequence of declarations for the
6221  members of the structure or union. If the struct-declaration-list contains no named
6222  members, no anonymous structures, and no anonymous unions, the behavior is undefined.
6223  The type is incomplete until immediately after the } that terminates the list, and complete
6224  thereafter.
6225 <p><!--para 9 -->
6226  A member of a structure or union may have any complete object type other than a
6227  variably modified type.<sup><a href="#note123"><b>123)</b></a></sup> In addition, a member may be declared to consist of a
6228  specified number of bits (including a sign bit, if any). Such a member is called a
6229  bit-field;<sup><a href="#note124"><b>124)</b></a></sup> its width is preceded by a colon.
6230 <p><!--para 10 -->
6231  A bit-field is interpreted as having a signed or unsigned integer type consisting of the
6232  specified number of bits.<sup><a href="#note125"><b>125)</b></a></sup> If the value 0 or 1 is stored into a nonzero-width bit-field of
6233  
6234 <!--page 131 -->
6235  type _Bool, the value of the bit-field shall compare equal to the value stored; a _Bool
6236  bit-field has the semantics of a _Bool.
6237 <p><!--para 11 -->
6238  An implementation may allocate any addressable storage unit large enough to hold a bit-
6239  field. If enough space remains, a bit-field that immediately follows another bit-field in a
6240  structure shall be packed into adjacent bits of the same unit. If insufficient space remains,
6241  whether a bit-field that does not fit is put into the next unit or overlaps adjacent units is
6242  implementation-defined. The order of allocation of bit-fields within a unit (high-order to
6243  low-order or low-order to high-order) is implementation-defined. The alignment of the
6244  addressable storage unit is unspecified.
6245 <p><!--para 12 -->
6246  A bit-field declaration with no declarator, but only a colon and a width, indicates an
6247  unnamed bit-field.<sup><a href="#note126"><b>126)</b></a></sup> As a special case, a bit-field structure member with a width of 0
6248  indicates that no further bit-field is to be packed into the unit in which the previous bit-
6249  field, if any, was placed.
6250 <p><!--para 13 -->
6251  An unnamed member of structure type with no tag is called an anonymous structure; an
6252  unnamed member of union type with no tag is called an anonymous union. The members
6253  of an anonymous structure or union are considered to be members of the containing
6254  structure or union. This applies recursively if the containing structure or union is also
6255  anonymous.
6256 <p><!--para 14 -->
6257  Each non-bit-field member of a structure or union object is aligned in an implementation-
6258  defined manner appropriate to its type.
6259 <p><!--para 15 -->
6260  Within a structure object, the non-bit-field members and the units in which bit-fields
6261  reside have addresses that increase in the order in which they are declared. A pointer to a
6262  structure object, suitably converted, points to its initial member (or if that member is a
6263  bit-field, then to the unit in which it resides), and vice versa. There may be unnamed
6264  padding within a structure object, but not at its beginning.
6265 <p><!--para 16 -->
6266  The size of a union is sufficient to contain the largest of its members. The value of at
6267  most one of the members can be stored in a union object at any time. A pointer to a
6268  union object, suitably converted, points to each of its members (or if a member is a bit-
6269  field, then to the unit in which it resides), and vice versa.
6270 <p><!--para 17 -->
6271  There may be unnamed padding at the end of a structure or union.
6272 <p><!--para 18 -->
6273  As a special case, the last element of a structure with more than one named member may
6274  have an incomplete array type; this is called a flexible array member. In most situations,
6275  
6276  
6277 <!--page 132 -->
6278  the flexible array member is ignored. In particular, the size of the structure is as if the
6279  flexible array member were omitted except that it may have more trailing padding than
6280  the omission would imply. However, when a . (or -&gt;) operator has a left operand that is
6281  (a pointer to) a structure with a flexible array member and the right operand names that
6282  member, it behaves as if that member were replaced with the longest array (with the same
6283  element type) that would not make the structure larger than the object being accessed; the
6284  offset of the array shall remain that of the flexible array member, even if this would differ
6285  from that of the replacement array. If this array would have no elements, it behaves as if
6286  it had one element but the behavior is undefined if any attempt is made to access that
6287  element or to generate a pointer one past it.
6288 <p><!--para 19 -->
6289  EXAMPLE 1       The following illustrates anonymous structures and unions:
6290 <pre>
6291           struct v {
6292                 union {      // anonymous union
6293                        struct { int i, j; };    // anonymous structure
6294                        struct { long k, l; } w;
6295                 };
6296                 int m;
6297           } v1;
6298           v1.i = 2;   // valid
6299           v1.k = 3;   // invalid: inner structure is not anonymous
6300           v1.w.k = 5; // valid
6301 </pre>
6302  
6303 <p><!--para 20 -->
6304  EXAMPLE 2       After the declaration:
6305 <pre>
6306           struct s { int n; double d[]; };
6307 </pre>
6308  the structure struct s has a flexible array member d. A typical way to use this is:
6309 <pre>
6310           int m = /* some value */;
6311           struct s *p = malloc(sizeof (struct s) + sizeof (double [m]));
6312 </pre>
6313  and assuming that the call to malloc succeeds, the object pointed to by p behaves, for most purposes, as if
6314  p had been declared as:
6315 <pre>
6316           struct { int n; double d[m]; } *p;
6317 </pre>
6318  (there are circumstances in which this equivalence is broken; in particular, the offsets of member d might
6319  not be the same).
6320 <p><!--para 21 -->
6321  Following the above declaration:
6322 <pre>
6323           struct s t1 = { 0 };                         //   valid
6324           struct s t2 = { 1, { <a href="#4.2">4.2</a> }};                 //   invalid
6325           t1.n = 4;                                    //   valid
6326           t1.d[0] = <a href="#4.2">4.2</a>;                               //   might be undefined behavior
6327 </pre>
6328  The initialization of t2 is invalid (and violates a constraint) because struct s is treated as if it did not
6329  contain member d. The assignment to t1.d[0] is probably undefined behavior, but it is possible that
6330 <pre>
6331           sizeof (struct s) &gt;= offsetof(struct s, d) + sizeof (double)
6332 </pre>
6333  in which case the assignment would be legitimate. Nevertheless, it cannot appear in strictly conforming
6334  code.
6335 <!--page 133 -->
6336 <p><!--para 22 -->
6337  After the further declaration:
6338 <pre>
6339           struct ss { int n; };
6340 </pre>
6341  the expressions:
6342 <pre>
6343           sizeof (struct s) &gt;= sizeof (struct ss)
6344           sizeof (struct s) &gt;= offsetof(struct s, d)
6345 </pre>
6346  are always equal to 1.
6347 <p><!--para 23 -->
6348  If sizeof (double) is 8, then after the following code is executed:
6349 <pre>
6350           struct s *s1;
6351           struct s *s2;
6352           s1 = malloc(sizeof (struct s) + 64);
6353           s2 = malloc(sizeof (struct s) + 46);
6354 </pre>
6355  and assuming that the calls to malloc succeed, the objects pointed to by s1 and s2 behave, for most
6356  purposes, as if the identifiers had been declared as:
6357 <pre>
6358           struct { int n; double d[8]; } *s1;
6359           struct { int n; double d[5]; } *s2;
6360 </pre>
6361 <p><!--para 24 -->
6362  Following the further successful assignments:
6363 <pre>
6364           s1 = malloc(sizeof (struct s) + 10);
6365           s2 = malloc(sizeof (struct s) + 6);
6366 </pre>
6367  they then behave as if the declarations were:
6368 <pre>
6369           struct { int n; double d[1]; } *s1, *s2;
6370 </pre>
6371  and:
6372 <pre>
6373           double *dp;
6374           dp = &amp;(s1-&gt;d[0]);          //   valid
6375           *dp = 42;                  //   valid
6376           dp = &amp;(s2-&gt;d[0]);          //   valid
6377           *dp = 42;                  //   undefined behavior
6378 </pre>
6379 <p><!--para 25 -->
6380  The assignment:
6381 <pre>
6382           *s1 = *s2;
6383 </pre>
6384  only copies the member n; if any of the array elements are within the first sizeof (struct s) bytes
6385  of the structure, they might be copied or simply overwritten with indeterminate values.
6386  
6387 <p><b> Forward references</b>: declarators (<a href="#6.7.6">6.7.6</a>), tags (<a href="#6.7.2.3">6.7.2.3</a>).
6388 <!--page 134 -->
6389
6390 <h6>footnotes</h6>
6391 <p><small><a name="note122" href="#note122">122)</a> While the number of bits in a _Bool object is at least CHAR_BIT, the width (number of sign and
6392  value bits) of a _Bool may be just 1 bit.
6393 </small>
6394 <p><small><a name="note123" href="#note123">123)</a> A structure or union cannot contain a member with a variably modified type because member names
6395  are not ordinary identifiers as defined in <a href="#6.2.3">6.2.3</a>.
6396 </small>
6397 <p><small><a name="note124" href="#note124">124)</a> The unary &amp; (address-of) operator cannot be applied to a bit-field object; thus, there are no pointers to
6398  or arrays of bit-field objects.
6399 </small>
6400 <p><small><a name="note125" href="#note125">125)</a> As specified in <a href="#6.7.2">6.7.2</a> above, if the actual type specifier used is int or a typedef-name defined as int,
6401  then it is implementation-defined whether the bit-field is signed or unsigned.
6402 </small>
6403 <p><small><a name="note126" href="#note126">126)</a> An unnamed bit-field structure member is useful for padding to conform to externally imposed
6404  layouts.
6405 </small>
6406
6407 <h5><a name="6.7.2.2" href="#6.7.2.2">6.7.2.2 Enumeration specifiers</a></h5>
6408 <h6>Syntax</h6>
6409 <p><!--para 1 -->
6410 <pre>
6411           enum-specifier:
6412                 enum identifier<sub>opt</sub> { enumerator-list }
6413                 enum identifier<sub>opt</sub> { enumerator-list , }
6414                 enum identifier
6415           enumerator-list:
6416                 enumerator
6417                 enumerator-list , enumerator
6418           enumerator:
6419                 enumeration-constant
6420                 enumeration-constant = constant-expression
6421 </pre>
6422 <h6>Constraints</h6>
6423 <p><!--para 2 -->
6424  The expression that defines the value of an enumeration constant shall be an integer
6425  constant expression that has a value representable as an int.
6426 <h6>Semantics</h6>
6427 <p><!--para 3 -->
6428  The identifiers in an enumerator list are declared as constants that have type int and
6429  may appear wherever such are permitted.<sup><a href="#note127"><b>127)</b></a></sup> An enumerator with = defines its
6430  enumeration constant as the value of the constant expression. If the first enumerator has
6431  no =, the value of its enumeration constant is 0. Each subsequent enumerator with no =
6432  defines its enumeration constant as the value of the constant expression obtained by
6433  adding 1 to the value of the previous enumeration constant. (The use of enumerators with
6434  = may produce enumeration constants with values that duplicate other values in the same
6435  enumeration.) The enumerators of an enumeration are also known as its members.
6436 <p><!--para 4 -->
6437  Each enumerated type shall be compatible with char, a signed integer type, or an
6438  unsigned integer type. The choice of type is implementation-defined,<sup><a href="#note128"><b>128)</b></a></sup> but shall be
6439  capable of representing the values of all the members of the enumeration. The
6440  enumerated type is incomplete until immediately after the } that terminates the list of
6441  enumerator declarations, and complete thereafter.
6442  
6443  
6444  
6445  
6446 <!--page 135 -->
6447 <p><!--para 5 -->
6448  EXAMPLE       The following fragment:
6449 <pre>
6450           enum hue { chartreuse, burgundy, claret=20, winedark };
6451           enum hue col, *cp;
6452           col = claret;
6453           cp = &amp;col;
6454           if (*cp != burgundy)
6455                 /* ... */
6456 </pre>
6457  makes hue the tag of an enumeration, and then declares col as an object that has that type and cp as a
6458  pointer to an object that has that type. The enumerated values are in the set { 0, 1, 20, 21 }.
6459  
6460 <p><b> Forward references</b>: tags (<a href="#6.7.2.3">6.7.2.3</a>).
6461
6462 <h6>footnotes</h6>
6463 <p><small><a name="note127" href="#note127">127)</a> Thus, the identifiers of enumeration constants declared in the same scope shall all be distinct from
6464  each other and from other identifiers declared in ordinary declarators.
6465 </small>
6466 <p><small><a name="note128" href="#note128">128)</a> An implementation may delay the choice of which integer type until all enumeration constants have
6467  been seen.
6468 </small>
6469
6470 <h5><a name="6.7.2.3" href="#6.7.2.3">6.7.2.3 Tags</a></h5>
6471 <h6>Constraints</h6>
6472 <p><!--para 1 -->
6473  A specific type shall have its content defined at most once.
6474 <p><!--para 2 -->
6475  Where two declarations that use the same tag declare the same type, they shall both use
6476  the same choice of struct, union, or enum.
6477 <p><!--para 3 -->
6478  A type specifier of the form
6479 <pre>
6480          enum identifier
6481 </pre>
6482  without an enumerator list shall only appear after the type it specifies is complete.
6483 <h6>Semantics</h6>
6484 <p><!--para 4 -->
6485  All declarations of structure, union, or enumerated types that have the same scope and
6486  use the same tag declare the same type. Irrespective of whether there is a tag or what
6487  other declarations of the type are in the same translation unit, the type is incomplete<sup><a href="#note129"><b>129)</b></a></sup>
6488  until immediately after the closing brace of the list defining the content, and complete
6489  thereafter.
6490 <p><!--para 5 -->
6491  Two declarations of structure, union, or enumerated types which are in different scopes or
6492  use different tags declare distinct types. Each declaration of a structure, union, or
6493  enumerated type which does not include a tag declares a distinct type.
6494 <p><!--para 6 -->
6495  A type specifier of the form
6496  
6497  
6498  
6499  
6500 <!--page 136 -->
6501 <pre>
6502           struct-or-union identifier<sub>opt</sub> { struct-declaration-list }
6503 </pre>
6504  or
6505 <pre>
6506           enum identifier<sub>opt</sub> { enumerator-list }
6507 </pre>
6508  or
6509 <pre>
6510           enum identifier<sub>opt</sub> { enumerator-list , }
6511 </pre>
6512  declares a structure, union, or enumerated type. The list defines the structure content,
6513  union content, or enumeration content. If an identifier is provided,<sup><a href="#note130"><b>130)</b></a></sup> the type specifier
6514  also declares the identifier to be the tag of that type.
6515 <p><!--para 7 -->
6516  A declaration of the form
6517 <pre>
6518           struct-or-union identifier ;
6519 </pre>
6520  specifies a structure or union type and declares the identifier as a tag of that type.<sup><a href="#note131"><b>131)</b></a></sup>
6521 <p><!--para 8 -->
6522  If a type specifier of the form
6523 <pre>
6524           struct-or-union identifier
6525 </pre>
6526  occurs other than as part of one of the above forms, and no other declaration of the
6527  identifier as a tag is visible, then it declares an incomplete structure or union type, and
6528  declares the identifier as the tag of that type.<sup><a href="#note131"><b>131)</b></a></sup>
6529 <p><!--para 9 -->
6530  If a type specifier of the form
6531 <pre>
6532           struct-or-union identifier
6533 </pre>
6534  or
6535 <pre>
6536           enum identifier
6537 </pre>
6538  occurs other than as part of one of the above forms, and a declaration of the identifier as a
6539  tag is visible, then it specifies the same type as that other declaration, and does not
6540  redeclare the tag.
6541 <p><!--para 10 -->
6542  EXAMPLE 1       This mechanism allows declaration of a self-referential structure.
6543 <pre>
6544           struct tnode {
6545                 int count;
6546                 struct tnode *left, *right;
6547           };
6548 </pre>
6549  specifies a structure that contains an integer and two pointers to objects of the same type. Once this
6550  declaration has been given, the declaration
6551  
6552  
6553  
6554  
6555 <!--page 137 -->
6556 <pre>
6557           struct tnode s, *sp;
6558 </pre>
6559  declares s to be an object of the given type and sp to be a pointer to an object of the given type. With
6560  these declarations, the expression sp-&gt;left refers to the left struct tnode pointer of the object to
6561  which sp points; the expression s.right-&gt;count designates the count member of the right struct
6562  tnode pointed to from s.
6563 <p><!--para 11 -->
6564  The following alternative formulation uses the typedef mechanism:
6565 <pre>
6566           typedef struct tnode TNODE;
6567           struct tnode {
6568                 int count;
6569                 TNODE *left, *right;
6570           };
6571           TNODE s, *sp;
6572 </pre>
6573  
6574 <p><!--para 12 -->
6575  EXAMPLE 2 To illustrate the use of prior declaration of a tag to specify a pair of mutually referential
6576  structures, the declarations
6577 <pre>
6578           struct s1 { struct s2 *s2p; /* ... */ }; // D1
6579           struct s2 { struct s1 *s1p; /* ... */ }; // D2
6580 </pre>
6581  specify a pair of structures that contain pointers to each other. Note, however, that if s2 were already
6582  declared as a tag in an enclosing scope, the declaration D1 would refer to it, not to the tag s2 declared in
6583  D2. To eliminate this context sensitivity, the declaration
6584 <pre>
6585           struct s2;
6586 </pre>
6587  may be inserted ahead of D1. This declares a new tag s2 in the inner scope; the declaration D2 then
6588  completes the specification of the new type.
6589  
6590 <p><b> Forward references</b>: declarators (<a href="#6.7.6">6.7.6</a>), type definitions (<a href="#6.7.8">6.7.8</a>).
6591
6592 <h6>footnotes</h6>
6593 <p><small><a name="note129" href="#note129">129)</a> An incomplete type may only by used when the size of an object of that type is not needed. It is not
6594  needed, for example, when a typedef name is declared to be a specifier for a structure or union, or
6595  when a pointer to or a function returning a structure or union is being declared. (See incomplete types
6596  in <a href="#6.2.5">6.2.5</a>.) The specification has to be complete before such a function is called or defined.
6597 </small>
6598 <p><small><a name="note130" href="#note130">130)</a> If there is no identifier, the type can, within the translation unit, only be referred to by the declaration
6599  of which it is a part. Of course, when the declaration is of a typedef name, subsequent declarations
6600  can make use of that typedef name to declare objects having the specified structure, union, or
6601  enumerated type.
6602 </small>
6603 <p><small><a name="note131" href="#note131">131)</a> A similar construction with enum does not exist.
6604 </small>
6605
6606 <h5><a name="6.7.2.4" href="#6.7.2.4">6.7.2.4 Atomic type specifiers</a></h5>
6607 <h6>Syntax</h6>
6608 <p><!--para 1 -->
6609 <pre>
6610           atomic-type-specifier:
6611                  _Atomic ( type-name )
6612 </pre>
6613 <h6>Constraints</h6>
6614 <p><!--para 2 -->
6615  Atomic type specifiers shall not be used if the implementation does not support atomic
6616  types (see <a href="#6.10.8.3">6.10.8.3</a>).
6617 <p><!--para 3 -->
6618  The type name in an atomic type specifier shall not refer to an array type, a function type,
6619  an atomic type, or a qualified type.
6620 <h6>Semantics</h6>
6621 <p><!--para 4 -->
6622  The properties associated with atomic types are meaningful only for expressions that are
6623  lvalues. If the _Atomic keyword is immediately followed by a left parenthesis, it is
6624  interpreted as a type specifier (with a type name), not as a type qualifier.
6625 <!--page 138 -->
6626
6627 <h4><a name="6.7.3" href="#6.7.3">6.7.3 Type qualifiers</a></h4>
6628 <h6>Syntax</h6>
6629 <p><!--para 1 -->
6630 <pre>
6631           type-qualifier:
6632                  const
6633                  restrict
6634                  volatile
6635                  _Atomic
6636 </pre>
6637 <h6>Constraints</h6>
6638 <p><!--para 2 -->
6639  Types other than pointer types whose referenced type is an object type shall not be
6640  restrict-qualified.
6641 <p><!--para 3 -->
6642  The type modified by the _Atomic qualifier shall not be an array type or a function
6643  type.
6644 <h6>Semantics</h6>
6645 <p><!--para 4 -->
6646  The properties associated with qualified types are meaningful only for expressions that
6647  are lvalues.<sup><a href="#note132"><b>132)</b></a></sup>
6648 <p><!--para 5 -->
6649  If the same qualifier appears more than once in the same specifier-qualifier-list, either
6650  directly or via one or more typedefs, the behavior is the same as if it appeared only
6651  once. If other qualifiers appear along with the _Atomic qualifier in a specifier-qualifier-
6652  list, the resulting type is the so-qualified atomic type.
6653 <p><!--para 6 -->
6654  If an attempt is made to modify an object defined with a const-qualified type through use
6655  of an lvalue with non-const-qualified type, the behavior is undefined. If an attempt is
6656  made to refer to an object defined with a volatile-qualified type through use of an lvalue
6657  with non-volatile-qualified type, the behavior is undefined.<sup><a href="#note133"><b>133)</b></a></sup>
6658 <p><!--para 7 -->
6659  An object that has volatile-qualified type may be modified in ways unknown to the
6660  implementation or have other unknown side effects. Therefore any expression referring
6661  to such an object shall be evaluated strictly according to the rules of the abstract machine,
6662  as described in <a href="#5.1.2.3">5.1.2.3</a>. Furthermore, at every sequence point the value last stored in the
6663  object shall agree with that prescribed by the abstract machine, except as modified by the
6664  
6665  
6666  
6667  
6668 <!--page 139 -->
6669  unknown factors mentioned previously.<sup><a href="#note134"><b>134)</b></a></sup> What constitutes an access to an object that
6670  has volatile-qualified type is implementation-defined.
6671 <p><!--para 8 -->
6672  An object that is accessed through a restrict-qualified pointer has a special association
6673  with that pointer. This association, defined in <a href="#6.7.3.1">6.7.3.1</a> below, requires that all accesses to
6674  that object use, directly or indirectly, the value of that particular pointer.<sup><a href="#note135"><b>135)</b></a></sup> The intended
6675  use of the restrict qualifier (like the register storage class) is to promote
6676  optimization, and deleting all instances of the qualifier from all preprocessing translation
6677  units composing a conforming program does not change its meaning (i.e., observable
6678  behavior).
6679 <p><!--para 9 -->
6680  If the specification of an array type includes any type qualifiers, the element type is so-
6681  qualified, not the array type. If the specification of a function type includes any type
6682  qualifiers, the behavior is undefined.<sup><a href="#note136"><b>136)</b></a></sup>
6683 <p><!--para 10 -->
6684  For two qualified types to be compatible, both shall have the identically qualified version
6685  of a compatible type; the order of type qualifiers within a list of specifiers or qualifiers
6686  does not affect the specified type.
6687 <p><!--para 11 -->
6688  EXAMPLE 1      An object declared
6689 <pre>
6690           extern const volatile int real_time_clock;
6691 </pre>
6692  may be modifiable by hardware, but cannot be assigned to, incremented, or decremented.
6693  
6694 <p><!--para 12 -->
6695  EXAMPLE 2 The following declarations and expressions illustrate the behavior when type qualifiers
6696  modify an aggregate type:
6697 <pre>
6698           const struct s { int mem; } cs = { 1 };
6699           struct s ncs; // the object ncs is modifiable
6700           typedef int A[2][3];
6701           const A a = {{4, 5, 6}, {7, 8, 9}}; // array of array of const int
6702           int *pi;
6703           const int *pci;
6704           ncs = cs;            //    valid
6705           cs = ncs;            //    violates modifiable lvalue constraint for =
6706           pi = &amp;ncs.mem;       //    valid
6707           pi = &amp;cs.mem;        //    violates type constraints for =
6708           pci = &amp;cs.mem;       //    valid
6709           pi = a[0];           //    invalid: a[0] has type ''const int *''
6710 </pre>
6711  
6712  
6713  
6714 <!--page 140 -->
6715 <p><!--para 13 -->
6716  EXAMPLE 3       The declaration
6717 <pre>
6718           _Atomic volatile int *p;
6719 </pre>
6720  specifies that p has the type ''pointer to volatile atomic int'', a pointer to a volatile-qualified atomic type.
6721  
6722
6723 <h6>footnotes</h6>
6724 <p><small><a name="note132" href="#note132">132)</a> The implementation may place a const object that is not volatile in a read-only region of
6725  storage. Moreover, the implementation need not allocate storage for such an object if its address is
6726  never used.
6727 </small>
6728 <p><small><a name="note133" href="#note133">133)</a> This applies to those objects that behave as if they were defined with qualified types, even if they are
6729  never actually defined as objects in the program (such as an object at a memory-mapped input/output
6730  address).
6731 </small>
6732 <p><small><a name="note134" href="#note134">134)</a> A volatile declaration may be used to describe an object corresponding to a memory-mapped
6733  input/output port or an object accessed by an asynchronously interrupting function. Actions on
6734  objects so declared shall not be ''optimized out'' by an implementation or reordered except as
6735  permitted by the rules for evaluating expressions.
6736 </small>
6737 <p><small><a name="note135" href="#note135">135)</a> For example, a statement that assigns a value returned by malloc to a single pointer establishes this
6738  association between the allocated object and the pointer.
6739 </small>
6740 <p><small><a name="note136" href="#note136">136)</a> Both of these can occur through the use of typedefs.
6741 </small>
6742
6743 <h5><a name="6.7.3.1" href="#6.7.3.1">6.7.3.1 Formal definition of restrict</a></h5>
6744 <p><!--para 1 -->
6745  Let D be a declaration of an ordinary identifier that provides a means of designating an
6746  object P as a restrict-qualified pointer to type T.
6747 <p><!--para 2 -->
6748  If D appears inside a block and does not have storage class extern, let B denote the
6749  block. If D appears in the list of parameter declarations of a function definition, let B
6750  denote the associated block. Otherwise, let B denote the block of main (or the block of
6751  whatever function is called at program startup in a freestanding environment).
6752 <p><!--para 3 -->
6753  In what follows, a pointer expression E is said to be based on object P if (at some
6754  sequence point in the execution of B prior to the evaluation of E) modifying P to point to
6755  a copy of the array object into which it formerly pointed would change the value of E.<sup><a href="#note137"><b>137)</b></a></sup>
6756  Note that ''based'' is defined only for expressions with pointer types.
6757 <p><!--para 4 -->
6758  During each execution of B, let L be any lvalue that has &amp;L based on P. If L is used to
6759  access the value of the object X that it designates, and X is also modified (by any means),
6760  then the following requirements apply: T shall not be const-qualified. Every other lvalue
6761  used to access the value of X shall also have its address based on P. Every access that
6762  modifies X shall be considered also to modify P, for the purposes of this subclause. If P
6763  is assigned the value of a pointer expression E that is based on another restricted pointer
6764  object P2, associated with block B2, then either the execution of B2 shall begin before
6765  the execution of B, or the execution of B2 shall end prior to the assignment. If these
6766  requirements are not met, then the behavior is undefined.
6767 <p><!--para 5 -->
6768  Here an execution of B means that portion of the execution of the program that would
6769  correspond to the lifetime of an object with scalar type and automatic storage duration
6770  associated with B.
6771 <p><!--para 6 -->
6772  A translator is free to ignore any or all aliasing implications of uses of restrict.
6773 <p><!--para 7 -->
6774  EXAMPLE 1       The file scope declarations
6775 <pre>
6776           int * restrict a;
6777           int * restrict b;
6778           extern int c[];
6779 </pre>
6780  assert that if an object is accessed using one of a, b, or c, and that object is modified anywhere in the
6781  program, then it is never accessed using either of the other two.
6782  
6783  
6784 <!--page 141 -->
6785 <p><!--para 8 -->
6786  EXAMPLE 2       The function parameter declarations in the following example
6787 <pre>
6788          void f(int n, int * restrict p, int * restrict q)
6789          {
6790                while (n-- &gt; 0)
6791                      *p++ = *q++;
6792          }
6793 </pre>
6794  assert that, during each execution of the function, if an object is accessed through one of the pointer
6795  parameters, then it is not also accessed through the other.
6796 <p><!--para 9 -->
6797  The benefit of the restrict qualifiers is that they enable a translator to make an effective dependence
6798  analysis of function f without examining any of the calls of f in the program. The cost is that the
6799  programmer has to examine all of those calls to ensure that none give undefined behavior. For example, the
6800  second call of f in g has undefined behavior because each of d[1] through d[49] is accessed through
6801  both p and q.
6802 <pre>
6803           void g(void)
6804           {
6805                 extern int d[100];
6806                 f(50, d + 50, d); // valid
6807                 f(50, d + 1, d); // undefined behavior
6808           }
6809 </pre>
6810  
6811 <p><!--para 10 -->
6812  EXAMPLE 3       The function parameter declarations
6813 <pre>
6814          void h(int n, int * restrict p, int * restrict q, int * restrict r)
6815          {
6816                int i;
6817                for (i = 0; i &lt; n; i++)
6818                       p[i] = q[i] + r[i];
6819          }
6820 </pre>
6821  illustrate how an unmodified object can be aliased through two restricted pointers. In particular, if a and b
6822  are disjoint arrays, a call of the form h(100, a, b, b) has defined behavior, because array b is not
6823  modified within function h.
6824  
6825 <p><!--para 11 -->
6826  EXAMPLE 4 The rule limiting assignments between restricted pointers does not distinguish between a
6827  function call and an equivalent nested block. With one exception, only ''outer-to-inner'' assignments
6828  between restricted pointers declared in nested blocks have defined behavior.
6829 <!--page 142 -->
6830 <pre>
6831          {
6832                   int * restrict p1;
6833                   int * restrict q1;
6834                   p1 = q1; // undefined behavior
6835                   {
6836                         int * restrict p2 = p1; // valid
6837                         int * restrict q2 = q1; // valid
6838                         p1 = q2;                // undefined behavior
6839                         p2 = q2;                // undefined behavior
6840                   }
6841          }
6842 </pre>
6843 <p><!--para 12 -->
6844  The one exception allows the value of a restricted pointer to be carried out of the block in which it (or, more
6845  precisely, the ordinary identifier used to designate it) is declared when that block finishes execution. For
6846  example, this permits new_vector to return a vector.
6847 <pre>
6848           typedef struct { int n; float * restrict v; } vector;
6849           vector new_vector(int n)
6850           {
6851                 vector t;
6852                 t.n = n;
6853                 t.v = malloc(n * sizeof (float));
6854                 return t;
6855           }
6856 </pre>
6857  
6858
6859 <h6>footnotes</h6>
6860 <p><small><a name="note137" href="#note137">137)</a> In other words, E depends on the value of P itself rather than on the value of an object referenced
6861  indirectly through P. For example, if identifier p has type (int **restrict), then the pointer
6862  expressions p and p+1 are based on the restricted pointer object designated by p, but the pointer
6863  expressions *p and p[1] are not.
6864 </small>
6865
6866 <h4><a name="6.7.4" href="#6.7.4">6.7.4 Function specifiers</a></h4>
6867 <h6>Syntax</h6>
6868 <p><!--para 1 -->
6869 <pre>
6870           function-specifier:
6871                  inline
6872                  _Noreturn
6873 </pre>
6874 <h6>Constraints</h6>
6875 <p><!--para 2 -->
6876  Function specifiers shall be used only in the declaration of an identifier for a function.
6877 <p><!--para 3 -->
6878  An inline definition of a function with external linkage shall not contain a definition of a
6879  modifiable object with static or thread storage duration, and shall not contain a reference
6880  to an identifier with internal linkage.
6881 <p><!--para 4 -->
6882  In a hosted environment, no function specifier(s) shall appear in a declaration of main.
6883 <h6>Semantics</h6>
6884 <p><!--para 5 -->
6885  A function specifier may appear more than once; the behavior is the same as if it
6886  appeared only once.
6887 <p><!--para 6 -->
6888  A function declared with an inline function specifier is an inline function. Making a *
6889  function an inline function suggests that calls to the function be as fast as possible.<sup><a href="#note138"><b>138)</b></a></sup>
6890  The extent to which such suggestions are effective is implementation-defined.<sup><a href="#note139"><b>139)</b></a></sup>
6891  
6892  
6893  
6894  
6895 <!--page 143 -->
6896 <p><!--para 7 -->
6897  Any function with internal linkage can be an inline function. For a function with external
6898  linkage, the following restrictions apply: If a function is declared with an inline
6899  function specifier, then it shall also be defined in the same translation unit. If all of the
6900  file scope declarations for a function in a translation unit include the inline function
6901  specifier without extern, then the definition in that translation unit is an inline
6902  definition. An inline definition does not provide an external definition for the function,
6903  and does not forbid an external definition in another translation unit. An inline definition
6904  provides an alternative to an external definition, which a translator may use to implement
6905  any call to the function in the same translation unit. It is unspecified whether a call to the
6906  function uses the inline definition or the external definition.<sup><a href="#note140"><b>140)</b></a></sup>
6907 <p><!--para 8 -->
6908  A function declared with a _Noreturn function specifier shall not return to its caller.
6909 <h6>Recommended practice</h6>
6910 <p><!--para 9 -->
6911  The implementation should produce a diagnostic message for a function declared with a
6912  _Noreturn function specifier that appears to be capable of returning to its caller.
6913 <p><!--para 10 -->
6914  EXAMPLE 1 The declaration of an inline function with external linkage can result in either an external
6915  definition, or a definition available for use only within the translation unit. A file scope declaration with
6916  extern creates an external definition. The following example shows an entire translation unit.
6917 <pre>
6918           inline double fahr(double t)
6919           {
6920                 return (9.0 * t) / 5.0 + 32.0;
6921           }
6922           inline double cels(double t)
6923           {
6924                 return (5.0 * (t - 32.0)) / 9.0;
6925           }
6926           extern double fahr(double);                  // creates an external definition
6927           double convert(int is_fahr, double temp)
6928           {
6929                 /* A translator may perform inline substitutions */
6930                 return is_fahr ? cels(temp) : fahr(temp);
6931           }
6932 </pre>
6933 <p><!--para 11 -->
6934  Note that the definition of fahr is an external definition because fahr is also declared with extern, but
6935  the definition of cels is an inline definition. Because cels has external linkage and is referenced, an
6936  external definition has to appear in another translation unit (see <a href="#6.9">6.9</a>); the inline definition and the external
6937  definition are distinct and either may be used for the call.
6938  
6939 <p><!--para 12 -->
6940  EXAMPLE 2
6941  
6942  
6943  
6944  
6945 <!--page 144 -->
6946 <pre>
6947           _Noreturn void f () {
6948                 abort(); // ok
6949           }
6950           _Noreturn void g (int i) { // causes undefined behavior if i &lt;= 0
6951                 if (i &gt; 0) abort();
6952           }
6953 </pre>
6954  
6955 <p><b> Forward references</b>: function definitions (<a href="#6.9.1">6.9.1</a>).
6956
6957 <h6>footnotes</h6>
6958 <p><small><a name="note138" href="#note138">138)</a> By using, for example, an alternative to the usual function call mechanism, such as ''inline
6959  substitution''. Inline substitution is not textual substitution, nor does it create a new function.
6960  Therefore, for example, the expansion of a macro used within the body of the function uses the
6961  definition it had at the point the function body appears, and not where the function is called; and
6962  identifiers refer to the declarations in scope where the body occurs. Likewise, the function has a
6963  single address, regardless of the number of inline definitions that occur in addition to the external
6964  definition.
6965 </small>
6966 <p><small><a name="note139" href="#note139">139)</a> For example, an implementation might never perform inline substitution, or might only perform inline
6967  substitutions to calls in the scope of an inline declaration.
6968 </small>
6969 <p><small><a name="note140" href="#note140">140)</a> Since an inline definition is distinct from the corresponding external definition and from any other
6970  corresponding inline definitions in other translation units, all corresponding objects with static storage
6971  duration are also distinct in each of the definitions.
6972 </small>
6973
6974 <h4><a name="6.7.5" href="#6.7.5">6.7.5 Alignment specifier</a></h4>
6975 <h6>Syntax</h6>
6976 <p><!--para 1 -->
6977 <pre>
6978           alignment-specifier:
6979                 _Alignas ( type-name )
6980                 _Alignas ( constant-expression )
6981 </pre>
6982 <h6>Constraints</h6>
6983 <p><!--para 2 -->
6984  An alignment attribute shall not be specified in a declaration of a typedef, or a bit-field, or
6985  a function, or a parameter, or an object declared with the register storage-class
6986  specifier.
6987 <p><!--para 3 -->
6988  The constant expression shall be an integer constant expression. It shall evaluate to a
6989  valid fundamental alignment, or to a valid extended alignment supported by the
6990  implementation in the context in which it appears, or to zero.
6991 <p><!--para 4 -->
6992  The combined effect of all alignment attributes in a declaration shall not specify an
6993  alignment that is less strict than the alignment that would otherwise be required for the
6994  type of the object or member being declared.
6995 <h6>Semantics</h6>
6996 <p><!--para 5 -->
6997  The first form is equivalent to _Alignas(alignof(type-name)).
6998 <p><!--para 6 -->
6999  The alignment requirement of the declared object or member is taken to be the specified
7000  alignment. An alignment specification of zero has no effect.<sup><a href="#note141"><b>141)</b></a></sup> When multiple
7001  alignment specifiers occur in a declaration, the effective alignment requirement is the
7002  strictest specified alignment.
7003 <p><!--para 7 -->
7004  If the definition of an object has an alignment specifier, any other declaration of that
7005  object shall either specify equivalent alignment or have no alignment specifier. If the
7006  definition of an object does not have an alignment specifier, any other declaration of that
7007  object shall also have no alignment specifier. If declarations of an object in different
7008  translation units have different alignment specifiers, the behavior is undefined.
7009  
7010  
7011  
7012 <!--page 145 -->
7013
7014 <h6>footnotes</h6>
7015 <p><small><a name="note141" href="#note141">141)</a> An alignment specification of zero also does not affect other alignment specifications in the same
7016  declaration.
7017 </small>
7018
7019 <h4><a name="6.7.6" href="#6.7.6">6.7.6 Declarators</a></h4>
7020 <h6>Syntax</h6>
7021 <p><!--para 1 -->
7022 <pre>
7023           declarator:
7024                  pointer<sub>opt</sub> direct-declarator
7025           direct-declarator:
7026                   identifier
7027                   ( declarator )
7028                   direct-declarator [ type-qualifier-list<sub>opt</sub> assignment-expression<sub>opt</sub> ]
7029                   direct-declarator [ static type-qualifier-list<sub>opt</sub> assignment-expression ]
7030                   direct-declarator [ type-qualifier-list static assignment-expression ]
7031                   direct-declarator [ type-qualifier-list<sub>opt</sub> * ]
7032                   direct-declarator ( parameter-type-list )
7033                   direct-declarator ( identifier-list<sub>opt</sub> )
7034           pointer:
7035                  * type-qualifier-list<sub>opt</sub>
7036                  * type-qualifier-list<sub>opt</sub> pointer
7037           type-qualifier-list:
7038                  type-qualifier
7039                  type-qualifier-list type-qualifier
7040           parameter-type-list:
7041                 parameter-list
7042                 parameter-list , ...
7043           parameter-list:
7044                 parameter-declaration
7045                 parameter-list , parameter-declaration
7046           parameter-declaration:
7047                 declaration-specifiers declarator
7048                 declaration-specifiers abstract-declarator<sub>opt</sub>
7049           identifier-list:
7050                  identifier
7051                  identifier-list , identifier
7052 </pre>
7053 <h6>Semantics</h6>
7054 <p><!--para 2 -->
7055  Each declarator declares one identifier, and asserts that when an operand of the same
7056  form as the declarator appears in an expression, it designates a function or object with the
7057  scope, storage duration, and type indicated by the declaration specifiers.
7058 <p><!--para 3 -->
7059  A full declarator is a declarator that is not part of another declarator. The end of a full
7060  declarator is a sequence point. If, in the nested sequence of declarators in a full
7061 <!--page 146 -->
7062  declarator, there is a declarator specifying a variable length array type, the type specified
7063  by the full declarator is said to be variably modified. Furthermore, any type derived by
7064  declarator type derivation from a variably modified type is itself variably modified.
7065 <p><!--para 4 -->
7066  In the following subclauses, consider a declaration
7067 <pre>
7068          T D1
7069 </pre>
7070  where T contains the declaration specifiers that specify a type T (such as int) and D1 is
7071  a declarator that contains an identifier ident. The type specified for the identifier ident in
7072  the various forms of declarator is described inductively using this notation.
7073 <p><!--para 5 -->
7074  If, in the declaration ''T D1'', D1 has the form
7075 <pre>
7076          identifier
7077 </pre>
7078  then the type specified for ident is T .
7079 <p><!--para 6 -->
7080  If, in the declaration ''T D1'', D1 has the form
7081 <pre>
7082          ( D )
7083 </pre>
7084  then ident has the type specified by the declaration ''T D''. Thus, a declarator in
7085  parentheses is identical to the unparenthesized declarator, but the binding of complicated
7086  declarators may be altered by parentheses.
7087 <h6>Implementation limits</h6>
7088 <p><!--para 7 -->
7089  As discussed in <a href="#5.2.4.1">5.2.4.1</a>, an implementation may limit the number of pointer, array, and
7090  function declarators that modify an arithmetic, structure, union, or void type, either
7091  directly or via one or more typedefs.
7092 <p><b> Forward references</b>: array declarators (<a href="#6.7.6.2">6.7.6.2</a>), type definitions (<a href="#6.7.8">6.7.8</a>).
7093
7094 <h5><a name="6.7.6.1" href="#6.7.6.1">6.7.6.1 Pointer declarators</a></h5>
7095 <h6>Semantics</h6>
7096 <p><!--para 1 -->
7097  If, in the declaration ''T D1'', D1 has the form
7098 <pre>
7099          * type-qualifier-list<sub>opt</sub> D
7100 </pre>
7101  and the type specified for ident in the declaration ''T D'' is ''derived-declarator-type-list
7102  T '', then the type specified for ident is ''derived-declarator-type-list type-qualifier-list
7103  pointer to T ''. For each type qualifier in the list, ident is a so-qualified pointer.
7104 <p><!--para 2 -->
7105  For two pointer types to be compatible, both shall be identically qualified and both shall
7106  be pointers to compatible types.
7107 <p><!--para 3 -->
7108  EXAMPLE The following pair of declarations demonstrates the difference between a ''variable pointer
7109  to a constant value'' and a ''constant pointer to a variable value''.
7110 <!--page 147 -->
7111 <pre>
7112           const int *ptr_to_constant;
7113           int *const constant_ptr;
7114 </pre>
7115  The contents of any object pointed to by ptr_to_constant shall not be modified through that pointer,
7116  but ptr_to_constant itself may be changed to point to another object. Similarly, the contents of the
7117  int pointed to by constant_ptr may be modified, but constant_ptr itself shall always point to the
7118  same location.
7119 <p><!--para 4 -->
7120  The declaration of the constant pointer constant_ptr may be clarified by including a definition for the
7121  type ''pointer to int''.
7122 <pre>
7123           typedef int *int_ptr;
7124           const int_ptr constant_ptr;
7125 </pre>
7126  declares constant_ptr as an object that has type ''const-qualified pointer to int''.
7127  
7128
7129 <h5><a name="6.7.6.2" href="#6.7.6.2">6.7.6.2 Array declarators</a></h5>
7130 <h6>Constraints</h6>
7131 <p><!--para 1 -->
7132  In addition to optional type qualifiers and the keyword static, the [ and ] may delimit
7133  an expression or *. If they delimit an expression (which specifies the size of an array), the
7134  expression shall have an integer type. If the expression is a constant expression, it shall
7135  have a value greater than zero. The element type shall not be an incomplete or function
7136  type. The optional type qualifiers and the keyword static shall appear only in a
7137  declaration of a function parameter with an array type, and then only in the outermost
7138  array type derivation.
7139 <p><!--para 2 -->
7140  If an identifier is declared as having a variably modified type, it shall be an ordinary
7141  identifier (as defined in <a href="#6.2.3">6.2.3</a>), have no linkage, and have either block scope or function
7142  prototype scope. If an identifier is declared to be an object with static or thread storage
7143  duration, it shall not have a variable length array type.
7144 <h6>Semantics</h6>
7145 <p><!--para 3 -->
7146  If, in the declaration ''T D1'', D1 has one of the forms:
7147 <pre>
7148           D[ type-qualifier-list<sub>opt</sub> assignment-expression<sub>opt</sub> ]
7149           D[ static type-qualifier-list<sub>opt</sub> assignment-expression ]
7150           D[ type-qualifier-list static assignment-expression ]
7151           D[ type-qualifier-list<sub>opt</sub> * ]
7152 </pre>
7153  and the type specified for ident in the declaration ''T D'' is ''derived-declarator-type-list
7154  T '', then the type specified for ident is ''derived-declarator-type-list array of T ''.<sup><a href="#note142"><b>142)</b></a></sup>
7155  (See <a href="#6.7.6.3">6.7.6.3</a> for the meaning of the optional type qualifiers and the keyword static.)
7156 <p><!--para 4 -->
7157  If the size is not present, the array type is an incomplete type. If the size is * instead of
7158  being an expression, the array type is a variable length array type of unspecified size,
7159  which can only be used in declarations or type names with function prototype scope;<sup><a href="#note143"><b>143)</b></a></sup>
7160  
7161 <!--page 148 -->
7162  such arrays are nonetheless complete types. If the size is an integer constant expression
7163  and the element type has a known constant size, the array type is not a variable length
7164  array type; otherwise, the array type is a variable length array type. (Variable length
7165  arrays are a conditional feature that implementations need not support; see <a href="#6.10.8.3">6.10.8.3</a>.)
7166 <p><!--para 5 -->
7167  If the size is an expression that is not an integer constant expression: if it occurs in a
7168  declaration at function prototype scope, it is treated as if it were replaced by *; otherwise,
7169  each time it is evaluated it shall have a value greater than zero. The size of each instance
7170  of a variable length array type does not change during its lifetime. Where a size
7171  expression is part of the operand of a sizeof operator and changing the value of the
7172  size expression would not affect the result of the operator, it is unspecified whether or not
7173  the size expression is evaluated.
7174 <p><!--para 6 -->
7175  For two array types to be compatible, both shall have compatible element types, and if
7176  both size specifiers are present, and are integer constant expressions, then both size
7177  specifiers shall have the same constant value. If the two array types are used in a context
7178  which requires them to be compatible, it is undefined behavior if the two size specifiers
7179  evaluate to unequal values.
7180 <p><!--para 7 -->
7181  EXAMPLE 1
7182 <pre>
7183           float fa[11], *afp[17];
7184 </pre>
7185  declares an array of float numbers and an array of pointers to float numbers.
7186  
7187 <p><!--para 8 -->
7188  EXAMPLE 2       Note the distinction between the declarations
7189 <pre>
7190           extern int *x;
7191           extern int y[];
7192 </pre>
7193  The first declares x to be a pointer to int; the second declares y to be an array of int of unspecified size
7194  (an incomplete type), the storage for which is defined elsewhere.
7195  
7196 <p><!--para 9 -->
7197  EXAMPLE 3       The following declarations demonstrate the compatibility rules for variably modified types.
7198 <pre>
7199           extern int n;
7200           extern int m;
7201           void fcompat(void)
7202           {
7203                 int a[n][6][m];
7204                 int (*p)[4][n+1];
7205                 int c[n][n][6][m];
7206                 int (*r)[n][n][n+1];
7207                 p = a;       // invalid: not compatible because 4 != 6
7208                 r = c;       // compatible, but defined behavior only if
7209                              // n == 6 and m == n+1
7210           }
7211 </pre>
7212  
7213  
7214  
7215  
7216 <!--page 149 -->
7217 <p><!--para 10 -->
7218  EXAMPLE 4 All declarations of variably modified (VM) types have to be at either block scope or
7219  function prototype scope. Array objects declared with the _Thread_local, static, or extern
7220  storage-class specifier cannot have a variable length array (VLA) type. However, an object declared with
7221  the static storage-class specifier can have a VM type (that is, a pointer to a VLA type). Finally, all
7222  identifiers declared with a VM type have to be ordinary identifiers and cannot, therefore, be members of
7223  structures or unions.
7224 <pre>
7225          extern int n;
7226          int A[n];                                           // invalid: file scope VLA
7227          extern int (*p2)[n];                                // invalid: file scope VM
7228          int B[100];                                         // valid: file scope but not VM
7229          void fvla(int m, int C[m][m]);                      // valid: VLA with prototype scope
7230          void fvla(int m, int C[m][m])                       // valid: adjusted to auto pointer to VLA
7231          {
7232                typedef int VLA[m][m];                        // valid: block scope typedef VLA
7233                   struct tag {
7234                         int (*y)[n];                         // invalid: y not ordinary identifier
7235                         int z[n];                            // invalid: z not ordinary identifier
7236                   };
7237                   int D[m];                                  //   valid: auto VLA
7238                   static int E[m];                           //   invalid: static block scope VLA
7239                   extern int F[m];                           //   invalid: F has linkage and is VLA
7240                   int (*s)[m];                               //   valid: auto pointer to VLA
7241                   extern int (*r)[m];                        //   invalid: r has linkage and points to VLA
7242                   static int (*q)[m] = &amp;B;                   //   valid: q is a static block pointer to VLA
7243          }
7244 </pre>
7245  
7246 <p><b> Forward references</b>:          function declarators (<a href="#6.7.6.3">6.7.6.3</a>), function definitions (<a href="#6.9.1">6.9.1</a>),
7247  initialization (<a href="#6.7.9">6.7.9</a>).
7248
7249 <h6>footnotes</h6>
7250 <p><small><a name="note142" href="#note142">142)</a> When several ''array of'' specifications are adjacent, a multidimensional array is declared.
7251 </small>
7252 <p><small><a name="note143" href="#note143">143)</a> Thus, * can be used only in function declarations that are not definitions (see <a href="#6.7.6.3">6.7.6.3</a>).
7253 </small>
7254
7255 <h5><a name="6.7.6.3" href="#6.7.6.3">6.7.6.3 Function declarators (including prototypes)</a></h5>
7256 <h6>Constraints</h6>
7257 <p><!--para 1 -->
7258  A function declarator shall not specify a return type that is a function type or an array
7259  type.
7260 <p><!--para 2 -->
7261  The only storage-class specifier that shall occur in a parameter declaration is register.
7262 <p><!--para 3 -->
7263  An identifier list in a function declarator that is not part of a definition of that function
7264  shall be empty.
7265 <p><!--para 4 -->
7266  After adjustment, the parameters in a parameter type list in a function declarator that is
7267  part of a definition of that function shall not have incomplete type.
7268 <h6>Semantics</h6>
7269 <p><!--para 5 -->
7270  If, in the declaration ''T D1'', D1 has the form
7271 <!--page 150 -->
7272 <pre>
7273         D( parameter-type-list )
7274 </pre>
7275  or
7276 <pre>
7277         D( identifier-list<sub>opt</sub> )
7278 </pre>
7279  and the type specified for ident in the declaration ''T D'' is ''derived-declarator-type-list
7280  T '', then the type specified for ident is ''derived-declarator-type-list function returning
7281  T ''.
7282 <p><!--para 6 -->
7283  A parameter type list specifies the types of, and may declare identifiers for, the
7284  parameters of the function.
7285 <p><!--para 7 -->
7286  A declaration of a parameter as ''array of type'' shall be adjusted to ''qualified pointer to
7287  type'', where the type qualifiers (if any) are those specified within the [ and ] of the
7288  array type derivation. If the keyword static also appears within the [ and ] of the
7289  array type derivation, then for each call to the function, the value of the corresponding
7290  actual argument shall provide access to the first element of an array with at least as many
7291  elements as specified by the size expression.
7292 <p><!--para 8 -->
7293  A declaration of a parameter as ''function returning type'' shall be adjusted to ''pointer to
7294  function returning type'', as in <a href="#6.3.2.1">6.3.2.1</a>.
7295 <p><!--para 9 -->
7296  If the list terminates with an ellipsis (, ...), no information about the number or types
7297  of the parameters after the comma is supplied.<sup><a href="#note144"><b>144)</b></a></sup>
7298 <p><!--para 10 -->
7299  The special case of an unnamed parameter of type void as the only item in the list
7300  specifies that the function has no parameters.
7301 <p><!--para 11 -->
7302  If, in a parameter declaration, an identifier can be treated either as a typedef name or as a
7303  parameter name, it shall be taken as a typedef name.
7304 <p><!--para 12 -->
7305  If the function declarator is not part of a definition of that function, parameters may have
7306  incomplete type and may use the [*] notation in their sequences of declarator specifiers
7307  to specify variable length array types.
7308 <p><!--para 13 -->
7309  The storage-class specifier in the declaration specifiers for a parameter declaration, if
7310  present, is ignored unless the declared parameter is one of the members of the parameter
7311  type list for a function definition.
7312 <p><!--para 14 -->
7313  An identifier list declares only the identifiers of the parameters of the function. An empty
7314  list in a function declarator that is part of a definition of that function specifies that the
7315  function has no parameters. The empty list in a function declarator that is not part of a
7316  definition of that function specifies that no information about the number or types of the
7317  parameters is supplied.<sup><a href="#note145"><b>145)</b></a></sup>
7318  
7319  
7320  
7321 <!--page 151 -->
7322 <p><!--para 15 -->
7323  For two function types to be compatible, both shall specify compatible return types.<sup><a href="#note146"><b>146)</b></a></sup>
7324  Moreover, the parameter type lists, if both are present, shall agree in the number of
7325  parameters and in use of the ellipsis terminator; corresponding parameters shall have
7326  compatible types. If one type has a parameter type list and the other type is specified by a
7327  function declarator that is not part of a function definition and that contains an empty
7328  identifier list, the parameter list shall not have an ellipsis terminator and the type of each
7329  parameter shall be compatible with the type that results from the application of the
7330  default argument promotions. If one type has a parameter type list and the other type is
7331  specified by a function definition that contains a (possibly empty) identifier list, both shall
7332  agree in the number of parameters, and the type of each prototype parameter shall be
7333  compatible with the type that results from the application of the default argument
7334  promotions to the type of the corresponding identifier. (In the determination of type
7335  compatibility and of a composite type, each parameter declared with function or array
7336  type is taken as having the adjusted type and each parameter declared with qualified type
7337  is taken as having the unqualified version of its declared type.)
7338 <p><!--para 16 -->
7339  EXAMPLE 1       The declaration
7340 <pre>
7341           int f(void), *fip(), (*pfi)();
7342 </pre>
7343  declares a function f with no parameters returning an int, a function fip with no parameter specification
7344  returning a pointer to an int, and a pointer pfi to a function with no parameter specification returning an
7345  int. It is especially useful to compare the last two. The binding of *fip() is *(fip()), so that the
7346  declaration suggests, and the same construction in an expression requires, the calling of a function fip,
7347  and then using indirection through the pointer result to yield an int. In the declarator (*pfi)(), the
7348  extra parentheses are necessary to indicate that indirection through a pointer to a function yields a function
7349  designator, which is then used to call the function; it returns an int.
7350 <p><!--para 17 -->
7351  If the declaration occurs outside of any function, the identifiers have file scope and external linkage. If the
7352  declaration occurs inside a function, the identifiers of the functions f and fip have block scope and either
7353  internal or external linkage (depending on what file scope declarations for these identifiers are visible), and
7354  the identifier of the pointer pfi has block scope and no linkage.
7355  
7356 <p><!--para 18 -->
7357  EXAMPLE 2       The declaration
7358 <pre>
7359           int (*apfi[3])(int *x, int *y);
7360 </pre>
7361  declares an array apfi of three pointers to functions returning int. Each of these functions has two
7362  parameters that are pointers to int. The identifiers x and y are declared for descriptive purposes only and
7363  go out of scope at the end of the declaration of apfi.
7364  
7365 <p><!--para 19 -->
7366  EXAMPLE 3       The declaration
7367 <pre>
7368           int (*fpfi(int (*)(long), int))(int, ...);
7369 </pre>
7370  declares a function fpfi that returns a pointer to a function returning an int. The function fpfi has two
7371  parameters: a pointer to a function returning an int (with one parameter of type long int), and an int.
7372  The pointer returned by fpfi points to a function that has one int parameter and accepts zero or more
7373  
7374  
7375 <!--page 152 -->
7376  additional arguments of any type.
7377  
7378 <p><!--para 20 -->
7379  EXAMPLE 4        The following prototype has a variably modified parameter.
7380 <pre>
7381            void addscalar(int n, int m,
7382                  double a[n][n*m+300], double x);
7383            int main()
7384            {
7385                  double b[4][308];
7386                  addscalar(4, 2, b, <a href="#2.17">2.17</a>);
7387                  return 0;
7388            }
7389            void addscalar(int n, int m,
7390                  double a[n][n*m+300], double x)
7391            {
7392                  for (int i = 0; i &lt; n; i++)
7393                        for (int j = 0, k = n*m+300; j &lt; k; j++)
7394                              // a is a pointer to a VLA with n*m+300 elements
7395                              a[i][j] += x;
7396            }
7397 </pre>
7398  
7399 <p><!--para 21 -->
7400  EXAMPLE 5        The following are all compatible function prototype declarators.
7401 <pre>
7402            double    maximum(int       n,   int   m,   double   a[n][m]);
7403            double    maximum(int       n,   int   m,   double   a[*][*]);
7404            double    maximum(int       n,   int   m,   double   a[ ][*]);
7405            double    maximum(int       n,   int   m,   double   a[ ][m]);
7406 </pre>
7407  as are:
7408 <pre>
7409            void   f(double     (* restrict a)[5]);
7410            void   f(double     a[restrict][5]);
7411            void   f(double     a[restrict 3][5]);
7412            void   f(double     a[restrict static 3][5]);
7413 </pre>
7414  (Note that the last declaration also specifies that the argument corresponding to a in any call to f must be a
7415  non-null pointer to the first of at least three arrays of 5 doubles, which the others do not.)
7416  
7417 <p><b> Forward references</b>: function definitions (<a href="#6.9.1">6.9.1</a>), type names (<a href="#6.7.7">6.7.7</a>).
7418 <!--page 153 -->
7419
7420 <h6>footnotes</h6>
7421 <p><small><a name="note144" href="#note144">144)</a> The macros defined in the <a href="#7.16">&lt;stdarg.h&gt;</a> header (<a href="#7.16">7.16</a>) may be used to access arguments that
7422  correspond to the ellipsis.
7423 </small>
7424 <p><small><a name="note145" href="#note145">145)</a> See ''future language directions'' (<a href="#6.11.6">6.11.6</a>).
7425 </small>
7426 <p><small><a name="note146" href="#note146">146)</a> If both function types are ''old style'', parameter types are not compared.
7427 </small>
7428
7429 <h4><a name="6.7.7" href="#6.7.7">6.7.7 Type names</a></h4>
7430 <h6>Syntax</h6>
7431 <p><!--para 1 -->
7432 <pre>
7433           type-name:
7434                  specifier-qualifier-list abstract-declarator<sub>opt</sub>
7435           abstract-declarator:
7436                  pointer
7437                  pointer<sub>opt</sub> direct-abstract-declarator
7438           direct-abstract-declarator:
7439                   ( abstract-declarator )
7440                   direct-abstract-declarator<sub>opt</sub> [ type-qualifier-list<sub>opt</sub>
7441                                  assignment-expression<sub>opt</sub> ]
7442                   direct-abstract-declarator<sub>opt</sub> [ static type-qualifier-list<sub>opt</sub>
7443                                  assignment-expression ]
7444                   direct-abstract-declarator<sub>opt</sub> [ type-qualifier-list static
7445                                  assignment-expression ]
7446                   direct-abstract-declarator<sub>opt</sub> [ * ]
7447                   direct-abstract-declarator<sub>opt</sub> ( parameter-type-list<sub>opt</sub> )
7448 </pre>
7449 <h6>Semantics</h6>
7450 <p><!--para 2 -->
7451  In several contexts, it is necessary to specify a type. This is accomplished using a type
7452  name, which is syntactically a declaration for a function or an object of that type that
7453  omits the identifier.<sup><a href="#note147"><b>147)</b></a></sup>
7454 <p><!--para 3 -->
7455  EXAMPLE        The constructions
7456 <pre>
7457           (a)      int
7458           (b)      int   *
7459           (c)      int   *[3]
7460           (d)      int   (*)[3]
7461           (e)      int   (*)[*]
7462           (f)      int   *()
7463           (g)      int   (*)(void)
7464           (h)      int   (*const [])(unsigned int, ...)
7465 </pre>
7466  name respectively the types (a) int, (b) pointer to int, (c) array of three pointers to int, (d) pointer to an
7467  array of three ints, (e) pointer to a variable length array of an unspecified number of ints, (f) function
7468  with no parameter specification returning a pointer to int, (g) pointer to function with no parameters
7469  returning an int, and (h) array of an unspecified number of constant pointers to functions, each with one
7470  parameter that has type unsigned int and an unspecified number of other parameters, returning an
7471  int.
7472  
7473  
7474  
7475  
7476 <!--page 154 -->
7477
7478 <h6>footnotes</h6>
7479 <p><small><a name="note147" href="#note147">147)</a> As indicated by the syntax, empty parentheses in a type name are interpreted as ''function with no
7480  parameter specification'', rather than redundant parentheses around the omitted identifier.
7481 </small>
7482
7483 <h4><a name="6.7.8" href="#6.7.8">6.7.8 Type definitions</a></h4>
7484 <h6>Syntax</h6>
7485 <p><!--para 1 -->
7486 <pre>
7487           typedef-name:
7488                  identifier
7489 </pre>
7490 <h6>Constraints</h6>
7491 <p><!--para 2 -->
7492  If a typedef name specifies a variably modified type then it shall have block scope.
7493 <h6>Semantics</h6>
7494 <p><!--para 3 -->
7495  In a declaration whose storage-class specifier is typedef, each declarator defines an
7496  identifier to be a typedef name that denotes the type specified for the identifier in the way
7497  described in <a href="#6.7.6">6.7.6</a>. Any array size expressions associated with variable length array
7498  declarators are evaluated each time the declaration of the typedef name is reached in the
7499  order of execution. A typedef declaration does not introduce a new type, only a
7500  synonym for the type so specified. That is, in the following declarations:
7501 <pre>
7502           typedef T type_ident;
7503           type_ident D;
7504 </pre>
7505  type_ident is defined as a typedef name with the type specified by the declaration
7506  specifiers in T (known as T ), and the identifier in D has the type ''derived-declarator-
7507  type-list T '' where the derived-declarator-type-list is specified by the declarators of D. A
7508  typedef name shares the same name space as other identifiers declared in ordinary
7509  declarators.
7510 <p><!--para 4 -->
7511  EXAMPLE 1       After
7512 <pre>
7513           typedef int MILES, KLICKSP();
7514           typedef struct { double hi, lo; } range;
7515 </pre>
7516  the constructions
7517 <pre>
7518           MILES distance;
7519           extern KLICKSP *metricp;
7520           range x;
7521           range z, *zp;
7522 </pre>
7523  are all valid declarations. The type of distance is int, that of metricp is ''pointer to function with no
7524  parameter specification returning int'', and that of x and z is the specified structure; zp is a pointer to
7525  such a structure. The object distance has a type compatible with any other int object.
7526  
7527 <p><!--para 5 -->
7528  EXAMPLE 2       After the declarations
7529 <pre>
7530           typedef struct s1 { int x; } t1, *tp1;
7531           typedef struct s2 { int x; } t2, *tp2;
7532 </pre>
7533  type t1 and the type pointed to by tp1 are compatible. Type t1 is also compatible with type struct
7534  s1, but not compatible with the types struct s2, t2, the type pointed to by tp2, or int.
7535 <!--page 155 -->
7536 <p><!--para 6 -->
7537  EXAMPLE 3       The following obscure constructions
7538 <pre>
7539           typedef signed int t;
7540           typedef int plain;
7541           struct tag {
7542                 unsigned t:4;
7543                 const t:5;
7544                 plain r:5;
7545           };
7546 </pre>
7547  declare a typedef name t with type signed int, a typedef name plain with type int, and a structure
7548  with three bit-field members, one named t that contains values in the range [0, 15], an unnamed const-
7549  qualified bit-field which (if it could be accessed) would contain values in either the range [-15, +15] or
7550  [-16, +15], and one named r that contains values in one of the ranges [0, 31], [-15, +15], or [-16, +15].
7551  (The choice of range is implementation-defined.) The first two bit-field declarations differ in that
7552  unsigned is a type specifier (which forces t to be the name of a structure member), while const is a
7553  type qualifier (which modifies t which is still visible as a typedef name). If these declarations are followed
7554  in an inner scope by
7555 <pre>
7556           t f(t (t));
7557           long t;
7558 </pre>
7559  then a function f is declared with type ''function returning signed int with one unnamed parameter
7560  with type pointer to function returning signed int with one unnamed parameter with type signed
7561  int'', and an identifier t with type long int.
7562  
7563 <p><!--para 7 -->
7564  EXAMPLE 4 On the other hand, typedef names can be used to improve code readability. All three of the
7565  following declarations of the signal function specify exactly the same type, the first without making use
7566  of any typedef names.
7567 <pre>
7568           typedef void fv(int), (*pfv)(int);
7569           void (*signal(int, void (*)(int)))(int);
7570           fv *signal(int, fv *);
7571           pfv signal(int, pfv);
7572 </pre>
7573  
7574 <p><!--para 8 -->
7575  EXAMPLE 5 If a typedef name denotes a variable length array type, the length of the array is fixed at the
7576  time the typedef name is defined, not each time it is used:
7577 <!--page 156 -->
7578 <pre>
7579           void copyt(int n)
7580           {
7581                 typedef int B[n];   //               B is n ints, n evaluated now
7582                 n += 1;
7583                 B a;                //               a is n ints, n without += 1
7584                 int b[n];           //               a and b are different sizes
7585                 for (int i = 1; i &lt; n;               i++)
7586                       a[i-1] = b[i];
7587           }
7588 </pre>
7589
7590 <h4><a name="6.7.9" href="#6.7.9">6.7.9 Initialization</a></h4>
7591 <h6>Syntax</h6>
7592 <p><!--para 1 -->
7593 <pre>
7594           initializer:
7595                    assignment-expression
7596                    { initializer-list }
7597                    { initializer-list , }
7598           initializer-list:
7599                    designation<sub>opt</sub> initializer
7600                    initializer-list , designation<sub>opt</sub> initializer
7601           designation:
7602                  designator-list =
7603           designator-list:
7604                  designator
7605                  designator-list designator
7606           designator:
7607                  [ constant-expression ]
7608                  . identifier
7609 </pre>
7610 <h6>Constraints</h6>
7611 <p><!--para 2 -->
7612  No initializer shall attempt to provide a value for an object not contained within the entity
7613  being initialized.
7614 <p><!--para 3 -->
7615  The type of the entity to be initialized shall be an array of unknown size or a complete
7616  object type that is not a variable length array type.
7617 <p><!--para 4 -->
7618  All the expressions in an initializer for an object that has static or thread storage duration
7619  shall be constant expressions or string literals.
7620 <p><!--para 5 -->
7621  If the declaration of an identifier has block scope, and the identifier has external or
7622  internal linkage, the declaration shall have no initializer for the identifier.
7623 <p><!--para 6 -->
7624  If a designator has the form
7625 <pre>
7626           [ constant-expression ]
7627 </pre>
7628  then the current object (defined below) shall have array type and the expression shall be
7629  an integer constant expression. If the array is of unknown size, any nonnegative value is
7630  valid.
7631 <p><!--para 7 -->
7632  If a designator has the form
7633 <pre>
7634           . identifier
7635 </pre>
7636  then the current object (defined below) shall have structure or union type and the
7637  identifier shall be the name of a member of that type.
7638 <!--page 157 -->
7639 <h6>Semantics</h6>
7640 <p><!--para 8 -->
7641  An initializer specifies the initial value stored in an object.
7642 <p><!--para 9 -->
7643  Except where explicitly stated otherwise, for the purposes of this subclause unnamed
7644  members of objects of structure and union type do not participate in initialization.
7645  Unnamed members of structure objects have indeterminate value even after initialization.
7646 <p><!--para 10 -->
7647  If an object that has automatic storage duration is not initialized explicitly, its value is
7648  indeterminate. If an object that has static or thread storage duration is not initialized
7649  explicitly, then:
7650 <ul>
7651 <li>  if it has pointer type, it is initialized to a null pointer;
7652 <li>  if it has arithmetic type, it is initialized to (positive or unsigned) zero;
7653 <li>  if it is an aggregate, every member is initialized (recursively) according to these rules,
7654  and any padding is initialized to zero bits;
7655 <li>  if it is a union, the first named member is initialized (recursively) according to these
7656  rules, and any padding is initialized to zero bits;
7657 </ul>
7658 <p><!--para 11 -->
7659  The initializer for a scalar shall be a single expression, optionally enclosed in braces. The
7660  initial value of the object is that of the expression (after conversion); the same type
7661  constraints and conversions as for simple assignment apply, taking the type of the scalar
7662  to be the unqualified version of its declared type.
7663 <p><!--para 12 -->
7664  The rest of this subclause deals with initializers for objects that have aggregate or union
7665  type.
7666 <p><!--para 13 -->
7667  The initializer for a structure or union object that has automatic storage duration shall be
7668  either an initializer list as described below, or a single expression that has compatible
7669  structure or union type. In the latter case, the initial value of the object, including
7670  unnamed members, is that of the expression.
7671 <p><!--para 14 -->
7672  An array of character type may be initialized by a character string literal or UTF-8 string
7673  literal, optionally enclosed in braces. Successive bytes of the string literal (including the
7674  terminating null character if there is room or if the array is of unknown size) initialize the
7675  elements of the array.
7676 <p><!--para 15 -->
7677  An array with element type compatible with a qualified or unqualified version of
7678  wchar_t may be initialized by a wide string literal, optionally enclosed in braces.
7679  Successive wide characters of the wide string literal (including the terminating null wide
7680  character if there is room or if the array is of unknown size) initialize the elements of the
7681  array.
7682 <p><!--para 16 -->
7683  Otherwise, the initializer for an object that has aggregate or union type shall be a brace-
7684  enclosed list of initializers for the elements or named members.
7685 <!--page 158 -->
7686 <p><!--para 17 -->
7687  Each brace-enclosed initializer list has an associated current object. When no
7688  designations are present, subobjects of the current object are initialized in order according
7689  to the type of the current object: array elements in increasing subscript order, structure
7690  members in declaration order, and the first named member of a union.<sup><a href="#note148"><b>148)</b></a></sup> In contrast, a
7691  designation causes the following initializer to begin initialization of the subobject
7692  described by the designator. Initialization then continues forward in order, beginning
7693  with the next subobject after that described by the designator.<sup><a href="#note149"><b>149)</b></a></sup>
7694 <p><!--para 18 -->
7695  Each designator list begins its description with the current object associated with the
7696  closest surrounding brace pair. Each item in the designator list (in order) specifies a
7697  particular member of its current object and changes the current object for the next
7698  designator (if any) to be that member.<sup><a href="#note150"><b>150)</b></a></sup> The current object that results at the end of the
7699  designator list is the subobject to be initialized by the following initializer.
7700 <p><!--para 19 -->
7701  The initialization shall occur in initializer list order, each initializer provided for a
7702  particular subobject overriding any previously listed initializer for the same subobject;<sup><a href="#note151"><b>151)</b></a></sup>
7703  all subobjects that are not initialized explicitly shall be initialized implicitly the same as
7704  objects that have static storage duration.
7705 <p><!--para 20 -->
7706  If the aggregate or union contains elements or members that are aggregates or unions,
7707  these rules apply recursively to the subaggregates or contained unions. If the initializer of
7708  a subaggregate or contained union begins with a left brace, the initializers enclosed by
7709  that brace and its matching right brace initialize the elements or members of the
7710  subaggregate or the contained union. Otherwise, only enough initializers from the list are
7711  taken to account for the elements or members of the subaggregate or the first member of
7712  the contained union; any remaining initializers are left to initialize the next element or
7713  member of the aggregate of which the current subaggregate or contained union is a part.
7714 <p><!--para 21 -->
7715  If there are fewer initializers in a brace-enclosed list than there are elements or members
7716  of an aggregate, or fewer characters in a string literal used to initialize an array of known
7717  size than there are elements in the array, the remainder of the aggregate shall be
7718  initialized implicitly the same as objects that have static storage duration.
7719  
7720  
7721  
7722 <!--page 159 -->
7723 <p><!--para 22 -->
7724  If an array of unknown size is initialized, its size is determined by the largest indexed
7725  element with an explicit initializer. The array type is completed at the end of its
7726  initializer list.
7727 <p><!--para 23 -->
7728  The evaluations of the initialization list expressions are indeterminately sequenced with
7729  respect to one another and thus the order in which any side effects occur is
7730  unspecified.<sup><a href="#note152"><b>152)</b></a></sup>
7731 <p><!--para 24 -->
7732  EXAMPLE 1       Provided that <a href="#7.3">&lt;complex.h&gt;</a> has been #included, the declarations
7733 <pre>
7734           int i = <a href="#3.5">3.5</a>;
7735           double complex c = 5 + 3 * I;
7736 </pre>
7737  define and initialize i with the value 3 and c with the value 5.0 + i3.0.
7738  
7739 <p><!--para 25 -->
7740  EXAMPLE 2       The declaration
7741 <pre>
7742           int x[] = { 1, 3, 5 };
7743 </pre>
7744  defines and initializes x as a one-dimensional array object that has three elements, as no size was specified
7745  and there are three initializers.
7746  
7747 <p><!--para 26 -->
7748  EXAMPLE 3       The declaration
7749 <pre>
7750           int y[4][3] =         {
7751                 { 1, 3,         5 },
7752                 { 2, 4,         6 },
7753                 { 3, 5,         7 },
7754           };
7755 </pre>
7756  is a definition with a fully bracketed initialization: 1, 3, and 5 initialize the first row of y (the array object
7757  y[0]), namely y[0][0], y[0][1], and y[0][2]. Likewise the next two lines initialize y[1] and
7758  y[2]. The initializer ends early, so y[3] is initialized with zeros. Precisely the same effect could have
7759  been achieved by
7760 <pre>
7761           int y[4][3] = {
7762                 1, 3, 5, 2, 4, 6, 3, 5, 7
7763           };
7764 </pre>
7765  The initializer for y[0] does not begin with a left brace, so three items from the list are used. Likewise the
7766  next three are taken successively for y[1] and y[2].
7767  
7768 <p><!--para 27 -->
7769  EXAMPLE 4       The declaration
7770 <pre>
7771           int z[4][3] = {
7772                 { 1 }, { 2 }, { 3 }, { 4 }
7773           };
7774 </pre>
7775  initializes the first column of z as specified and initializes the rest with zeros.
7776  
7777 <p><!--para 28 -->
7778  EXAMPLE 5       The declaration
7779 <pre>
7780           struct { int a[3], b; } w[] = { { 1 }, 2 };
7781 </pre>
7782  is a definition with an inconsistently bracketed initialization. It defines an array with two element
7783  
7784  
7785  
7786 <!--page 160 -->
7787  structures: w[0].a[0] is 1 and w[1].a[0] is 2; all the other elements are zero.
7788  
7789 <p><!--para 29 -->
7790  EXAMPLE 6         The declaration
7791 <pre>
7792            short q[4][3][2] = {
7793                  { 1 },
7794                  { 2, 3 },
7795                  { 4, 5, 6 }
7796            };
7797 </pre>
7798  contains an incompletely but consistently bracketed initialization. It defines a three-dimensional array
7799  object: q[0][0][0] is 1, q[1][0][0] is 2, q[1][0][1] is 3, and 4, 5, and 6 initialize
7800  q[2][0][0], q[2][0][1], and q[2][1][0], respectively; all the rest are zero. The initializer for
7801  q[0][0] does not begin with a left brace, so up to six items from the current list may be used. There is
7802  only one, so the values for the remaining five elements are initialized with zero. Likewise, the initializers
7803  for q[1][0] and q[2][0] do not begin with a left brace, so each uses up to six items, initializing their
7804  respective two-dimensional subaggregates. If there had been more than six items in any of the lists, a
7805  diagnostic message would have been issued. The same initialization result could have been achieved by:
7806 <pre>
7807            short q[4][3][2] = {
7808                  1, 0, 0, 0, 0, 0,
7809                  2, 3, 0, 0, 0, 0,
7810                  4, 5, 6
7811            };
7812 </pre>
7813  or by:
7814 <pre>
7815            short q[4][3][2] = {
7816                  {
7817                        { 1 },
7818                  },
7819                  {
7820                        { 2, 3 },
7821                  },
7822                  {
7823                        { 4, 5 },
7824                        { 6 },
7825                  }
7826            };
7827 </pre>
7828  in a fully bracketed form.
7829 <p><!--para 30 -->
7830  Note that the fully bracketed and minimally bracketed forms of initialization are, in general, less likely to
7831  cause confusion.
7832  
7833 <p><!--para 31 -->
7834  EXAMPLE 7         One form of initialization that completes array types involves typedef names. Given the
7835  declaration
7836 <pre>
7837            typedef int A[];          // OK - declared with block scope
7838 </pre>
7839  the declaration
7840 <pre>
7841            A a = { 1, 2 }, b = { 3, 4, 5 };
7842 </pre>
7843  is identical to
7844 <pre>
7845            int a[] = { 1, 2 }, b[] = { 3, 4, 5 };
7846 </pre>
7847  due to the rules for incomplete types.
7848 <!--page 161 -->
7849 <p><!--para 32 -->
7850  EXAMPLE 8       The declaration
7851 <pre>
7852           char s[] = "abc", t[3] = "abc";
7853 </pre>
7854  defines ''plain'' char array objects s and t whose elements are initialized with character string literals.
7855  This declaration is identical to
7856 <pre>
7857           char s[] = { 'a', 'b', 'c', '\0' },
7858                t[] = { 'a', 'b', 'c' };
7859 </pre>
7860  The contents of the arrays are modifiable. On the other hand, the declaration
7861 <pre>
7862           char *p = "abc";
7863 </pre>
7864  defines p with type ''pointer to char'' and initializes it to point to an object with type ''array of char''
7865  with length 4 whose elements are initialized with a character string literal. If an attempt is made to use p to
7866  modify the contents of the array, the behavior is undefined.
7867  
7868 <p><!--para 33 -->
7869  EXAMPLE 9       Arrays can be initialized to correspond to the elements of an enumeration by using
7870  designators:
7871 <pre>
7872           enum { member_one,           member_two };
7873           const char *nm[] =           {
7874                 [member_two]           = "member two",
7875                 [member_one]           = "member one",
7876           };
7877 </pre>
7878  
7879 <p><!--para 34 -->
7880  EXAMPLE 10       Structure members can be initialized to nonzero values without depending on their order:
7881 <pre>
7882           div_t answer = { .quot = 2, .rem = -1 };
7883 </pre>
7884  
7885 <p><!--para 35 -->
7886  EXAMPLE 11 Designators can be used to provide explicit initialization when unadorned initializer lists
7887  might be misunderstood:
7888 <pre>
7889           struct { int a[3], b; } w[] =
7890                 { [0].a = {1}, [1].a[0] = 2 };
7891 </pre>
7892  
7893 <p><!--para 36 -->
7894  EXAMPLE 12       Space can be ''allocated'' from both ends of an array by using a single designator:
7895 <pre>
7896           int a[MAX] = {
7897                 1, 3, 5, 7, 9, [MAX-5] = 8, 6, 4, 2, 0
7898           };
7899 </pre>
7900 <p><!--para 37 -->
7901  In the above, if MAX is greater than ten, there will be some zero-valued elements in the middle; if it is less
7902  than ten, some of the values provided by the first five initializers will be overridden by the second five.
7903  
7904 <p><!--para 38 -->
7905  EXAMPLE 13       Any member of a union can be initialized:
7906 <pre>
7907           union { /* ... */ } u = { .any_member = 42 };
7908 </pre>
7909  
7910 <p><b> Forward references</b>: common definitions <a href="#7.19">&lt;stddef.h&gt;</a> (<a href="#7.19">7.19</a>).
7911 <!--page 162 -->
7912
7913 <h6>footnotes</h6>
7914 <p><small><a name="note148" href="#note148">148)</a> If the initializer list for a subaggregate or contained union does not begin with a left brace, its
7915  subobjects are initialized as usual, but the subaggregate or contained union does not become the
7916  current object: current objects are associated only with brace-enclosed initializer lists.
7917 </small>
7918 <p><small><a name="note149" href="#note149">149)</a> After a union member is initialized, the next object is not the next member of the union; instead, it is
7919  the next subobject of an object containing the union.
7920 </small>
7921 <p><small><a name="note150" href="#note150">150)</a> Thus, a designator can only specify a strict subobject of the aggregate or union that is associated with
7922  the surrounding brace pair. Note, too, that each separate designator list is independent.
7923 </small>
7924 <p><small><a name="note151" href="#note151">151)</a> Any initializer for the subobject which is overridden and so not used to initialize that subobject might
7925  not be evaluated at all.
7926 </small>
7927 <p><small><a name="note152" href="#note152">152)</a> In particular, the evaluation order need not be the same as the order of subobject initialization.
7928 </small>
7929
7930 <h4><a name="6.7.10" href="#6.7.10">6.7.10 Static assertions</a></h4>
7931 <h6>Syntax</h6>
7932 <p><!--para 1 -->
7933 <pre>
7934           static_assert-declaration:
7935                   _Static_assert ( constant-expression , string-literal ) ;
7936 </pre>
7937 <h6>Constraints</h6>
7938 <p><!--para 2 -->
7939  The constant expression shall compare unequal to 0.
7940 <h6>Semantics</h6>
7941 <p><!--para 3 -->
7942  The constant expression shall be an integer constant expression. If the value of the
7943  constant expression compares unequal to 0, the declaration has no effect. Otherwise, the
7944  constraint is violated and the implementation shall produce a diagnostic message that
7945  includes the text of the string literal, except that characters not in the basic source
7946  character set are not required to appear in the message.
7947 <p><b> Forward references</b>: diagnostics (<a href="#7.2">7.2</a>).
7948 <!--page 163 -->
7949
7950 <h3><a name="6.8" href="#6.8">6.8 Statements and blocks</a></h3>
7951 <h6>Syntax</h6>
7952 <p><!--para 1 -->
7953 <pre>
7954           statement:
7955                  labeled-statement
7956                  compound-statement
7957                  expression-statement
7958                  selection-statement
7959                  iteration-statement
7960                  jump-statement
7961 </pre>
7962 <h6>Semantics</h6>
7963 <p><!--para 2 -->
7964  A statement specifies an action to be performed. Except as indicated, statements are
7965  executed in sequence.
7966 <p><!--para 3 -->
7967  A block allows a set of declarations and statements to be grouped into one syntactic unit.
7968  The initializers of objects that have automatic storage duration, and the variable length
7969  array declarators of ordinary identifiers with block scope, are evaluated and the values are
7970  stored in the objects (including storing an indeterminate value in objects without an
7971  initializer) each time the declaration is reached in the order of execution, as if it were a
7972  statement, and within each declaration in the order that declarators appear.
7973 <p><!--para 4 -->
7974  A full expression is an expression that is not part of another expression or of a declarator.
7975  Each of the following is a full expression: an initializer that is not part of a compound
7976  literal; the expression in an expression statement; the controlling expression of a selection
7977  statement (if or switch); the controlling expression of a while or do statement; each
7978  of the (optional) expressions of a for statement; the (optional) expression in a return
7979  statement. There is a sequence point between the evaluation of a full expression and the
7980  evaluation of the next full expression to be evaluated.
7981 <p><b> Forward references</b>: expression and null statements (<a href="#6.8.3">6.8.3</a>), selection statements
7982  (<a href="#6.8.4">6.8.4</a>), iteration statements (<a href="#6.8.5">6.8.5</a>), the return statement (<a href="#6.8.6.4">6.8.6.4</a>).
7983
7984 <h4><a name="6.8.1" href="#6.8.1">6.8.1 Labeled statements</a></h4>
7985 <h6>Syntax</h6>
7986 <p><!--para 1 -->
7987 <pre>
7988           labeled-statement:
7989                  identifier : statement
7990                  case constant-expression : statement
7991                  default : statement
7992 </pre>
7993 <h6>Constraints</h6>
7994 <p><!--para 2 -->
7995  A case or default label shall appear only in a switch statement. Further
7996  constraints on such labels are discussed under the switch statement.
7997 <!--page 164 -->
7998 <p><!--para 3 -->
7999  Label names shall be unique within a function.
8000 <h6>Semantics</h6>
8001 <p><!--para 4 -->
8002  Any statement may be preceded by a prefix that declares an identifier as a label name.
8003  Labels in themselves do not alter the flow of control, which continues unimpeded across
8004  them.
8005 <p><b> Forward references</b>: the goto statement (<a href="#6.8.6.1">6.8.6.1</a>), the switch statement (<a href="#6.8.4.2">6.8.4.2</a>).
8006
8007 <h4><a name="6.8.2" href="#6.8.2">6.8.2 Compound statement</a></h4>
8008 <h6>Syntax</h6>
8009 <p><!--para 1 -->
8010 <pre>
8011           compound-statement:
8012                 { block-item-list<sub>opt</sub> }
8013           block-item-list:
8014                   block-item
8015                   block-item-list block-item
8016           block-item:
8017                   declaration
8018                   statement
8019 </pre>
8020 <h6>Semantics</h6>
8021 <p><!--para 2 -->
8022  A compound statement is a block.
8023
8024 <h4><a name="6.8.3" href="#6.8.3">6.8.3 Expression and null statements</a></h4>
8025 <h6>Syntax</h6>
8026 <p><!--para 1 -->
8027 <pre>
8028           expression-statement:
8029                  expression<sub>opt</sub> ;
8030 </pre>
8031 <h6>Semantics</h6>
8032 <p><!--para 2 -->
8033  The expression in an expression statement is evaluated as a void expression for its side
8034  effects.<sup><a href="#note153"><b>153)</b></a></sup>
8035 <p><!--para 3 -->
8036  A null statement (consisting of just a semicolon) performs no operations.
8037 <p><!--para 4 -->
8038  EXAMPLE 1 If a function call is evaluated as an expression statement for its side effects only, the
8039  discarding of its value may be made explicit by converting the expression to a void expression by means of
8040  a cast:
8041 <pre>
8042           int p(int);
8043           /* ... */
8044           (void)p(0);
8045 </pre>
8046  
8047  
8048  
8049 <!--page 165 -->
8050 <p><!--para 5 -->
8051  EXAMPLE 2       In the program fragment
8052 <pre>
8053           char *s;
8054           /* ... */
8055           while (*s++ != '\0')
8056                   ;
8057 </pre>
8058  a null statement is used to supply an empty loop body to the iteration statement.
8059  
8060 <p><!--para 6 -->
8061  EXAMPLE 3       A null statement may also be used to carry a label just before the closing } of a compound
8062  statement.
8063 <pre>
8064           while (loop1) {
8065                 /* ... */
8066                 while (loop2) {
8067                         /* ... */
8068                         if (want_out)
8069                                 goto end_loop1;
8070                         /* ... */
8071                 }
8072                 /* ... */
8073           end_loop1: ;
8074           }
8075 </pre>
8076  
8077 <p><b> Forward references</b>: iteration statements (<a href="#6.8.5">6.8.5</a>).
8078
8079 <h6>footnotes</h6>
8080 <p><small><a name="note153" href="#note153">153)</a> Such as assignments, and function calls which have side effects.
8081 </small>
8082
8083 <h4><a name="6.8.4" href="#6.8.4">6.8.4 Selection statements</a></h4>
8084 <h6>Syntax</h6>
8085 <p><!--para 1 -->
8086 <pre>
8087           selection-statement:
8088                   if ( expression ) statement
8089                   if ( expression ) statement else statement
8090                   switch ( expression ) statement
8091 </pre>
8092 <h6>Semantics</h6>
8093 <p><!--para 2 -->
8094  A selection statement selects among a set of statements depending on the value of a
8095  controlling expression.
8096 <p><!--para 3 -->
8097  A selection statement is a block whose scope is a strict subset of the scope of its
8098  enclosing block. Each associated substatement is also a block whose scope is a strict
8099  subset of the scope of the selection statement.
8100
8101 <h5><a name="6.8.4.1" href="#6.8.4.1">6.8.4.1 The if statement</a></h5>
8102 <h6>Constraints</h6>
8103 <p><!--para 1 -->
8104  The controlling expression of an if statement shall have scalar type.
8105 <h6>Semantics</h6>
8106 <p><!--para 2 -->
8107  In both forms, the first substatement is executed if the expression compares unequal to 0.
8108  In the else form, the second substatement is executed if the expression compares equal
8109 <!--page 166 -->
8110  to 0. If the first substatement is reached via a label, the second substatement is not
8111  executed.
8112 <p><!--para 3 -->
8113  An else is associated with the lexically nearest preceding if that is allowed by the
8114  syntax.
8115
8116 <h5><a name="6.8.4.2" href="#6.8.4.2">6.8.4.2 The switch statement</a></h5>
8117 <h6>Constraints</h6>
8118 <p><!--para 1 -->
8119  The controlling expression of a switch statement shall have integer type.
8120 <p><!--para 2 -->
8121  If a switch statement has an associated case or default label within the scope of an
8122  identifier with a variably modified type, the entire switch statement shall be within the
8123  scope of that identifier.<sup><a href="#note154"><b>154)</b></a></sup>
8124 <p><!--para 3 -->
8125  The expression of each case label shall be an integer constant expression and no two of
8126  the case constant expressions in the same switch statement shall have the same value
8127  after conversion. There may be at most one default label in a switch statement.
8128  (Any enclosed switch statement may have a default label or case constant
8129  expressions with values that duplicate case constant expressions in the enclosing
8130  switch statement.)
8131 <h6>Semantics</h6>
8132 <p><!--para 4 -->
8133  A switch statement causes control to jump to, into, or past the statement that is the
8134  switch body, depending on the value of a controlling expression, and on the presence of a
8135  default label and the values of any case labels on or in the switch body. A case or
8136  default label is accessible only within the closest enclosing switch statement.
8137 <p><!--para 5 -->
8138  The integer promotions are performed on the controlling expression. The constant
8139  expression in each case label is converted to the promoted type of the controlling
8140  expression. If a converted value matches that of the promoted controlling expression,
8141  control jumps to the statement following the matched case label. Otherwise, if there is
8142  a default label, control jumps to the labeled statement. If no converted case constant
8143  expression matches and there is no default label, no part of the switch body is
8144  executed.
8145 <h6>Implementation limits</h6>
8146 <p><!--para 6 -->
8147  As discussed in <a href="#5.2.4.1">5.2.4.1</a>, the implementation may limit the number of case values in a
8148  switch statement.
8149  
8150  
8151  
8152  
8153 <!--page 167 -->
8154 <p><!--para 7 -->
8155  EXAMPLE        In the artificial program fragment
8156 <pre>
8157           switch (expr)
8158           {
8159                 int i = 4;
8160                 f(i);
8161           case 0:
8162                 i = 17;
8163                 /* falls through into default code */
8164           default:
8165                 printf("%d\n", i);
8166           }
8167 </pre>
8168  the object whose identifier is i exists with automatic storage duration (within the block) but is never
8169  initialized, and thus if the controlling expression has a nonzero value, the call to the printf function will
8170  access an indeterminate value. Similarly, the call to the function f cannot be reached.
8171  
8172
8173 <h6>footnotes</h6>
8174 <p><small><a name="note154" href="#note154">154)</a> That is, the declaration either precedes the switch statement, or it follows the last case or
8175  default label associated with the switch that is in the block containing the declaration.
8176 </small>
8177
8178 <h4><a name="6.8.5" href="#6.8.5">6.8.5 Iteration statements</a></h4>
8179 <h6>Syntax</h6>
8180 <p><!--para 1 -->
8181 <pre>
8182           iteration-statement:
8183                   while ( expression ) statement
8184                   do statement while ( expression ) ;
8185                   for ( expression<sub>opt</sub> ; expression<sub>opt</sub> ; expression<sub>opt</sub> ) statement
8186                   for ( declaration expression<sub>opt</sub> ; expression<sub>opt</sub> ) statement
8187 </pre>
8188 <h6>Constraints</h6>
8189 <p><!--para 2 -->
8190  The controlling expression of an iteration statement shall have scalar type.
8191 <p><!--para 3 -->
8192  The declaration part of a for statement shall only declare identifiers for objects having
8193  storage class auto or register.
8194 <h6>Semantics</h6>
8195 <p><!--para 4 -->
8196  An iteration statement causes a statement called the loop body to be executed repeatedly
8197  until the controlling expression compares equal to 0. The repetition occurs regardless of
8198  whether the loop body is entered from the iteration statement or by a jump.<sup><a href="#note155"><b>155)</b></a></sup>
8199 <p><!--para 5 -->
8200  An iteration statement is a block whose scope is a strict subset of the scope of its
8201  enclosing block. The loop body is also a block whose scope is a strict subset of the scope
8202  of the iteration statement.
8203 <p><!--para 6 -->
8204  An iteration statement whose controlling expression is not a constant expression,<sup><a href="#note156"><b>156)</b></a></sup> that
8205  performs no input/output operations, does not access volatile objects, and performs no
8206  synchronization or atomic operations in its body, controlling expression, or (in the case of
8207  
8208 <!--page 168 -->
8209  a for statement) its expression-3, may be assumed by the implementation to
8210  terminate.<sup><a href="#note157"><b>157)</b></a></sup>
8211
8212 <h6>footnotes</h6>
8213 <p><small><a name="note155" href="#note155">155)</a> Code jumped over is not executed. In particular, the controlling expression of a for or while
8214  statement is not evaluated before entering the loop body, nor is clause-1 of a for statement.
8215 </small>
8216 <p><small><a name="note156" href="#note156">156)</a> An omitted controlling expression is replaced by a nonzero constant, which is a constant expression.
8217 </small>
8218 <p><small><a name="note157" href="#note157">157)</a> This is intended to allow compiler transformations such as removal of empty loops even when
8219  termination cannot be proven.
8220 </small>
8221
8222 <h5><a name="6.8.5.1" href="#6.8.5.1">6.8.5.1 The while statement</a></h5>
8223 <p><!--para 1 -->
8224  The evaluation of the controlling expression takes place before each execution of the loop
8225  body.
8226
8227 <h5><a name="6.8.5.2" href="#6.8.5.2">6.8.5.2 The do statement</a></h5>
8228 <p><!--para 1 -->
8229  The evaluation of the controlling expression takes place after each execution of the loop
8230  body.
8231
8232 <h5><a name="6.8.5.3" href="#6.8.5.3">6.8.5.3 The for statement</a></h5>
8233 <p><!--para 1 -->
8234  The statement
8235 <pre>
8236           for ( clause-1 ; expression-2 ; expression-3 ) statement
8237 </pre>
8238  behaves as follows: The expression expression-2 is the controlling expression that is
8239  evaluated before each execution of the loop body. The expression expression-3 is
8240  evaluated as a void expression after each execution of the loop body. If clause-1 is a
8241  declaration, the scope of any identifiers it declares is the remainder of the declaration and
8242  the entire loop, including the other two expressions; it is reached in the order of execution
8243  before the first evaluation of the controlling expression. If clause-1 is an expression, it is
8244  evaluated as a void expression before the first evaluation of the controlling expression.<sup><a href="#note158"><b>158)</b></a></sup>
8245 <p><!--para 2 -->
8246  Both clause-1 and expression-3 can be omitted. An omitted expression-2 is replaced by a
8247  nonzero constant.
8248
8249 <h6>footnotes</h6>
8250 <p><small><a name="note158" href="#note158">158)</a> Thus, clause-1 specifies initialization for the loop, possibly declaring one or more variables for use in
8251  the loop; the controlling expression, expression-2, specifies an evaluation made before each iteration,
8252  such that execution of the loop continues until the expression compares equal to 0; and expression-3
8253  specifies an operation (such as incrementing) that is performed after each iteration.
8254 </small>
8255
8256 <h4><a name="6.8.6" href="#6.8.6">6.8.6 Jump statements</a></h4>
8257 <h6>Syntax</h6>
8258 <p><!--para 1 -->
8259 <pre>
8260           jump-statement:
8261                  goto identifier ;
8262                  continue ;
8263                  break ;
8264                  return expression<sub>opt</sub> ;
8265 </pre>
8266  
8267  
8268  
8269  
8270 <!--page 169 -->
8271 <h6>Semantics</h6>
8272 <p><!--para 2 -->
8273  A jump statement causes an unconditional jump to another place.
8274
8275 <h5><a name="6.8.6.1" href="#6.8.6.1">6.8.6.1 The goto statement</a></h5>
8276 <h6>Constraints</h6>
8277 <p><!--para 1 -->
8278  The identifier in a goto statement shall name a label located somewhere in the enclosing
8279  function. A goto statement shall not jump from outside the scope of an identifier having
8280  a variably modified type to inside the scope of that identifier.
8281 <h6>Semantics</h6>
8282 <p><!--para 2 -->
8283  A goto statement causes an unconditional jump to the statement prefixed by the named
8284  label in the enclosing function.
8285 <p><!--para 3 -->
8286  EXAMPLE 1 It is sometimes convenient to jump into the middle of a complicated set of statements. The
8287  following outline presents one possible approach to a problem based on these three assumptions:
8288 <ol>
8289 <li>  The general initialization code accesses objects only visible to the current function.
8290 <li>  The general initialization code is too large to warrant duplication.
8291 <li>  The code to determine the next operation is at the head of the loop. (To allow it to be reached by
8292  continue statements, for example.)
8293 <!--page 170 -->
8294 <pre>
8295     /* ... */
8296     goto first_time;
8297     for (;;) {
8298             // determine next operation
8299             /* ... */
8300             if (need to reinitialize) {
8301                     // reinitialize-only code
8302                     /* ... */
8303             first_time:
8304                     // general initialization code
8305                     /* ... */
8306                     continue;
8307             }
8308             // handle other operations
8309             /* ... */
8310     }
8311 </pre>
8312 </ol>
8313 <p><!--para 4 -->
8314  EXAMPLE 2 A goto statement is not allowed to jump past any declarations of objects with variably
8315  modified types. A jump within the scope, however, is permitted.
8316 <pre>
8317          goto lab3;                         // invalid: going INTO scope of VLA.
8318          {
8319                double a[n];
8320                a[j] = <a href="#4.4">4.4</a>;
8321          lab3:
8322                a[j] = <a href="#3.3">3.3</a>;
8323                goto lab4;                   // valid: going WITHIN scope of VLA.
8324                a[j] = <a href="#5.5">5.5</a>;
8325          lab4:
8326                a[j] = <a href="#6.6">6.6</a>;
8327          }
8328          goto lab4;                         // invalid: going INTO scope of VLA.
8329 </pre>
8330  
8331
8332 <h5><a name="6.8.6.2" href="#6.8.6.2">6.8.6.2 The continue statement</a></h5>
8333 <h6>Constraints</h6>
8334 <p><!--para 1 -->
8335  A continue statement shall appear only in or as a loop body.
8336 <h6>Semantics</h6>
8337 <p><!--para 2 -->
8338  A continue statement causes a jump to the loop-continuation portion of the smallest
8339  enclosing iteration statement; that is, to the end of the loop body. More precisely, in each
8340  of the statements
8341  while (/* ... */) {                  do {                                 for (/* ... */) {
8342 <pre>
8343     /* ... */                            /* ... */                            /* ... */
8344     continue;                            continue;                            continue;
8345     /* ... */                            /* ... */                            /* ... */
8346 </pre>
8347  contin: ;                            contin: ;                            contin: ;
8348  }                                    } while (/* ... */);                 }
8349  unless the continue statement shown is in an enclosed iteration statement (in which
8350  case it is interpreted within that statement), it is equivalent to goto contin;.<sup><a href="#note159"><b>159)</b></a></sup>
8351
8352 <h6>footnotes</h6>
8353 <p><small><a name="note159" href="#note159">159)</a> Following the contin: label is a null statement.
8354 </small>
8355
8356 <h5><a name="6.8.6.3" href="#6.8.6.3">6.8.6.3 The break statement</a></h5>
8357 <h6>Constraints</h6>
8358 <p><!--para 1 -->
8359  A break statement shall appear only in or as a switch body or loop body.
8360 <h6>Semantics</h6>
8361 <p><!--para 2 -->
8362  A break statement terminates execution of the smallest enclosing switch or iteration
8363  statement.
8364  
8365  
8366  
8367 <!--page 171 -->
8368
8369 <h5><a name="6.8.6.4" href="#6.8.6.4">6.8.6.4 The return statement</a></h5>
8370 <h6>Constraints</h6>
8371 <p><!--para 1 -->
8372  A return statement with an expression shall not appear in a function whose return type
8373  is void. A return statement without an expression shall only appear in a function
8374  whose return type is void.
8375 <h6>Semantics</h6>
8376 <p><!--para 2 -->
8377  A return statement terminates execution of the current function and returns control to
8378  its caller. A function may have any number of return statements.
8379 <p><!--para 3 -->
8380  If a return statement with an expression is executed, the value of the expression is
8381  returned to the caller as the value of the function call expression. If the expression has a
8382  type different from the return type of the function in which it appears, the value is
8383  converted as if by assignment to an object having the return type of the function.<sup><a href="#note160"><b>160)</b></a></sup>
8384 <p><!--para 4 -->
8385  EXAMPLE       In:
8386 <pre>
8387          struct s { double i; } f(void);
8388          union {
8389                struct {
8390                      int f1;
8391                      struct s f2;
8392                } u1;
8393                struct {
8394                      struct s f3;
8395                      int f4;
8396                } u2;
8397          } g;
8398          struct s f(void)
8399          {
8400                return g.u1.f2;
8401          }
8402          /* ... */
8403          g.u2.f3 = f();
8404 </pre>
8405  there is no undefined behavior, although there would be if the assignment were done directly (without using
8406  a function call to fetch the value).
8407  
8408  
8409  
8410  
8411 <!--page 172 -->
8412
8413 <h6>footnotes</h6>
8414 <p><small><a name="note160" href="#note160">160)</a> The return statement is not an assignment. The overlap restriction of subclause <a href="#6.5.16.1">6.5.16.1</a> does not
8415  apply to the case of function return. The representation of floating-point values may have wider range
8416  or precision than implied by the type; a cast may be used to remove this extra range and precision.
8417 </small>
8418
8419 <h3><a name="6.9" href="#6.9">6.9 External definitions</a></h3>
8420 <h6>Syntax</h6>
8421 <p><!--para 1 -->
8422 <pre>
8423           translation-unit:
8424                   external-declaration
8425                   translation-unit external-declaration
8426           external-declaration:
8427                  function-definition
8428                  declaration
8429 </pre>
8430 <h6>Constraints</h6>
8431 <p><!--para 2 -->
8432  The storage-class specifiers auto and register shall not appear in the declaration
8433  specifiers in an external declaration.
8434 <p><!--para 3 -->
8435  There shall be no more than one external definition for each identifier declared with
8436  internal linkage in a translation unit. Moreover, if an identifier declared with internal
8437  linkage is used in an expression (other than as a part of the operand of a sizeof
8438  operator whose result is an integer constant), there shall be exactly one external definition
8439  for the identifier in the translation unit.
8440 <h6>Semantics</h6>
8441 <p><!--para 4 -->
8442  As discussed in <a href="#5.1.1.1">5.1.1.1</a>, the unit of program text after preprocessing is a translation unit,
8443  which consists of a sequence of external declarations. These are described as ''external''
8444  because they appear outside any function (and hence have file scope). As discussed in
8445  <a href="#6.7">6.7</a>, a declaration that also causes storage to be reserved for an object or a function named
8446  by the identifier is a definition.
8447 <p><!--para 5 -->
8448  An external definition is an external declaration that is also a definition of a function
8449  (other than an inline definition) or an object. If an identifier declared with external
8450  linkage is used in an expression (other than as part of the operand of a sizeof operator
8451  whose result is an integer constant), somewhere in the entire program there shall be
8452  exactly one external definition for the identifier; otherwise, there shall be no more than
8453  one.<sup><a href="#note161"><b>161)</b></a></sup>
8454  
8455  
8456  
8457  
8458 <!--page 173 -->
8459
8460 <h6>footnotes</h6>
8461 <p><small><a name="note161" href="#note161">161)</a> Thus, if an identifier declared with external linkage is not used in an expression, there need be no
8462  external definition for it.
8463 </small>
8464
8465 <h4><a name="6.9.1" href="#6.9.1">6.9.1 Function definitions</a></h4>
8466 <h6>Syntax</h6>
8467 <p><!--para 1 -->
8468 <pre>
8469           function-definition:
8470                  declaration-specifiers declarator declaration-list<sub>opt</sub> compound-statement
8471           declaration-list:
8472                  declaration
8473                  declaration-list declaration
8474 </pre>
8475 <h6>Constraints</h6>
8476 <p><!--para 2 -->
8477  The identifier declared in a function definition (which is the name of the function) shall
8478  have a function type, as specified by the declarator portion of the function definition.<sup><a href="#note162"><b>162)</b></a></sup>
8479 <p><!--para 3 -->
8480  The return type of a function shall be void or a complete object type other than array
8481  type.
8482 <p><!--para 4 -->
8483  The storage-class specifier, if any, in the declaration specifiers shall be either extern or
8484  static.
8485 <p><!--para 5 -->
8486  If the declarator includes a parameter type list, the declaration of each parameter shall
8487  include an identifier, except for the special case of a parameter list consisting of a single
8488  parameter of type void, in which case there shall not be an identifier. No declaration list
8489  shall follow.
8490 <p><!--para 6 -->
8491  If the declarator includes an identifier list, each declaration in the declaration list shall
8492  have at least one declarator, those declarators shall declare only identifiers from the
8493  identifier list, and every identifier in the identifier list shall be declared. An identifier
8494  declared as a typedef name shall not be redeclared as a parameter. The declarations in the
8495  declaration list shall contain no storage-class specifier other than register and no
8496  initializations.
8497  
8498  
8499  
8500 <!--page 174 -->
8501 <h6>Semantics</h6>
8502 <p><!--para 7 -->
8503  The declarator in a function definition specifies the name of the function being defined
8504  and the identifiers of its parameters. If the declarator includes a parameter type list, the
8505  list also specifies the types of all the parameters; such a declarator also serves as a
8506  function prototype for later calls to the same function in the same translation unit. If the
8507  declarator includes an identifier list,<sup><a href="#note163"><b>163)</b></a></sup> the types of the parameters shall be declared in a
8508  following declaration list. In either case, the type of each parameter is adjusted as
8509  described in <a href="#6.7.6.3">6.7.6.3</a> for a parameter type list; the resulting type shall be a complete object
8510  type.
8511 <p><!--para 8 -->
8512  If a function that accepts a variable number of arguments is defined without a parameter
8513  type list that ends with the ellipsis notation, the behavior is undefined.
8514 <p><!--para 9 -->
8515  Each parameter has automatic storage duration; its identifier is an lvalue.<sup><a href="#note164"><b>164)</b></a></sup> The layout
8516  of the storage for parameters is unspecified.
8517 <p><!--para 10 -->
8518  On entry to the function, the size expressions of each variably modified parameter are
8519  evaluated and the value of each argument expression is converted to the type of the
8520  corresponding parameter as if by assignment. (Array expressions and function
8521  designators as arguments were converted to pointers before the call.)
8522 <p><!--para 11 -->
8523  After all parameters have been assigned, the compound statement that constitutes the
8524  body of the function definition is executed.
8525 <p><!--para 12 -->
8526  If the } that terminates a function is reached, and the value of the function call is used by
8527  the caller, the behavior is undefined.
8528 <p><!--para 13 -->
8529  EXAMPLE 1       In the following:
8530 <pre>
8531           extern int max(int a, int b)
8532           {
8533                 return a &gt; b ? a : b;
8534           }
8535 </pre>
8536  extern is the storage-class specifier and int is the type specifier; max(int a, int b) is the
8537  function declarator; and
8538 <pre>
8539           { return a &gt; b ? a : b; }
8540 </pre>
8541  is the function body. The following similar definition uses the identifier-list form for the parameter
8542  declarations:
8543  
8544  
8545  
8546  
8547 <!--page 175 -->
8548 <pre>
8549           extern int max(a, b)
8550           int a, b;
8551           {
8552                 return a &gt; b ? a : b;
8553           }
8554 </pre>
8555  Here int a, b; is the declaration list for the parameters. The difference between these two definitions is
8556  that the first form acts as a prototype declaration that forces conversion of the arguments of subsequent calls
8557  to the function, whereas the second form does not.
8558  
8559 <p><!--para 14 -->
8560  EXAMPLE 2           To pass one function to another, one might say
8561 <pre>
8562                       int f(void);
8563                       /* ... */
8564                       g(f);
8565 </pre>
8566  Then the definition of g might read
8567 <pre>
8568           void g(int (*funcp)(void))
8569           {
8570                 /* ... */
8571                 (*funcp)(); /* or funcp(); ...                    */
8572           }
8573 </pre>
8574  or, equivalently,
8575 <pre>
8576           void g(int func(void))
8577           {
8578                 /* ... */
8579                 func(); /* or (*func)(); ...                   */
8580           }
8581 </pre>
8582  
8583
8584 <h6>footnotes</h6>
8585 <p><small><a name="note162" href="#note162">162)</a> The intent is that the type category in a function definition cannot be inherited from a typedef:
8586
8587 <pre>
8588           typedef int F(void);                          //   type F is ''function with no parameters
8589                                                         //                  returning int''
8590           F f, g;                                       //   f and g both have type compatible with F
8591           F f { /* ... */ }                             //   WRONG: syntax/constraint error
8592           F g() { /* ... */ }                           //   WRONG: declares that g returns a function
8593           int f(void) { /* ... */ }                     //   RIGHT: f has type compatible with F
8594           int g() { /* ... */ }                         //   RIGHT: g has type compatible with F
8595           F *e(void) { /* ... */ }                      //   e returns a pointer to a function
8596           F *((e))(void) { /* ... */ }                  //   same: parentheses irrelevant
8597           int (*fp)(void);                              //   fp points to a function that has type F
8598           F *Fp;                                        //   Fp points to a function that has type F
8599 </pre>
8600 </small>
8601 <p><small><a name="note163" href="#note163">163)</a> See ''future language directions'' (<a href="#6.11.7">6.11.7</a>).
8602 </small>
8603 <p><small><a name="note164" href="#note164">164)</a> A parameter identifier cannot be redeclared in the function body except in an enclosed block.
8604 </small>
8605
8606 <h4><a name="6.9.2" href="#6.9.2">6.9.2 External object definitions</a></h4>
8607 <h6>Semantics</h6>
8608 <p><!--para 1 -->
8609  If the declaration of an identifier for an object has file scope and an initializer, the
8610  declaration is an external definition for the identifier.
8611 <p><!--para 2 -->
8612  A declaration of an identifier for an object that has file scope without an initializer, and
8613  without a storage-class specifier or with the storage-class specifier static, constitutes a
8614  tentative definition. If a translation unit contains one or more tentative definitions for an
8615  identifier, and the translation unit contains no external definition for that identifier, then
8616  the behavior is exactly as if the translation unit contains a file scope declaration of that
8617  identifier, with the composite type as of the end of the translation unit, with an initializer
8618  equal to 0.
8619 <p><!--para 3 -->
8620  If the declaration of an identifier for an object is a tentative definition and has internal
8621  linkage, the declared type shall not be an incomplete type.
8622 <!--page 176 -->
8623 <p><!--para 4 -->
8624  EXAMPLE 1
8625 <pre>
8626           int i1 = 1;                    // definition, external linkage
8627           static int i2 = 2;             // definition, internal linkage
8628           extern int i3 = 3;             // definition, external linkage
8629           int i4;                        // tentative definition, external linkage
8630           static int i5;                 // tentative definition, internal linkage
8631           int   i1;                      // valid tentative definition, refers to previous
8632           int   i2;                      // <a href="#6.2.2">6.2.2</a> renders undefined, linkage disagreement
8633           int   i3;                      // valid tentative definition, refers to previous
8634           int   i4;                      // valid tentative definition, refers to previous
8635           int   i5;                      // <a href="#6.2.2">6.2.2</a> renders undefined, linkage disagreement
8636           extern    int   i1;            // refers to previous, whose linkage is external
8637           extern    int   i2;            // refers to previous, whose linkage is internal
8638           extern    int   i3;            // refers to previous, whose linkage is external
8639           extern    int   i4;            // refers to previous, whose linkage is external
8640           extern    int   i5;            // refers to previous, whose linkage is internal
8641 </pre>
8642  
8643 <p><!--para 5 -->
8644  EXAMPLE 2       If at the end of the translation unit containing
8645 <pre>
8646           int i[];
8647 </pre>
8648  the array i still has incomplete type, the implicit initializer causes it to have one element, which is set to
8649  zero on program startup.
8650 <!--page 177 -->
8651
8652 <h3><a name="6.10" href="#6.10">6.10 Preprocessing directives</a></h3>
8653 <h6>Syntax</h6>
8654 <p><!--para 1 -->
8655 <!--page 178 -->
8656 <pre>
8657           preprocessing-file:
8658                  group<sub>opt</sub>
8659           group:
8660                    group-part
8661                    group group-part
8662           group-part:
8663                  if-section
8664                  control-line
8665                  text-line
8666                  # non-directive
8667           if-section:
8668                    if-group elif-groups<sub>opt</sub> else-group<sub>opt</sub> endif-line
8669           if-group:
8670                   # if     constant-expression new-line group<sub>opt</sub>
8671                   # ifdef identifier new-line group<sub>opt</sub>
8672                   # ifndef identifier new-line group<sub>opt</sub>
8673           elif-groups:
8674                   elif-group
8675                   elif-groups elif-group
8676           elif-group:
8677                   # elif       constant-expression new-line group<sub>opt</sub>
8678           else-group:
8679                   # else       new-line group<sub>opt</sub>
8680           endif-line:
8681                   # endif      new-line
8682           control-line:
8683                  # include pp-tokens new-line
8684                  # define identifier replacement-list new-line
8685                  # define identifier lparen identifier-list<sub>opt</sub> )
8686                                                  replacement-list new-line
8687                  # define identifier lparen ... ) replacement-list new-line
8688                  # define identifier lparen identifier-list , ... )
8689                                                  replacement-list new-line
8690                  # undef   identifier new-line
8691                  # line    pp-tokens new-line
8692                  # error   pp-tokens<sub>opt</sub> new-line
8693                  # pragma pp-tokens<sub>opt</sub> new-line
8694                  #         new-line
8695           text-line:
8696                   pp-tokens<sub>opt</sub> new-line
8697           non-directive:
8698                  pp-tokens new-line
8699           lparen:
8700                     a ( character not immediately preceded by white-space
8701           replacement-list:
8702                  pp-tokens<sub>opt</sub>
8703           pp-tokens:
8704                  preprocessing-token
8705                  pp-tokens preprocessing-token
8706           new-line:
8707                  the new-line character
8708 </pre>
8709 <h6>Description</h6>
8710 <p><!--para 2 -->
8711  A preprocessing directive consists of a sequence of preprocessing tokens that satisfies the
8712  following constraints: The first token in the sequence is a # preprocessing token that (at
8713  the start of translation phase 4) is either the first character in the source file (optionally
8714  after white space containing no new-line characters) or that follows white space
8715  containing at least one new-line character. The last token in the sequence is the first new-
8716  line character that follows the first token in the sequence.<sup><a href="#note165"><b>165)</b></a></sup> A new-line character ends
8717  the preprocessing directive even if it occurs within what would otherwise be an
8718  
8719 <!--page 179 -->
8720  invocation of a function-like macro.
8721 <p><!--para 3 -->
8722  A text line shall not begin with a # preprocessing token. A non-directive shall not begin
8723  with any of the directive names appearing in the syntax.
8724 <p><!--para 4 -->
8725  When in a group that is skipped (<a href="#6.10.1">6.10.1</a>), the directive syntax is relaxed to allow any
8726  sequence of preprocessing tokens to occur between the directive name and the following
8727  new-line character.
8728 <h6>Constraints</h6>
8729 <p><!--para 5 -->
8730  The only white-space characters that shall appear between preprocessing tokens within a
8731  preprocessing directive (from just after the introducing # preprocessing token through
8732  just before the terminating new-line character) are space and horizontal-tab (including
8733  spaces that have replaced comments or possibly other white-space characters in
8734  translation phase 3).
8735 <h6>Semantics</h6>
8736 <p><!--para 6 -->
8737  The implementation can process and skip sections of source files conditionally, include
8738  other source files, and replace macros. These capabilities are called preprocessing,
8739  because conceptually they occur before translation of the resulting translation unit.
8740 <p><!--para 7 -->
8741  The preprocessing tokens within a preprocessing directive are not subject to macro
8742  expansion unless otherwise stated.
8743 <p><!--para 8 -->
8744  EXAMPLE        In:
8745 <pre>
8746            #define EMPTY
8747            EMPTY # include &lt;file.h&gt;
8748 </pre>
8749  the sequence of preprocessing tokens on the second line is not a preprocessing directive, because it does not
8750  begin with a # at the start of translation phase 4, even though it will do so after the macro EMPTY has been
8751  replaced.
8752  
8753
8754 <h6>footnotes</h6>
8755 <p><small><a name="note165" href="#note165">165)</a> Thus, preprocessing directives are commonly called ''lines''. These ''lines'' have no other syntactic
8756  significance, as all white space is equivalent except in certain situations during preprocessing (see the
8757  # character string literal creation operator in <a href="#6.10.3.2">6.10.3.2</a>, for example).
8758 </small>
8759
8760 <h4><a name="6.10.1" href="#6.10.1">6.10.1 Conditional inclusion</a></h4>
8761 <h6>Constraints</h6>
8762 <p><!--para 1 -->
8763  The expression that controls conditional inclusion shall be an integer constant expression
8764  except that: identifiers (including those lexically identical to keywords) are interpreted as *
8765  described below;<sup><a href="#note166"><b>166)</b></a></sup> and it may contain unary operator expressions of the form
8766 <pre>
8767       defined identifier
8768 </pre>
8769  or
8770 <pre>
8771       defined ( identifier )
8772 </pre>
8773  which evaluate to 1 if the identifier is currently defined as a macro name (that is, if it is
8774  
8775  
8776 <!--page 180 -->
8777  predefined or if it has been the subject of a #define preprocessing directive without an
8778  intervening #undef directive with the same subject identifier), 0 if it is not.
8779 <p><!--para 2 -->
8780  Each preprocessing token that remains (in the list of preprocessing tokens that will
8781  become the controlling expression) after all macro replacements have occurred shall be in
8782  the lexical form of a token (<a href="#6.4">6.4</a>).
8783 <h6>Semantics</h6>
8784 <p><!--para 3 -->
8785  Preprocessing directives of the forms
8786 <pre>
8787     # if   constant-expression new-line group<sub>opt</sub>
8788     # elif constant-expression new-line group<sub>opt</sub>
8789 </pre>
8790  check whether the controlling constant expression evaluates to nonzero.
8791 <p><!--para 4 -->
8792  Prior to evaluation, macro invocations in the list of preprocessing tokens that will become
8793  the controlling constant expression are replaced (except for those macro names modified
8794  by the defined unary operator), just as in normal text. If the token defined is
8795  generated as a result of this replacement process or use of the defined unary operator
8796  does not match one of the two specified forms prior to macro replacement, the behavior is
8797  undefined. After all replacements due to macro expansion and the defined unary
8798  operator have been performed, all remaining identifiers (including those lexically
8799  identical to keywords) are replaced with the pp-number 0, and then each preprocessing
8800  token is converted into a token. The resulting tokens compose the controlling constant
8801  expression which is evaluated according to the rules of <a href="#6.6">6.6</a>. For the purposes of this
8802  token conversion and evaluation, all signed integer types and all unsigned integer types
8803  act as if they have the same representation as, respectively, the types intmax_t and
8804  uintmax_t defined in the header <a href="#7.20">&lt;stdint.h&gt;</a>.<sup><a href="#note167"><b>167)</b></a></sup> This includes interpreting
8805  character constants, which may involve converting escape sequences into execution
8806  character set members. Whether the numeric value for these character constants matches
8807  the value obtained when an identical character constant occurs in an expression (other
8808  than within a #if or #elif directive) is implementation-defined.<sup><a href="#note168"><b>168)</b></a></sup> Also, whether a
8809  single-character character constant may have a negative value is implementation-defined.
8810  
8811  
8812  
8813  
8814 <!--page 181 -->
8815 <p><!--para 5 -->
8816  Preprocessing directives of the forms
8817 <pre>
8818     # ifdef identifier new-line group<sub>opt</sub>
8819     # ifndef identifier new-line group<sub>opt</sub>
8820 </pre>
8821  check whether the identifier is or is not currently defined as a macro name. Their
8822  conditions are equivalent to #if defined identifier and #if !defined identifier
8823  respectively.
8824 <p><!--para 6 -->
8825  Each directive's condition is checked in order. If it evaluates to false (zero), the group
8826  that it controls is skipped: directives are processed only through the name that determines
8827  the directive in order to keep track of the level of nested conditionals; the rest of the
8828  directives' preprocessing tokens are ignored, as are the other preprocessing tokens in the
8829  group. Only the first group whose control condition evaluates to true (nonzero) is
8830  processed. If none of the conditions evaluates to true, and there is a #else directive, the
8831  group controlled by the #else is processed; lacking a #else directive, all the groups
8832  until the #endif are skipped.<sup><a href="#note169"><b>169)</b></a></sup>
8833 <p><b> Forward references</b>: macro replacement (<a href="#6.10.3">6.10.3</a>), source file inclusion (<a href="#6.10.2">6.10.2</a>), largest
8834  integer types (<a href="#7.20.1.5">7.20.1.5</a>).
8835
8836 <h6>footnotes</h6>
8837 <p><small><a name="note166" href="#note166">166)</a> Because the controlling constant expression is evaluated during translation phase 4, all identifiers
8838  either are or are not macro names -- there simply are no keywords, enumeration constants, etc.
8839 </small>
8840 <p><small><a name="note167" href="#note167">167)</a> Thus, on an implementation where INT_MAX is 0x7FFF and UINT_MAX is 0xFFFF, the constant
8841  0x8000 is signed and positive within a #if expression even though it would be unsigned in
8842  translation phase 7.
8843 </small>
8844 <p><small><a name="note168" href="#note168">168)</a> Thus, the constant expression in the following #if directive and if statement is not guaranteed to
8845  evaluate to the same value in these two contexts.
8846    #if 'z' - 'a' == 25
8847    if ('z' - 'a' == 25)
8848 </small>
8849 <p><small><a name="note169" href="#note169">169)</a> As indicated by the syntax, a preprocessing token shall not follow a #else or #endif directive
8850  before the terminating new-line character. However, comments may appear anywhere in a source file,
8851  including within a preprocessing directive.
8852 </small>
8853
8854 <h4><a name="6.10.2" href="#6.10.2">6.10.2 Source file inclusion</a></h4>
8855 <h6>Constraints</h6>
8856 <p><!--para 1 -->
8857  A #include directive shall identify a header or source file that can be processed by the
8858  implementation.
8859 <h6>Semantics</h6>
8860 <p><!--para 2 -->
8861  A preprocessing directive of the form
8862 <pre>
8863     # include &lt;h-char-sequence&gt; new-line
8864 </pre>
8865  searches a sequence of implementation-defined places for a header identified uniquely by
8866  the specified sequence between the &lt; and &gt; delimiters, and causes the replacement of that
8867  directive by the entire contents of the header. How the places are specified or the header
8868  identified is implementation-defined.
8869 <p><!--para 3 -->
8870  A preprocessing directive of the form
8871 <pre>
8872     # include "q-char-sequence" new-line
8873 </pre>
8874  causes the replacement of that directive by the entire contents of the source file identified
8875  by the specified sequence between the " delimiters. The named source file is searched
8876  
8877  
8878 <!--page 182 -->
8879  for in an implementation-defined manner. If this search is not supported, or if the search
8880  fails, the directive is reprocessed as if it read
8881 <pre>
8882     # include &lt;h-char-sequence&gt; new-line
8883 </pre>
8884  with the identical contained sequence (including &gt; characters, if any) from the original
8885  directive.
8886 <p><!--para 4 -->
8887  A preprocessing directive of the form
8888 <pre>
8889     # include pp-tokens new-line
8890 </pre>
8891  (that does not match one of the two previous forms) is permitted. The preprocessing
8892  tokens after include in the directive are processed just as in normal text. (Each
8893  identifier currently defined as a macro name is replaced by its replacement list of
8894  preprocessing tokens.) The directive resulting after all replacements shall match one of
8895  the two previous forms.<sup><a href="#note170"><b>170)</b></a></sup> The method by which a sequence of preprocessing tokens
8896  between a &lt; and a &gt; preprocessing token pair or a pair of " characters is combined into a
8897  single header name preprocessing token is implementation-defined.
8898 <p><!--para 5 -->
8899  The implementation shall provide unique mappings for sequences consisting of one or
8900  more nondigits or digits (<a href="#6.4.2.1">6.4.2.1</a>) followed by a period (.) and a single nondigit. The
8901  first character shall not be a digit. The implementation may ignore distinctions of
8902  alphabetical case and restrict the mapping to eight significant characters before the
8903  period.
8904 <p><!--para 6 -->
8905  A #include preprocessing directive may appear in a source file that has been read
8906  because of a #include directive in another file, up to an implementation-defined
8907  nesting limit (see <a href="#5.2.4.1">5.2.4.1</a>).
8908 <p><!--para 7 -->
8909  EXAMPLE 1       The most common uses of #include preprocessing directives are as in the following:
8910 <pre>
8911           #include <a href="#7.21">&lt;stdio.h&gt;</a>
8912           #include "myprog.h"
8913 </pre>
8914  
8915  
8916  
8917  
8918 <!--page 183 -->
8919 <p><!--para 8 -->
8920  EXAMPLE 2      This illustrates macro-replaced #include directives:
8921 <pre>
8922            #if VERSION == 1
8923                  #define INCFILE          "vers1.h"
8924            #elif VERSION == 2
8925                  #define INCFILE          "vers2.h"        // and so on
8926            #else
8927                   #define INCFILE         "versN.h"
8928            #endif
8929            #include INCFILE
8930 </pre>
8931  
8932 <p><b> Forward references</b>: macro replacement (<a href="#6.10.3">6.10.3</a>).
8933
8934 <h6>footnotes</h6>
8935 <p><small><a name="note170" href="#note170">170)</a> Note that adjacent string literals are not concatenated into a single string literal (see the translation
8936  phases in <a href="#5.1.1.2">5.1.1.2</a>); thus, an expansion that results in two string literals is an invalid directive.
8937 </small>
8938
8939 <h4><a name="6.10.3" href="#6.10.3">6.10.3 Macro replacement</a></h4>
8940 <h6>Constraints</h6>
8941 <p><!--para 1 -->
8942  Two replacement lists are identical if and only if the preprocessing tokens in both have
8943  the same number, ordering, spelling, and white-space separation, where all white-space
8944  separations are considered identical.
8945 <p><!--para 2 -->
8946  An identifier currently defined as an object-like macro shall not be redefined by another
8947  #define preprocessing directive unless the second definition is an object-like macro
8948  definition and the two replacement lists are identical. Likewise, an identifier currently
8949  defined as a function-like macro shall not be redefined by another #define
8950  preprocessing directive unless the second definition is a function-like macro definition
8951  that has the same number and spelling of parameters, and the two replacement lists are
8952  identical.
8953 <p><!--para 3 -->
8954  There shall be white-space between the identifier and the replacement list in the definition
8955  of an object-like macro.
8956 <p><!--para 4 -->
8957  If the identifier-list in the macro definition does not end with an ellipsis, the number of
8958  arguments (including those arguments consisting of no preprocessing tokens) in an
8959  invocation of a function-like macro shall equal the number of parameters in the macro
8960  definition. Otherwise, there shall be more arguments in the invocation than there are
8961  parameters in the macro definition (excluding the ...). There shall exist a )
8962  preprocessing token that terminates the invocation.
8963 <p><!--para 5 -->
8964  The identifier __VA_ARGS__ shall occur only in the replacement-list of a function-like
8965  macro that uses the ellipsis notation in the parameters.
8966 <p><!--para 6 -->
8967  A parameter identifier in a function-like macro shall be uniquely declared within its
8968  scope.
8969 <h6>Semantics</h6>
8970 <p><!--para 7 -->
8971  The identifier immediately following the define is called the macro name. There is one
8972  name space for macro names. Any white-space characters preceding or following the
8973  replacement list of preprocessing tokens are not considered part of the replacement list
8974 <!--page 184 -->
8975  for either form of macro.
8976 <p><!--para 8 -->
8977  If a # preprocessing token, followed by an identifier, occurs lexically at the point at which
8978  a preprocessing directive could begin, the identifier is not subject to macro replacement.
8979 <p><!--para 9 -->
8980  A preprocessing directive of the form
8981 <pre>
8982     # define identifier replacement-list new-line
8983 </pre>
8984  defines an object-like macro that causes each subsequent instance of the macro name<sup><a href="#note171"><b>171)</b></a></sup>
8985  to be replaced by the replacement list of preprocessing tokens that constitute the
8986  remainder of the directive. The replacement list is then rescanned for more macro names
8987  as specified below.
8988 <p><!--para 10 -->
8989  A preprocessing directive of the form
8990 <pre>
8991     # define identifier lparen identifier-list<sub>opt</sub> ) replacement-list new-line
8992     # define identifier lparen ... ) replacement-list new-line
8993     # define identifier lparen identifier-list , ... ) replacement-list new-line
8994 </pre>
8995  defines a function-like macro with parameters, whose use is similar syntactically to a
8996  function call. The parameters are specified by the optional list of identifiers, whose scope
8997  extends from their declaration in the identifier list until the new-line character that
8998  terminates the #define preprocessing directive. Each subsequent instance of the
8999  function-like macro name followed by a ( as the next preprocessing token introduces the
9000  sequence of preprocessing tokens that is replaced by the replacement list in the definition
9001  (an invocation of the macro). The replaced sequence of preprocessing tokens is
9002  terminated by the matching ) preprocessing token, skipping intervening matched pairs of
9003  left and right parenthesis preprocessing tokens. Within the sequence of preprocessing
9004  tokens making up an invocation of a function-like macro, new-line is considered a normal
9005  white-space character.
9006 <p><!--para 11 -->
9007  The sequence of preprocessing tokens bounded by the outside-most matching parentheses
9008  forms the list of arguments for the function-like macro. The individual arguments within
9009  the list are separated by comma preprocessing tokens, but comma preprocessing tokens
9010  between matching inner parentheses do not separate arguments. If there are sequences of
9011  preprocessing tokens within the list of arguments that would otherwise act as
9012  preprocessing directives,<sup><a href="#note172"><b>172)</b></a></sup> the behavior is undefined.
9013 <p><!--para 12 -->
9014  If there is a ... in the identifier-list in the macro definition, then the trailing arguments,
9015  including any separating comma preprocessing tokens, are merged to form a single item:
9016  
9017  
9018 <!--page 185 -->
9019  the variable arguments. The number of arguments so combined is such that, following
9020  merger, the number of arguments is one more than the number of parameters in the macro
9021  definition (excluding the ...).
9022
9023 <h6>footnotes</h6>
9024 <p><small><a name="note171" href="#note171">171)</a> Since, by macro-replacement time, all character constants and string literals are preprocessing tokens,
9025  not sequences possibly containing identifier-like subsequences (see <a href="#5.1.1.2">5.1.1.2</a>, translation phases), they
9026  are never scanned for macro names or parameters.
9027 </small>
9028 <p><small><a name="note172" href="#note172">172)</a> Despite the name, a non-directive is a preprocessing directive.
9029 </small>
9030
9031 <h5><a name="6.10.3.1" href="#6.10.3.1">6.10.3.1 Argument substitution</a></h5>
9032 <p><!--para 1 -->
9033  After the arguments for the invocation of a function-like macro have been identified,
9034  argument substitution takes place. A parameter in the replacement list, unless preceded
9035  by a # or ## preprocessing token or followed by a ## preprocessing token (see below), is
9036  replaced by the corresponding argument after all macros contained therein have been
9037  expanded. Before being substituted, each argument's preprocessing tokens are
9038  completely macro replaced as if they formed the rest of the preprocessing file; no other
9039  preprocessing tokens are available.
9040 <p><!--para 2 -->
9041  An identifier __VA_ARGS__ that occurs in the replacement list shall be treated as if it
9042  were a parameter, and the variable arguments shall form the preprocessing tokens used to
9043  replace it.
9044
9045 <h5><a name="6.10.3.2" href="#6.10.3.2">6.10.3.2 The # operator</a></h5>
9046 <h6>Constraints</h6>
9047 <p><!--para 1 -->
9048  Each # preprocessing token in the replacement list for a function-like macro shall be
9049  followed by a parameter as the next preprocessing token in the replacement list.
9050 <h6>Semantics</h6>
9051 <p><!--para 2 -->
9052  If, in the replacement list, a parameter is immediately preceded by a # preprocessing
9053  token, both are replaced by a single character string literal preprocessing token that
9054  contains the spelling of the preprocessing token sequence for the corresponding
9055  argument. Each occurrence of white space between the argument's preprocessing tokens
9056  becomes a single space character in the character string literal. White space before the
9057  first preprocessing token and after the last preprocessing token composing the argument
9058  is deleted. Otherwise, the original spelling of each preprocessing token in the argument
9059  is retained in the character string literal, except for special handling for producing the
9060  spelling of string literals and character constants: a \ character is inserted before each "
9061  and \ character of a character constant or string literal (including the delimiting "
9062  characters), except that it is implementation-defined whether a \ character is inserted
9063  before the \ character beginning a universal character name. If the replacement that
9064  results is not a valid character string literal, the behavior is undefined. The character
9065  string literal corresponding to an empty argument is "". The order of evaluation of # and
9066  ## operators is unspecified.
9067 <!--page 186 -->
9068
9069 <h5><a name="6.10.3.3" href="#6.10.3.3">6.10.3.3 The ## operator</a></h5>
9070 <h6>Constraints</h6>
9071 <p><!--para 1 -->
9072  A ## preprocessing token shall not occur at the beginning or at the end of a replacement
9073  list for either form of macro definition.
9074 <h6>Semantics</h6>
9075 <p><!--para 2 -->
9076  If, in the replacement list of a function-like macro, a parameter is immediately preceded
9077  or followed by a ## preprocessing token, the parameter is replaced by the corresponding
9078  argument's preprocessing token sequence; however, if an argument consists of no
9079  preprocessing tokens, the parameter is replaced by a placemarker preprocessing token
9080  instead.<sup><a href="#note173"><b>173)</b></a></sup>
9081 <p><!--para 3 -->
9082  For both object-like and function-like macro invocations, before the replacement list is
9083  reexamined for more macro names to replace, each instance of a ## preprocessing token
9084  in the replacement list (not from an argument) is deleted and the preceding preprocessing
9085  token is concatenated with the following preprocessing token. Placemarker
9086  preprocessing tokens are handled specially: concatenation of two placemarkers results in
9087  a single placemarker preprocessing token, and concatenation of a placemarker with a
9088  non-placemarker preprocessing token results in the non-placemarker preprocessing token.
9089  If the result is not a valid preprocessing token, the behavior is undefined. The resulting
9090  token is available for further macro replacement. The order of evaluation of ## operators
9091  is unspecified.
9092 <p><!--para 4 -->
9093  EXAMPLE       In the following fragment:
9094 <pre>
9095          #define     hash_hash # ## #
9096          #define     mkstr(a) # a
9097          #define     in_between(a) mkstr(a)
9098          #define     join(c, d) in_between(c hash_hash d)
9099          char p[] = join(x, y); // equivalent to
9100                                 // char p[] = "x ## y";
9101 </pre>
9102  The expansion produces, at various stages:
9103 <pre>
9104          join(x, y)
9105          in_between(x hash_hash y)
9106          in_between(x ## y)
9107          mkstr(x ## y)
9108          "x ## y"
9109 </pre>
9110  In other words, expanding hash_hash produces a new token, consisting of two adjacent sharp signs, but
9111  this new token is not the ## operator.
9112  
9113  
9114 <!--page 187 -->
9115
9116 <h6>footnotes</h6>
9117 <p><small><a name="note173" href="#note173">173)</a> Placemarker preprocessing tokens do not appear in the syntax because they are temporary entities that
9118  exist only within translation phase 4.
9119 </small>
9120
9121 <h5><a name="6.10.3.4" href="#6.10.3.4">6.10.3.4 Rescanning and further replacement</a></h5>
9122 <p><!--para 1 -->
9123  After all parameters in the replacement list have been substituted and # and ##
9124  processing has taken place, all placemarker preprocessing tokens are removed. The
9125  resulting preprocessing token sequence is then rescanned, along with all subsequent
9126  preprocessing tokens of the source file, for more macro names to replace.
9127 <p><!--para 2 -->
9128  If the name of the macro being replaced is found during this scan of the replacement list
9129  (not including the rest of the source file's preprocessing tokens), it is not replaced.
9130  Furthermore, if any nested replacements encounter the name of the macro being replaced,
9131  it is not replaced. These nonreplaced macro name preprocessing tokens are no longer
9132  available for further replacement even if they are later (re)examined in contexts in which
9133  that macro name preprocessing token would otherwise have been replaced.
9134 <p><!--para 3 -->
9135  The resulting completely macro-replaced preprocessing token sequence is not processed
9136  as a preprocessing directive even if it resembles one, but all pragma unary operator
9137  expressions within it are then processed as specified in <a href="#6.10.9">6.10.9</a> below.
9138
9139 <h5><a name="6.10.3.5" href="#6.10.3.5">6.10.3.5 Scope of macro definitions</a></h5>
9140 <p><!--para 1 -->
9141  A macro definition lasts (independent of block structure) until a corresponding #undef
9142  directive is encountered or (if none is encountered) until the end of the preprocessing
9143  translation unit. Macro definitions have no significance after translation phase 4.
9144 <p><!--para 2 -->
9145  A preprocessing directive of the form
9146 <pre>
9147     # undef identifier new-line
9148 </pre>
9149  causes the specified identifier no longer to be defined as a macro name. It is ignored if
9150  the specified identifier is not currently defined as a macro name.
9151 <p><!--para 3 -->
9152  EXAMPLE 1      The simplest use of this facility is to define a ''manifest constant'', as in
9153 <pre>
9154          #define TABSIZE 100
9155          int table[TABSIZE];
9156 </pre>
9157  
9158 <p><!--para 4 -->
9159  EXAMPLE 2 The following defines a function-like macro whose value is the maximum of its arguments.
9160  It has the advantages of working for any compatible types of the arguments and of generating in-line code
9161  without the overhead of function calling. It has the disadvantages of evaluating one or the other of its
9162  arguments a second time (including side effects) and generating more code than a function if invoked
9163  several times. It also cannot have its address taken, as it has none.
9164 <pre>
9165          #define max(a, b) ((a) &gt; (b) ? (a) : (b))
9166 </pre>
9167  The parentheses ensure that the arguments and the resulting expression are bound properly.
9168 <!--page 188 -->
9169 <p><!--para 5 -->
9170  EXAMPLE 3     To illustrate the rules for redefinition and reexamination, the sequence
9171 <pre>
9172           #define   x         3
9173           #define   f(a)      f(x * (a))
9174           #undef    x
9175           #define   x         2
9176           #define   g         f
9177           #define   z         z[0]
9178           #define   h         g(~
9179           #define   m(a)      a(w)
9180           #define   w         0,1
9181           #define   t(a)      a
9182           #define   p()       int
9183           #define   q(x)      x
9184           #define   r(x,y)    x ## y
9185           #define   str(x)    # x
9186           f(y+1) + f(f(z)) % t(t(g)(0) + t)(1);
9187           g(x+(3,4)-w) | h 5) &amp; m
9188                 (f)^m(m);
9189           p() i[q()] = { q(1), r(2,3), r(4,), r(,5), r(,) };
9190           char c[2][6] = { str(hello), str() };
9191 </pre>
9192  results in
9193 <pre>
9194           f(2 * (y+1)) + f(2 * (f(2 * (z[0])))) % f(2 * (0)) + t(1);
9195           f(2 * (2+(3,4)-0,1)) | f(2 * (~ 5)) &amp; f(2 * (0,1))^m(0,1);
9196           int i[] = { 1, 23, 4, 5, };
9197           char c[2][6] = { "hello", "" };
9198 </pre>
9199  
9200 <p><!--para 6 -->
9201  EXAMPLE 4     To illustrate the rules for creating character string literals and concatenating tokens, the
9202  sequence
9203 <pre>
9204           #define str(s)      # s
9205           #define xstr(s)     str(s)
9206           #define debug(s, t) printf("x" # s "= %d, x" # t "= %s", \
9207                                   x ## s, x ## t)
9208           #define INCFILE(n) vers ## n
9209           #define glue(a, b) a ## b
9210           #define xglue(a, b) glue(a, b)
9211           #define HIGHLOW     "hello"
9212           #define LOW         LOW ", world"
9213           debug(1, 2);
9214           fputs(str(strncmp("abc\0d", "abc", '\4') // this goes away
9215                 == 0) str(: @\n), s);
9216           #include xstr(INCFILE(2).h)
9217           glue(HIGH, LOW);
9218           xglue(HIGH, LOW)
9219 </pre>
9220  results in
9221 <!--page 189 -->
9222 <pre>
9223           printf("x" "1" "= %d, x" "2" "= %s", x1, x2);
9224           fputs(
9225             "strncmp(\"abc\\0d\", \"abc\", '\\4') == 0" ": @\n",
9226             s);
9227           #include "vers2.h"    (after macro replacement, before file access)
9228           "hello";
9229           "hello" ", world"
9230 </pre>
9231  or, after concatenation of the character string literals,
9232 <pre>
9233           printf("x1= %d, x2= %s", x1, x2);
9234           fputs(
9235             "strncmp(\"abc\\0d\", \"abc\", '\\4') == 0: @\n",
9236             s);
9237           #include "vers2.h"    (after macro replacement, before file access)
9238           "hello";
9239           "hello, world"
9240 </pre>
9241  Space around the # and ## tokens in the macro definition is optional.
9242  
9243 <p><!--para 7 -->
9244  EXAMPLE 5        To illustrate the rules for placemarker preprocessing tokens, the sequence
9245 <pre>
9246           #define t(x,y,z) x ## y ## z
9247           int j[] = { t(1,2,3), t(,4,5), t(6,,7), t(8,9,),
9248                      t(10,,), t(,11,), t(,,12), t(,,) };
9249 </pre>
9250  results in
9251 <pre>
9252           int j[] = { 123, 45, 67, 89,
9253                       10, 11, 12, };
9254 </pre>
9255  
9256 <p><!--para 8 -->
9257  EXAMPLE 6        To demonstrate the redefinition rules, the following sequence is valid.
9258 <pre>
9259           #define      OBJ_LIKE      (1-1)
9260           #define      OBJ_LIKE      /* white space */ (1-1) /* other */
9261           #define      FUNC_LIKE(a)   ( a )
9262           #define      FUNC_LIKE( a )( /* note the white space */ \
9263                                        a /* other stuff on this line
9264                                            */ )
9265 </pre>
9266  But the following redefinitions are invalid:
9267 <pre>
9268           #define      OBJ_LIKE    (0)     // different token sequence
9269           #define      OBJ_LIKE    (1 - 1) // different white space
9270           #define      FUNC_LIKE(b) ( a ) // different parameter usage
9271           #define      FUNC_LIKE(b) ( b ) // different parameter spelling
9272 </pre>
9273  
9274 <p><!--para 9 -->
9275  EXAMPLE 7        Finally, to show the variable argument list macro facilities:
9276 <!--page 190 -->
9277 <pre>
9278           #define debug(...)       fprintf(stderr, __VA_ARGS__)
9279           #define showlist(...)    puts(#__VA_ARGS__)
9280           #define report(test, ...) ((test)?puts(#test):\
9281                       printf(__VA_ARGS__))
9282           debug("Flag");
9283           debug("X = %d\n", x);
9284           showlist(The first, second, and third items.);
9285           report(x&gt;y, "x is %d but y is %d", x, y);
9286 </pre>
9287  results in
9288 <pre>
9289           fprintf(stderr, "Flag" );
9290           fprintf(stderr, "X = %d\n", x );
9291           puts( "The first, second, and third items." );
9292           ((x&gt;y)?puts("x&gt;y"):
9293                       printf("x is %d but y is %d", x, y));
9294 </pre>
9295  
9296
9297 <h4><a name="6.10.4" href="#6.10.4">6.10.4 Line control</a></h4>
9298 <h6>Constraints</h6>
9299 <p><!--para 1 -->
9300  The string literal of a #line directive, if present, shall be a character string literal.
9301 <h6>Semantics</h6>
9302 <p><!--para 2 -->
9303  The line number of the current source line is one greater than the number of new-line
9304  characters read or introduced in translation phase 1 (<a href="#5.1.1.2">5.1.1.2</a>) while processing the source
9305  file to the current token.
9306 <p><!--para 3 -->
9307  A preprocessing directive of the form
9308 <pre>
9309     # line digit-sequence new-line
9310 </pre>
9311  causes the implementation to behave as if the following sequence of source lines begins
9312  with a source line that has a line number as specified by the digit sequence (interpreted as
9313  a decimal integer). The digit sequence shall not specify zero, nor a number greater than
9314  2147483647.
9315 <p><!--para 4 -->
9316  A preprocessing directive of the form
9317 <pre>
9318     # line digit-sequence "s-char-sequence<sub>opt</sub>" new-line
9319 </pre>
9320  sets the presumed line number similarly and changes the presumed name of the source
9321  file to be the contents of the character string literal.
9322 <p><!--para 5 -->
9323  A preprocessing directive of the form
9324 <pre>
9325     # line pp-tokens new-line
9326 </pre>
9327  (that does not match one of the two previous forms) is permitted. The preprocessing
9328  tokens after line on the directive are processed just as in normal text (each identifier
9329  currently defined as a macro name is replaced by its replacement list of preprocessing
9330  tokens). The directive resulting after all replacements shall match one of the two
9331  previous forms and is then processed as appropriate.
9332 <!--page 191 -->
9333
9334 <h4><a name="6.10.5" href="#6.10.5">6.10.5 Error directive</a></h4>
9335 <h6>Semantics</h6>
9336 <p><!--para 1 -->
9337  A preprocessing directive of the form
9338 <pre>
9339     # error pp-tokens<sub>opt</sub> new-line
9340 </pre>
9341  causes the implementation to produce a diagnostic message that includes the specified
9342  sequence of preprocessing tokens.
9343
9344 <h4><a name="6.10.6" href="#6.10.6">6.10.6 Pragma directive</a></h4>
9345 <h6>Semantics</h6>
9346 <p><!--para 1 -->
9347  A preprocessing directive of the form
9348 <pre>
9349     # pragma pp-tokens<sub>opt</sub> new-line
9350 </pre>
9351  where the preprocessing token STDC does not immediately follow pragma in the
9352  directive (prior to any macro replacement)<sup><a href="#note174"><b>174)</b></a></sup> causes the implementation to behave in an
9353  implementation-defined manner. The behavior might cause translation to fail or cause the
9354  translator or the resulting program to behave in a non-conforming manner. Any such
9355  pragma that is not recognized by the implementation is ignored.
9356 <p><!--para 2 -->
9357  If the preprocessing token STDC does immediately follow pragma in the directive (prior
9358  to any macro replacement), then no macro replacement is performed on the directive, and
9359  the directive shall have one of the following forms<sup><a href="#note175"><b>175)</b></a></sup> whose meanings are described
9360  elsewhere:
9361 <pre>
9362     #pragma STDC FP_CONTRACT on-off-switch
9363     #pragma STDC FENV_ACCESS on-off-switch
9364     #pragma STDC CX_LIMITED_RANGE on-off-switch
9365     on-off-switch: one of
9366                 ON     OFF           DEFAULT
9367 </pre>
9368 <p><b> Forward references</b>: the FP_CONTRACT pragma (<a href="#7.12.2">7.12.2</a>), the FENV_ACCESS pragma
9369  (<a href="#7.6.1">7.6.1</a>), the CX_LIMITED_RANGE pragma (<a href="#7.3.4">7.3.4</a>).
9370  
9371  
9372  
9373  
9374 <!--page 192 -->
9375
9376 <h6>footnotes</h6>
9377 <p><small><a name="note174" href="#note174">174)</a> An implementation is not required to perform macro replacement in pragmas, but it is permitted
9378  except for in standard pragmas (where STDC immediately follows pragma). If the result of macro
9379  replacement in a non-standard pragma has the same form as a standard pragma, the behavior is still
9380  implementation-defined; an implementation is permitted to behave as if it were the standard pragma,
9381  but is not required to.
9382 </small>
9383 <p><small><a name="note175" href="#note175">175)</a> See ''future language directions'' (<a href="#6.11.8">6.11.8</a>).
9384 </small>
9385
9386 <h4><a name="6.10.7" href="#6.10.7">6.10.7 Null directive</a></h4>
9387 <h6>Semantics</h6>
9388 <p><!--para 1 -->
9389  A preprocessing directive of the form
9390 <pre>
9391     # new-line
9392 </pre>
9393  has no effect.
9394
9395 <h4><a name="6.10.8" href="#6.10.8">6.10.8 Predefined macro names</a></h4>
9396 <p><!--para 1 -->
9397  The values of the predefined macros listed in the following subclauses<sup><a href="#note176"><b>176)</b></a></sup> (except for
9398  __FILE__ and __LINE__) remain constant throughout the translation unit.
9399 <p><!--para 2 -->
9400  None of these macro names, nor the identifier defined, shall be the subject of a
9401  #define or a #undef preprocessing directive. Any other predefined macro names
9402  shall begin with a leading underscore followed by an uppercase letter or a second
9403  underscore.
9404 <p><!--para 3 -->
9405  The implementation shall not predefine the macro __cplusplus, nor shall it define it
9406  in any standard header.
9407 <p><b> Forward references</b>: standard headers (<a href="#7.1.2">7.1.2</a>).
9408
9409 <h6>footnotes</h6>
9410 <p><small><a name="note176" href="#note176">176)</a> See ''future language directions'' (<a href="#6.11.9">6.11.9</a>).
9411 </small>
9412
9413 <h5><a name="6.10.8.1" href="#6.10.8.1">6.10.8.1 Mandatory macros</a></h5>
9414 <p><!--para 1 -->
9415  The following macro names shall be defined by the implementation:
9416  __DATE__ The date of translation of the preprocessing translation unit: a character
9417 <pre>
9418             string literal of the form "Mmm dd yyyy", where the names of the
9419             months are the same as those generated by the asctime function, and the
9420             first character of dd is a space character if the value is less than 10. If the
9421             date of translation is not available, an implementation-defined valid date
9422             shall be supplied.
9423 </pre>
9424  __FILE__ The presumed name of the current source file (a character string literal).<sup><a href="#note177"><b>177)</b></a></sup>
9425  __LINE__ The presumed line number (within the current source file) of the current
9426 <pre>
9427             source line (an integer constant).<sup><a href="#note177"><b>177)</b></a></sup>
9428 </pre>
9429  __STDC__ The integer constant 1, intended to indicate a conforming implementation.
9430  __STDC_HOSTED__ The integer constant 1 if the implementation is a hosted
9431 <pre>
9432            implementation or the integer constant 0 if it is not.
9433 </pre>
9434  
9435  
9436  
9437  
9438 <!--page 193 -->
9439  __STDC_VERSION__ The integer constant 201ymmL.<sup><a href="#note178"><b>178)</b></a></sup>
9440  __TIME__ The time of translation of the preprocessing translation unit: a character
9441 <pre>
9442             string literal of the form "hh:mm:ss" as in the time generated by the
9443             asctime function. If the time of translation is not available, an
9444             implementation-defined valid time shall be supplied.
9445 </pre>
9446 <p><b> Forward references</b>: the asctime function (<a href="#7.26.3.1">7.26.3.1</a>).
9447
9448 <h6>footnotes</h6>
9449 <p><small><a name="note177" href="#note177">177)</a> The presumed source file name and line number can be changed by the #line directive.
9450 </small>
9451 <p><small><a name="note178" href="#note178">178)</a> This macro was not specified in ISO/IEC 9899:1990 and was specified as 199409L in
9452  ISO/IEC 9899/AMD1:1995 and as 199901L in ISO/IEC 9899:1999. The intention is that this will
9453  remain an integer constant of type long int that is increased with each revision of this International
9454  Standard.
9455 </small>
9456
9457 <h5><a name="6.10.8.2" href="#6.10.8.2">6.10.8.2 Environment macros</a></h5>
9458 <p><!--para 1 -->
9459  The following macro names are conditionally defined by the implementation:
9460  __STDC_ISO_10646__ An integer constant of the form yyyymmL (for example,
9461 <pre>
9462            199712L). If this symbol is defined, then every character in the Unicode
9463            required set, when stored in an object of type wchar_t, has the same
9464            value as the short identifier of that character. The Unicode required set
9465            consists of all the characters that are defined by ISO/IEC 10646, along with
9466            all amendments and technical corrigenda, as of the specified year and
9467            month. If some other encoding is used, the macro shall not be defined and
9468            the actual encoding used is implementation-defined.
9469 </pre>
9470  __STDC_MB_MIGHT_NEQ_WC__ The integer constant 1, intended to indicate that, in
9471 <pre>
9472            the encoding for wchar_t, a member of the basic character set need not
9473            have a code value equal to its value when used as the lone character in an
9474            integer character constant.
9475 </pre>
9476  __STDC_UTF_16__ The integer constant 1, intended to indicate that values of type
9477 <pre>
9478            char16_t are UTF-16 encoded. If some other encoding is used, the
9479            macro shall not be defined and the actual encoding used is implementation-
9480            defined.
9481 </pre>
9482  __STDC_UTF_32__ The integer constant 1, intended to indicate that values of type
9483 <pre>
9484            char32_t are UTF-32 encoded. If some other encoding is used, the
9485            macro shall not be defined and the actual encoding used is implementation-
9486            defined.
9487 </pre>
9488 <p><b> Forward references</b>: common definitions (<a href="#7.19">7.19</a>), unicode utilities (<a href="#7.27">7.27</a>).
9489  
9490  
9491  
9492  
9493 <!--page 194 -->
9494
9495 <h5><a name="6.10.8.3" href="#6.10.8.3">6.10.8.3 Conditional feature macros</a></h5>
9496 <p><!--para 1 -->
9497  The following macro names are conditionally defined by the implementation:
9498  __STDC_ANALYZABLE__ The integer constant 1, intended to indicate conformance to
9499 <pre>
9500            the specifications in <a href="#L">annex L</a> (Analyzability).
9501 </pre>
9502  __STDC_IEC_559__ The integer constant 1, intended to indicate conformance to the
9503 <pre>
9504            specifications in <a href="#F">annex F</a> (IEC 60559 floating-point arithmetic).
9505 </pre>
9506  __STDC_IEC_559_COMPLEX__ The integer constant 1, intended to indicate
9507 <pre>
9508            adherence to the specifications in <a href="#G">annex G</a> (IEC 60559 compatible complex
9509            arithmetic).
9510 </pre>
9511  __STDC_LIB_EXT1__ The integer constant 201ymmL, intended to indicate support
9512 <pre>
9513            for the extensions defined in <a href="#K">annex K</a> (Bounds-checking interfaces).<sup><a href="#note179"><b>179)</b></a></sup>
9514 </pre>
9515  __STDC_NO_COMPLEX__ The integer constant 1, intended to indicate that the
9516 <pre>
9517            implementation does not support complex types or the <a href="#7.3">&lt;complex.h&gt;</a>
9518            header.
9519 </pre>
9520  __STDC_NO_THREADS__ The integer constant 1, intended to indicate that the
9521 <pre>
9522            implementation does not support atomic types (including the _Atomic
9523            type qualifier and the <a href="#7.17">&lt;stdatomic.h&gt;</a> header) or the <a href="#7.25">&lt;threads.h&gt;</a>
9524            header.
9525 </pre>
9526  __STDC_NO_VLA__ The integer constant 1, intended to indicate that the
9527 <pre>
9528            implementation does not support variable length arrays or variably
9529            modified types.
9530 </pre>
9531 <p><!--para 2 -->
9532  An implementation that defines __STDC_NO_COMPLEX__ shall not define
9533  __STDC_IEC_559_COMPLEX__.
9534
9535 <h6>footnotes</h6>
9536 <p><small><a name="note179" href="#note179">179)</a> The intention is that this will remain an integer constant of type long int that is increased with
9537  each revision of this International Standard.
9538 </small>
9539
9540 <h4><a name="6.10.9" href="#6.10.9">6.10.9 Pragma operator</a></h4>
9541 <h6>Semantics</h6>
9542 <p><!--para 1 -->
9543  A unary operator expression of the form:
9544 <pre>
9545     _Pragma ( string-literal )
9546 </pre>
9547  is processed as follows: The string literal is destringized by deleting the L prefix, if
9548  present, deleting the leading and trailing double-quotes, replacing each escape sequence
9549  \" by a double-quote, and replacing each escape sequence \\ by a single backslash. The
9550  resulting sequence of characters is processed through translation phase 3 to produce
9551  preprocessing tokens that are executed as if they were the pp-tokens in a pragma
9552  
9553  
9554 <!--page 195 -->
9555  directive. The original four preprocessing tokens in the unary operator expression are
9556  removed.
9557 <p><!--para 2 -->
9558  EXAMPLE       A directive of the form:
9559 <pre>
9560            #pragma listing on "..\listing.dir"
9561 </pre>
9562  can also be expressed as:
9563 <pre>
9564            _Pragma ( "listing on \"..\\listing.dir\"" )
9565 </pre>
9566  The latter form is processed in the same way whether it appears literally as shown, or results from macro
9567  replacement, as in:
9568 <!--page 196 -->
9569 <pre>
9570            #define LISTING(x) PRAGMA(listing on #x)
9571            #define PRAGMA(x) _Pragma(#x)
9572            LISTING ( ..\listing.dir )
9573 </pre>
9574
9575 <h3><a name="6.11" href="#6.11">6.11 Future language directions</a></h3>
9576
9577 <h4><a name="6.11.1" href="#6.11.1">6.11.1 Floating types</a></h4>
9578 <p><!--para 1 -->
9579  Future standardization may include additional floating-point types, including those with
9580  greater range, precision, or both than long double.
9581
9582 <h4><a name="6.11.2" href="#6.11.2">6.11.2 Linkages of identifiers</a></h4>
9583 <p><!--para 1 -->
9584  Declaring an identifier with internal linkage at file scope without the static storage-
9585  class specifier is an obsolescent feature.
9586
9587 <h4><a name="6.11.3" href="#6.11.3">6.11.3 External names</a></h4>
9588 <p><!--para 1 -->
9589  Restriction of the significance of an external name to fewer than 255 characters
9590  (considering each universal character name or extended source character as a single
9591  character) is an obsolescent feature that is a concession to existing implementations.
9592
9593 <h4><a name="6.11.4" href="#6.11.4">6.11.4 Character escape sequences</a></h4>
9594 <p><!--para 1 -->
9595  Lowercase letters as escape sequences are reserved for future standardization. Other
9596  characters may be used in extensions.
9597
9598 <h4><a name="6.11.5" href="#6.11.5">6.11.5 Storage-class specifiers</a></h4>
9599 <p><!--para 1 -->
9600  The placement of a storage-class specifier other than at the beginning of the declaration
9601  specifiers in a declaration is an obsolescent feature.
9602
9603 <h4><a name="6.11.6" href="#6.11.6">6.11.6 Function declarators</a></h4>
9604 <p><!--para 1 -->
9605  The use of function declarators with empty parentheses (not prototype-format parameter
9606  type declarators) is an obsolescent feature.
9607
9608 <h4><a name="6.11.7" href="#6.11.7">6.11.7 Function definitions</a></h4>
9609 <p><!--para 1 -->
9610  The use of function definitions with separate parameter identifier and declaration lists
9611  (not prototype-format parameter type and identifier declarators) is an obsolescent feature.
9612
9613 <h4><a name="6.11.8" href="#6.11.8">6.11.8 Pragma directives</a></h4>
9614 <p><!--para 1 -->
9615  Pragmas whose first preprocessing token is STDC are reserved for future standardization.
9616
9617 <h4><a name="6.11.9" href="#6.11.9">6.11.9 Predefined macro names</a></h4>
9618 <p><!--para 1 -->
9619  Macro names beginning with __STDC_ are reserved for future standardization.
9620 <!--page 197 -->
9621
9622 <h2><a name="7" href="#7">7. Library</a></h2>
9623
9624 <h3><a name="7.1" href="#7.1">7.1 Introduction</a></h3>
9625
9626 <h4><a name="7.1.1" href="#7.1.1">7.1.1 Definitions of terms</a></h4>
9627 <p><!--para 1 -->
9628  A string is a contiguous sequence of characters terminated by and including the first null
9629  character. The term multibyte string is sometimes used instead to emphasize special
9630  processing given to multibyte characters contained in the string or to avoid confusion
9631  with a wide string. A pointer to a string is a pointer to its initial (lowest addressed)
9632  character. The length of a string is the number of bytes preceding the null character and
9633  the value of a string is the sequence of the values of the contained characters, in order.
9634 <p><!--para 2 -->
9635  The decimal-point character is the character used by functions that convert floating-point
9636  numbers to or from character sequences to denote the beginning of the fractional part of
9637  such character sequences.<sup><a href="#note180"><b>180)</b></a></sup> It is represented in the text and examples by a period, but
9638  may be changed by the setlocale function.
9639 <p><!--para 3 -->
9640  A null wide character is a wide character with code value zero.
9641 <p><!--para 4 -->
9642  A wide string is a contiguous sequence of wide characters terminated by and including
9643  the first null wide character. A pointer to a wide string is a pointer to its initial (lowest
9644  addressed) wide character. The length of a wide string is the number of wide characters
9645  preceding the null wide character and the value of a wide string is the sequence of code
9646  values of the contained wide characters, in order.
9647 <p><!--para 5 -->
9648  A shift sequence is a contiguous sequence of bytes within a multibyte string that
9649  (potentially) causes a change in shift state (see <a href="#5.2.1.2">5.2.1.2</a>). A shift sequence shall not have a
9650  corresponding wide character; it is instead taken to be an adjunct to an adjacent multibyte
9651  character.<sup><a href="#note181"><b>181)</b></a></sup>
9652 <p><b> Forward references</b>: character handling (<a href="#7.4">7.4</a>), the setlocale function (<a href="#7.11.1.1">7.11.1.1</a>).
9653  
9654  
9655  
9656  
9657 <!--page 198 -->
9658
9659 <h6>footnotes</h6>
9660 <p><small><a name="note180" href="#note180">180)</a> The functions that make use of the decimal-point character are the numeric conversion functions
9661  (<a href="#7.22.1">7.22.1</a>, <a href="#7.28.4.1">7.28.4.1</a>) and the formatted input/output functions (<a href="#7.21.6">7.21.6</a>, <a href="#7.28.2">7.28.2</a>).
9662 </small>
9663 <p><small><a name="note181" href="#note181">181)</a> For state-dependent encodings, the values for MB_CUR_MAX and MB_LEN_MAX shall thus be large
9664  enough to count all the bytes in any complete multibyte character plus at least one adjacent shift
9665  sequence of maximum length. Whether these counts provide for more than one shift sequence is the
9666  implementation's choice.
9667 </small>
9668
9669 <h4><a name="7.1.2" href="#7.1.2">7.1.2 Standard headers</a></h4>
9670 <p><!--para 1 -->
9671  Each library function is declared, with a type that includes a prototype, in a header,<sup><a href="#note182"><b>182)</b></a></sup>
9672  whose contents are made available by the #include preprocessing directive. The
9673  header declares a set of related functions, plus any necessary types and additional macros
9674  needed to facilitate their use. Declarations of types described in this clause shall not
9675  include type qualifiers, unless explicitly stated otherwise.
9676 <p><!--para 2 -->
9677  The standard headers are<sup><a href="#note183"><b>183)</b></a></sup>
9678 <pre>
9679         <a href="#7.2">&lt;assert.h&gt;</a>             <a href="#7.9">&lt;iso646.h&gt;</a>              <a href="#7.16">&lt;stdarg.h&gt;</a>              <a href="#7.23">&lt;string.h&gt;</a>
9680         <a href="#7.3">&lt;complex.h&gt;</a>            <a href="#7.10">&lt;limits.h&gt;</a>              <a href="#7.17">&lt;stdatomic.h&gt;</a>           <a href="#7.24">&lt;tgmath.h&gt;</a>
9681         <a href="#7.4">&lt;ctype.h&gt;</a>              <a href="#7.11">&lt;locale.h&gt;</a>              <a href="#7.18">&lt;stdbool.h&gt;</a>             <a href="#7.25">&lt;threads.h&gt;</a>
9682         <a href="#7.5">&lt;errno.h&gt;</a>              <a href="#7.12">&lt;math.h&gt;</a>                <a href="#7.19">&lt;stddef.h&gt;</a>              <a href="#7.26">&lt;time.h&gt;</a>
9683         <a href="#7.6">&lt;fenv.h&gt;</a>               <a href="#7.13">&lt;setjmp.h&gt;</a>              <a href="#7.20">&lt;stdint.h&gt;</a>              <a href="#7.27">&lt;uchar.h&gt;</a>
9684         <a href="#7.7">&lt;float.h&gt;</a>              <a href="#7.14">&lt;signal.h&gt;</a>              <a href="#7.21">&lt;stdio.h&gt;</a>               <a href="#7.28">&lt;wchar.h&gt;</a>
9685         <a href="#7.8">&lt;inttypes.h&gt;</a>           <a href="#7.15">&lt;stdalign.h&gt;</a>            <a href="#7.22">&lt;stdlib.h&gt;</a>              <a href="#7.29">&lt;wctype.h&gt;</a>
9686 </pre>
9687 <p><!--para 3 -->
9688  If a file with the same name as one of the above &lt; and &gt; delimited sequences, not
9689  provided as part of the implementation, is placed in any of the standard places that are
9690  searched for included source files, the behavior is undefined.
9691 <p><!--para 4 -->
9692  Standard headers may be included in any order; each may be included more than once in
9693  a given scope, with no effect different from being included only once, except that the
9694  effect of including <a href="#7.2">&lt;assert.h&gt;</a> depends on the definition of NDEBUG (see <a href="#7.2">7.2</a>). If
9695  used, a header shall be included outside of any external declaration or definition, and it
9696  shall first be included before the first reference to any of the functions or objects it
9697  declares, or to any of the types or macros it defines. However, if an identifier is declared
9698  or defined in more than one header, the second and subsequent associated headers may be
9699  included after the initial reference to the identifier. The program shall not have any
9700  macros with names lexically identical to keywords currently defined prior to the
9701  inclusion.
9702 <p><!--para 5 -->
9703  Any definition of an object-like macro described in this clause shall expand to code that is
9704  fully protected by parentheses where necessary, so that it groups in an arbitrary
9705  expression as if it were a single identifier.
9706 <p><!--para 6 -->
9707  Any declaration of a library function shall have external linkage.
9708  
9709  
9710  
9711  
9712 <!--page 199 -->
9713 <p><!--para 7 -->
9714  A summary of the contents of the standard headers is given in <a href="#B">annex B</a>.
9715 <p><b> Forward references</b>: diagnostics (<a href="#7.2">7.2</a>).
9716
9717 <h6>footnotes</h6>
9718 <p><small><a name="note182" href="#note182">182)</a> A header is not necessarily a source file, nor are the &lt; and &gt; delimited sequences in header names
9719  necessarily valid source file names.
9720 </small>
9721 <p><small><a name="note183" href="#note183">183)</a> The headers <a href="#7.3">&lt;complex.h&gt;</a>, <a href="#7.17">&lt;stdatomic.h&gt;</a>, and <a href="#7.25">&lt;threads.h&gt;</a> are conditional features that
9722  implementations need not support; see <a href="#6.10.8.3">6.10.8.3</a>.
9723 </small>
9724
9725 <h4><a name="7.1.3" href="#7.1.3">7.1.3 Reserved identifiers</a></h4>
9726 <p><!--para 1 -->
9727  Each header declares or defines all identifiers listed in its associated subclause, and
9728  optionally declares or defines identifiers listed in its associated future library directions
9729  subclause and identifiers which are always reserved either for any use or for use as file
9730  scope identifiers.
9731 <ul>
9732 <li>  All identifiers that begin with an underscore and either an uppercase letter or another
9733  underscore are always reserved for any use.
9734 <li>  All identifiers that begin with an underscore are always reserved for use as identifiers
9735  with file scope in both the ordinary and tag name spaces.
9736 <li>  Each macro name in any of the following subclauses (including the future library
9737  directions) is reserved for use as specified if any of its associated headers is included;
9738  unless explicitly stated otherwise (see <a href="#7.1.4">7.1.4</a>).
9739 <li>  All identifiers with external linkage in any of the following subclauses (including the
9740  future library directions) and errno are always reserved for use as identifiers with
9741  external linkage.<sup><a href="#note184"><b>184)</b></a></sup>
9742 <li>  Each identifier with file scope listed in any of the following subclauses (including the
9743  future library directions) is reserved for use as a macro name and as an identifier with
9744  file scope in the same name space if any of its associated headers is included.
9745 </ul>
9746 <p><!--para 2 -->
9747  No other identifiers are reserved. If the program declares or defines an identifier in a
9748  context in which it is reserved (other than as allowed by <a href="#7.1.4">7.1.4</a>), or defines a reserved
9749  identifier as a macro name, the behavior is undefined.
9750 <p><!--para 3 -->
9751  If the program removes (with #undef) any macro definition of an identifier in the first
9752  group listed above, the behavior is undefined.
9753  
9754  
9755  
9756  
9757 <!--page 200 -->
9758
9759 <h6>footnotes</h6>
9760 <p><small><a name="note184" href="#note184">184)</a> The list of reserved identifiers with external linkage includes math_errhandling, setjmp,
9761  va_copy, and va_end.
9762 </small>
9763
9764 <h4><a name="7.1.4" href="#7.1.4">7.1.4 Use of library functions</a></h4>
9765 <p><!--para 1 -->
9766  Each of the following statements applies unless explicitly stated otherwise in the detailed
9767  descriptions that follow: If an argument to a function has an invalid value (such as a value
9768  outside the domain of the function, or a pointer outside the address space of the program,
9769  or a null pointer, or a pointer to non-modifiable storage when the corresponding
9770  parameter is not const-qualified) or a type (after promotion) not expected by a function
9771  with variable number of arguments, the behavior is undefined. If a function argument is
9772  described as being an array, the pointer actually passed to the function shall have a value
9773  such that all address computations and accesses to objects (that would be valid if the
9774  pointer did point to the first element of such an array) are in fact valid. Any function
9775  declared in a header may be additionally implemented as a function-like macro defined in
9776  the header, so if a library function is declared explicitly when its header is included, one
9777  of the techniques shown below can be used to ensure the declaration is not affected by
9778  such a macro. Any macro definition of a function can be suppressed locally by enclosing
9779  the name of the function in parentheses, because the name is then not followed by the left
9780  parenthesis that indicates expansion of a macro function name. For the same syntactic
9781  reason, it is permitted to take the address of a library function even if it is also defined as
9782  a macro.<sup><a href="#note185"><b>185)</b></a></sup> The use of #undef to remove any macro definition will also ensure that an
9783  actual function is referred to. Any invocation of a library function that is implemented as
9784  a macro shall expand to code that evaluates each of its arguments exactly once, fully
9785  protected by parentheses where necessary, so it is generally safe to use arbitrary
9786  expressions as arguments.<sup><a href="#note186"><b>186)</b></a></sup> Likewise, those function-like macros described in the
9787  following subclauses may be invoked in an expression anywhere a function with a
9788  compatible return type could be called.<sup><a href="#note187"><b>187)</b></a></sup> All object-like macros listed as expanding to
9789  
9790  
9791 <!--page 201 -->
9792  integer constant expressions shall additionally be suitable for use in #if preprocessing
9793  directives.
9794 <p><!--para 2 -->
9795  Provided that a library function can be declared without reference to any type defined in a
9796  header, it is also permissible to declare the function and use it without including its
9797  associated header.
9798 <p><!--para 3 -->
9799  There is a sequence point immediately before a library function returns.
9800 <p><!--para 4 -->
9801  The functions in the standard library are not guaranteed to be reentrant and may modify
9802  objects with static or thread storage duration.<sup><a href="#note188"><b>188)</b></a></sup>
9803 <p><!--para 5 -->
9804  Unless explicitly stated otherwise in the detailed descriptions that follow, library
9805  functions shall prevent data races as follows: A library function shall not directly or
9806  indirectly access objects accessible by threads other than the current thread unless the
9807  objects are accessed directly or indirectly via the function's arguments. A library
9808  function shall not directly or indirectly modify objects accessible by threads other than
9809  the current thread unless the objects are accessed directly or indirectly via the function's
9810  non-const arguments.<sup><a href="#note189"><b>189)</b></a></sup> Implementations may share their own internal objects between
9811  threads if the objects are not visible to users and are protected against data races.
9812 <p><!--para 6 -->
9813  Unless otherwise specified, library functions shall perform all operations solely within the
9814  current thread if those operations have effects that are visible to users.<sup><a href="#note190"><b>190)</b></a></sup>
9815 <p><!--para 7 -->
9816  EXAMPLE        The function atoi may be used in any of several ways:
9817 <ul>
9818 <li>  by use of its associated header (possibly generating a macro expansion)
9819 <pre>
9820             #include <a href="#7.22">&lt;stdlib.h&gt;</a>
9821             const char *str;
9822             /* ... */
9823             i = atoi(str);
9824 </pre>
9825 <li>  by use of its associated header (assuredly generating a true function reference)
9826  
9827  
9828  
9829  
9830 <!--page 202 -->
9831 <pre>
9832            #include <a href="#7.22">&lt;stdlib.h&gt;</a>
9833            #undef atoi
9834            const char *str;
9835            /* ... */
9836            i = atoi(str);
9837 </pre>
9838   or
9839 <pre>
9840            #include <a href="#7.22">&lt;stdlib.h&gt;</a>
9841            const char *str;
9842            /* ... */
9843            i = (atoi)(str);
9844 </pre>
9845 <li>  by explicit declaration
9846 <!--page 203 -->
9847 <pre>
9848            extern int atoi(const char *);
9849            const char *str;
9850            /* ... */
9851            i = atoi(str);
9852 </pre>
9853 </ul>
9854
9855 <h6>footnotes</h6>
9856 <p><small><a name="note185" href="#note185">185)</a> This means that an implementation shall provide an actual function for each library function, even if it
9857  also provides a macro for that function.
9858 </small>
9859 <p><small><a name="note186" href="#note186">186)</a> Such macros might not contain the sequence points that the corresponding function calls do.
9860 </small>
9861 <p><small><a name="note187" href="#note187">187)</a> Because external identifiers and some macro names beginning with an underscore are reserved,
9862  implementations may provide special semantics for such names. For example, the identifier
9863  _BUILTIN_abs could be used to indicate generation of in-line code for the abs function. Thus, the
9864  appropriate header could specify
9865
9866 <pre>
9867            #define abs(x) _BUILTIN_abs(x)
9868 </pre>
9869   for a compiler whose code generator will accept it.
9870   In this manner, a user desiring to guarantee that a given library function such as abs will be a genuine
9871   function may write
9872
9873 <pre>
9874            #undef abs
9875 </pre>
9876   whether the implementation's header provides a macro implementation of abs or a built-in
9877   implementation. The prototype for the function, which precedes and is hidden by any macro
9878   definition, is thereby revealed also.
9879 </small>
9880 <p><small><a name="note188" href="#note188">188)</a> Thus, a signal handler cannot, in general, call standard library functions.
9881 </small>
9882 <p><small><a name="note189" href="#note189">189)</a> This means, for example, that an implementation is not permitted to use a static object for internal
9883  purposes without synchronization because it could cause a data race even in programs that do not
9884  explicitly share objects between threads.
9885 </small>
9886 <p><small><a name="note190" href="#note190">190)</a> This allows implementations to parallelize operations if there are no visible side effects.
9887 </small>
9888
9889 <h3><a name="7.2" href="#7.2">7.2 Diagnostics <assert.h></a></h3>
9890 <p><!--para 1 -->
9891  The header <a href="#7.2">&lt;assert.h&gt;</a> defines the assert and static_assert macros and
9892  refers to another macro,
9893 <pre>
9894          NDEBUG
9895 </pre>
9896  which is not defined by <a href="#7.2">&lt;assert.h&gt;</a>. If NDEBUG is defined as a macro name at the
9897  point in the source file where <a href="#7.2">&lt;assert.h&gt;</a> is included, the assert macro is defined
9898  simply as
9899 <pre>
9900          #define assert(ignore) ((void)0)
9901 </pre>
9902  The assert macro is redefined according to the current state of NDEBUG each time that
9903  <a href="#7.2">&lt;assert.h&gt;</a> is included.
9904 <p><!--para 2 -->
9905  The assert macro shall be implemented as a macro, not as an actual function. If the
9906  macro definition is suppressed in order to access an actual function, the behavior is
9907  undefined.
9908 <p><!--para 3 -->
9909  The macro
9910 <pre>
9911          static_assert
9912 </pre>
9913  expands to _Static_assert.
9914
9915 <h4><a name="7.2.1" href="#7.2.1">7.2.1 Program diagnostics</a></h4>
9916
9917 <h5><a name="7.2.1.1" href="#7.2.1.1">7.2.1.1 The assert macro</a></h5>
9918 <h6>Synopsis</h6>
9919 <p><!--para 1 -->
9920 <pre>
9921          #include <a href="#7.2">&lt;assert.h&gt;</a>
9922          void assert(scalar expression);
9923 </pre>
9924 <h6>Description</h6>
9925 <p><!--para 2 -->
9926  The assert macro puts diagnostic tests into programs; it expands to a void expression.
9927  When it is executed, if expression (which shall have a scalar type) is false (that is,
9928  compares equal to 0), the assert macro writes information about the particular call that
9929  failed (including the text of the argument, the name of the source file, the source line
9930  number, and the name of the enclosing function -- the latter are respectively the values of
9931  the preprocessing macros __FILE__ and __LINE__ and of the identifier
9932  __func__) on the standard error stream in an implementation-defined format.<sup><a href="#note191"><b>191)</b></a></sup> It
9933  then calls the abort function.
9934  
9935  
9936  
9937 <!--page 204 -->
9938 <h6>Returns</h6>
9939 <p><!--para 3 -->
9940  The assert macro returns no value.
9941 <p><b> Forward references</b>: the abort function (<a href="#7.22.4.1">7.22.4.1</a>).
9942 <!--page 205 -->
9943
9944 <h6>footnotes</h6>
9945 <p><small><a name="note191" href="#note191">191)</a> The message written might be of the form:
9946  Assertion failed: expression, function abc, file xyz, line nnn.
9947 </small>
9948
9949 <h3><a name="7.3" href="#7.3">7.3 Complex arithmetic <complex.h></a></h3>
9950
9951 <h4><a name="7.3.1" href="#7.3.1">7.3.1 Introduction</a></h4>
9952 <p><!--para 1 -->
9953  The header <a href="#7.3">&lt;complex.h&gt;</a> defines macros and declares functions that support complex
9954  arithmetic.<sup><a href="#note192"><b>192)</b></a></sup>
9955 <p><!--para 2 -->
9956  Implementations that define the macro __STDC_NO_COMPLEX__ need not provide
9957  this header nor support any of its facilities.
9958 <p><!--para 3 -->
9959  Each synopsis specifies a family of functions consisting of a principal function with one
9960  or more double complex parameters and a double complex or double return
9961  value; and other functions with the same name but with f and l suffixes which are
9962  corresponding functions with float and long double parameters and return values.
9963 <p><!--para 4 -->
9964  The macro
9965 <pre>
9966           complex
9967 </pre>
9968  expands to _Complex; the macro
9969 <pre>
9970           _Complex_I
9971 </pre>
9972  expands to a constant expression of type const float _Complex, with the value of
9973  the imaginary unit.<sup><a href="#note193"><b>193)</b></a></sup>
9974 <p><!--para 5 -->
9975  The macros
9976 <pre>
9977           imaginary
9978 </pre>
9979  and
9980 <pre>
9981           _Imaginary_I
9982 </pre>
9983  are defined if and only if the implementation supports imaginary types;<sup><a href="#note194"><b>194)</b></a></sup> if defined,
9984  they expand to _Imaginary and a constant expression of type const float
9985  _Imaginary with the value of the imaginary unit.
9986 <p><!--para 6 -->
9987  The macro
9988 <pre>
9989           I
9990 </pre>
9991  expands to either _Imaginary_I or _Complex_I. If _Imaginary_I is not
9992  defined, I shall expand to _Complex_I.
9993 <p><!--para 7 -->
9994  Notwithstanding the provisions of <a href="#7.1.3">7.1.3</a>, a program may undefine and perhaps then
9995  redefine the macros complex, imaginary, and I.
9996  
9997 <!--page 206 -->
9998 <p><b> Forward references</b>: IEC 60559-compatible complex arithmetic (<a href="#G">annex G</a>).
9999
10000 <h6>footnotes</h6>
10001 <p><small><a name="note192" href="#note192">192)</a> See ''future library directions'' (<a href="#7.30.1">7.30.1</a>).
10002 </small>
10003 <p><small><a name="note193" href="#note193">193)</a> The imaginary unit is a number i such that i 2 = -1.
10004 </small>
10005 <p><small><a name="note194" href="#note194">194)</a> A specification for imaginary types is in informative <a href="#G">annex G</a>.
10006 </small>
10007
10008 <h4><a name="7.3.2" href="#7.3.2">7.3.2 Conventions</a></h4>
10009 <p><!--para 1 -->
10010  Values are interpreted as radians, not degrees. An implementation may set errno but is
10011  not required to.
10012
10013 <h4><a name="7.3.3" href="#7.3.3">7.3.3 Branch cuts</a></h4>
10014 <p><!--para 1 -->
10015  Some of the functions below have branch cuts, across which the function is
10016  discontinuous. For implementations with a signed zero (including all IEC 60559
10017  implementations) that follow the specifications of <a href="#G">annex G</a>, the sign of zero distinguishes
10018  one side of a cut from another so the function is continuous (except for format
10019  limitations) as the cut is approached from either side. For example, for the square root
10020  function, which has a branch cut along the negative real axis, the top of the cut, with
10021  imaginary part +0, maps to the positive imaginary axis, and the bottom of the cut, with
10022  imaginary part -0, maps to the negative imaginary axis.
10023 <p><!--para 2 -->
10024  Implementations that do not support a signed zero (see <a href="#F">annex F</a>) cannot distinguish the
10025  sides of branch cuts. These implementations shall map a cut so the function is continuous
10026  as the cut is approached coming around the finite endpoint of the cut in a counter
10027  clockwise direction. (Branch cuts for the functions specified here have just one finite
10028  endpoint.) For example, for the square root function, coming counter clockwise around
10029  the finite endpoint of the cut along the negative real axis approaches the cut from above,
10030  so the cut maps to the positive imaginary axis.
10031
10032 <h4><a name="7.3.4" href="#7.3.4">7.3.4 The CX_LIMITED_RANGE pragma</a></h4>
10033 <h6>Synopsis</h6>
10034 <p><!--para 1 -->
10035 <pre>
10036         #include <a href="#7.3">&lt;complex.h&gt;</a>
10037         #pragma STDC CX_LIMITED_RANGE on-off-switch
10038 </pre>
10039 <h6>Description</h6>
10040 <p><!--para 2 -->
10041  The usual mathematical formulas for complex multiply, divide, and absolute value are
10042  problematic because of their treatment of infinities and because of undue overflow and
10043  underflow. The CX_LIMITED_RANGE pragma can be used to inform the
10044  implementation that (where the state is ''on'') the usual mathematical formulas are
10045  acceptable.<sup><a href="#note195"><b>195)</b></a></sup> The pragma can occur either outside external declarations or preceding all
10046  explicit declarations and statements inside a compound statement. When outside external
10047  declarations, the pragma takes effect from its occurrence until another
10048  CX_LIMITED_RANGE pragma is encountered, or until the end of the translation unit.
10049  When inside a compound statement, the pragma takes effect from its occurrence until
10050  another CX_LIMITED_RANGE pragma is encountered (including within a nested
10051  compound statement), or until the end of the compound statement; at the end of a
10052  compound statement the state for the pragma is restored to its condition just before the
10053 <!--page 207 -->
10054  compound statement. If this pragma is used in any other context, the behavior is
10055  undefined. The default state for the pragma is ''off''.
10056
10057 <h6>footnotes</h6>
10058 <p><small><a name="note195" href="#note195">195)</a> The purpose of the pragma is to allow the implementation to use the formulas:
10059
10060 <pre>
10061     (x + iy) x (u + iv) = (xu - yv) + i(yu + xv)
10062     (x + iy) / (u + iv) = [(xu + yv) + i(yu - xv)]/(u2 + v 2 )
10063     | x + iy | = (sqrt) x 2 + y 2
10064                  -----
10065 </pre>
10066  where the programmer can determine they are safe.
10067 </small>
10068
10069 <h4><a name="7.3.5" href="#7.3.5">7.3.5 Trigonometric functions</a></h4>
10070
10071 <h5><a name="7.3.5.1" href="#7.3.5.1">7.3.5.1 The cacos functions</a></h5>
10072 <h6>Synopsis</h6>
10073 <p><!--para 1 -->
10074 <pre>
10075          #include <a href="#7.3">&lt;complex.h&gt;</a>
10076          double complex cacos(double complex z);
10077          float complex cacosf(float complex z);
10078          long double complex cacosl(long double complex z);
10079 </pre>
10080 <h6>Description</h6>
10081 <p><!--para 2 -->
10082  The cacos functions compute the complex arc cosine of z, with branch cuts outside the
10083  interval [-1, +1] along the real axis.
10084 <h6>Returns</h6>
10085 <p><!--para 3 -->
10086  The cacos functions return the complex arc cosine value, in the range of a strip
10087  mathematically unbounded along the imaginary axis and in the interval [0, pi ] along the
10088  real axis.
10089
10090 <h5><a name="7.3.5.2" href="#7.3.5.2">7.3.5.2 The casin functions</a></h5>
10091 <h6>Synopsis</h6>
10092 <p><!--para 1 -->
10093 <pre>
10094          #include <a href="#7.3">&lt;complex.h&gt;</a>
10095          double complex casin(double complex z);
10096          float complex casinf(float complex z);
10097          long double complex casinl(long double complex z);
10098 </pre>
10099 <h6>Description</h6>
10100 <p><!--para 2 -->
10101  The casin functions compute the complex arc sine of z, with branch cuts outside the
10102  interval [-1, +1] along the real axis.
10103 <h6>Returns</h6>
10104 <p><!--para 3 -->
10105  The casin functions return the complex arc sine value, in the range of a strip
10106  mathematically unbounded along the imaginary axis and in the interval [-pi /2, +pi /2]
10107  
10108 <!--page 208 -->
10109  along the real axis.
10110
10111 <h5><a name="7.3.5.3" href="#7.3.5.3">7.3.5.3 The catan functions</a></h5>
10112 <h6>Synopsis</h6>
10113 <p><!--para 1 -->
10114 <pre>
10115         #include <a href="#7.3">&lt;complex.h&gt;</a>
10116         double complex catan(double complex z);
10117         float complex catanf(float complex z);
10118         long double complex catanl(long double complex z);
10119 </pre>
10120 <h6>Description</h6>
10121 <p><!--para 2 -->
10122  The catan functions compute the complex arc tangent of z, with branch cuts outside the
10123  interval [-i, +i] along the imaginary axis.
10124 <h6>Returns</h6>
10125 <p><!--para 3 -->
10126  The catan functions return the complex arc tangent value, in the range of a strip
10127  mathematically unbounded along the imaginary axis and in the interval [-pi /2, +pi /2]
10128  along the real axis.
10129
10130 <h5><a name="7.3.5.4" href="#7.3.5.4">7.3.5.4 The ccos functions</a></h5>
10131 <h6>Synopsis</h6>
10132 <p><!--para 1 -->
10133 <pre>
10134         #include <a href="#7.3">&lt;complex.h&gt;</a>
10135         double complex ccos(double complex z);
10136         float complex ccosf(float complex z);
10137         long double complex ccosl(long double complex z);
10138 </pre>
10139 <h6>Description</h6>
10140 <p><!--para 2 -->
10141  The ccos functions compute the complex cosine of z.
10142 <h6>Returns</h6>
10143 <p><!--para 3 -->
10144  The ccos functions return the complex cosine value.
10145
10146 <h5><a name="7.3.5.5" href="#7.3.5.5">7.3.5.5 The csin functions</a></h5>
10147 <h6>Synopsis</h6>
10148 <p><!--para 1 -->
10149 <pre>
10150         #include <a href="#7.3">&lt;complex.h&gt;</a>
10151         double complex csin(double complex z);
10152         float complex csinf(float complex z);
10153         long double complex csinl(long double complex z);
10154 </pre>
10155 <h6>Description</h6>
10156 <p><!--para 2 -->
10157  The csin functions compute the complex sine of z.
10158 <!--page 209 -->
10159 <h6>Returns</h6>
10160 <p><!--para 3 -->
10161  The csin functions return the complex sine value.
10162
10163 <h5><a name="7.3.5.6" href="#7.3.5.6">7.3.5.6 The ctan functions</a></h5>
10164 <h6>Synopsis</h6>
10165 <p><!--para 1 -->
10166 <pre>
10167          #include <a href="#7.3">&lt;complex.h&gt;</a>
10168          double complex ctan(double complex z);
10169          float complex ctanf(float complex z);
10170          long double complex ctanl(long double complex z);
10171 </pre>
10172 <h6>Description</h6>
10173 <p><!--para 2 -->
10174  The ctan functions compute the complex tangent of z.
10175 <h6>Returns</h6>
10176 <p><!--para 3 -->
10177  The ctan functions return the complex tangent value.
10178
10179 <h4><a name="7.3.6" href="#7.3.6">7.3.6 Hyperbolic functions</a></h4>
10180
10181 <h5><a name="7.3.6.1" href="#7.3.6.1">7.3.6.1 The cacosh functions</a></h5>
10182 <h6>Synopsis</h6>
10183 <p><!--para 1 -->
10184 <pre>
10185          #include <a href="#7.3">&lt;complex.h&gt;</a>
10186          double complex cacosh(double complex z);
10187          float complex cacoshf(float complex z);
10188          long double complex cacoshl(long double complex z);
10189 </pre>
10190 <h6>Description</h6>
10191 <p><!--para 2 -->
10192  The cacosh functions compute the complex arc hyperbolic cosine of z, with a branch
10193  cut at values less than 1 along the real axis.
10194 <h6>Returns</h6>
10195 <p><!--para 3 -->
10196  The cacosh functions return the complex arc hyperbolic cosine value, in the range of a
10197  half-strip of nonnegative values along the real axis and in the interval [-ipi , +ipi ] along the
10198  imaginary axis.
10199
10200 <h5><a name="7.3.6.2" href="#7.3.6.2">7.3.6.2 The casinh functions</a></h5>
10201 <h6>Synopsis</h6>
10202 <p><!--para 1 -->
10203 <!--page 210 -->
10204 <pre>
10205          #include <a href="#7.3">&lt;complex.h&gt;</a>
10206          double complex casinh(double complex z);
10207          float complex casinhf(float complex z);
10208          long double complex casinhl(long double complex z);
10209 </pre>
10210 <h6>Description</h6>
10211 <p><!--para 2 -->
10212  The casinh functions compute the complex arc hyperbolic sine of z, with branch cuts
10213  outside the interval [-i, +i] along the imaginary axis.
10214 <h6>Returns</h6>
10215 <p><!--para 3 -->
10216  The casinh functions return the complex arc hyperbolic sine value, in the range of a
10217  strip mathematically unbounded along the real axis and in the interval [-ipi /2, +ipi /2]
10218  along the imaginary axis.
10219
10220 <h5><a name="7.3.6.3" href="#7.3.6.3">7.3.6.3 The catanh functions</a></h5>
10221 <h6>Synopsis</h6>
10222 <p><!--para 1 -->
10223 <pre>
10224         #include <a href="#7.3">&lt;complex.h&gt;</a>
10225         double complex catanh(double complex z);
10226         float complex catanhf(float complex z);
10227         long double complex catanhl(long double complex z);
10228 </pre>
10229 <h6>Description</h6>
10230 <p><!--para 2 -->
10231  The catanh functions compute the complex arc hyperbolic tangent of z, with branch
10232  cuts outside the interval [-1, +1] along the real axis.
10233 <h6>Returns</h6>
10234 <p><!--para 3 -->
10235  The catanh functions return the complex arc hyperbolic tangent value, in the range of a
10236  strip mathematically unbounded along the real axis and in the interval [-ipi /2, +ipi /2]
10237  along the imaginary axis.
10238
10239 <h5><a name="7.3.6.4" href="#7.3.6.4">7.3.6.4 The ccosh functions</a></h5>
10240 <h6>Synopsis</h6>
10241 <p><!--para 1 -->
10242 <pre>
10243         #include <a href="#7.3">&lt;complex.h&gt;</a>
10244         double complex ccosh(double complex z);
10245         float complex ccoshf(float complex z);
10246         long double complex ccoshl(long double complex z);
10247 </pre>
10248 <h6>Description</h6>
10249 <p><!--para 2 -->
10250  The ccosh functions compute the complex hyperbolic cosine of z.
10251 <h6>Returns</h6>
10252 <p><!--para 3 -->
10253  The ccosh functions return the complex hyperbolic cosine value.
10254 <!--page 211 -->
10255
10256 <h5><a name="7.3.6.5" href="#7.3.6.5">7.3.6.5 The csinh functions</a></h5>
10257 <h6>Synopsis</h6>
10258 <p><!--para 1 -->
10259 <pre>
10260          #include <a href="#7.3">&lt;complex.h&gt;</a>
10261          double complex csinh(double complex z);
10262          float complex csinhf(float complex z);
10263          long double complex csinhl(long double complex z);
10264 </pre>
10265 <h6>Description</h6>
10266 <p><!--para 2 -->
10267  The csinh functions compute the complex hyperbolic sine of z.
10268 <h6>Returns</h6>
10269 <p><!--para 3 -->
10270  The csinh functions return the complex hyperbolic sine value.
10271
10272 <h5><a name="7.3.6.6" href="#7.3.6.6">7.3.6.6 The ctanh functions</a></h5>
10273 <h6>Synopsis</h6>
10274 <p><!--para 1 -->
10275 <pre>
10276          #include <a href="#7.3">&lt;complex.h&gt;</a>
10277          double complex ctanh(double complex z);
10278          float complex ctanhf(float complex z);
10279          long double complex ctanhl(long double complex z);
10280 </pre>
10281 <h6>Description</h6>
10282 <p><!--para 2 -->
10283  The ctanh functions compute the complex hyperbolic tangent of z.
10284 <h6>Returns</h6>
10285 <p><!--para 3 -->
10286  The ctanh functions return the complex hyperbolic tangent value.
10287
10288 <h4><a name="7.3.7" href="#7.3.7">7.3.7 Exponential and logarithmic functions</a></h4>
10289
10290 <h5><a name="7.3.7.1" href="#7.3.7.1">7.3.7.1 The cexp functions</a></h5>
10291 <h6>Synopsis</h6>
10292 <p><!--para 1 -->
10293 <pre>
10294          #include <a href="#7.3">&lt;complex.h&gt;</a>
10295          double complex cexp(double complex z);
10296          float complex cexpf(float complex z);
10297          long double complex cexpl(long double complex z);
10298 </pre>
10299 <h6>Description</h6>
10300 <p><!--para 2 -->
10301  The cexp functions compute the complex base-e exponential of z.
10302 <h6>Returns</h6>
10303 <p><!--para 3 -->
10304  The cexp functions return the complex base-e exponential value.
10305 <!--page 212 -->
10306
10307 <h5><a name="7.3.7.2" href="#7.3.7.2">7.3.7.2 The clog functions</a></h5>
10308 <h6>Synopsis</h6>
10309 <p><!--para 1 -->
10310 <pre>
10311         #include <a href="#7.3">&lt;complex.h&gt;</a>
10312         double complex clog(double complex z);
10313         float complex clogf(float complex z);
10314         long double complex clogl(long double complex z);
10315 </pre>
10316 <h6>Description</h6>
10317 <p><!--para 2 -->
10318  The clog functions compute the complex natural (base-e) logarithm of z, with a branch
10319  cut along the negative real axis.
10320 <h6>Returns</h6>
10321 <p><!--para 3 -->
10322  The clog functions return the complex natural logarithm value, in the range of a strip
10323  mathematically unbounded along the real axis and in the interval [-ipi , +ipi ] along the
10324  imaginary axis.
10325
10326 <h4><a name="7.3.8" href="#7.3.8">7.3.8 Power and absolute-value functions</a></h4>
10327
10328 <h5><a name="7.3.8.1" href="#7.3.8.1">7.3.8.1 The cabs functions</a></h5>
10329 <h6>Synopsis</h6>
10330 <p><!--para 1 -->
10331 <pre>
10332         #include <a href="#7.3">&lt;complex.h&gt;</a>
10333         double cabs(double complex z);
10334         float cabsf(float complex z);
10335         long double cabsl(long double complex z);
10336 </pre>
10337 <h6>Description</h6>
10338 <p><!--para 2 -->
10339  The cabs functions compute the complex absolute value (also called norm, modulus, or
10340  magnitude) of z.
10341 <h6>Returns</h6>
10342 <p><!--para 3 -->
10343  The cabs functions return the complex absolute value.
10344
10345 <h5><a name="7.3.8.2" href="#7.3.8.2">7.3.8.2 The cpow functions</a></h5>
10346 <h6>Synopsis</h6>
10347 <p><!--para 1 -->
10348 <!--page 213 -->
10349 <pre>
10350         #include <a href="#7.3">&lt;complex.h&gt;</a>
10351         double complex cpow(double complex x, double complex y);
10352         float complex cpowf(float complex x, float complex y);
10353         long double complex cpowl(long double complex x,
10354              long double complex y);
10355 </pre>
10356 <h6>Description</h6>
10357 <p><!--para 2 -->
10358  The cpow functions compute the complex power function xy , with a branch cut for the
10359  first parameter along the negative real axis.
10360 <h6>Returns</h6>
10361 <p><!--para 3 -->
10362  The cpow functions return the complex power function value.
10363
10364 <h5><a name="7.3.8.3" href="#7.3.8.3">7.3.8.3 The csqrt functions</a></h5>
10365 <h6>Synopsis</h6>
10366 <p><!--para 1 -->
10367 <pre>
10368          #include <a href="#7.3">&lt;complex.h&gt;</a>
10369          double complex csqrt(double complex z);
10370          float complex csqrtf(float complex z);
10371          long double complex csqrtl(long double complex z);
10372 </pre>
10373 <h6>Description</h6>
10374 <p><!--para 2 -->
10375  The csqrt functions compute the complex square root of z, with a branch cut along the
10376  negative real axis.
10377 <h6>Returns</h6>
10378 <p><!--para 3 -->
10379  The csqrt functions return the complex square root value, in the range of the right half-
10380  plane (including the imaginary axis).
10381
10382 <h4><a name="7.3.9" href="#7.3.9">7.3.9 Manipulation functions</a></h4>
10383
10384 <h5><a name="7.3.9.1" href="#7.3.9.1">7.3.9.1 The carg functions</a></h5>
10385 <h6>Synopsis</h6>
10386 <p><!--para 1 -->
10387 <pre>
10388          #include <a href="#7.3">&lt;complex.h&gt;</a>
10389          double carg(double complex z);
10390          float cargf(float complex z);
10391          long double cargl(long double complex z);
10392 </pre>
10393 <h6>Description</h6>
10394 <p><!--para 2 -->
10395  The carg functions compute the argument (also called phase angle) of z, with a branch
10396  cut along the negative real axis.
10397 <h6>Returns</h6>
10398 <p><!--para 3 -->
10399  The carg functions return the value of the argument in the interval [-pi , +pi ].
10400 <!--page 214 -->
10401
10402 <h5><a name="7.3.9.2" href="#7.3.9.2">7.3.9.2 The cimag functions</a></h5>
10403 <h6>Synopsis</h6>
10404 <p><!--para 1 -->
10405 <pre>
10406         #include <a href="#7.3">&lt;complex.h&gt;</a>
10407         double cimag(double complex z);
10408         float cimagf(float complex z);
10409         long double cimagl(long double complex z);
10410 </pre>
10411 <h6>Description</h6>
10412 <p><!--para 2 -->
10413  The cimag functions compute the imaginary part of z.<sup><a href="#note196"><b>196)</b></a></sup>
10414 <h6>Returns</h6>
10415 <p><!--para 3 -->
10416  The cimag functions return the imaginary part value (as a real).
10417
10418 <h6>footnotes</h6>
10419 <p><small><a name="note196" href="#note196">196)</a> For a variable z of complex type, z == creal(z) + cimag(z)*I.
10420 </small>
10421
10422 <h5><a name="7.3.9.3" href="#7.3.9.3">7.3.9.3 The CMPLX macros</a></h5>
10423 <h6>Synopsis</h6>
10424 <p><!--para 1 -->
10425 <pre>
10426         #include <a href="#7.3">&lt;complex.h&gt;</a>
10427         double complex CMPLX(double x, double y);
10428         float complex CMPLXF(float x, float y);
10429         long double complex CMPLXL(long double x, long double y);
10430 </pre>
10431 <h6>Description</h6>
10432 <p><!--para 2 -->
10433  The CMPLX macros expand to an expression of the specified complex type, with the real
10434  part having the (converted) value of x and the imaginary part having the (converted)
10435  value of y.
10436 <h6>Recommended practice</h6>
10437 <p><!--para 3 -->
10438  The resulting expression should be suitable for use as an initializer for an object with
10439  static or thread storage duration, provided both arguments are likewise suitable.
10440 <h6>Returns</h6>
10441 <p><!--para 4 -->
10442  The CMPLX macros return the complex value x + i y.
10443 <p><!--para 5 -->
10444  NOTE    These macros act as if the implementation supported imaginary types and the definitions were:
10445 <pre>
10446        #define CMPLX(x, y)  ((double complex)((double)(x) + \
10447                                      _Imaginary_I * (double)(y)))
10448        #define CMPLXF(x, y) ((float complex)((float)(x) + \
10449                                      _Imaginary_I * (float)(y)))
10450        #define CMPLXL(x, y) ((long double complex)((long double)(x) + \
10451                                      _Imaginary_I * (long double)(y)))
10452 </pre>
10453  
10454  
10455  
10456  
10457 <!--page 215 -->
10458
10459 <h5><a name="7.3.9.4" href="#7.3.9.4">7.3.9.4 The conj functions</a></h5>
10460 <h6>Synopsis</h6>
10461 <p><!--para 1 -->
10462 <pre>
10463          #include <a href="#7.3">&lt;complex.h&gt;</a>
10464          double complex conj(double complex z);
10465          float complex conjf(float complex z);
10466          long double complex conjl(long double complex z);
10467 </pre>
10468 <h6>Description</h6>
10469 <p><!--para 2 -->
10470  The conj functions compute the complex conjugate of z, by reversing the sign of its
10471  imaginary part.
10472 <h6>Returns</h6>
10473 <p><!--para 3 -->
10474  The conj functions return the complex conjugate value.
10475
10476 <h5><a name="7.3.9.5" href="#7.3.9.5">7.3.9.5 The cproj functions</a></h5>
10477 <h6>Synopsis</h6>
10478 <p><!--para 1 -->
10479 <pre>
10480          #include <a href="#7.3">&lt;complex.h&gt;</a>
10481          double complex cproj(double complex z);
10482          float complex cprojf(float complex z);
10483          long double complex cprojl(long double complex z);
10484 </pre>
10485 <h6>Description</h6>
10486 <p><!--para 2 -->
10487  The cproj functions compute a projection of z onto the Riemann sphere: z projects to
10488  z except that all complex infinities (even those with one infinite part and one NaN part)
10489  project to positive infinity on the real axis. If z has an infinite part, then cproj(z) is
10490  equivalent to
10491 <pre>
10492          INFINITY + I * copysign(0.0, cimag(z))
10493 </pre>
10494 <h6>Returns</h6>
10495 <p><!--para 3 -->
10496  The cproj functions return the value of the projection onto the Riemann sphere.
10497
10498 <h5><a name="7.3.9.6" href="#7.3.9.6">7.3.9.6 The creal functions</a></h5>
10499 <h6>Synopsis</h6>
10500 <p><!--para 1 -->
10501 <pre>
10502          #include <a href="#7.3">&lt;complex.h&gt;</a>
10503          double creal(double complex z);
10504          float crealf(float complex z);
10505          long double creall(long double complex z);
10506 </pre>
10507 <h6>Description</h6>
10508 <p><!--para 2 -->
10509  The creal functions compute the real part of z.<sup><a href="#note197"><b>197)</b></a></sup>
10510 <!--page 216 -->
10511 <h6>Returns</h6>
10512 <p><!--para 3 -->
10513  The creal functions return the real part value.
10514  
10515  
10516  
10517  
10518 <!--page 217 -->
10519
10520 <h6>footnotes</h6>
10521 <p><small><a name="note197" href="#note197">197)</a> For a variable z of complex type, z == creal(z) + cimag(z)*I.
10522 </small>
10523
10524 <h3><a name="7.4" href="#7.4">7.4 Character handling <ctype.h></a></h3>
10525 <p><!--para 1 -->
10526  The header <a href="#7.4">&lt;ctype.h&gt;</a> declares several functions useful for classifying and mapping
10527  characters.<sup><a href="#note198"><b>198)</b></a></sup> In all cases the argument is an int, the value of which shall be
10528  representable as an unsigned char or shall equal the value of the macro EOF. If the
10529  argument has any other value, the behavior is undefined.
10530 <p><!--para 2 -->
10531  The behavior of these functions is affected by the current locale. Those functions that
10532  have locale-specific aspects only when not in the "C" locale are noted below.
10533 <p><!--para 3 -->
10534  The term printing character refers to a member of a locale-specific set of characters, each
10535  of which occupies one printing position on a display device; the term control character
10536  refers to a member of a locale-specific set of characters that are not printing
10537  characters.<sup><a href="#note199"><b>199)</b></a></sup> All letters and digits are printing characters.
10538 <p><b> Forward references</b>: EOF (<a href="#7.21.1">7.21.1</a>), localization (<a href="#7.11">7.11</a>).
10539
10540 <h6>footnotes</h6>
10541 <p><small><a name="note198" href="#note198">198)</a> See ''future library directions'' (<a href="#7.30.2">7.30.2</a>).
10542 </small>
10543 <p><small><a name="note199" href="#note199">199)</a> In an implementation that uses the seven-bit US ASCII character set, the printing characters are those
10544  whose values lie from 0x20 (space) through 0x7E (tilde); the control characters are those whose
10545  values lie from 0 (NUL) through 0x1F (US), and the character 0x7F (DEL).
10546 </small>
10547
10548 <h4><a name="7.4.1" href="#7.4.1">7.4.1 Character classification functions</a></h4>
10549 <p><!--para 1 -->
10550  The functions in this subclause return nonzero (true) if and only if the value of the
10551  argument c conforms to that in the description of the function.
10552
10553 <h5><a name="7.4.1.1" href="#7.4.1.1">7.4.1.1 The isalnum function</a></h5>
10554 <h6>Synopsis</h6>
10555 <p><!--para 1 -->
10556 <pre>
10557           #include <a href="#7.4">&lt;ctype.h&gt;</a>
10558           int isalnum(int c);
10559 </pre>
10560 <h6>Description</h6>
10561 <p><!--para 2 -->
10562  The isalnum function tests for any character for which isalpha or isdigit is true.
10563
10564 <h5><a name="7.4.1.2" href="#7.4.1.2">7.4.1.2 The isalpha function</a></h5>
10565 <h6>Synopsis</h6>
10566 <p><!--para 1 -->
10567 <pre>
10568           #include <a href="#7.4">&lt;ctype.h&gt;</a>
10569           int isalpha(int c);
10570 </pre>
10571 <h6>Description</h6>
10572 <p><!--para 2 -->
10573  The isalpha function tests for any character for which isupper or islower is true,
10574  or any character that is one of a locale-specific set of alphabetic characters for which
10575  
10576  
10577  
10578 <!--page 218 -->
10579  none of iscntrl, isdigit, ispunct, or isspace is true.<sup><a href="#note200"><b>200)</b></a></sup> In the "C" locale,
10580  isalpha returns true only for the characters for which isupper or islower is true.
10581
10582 <h6>footnotes</h6>
10583 <p><small><a name="note200" href="#note200">200)</a> The functions islower and isupper test true or false separately for each of these additional
10584  characters; all four combinations are possible.
10585 </small>
10586
10587 <h5><a name="7.4.1.3" href="#7.4.1.3">7.4.1.3 The isblank function</a></h5>
10588 <h6>Synopsis</h6>
10589 <p><!--para 1 -->
10590 <pre>
10591          #include <a href="#7.4">&lt;ctype.h&gt;</a>
10592          int isblank(int c);
10593 </pre>
10594 <h6>Description</h6>
10595 <p><!--para 2 -->
10596  The isblank function tests for any character that is a standard blank character or is one
10597  of a locale-specific set of characters for which isspace is true and that is used to
10598  separate words within a line of text. The standard blank characters are the following:
10599  space (' '), and horizontal tab ('\t'). In the "C" locale, isblank returns true only
10600  for the standard blank characters.
10601
10602 <h5><a name="7.4.1.4" href="#7.4.1.4">7.4.1.4 The iscntrl function</a></h5>
10603 <h6>Synopsis</h6>
10604 <p><!--para 1 -->
10605 <pre>
10606          #include <a href="#7.4">&lt;ctype.h&gt;</a>
10607          int iscntrl(int c);
10608 </pre>
10609 <h6>Description</h6>
10610 <p><!--para 2 -->
10611  The iscntrl function tests for any control character.
10612
10613 <h5><a name="7.4.1.5" href="#7.4.1.5">7.4.1.5 The isdigit function</a></h5>
10614 <h6>Synopsis</h6>
10615 <p><!--para 1 -->
10616 <pre>
10617          #include <a href="#7.4">&lt;ctype.h&gt;</a>
10618          int isdigit(int c);
10619 </pre>
10620 <h6>Description</h6>
10621 <p><!--para 2 -->
10622  The isdigit function tests for any decimal-digit character (as defined in <a href="#5.2.1">5.2.1</a>).
10623
10624 <h5><a name="7.4.1.6" href="#7.4.1.6">7.4.1.6 The isgraph function</a></h5>
10625 <h6>Synopsis</h6>
10626 <p><!--para 1 -->
10627 <pre>
10628          #include <a href="#7.4">&lt;ctype.h&gt;</a>
10629          int isgraph(int c);
10630 </pre>
10631  
10632  
10633  
10634  
10635 <!--page 219 -->
10636 <h6>Description</h6>
10637 <p><!--para 2 -->
10638  The isgraph function tests for any printing character except space (' ').
10639
10640 <h5><a name="7.4.1.7" href="#7.4.1.7">7.4.1.7 The islower function</a></h5>
10641 <h6>Synopsis</h6>
10642 <p><!--para 1 -->
10643 <pre>
10644          #include <a href="#7.4">&lt;ctype.h&gt;</a>
10645          int islower(int c);
10646 </pre>
10647 <h6>Description</h6>
10648 <p><!--para 2 -->
10649  The islower function tests for any character that is a lowercase letter or is one of a
10650  locale-specific set of characters for which none of iscntrl, isdigit, ispunct, or
10651  isspace is true. In the "C" locale, islower returns true only for the lowercase
10652  letters (as defined in <a href="#5.2.1">5.2.1</a>).
10653
10654 <h5><a name="7.4.1.8" href="#7.4.1.8">7.4.1.8 The isprint function</a></h5>
10655 <h6>Synopsis</h6>
10656 <p><!--para 1 -->
10657 <pre>
10658          #include <a href="#7.4">&lt;ctype.h&gt;</a>
10659          int isprint(int c);
10660 </pre>
10661 <h6>Description</h6>
10662 <p><!--para 2 -->
10663  The isprint function tests for any printing character including space (' ').
10664
10665 <h5><a name="7.4.1.9" href="#7.4.1.9">7.4.1.9 The ispunct function</a></h5>
10666 <h6>Synopsis</h6>
10667 <p><!--para 1 -->
10668 <pre>
10669          #include <a href="#7.4">&lt;ctype.h&gt;</a>
10670          int ispunct(int c);
10671 </pre>
10672 <h6>Description</h6>
10673 <p><!--para 2 -->
10674  The ispunct function tests for any printing character that is one of a locale-specific set
10675  of punctuation characters for which neither isspace nor isalnum is true. In the "C"
10676  locale, ispunct returns true for every printing character for which neither isspace
10677  nor isalnum is true.
10678
10679 <h5><a name="7.4.1.10" href="#7.4.1.10">7.4.1.10 The isspace function</a></h5>
10680 <h6>Synopsis</h6>
10681 <p><!--para 1 -->
10682 <pre>
10683          #include <a href="#7.4">&lt;ctype.h&gt;</a>
10684          int isspace(int c);
10685 </pre>
10686 <h6>Description</h6>
10687 <p><!--para 2 -->
10688  The isspace function tests for any character that is a standard white-space character or
10689  is one of a locale-specific set of characters for which isalnum is false. The standard
10690 <!--page 220 -->
10691  white-space characters are the following: space (' '), form feed ('\f'), new-line
10692  ('\n'), carriage return ('\r'), horizontal tab ('\t'), and vertical tab ('\v'). In the
10693  "C" locale, isspace returns true only for the standard white-space characters.
10694
10695 <h5><a name="7.4.1.11" href="#7.4.1.11">7.4.1.11 The isupper function</a></h5>
10696 <h6>Synopsis</h6>
10697 <p><!--para 1 -->
10698 <pre>
10699         #include <a href="#7.4">&lt;ctype.h&gt;</a>
10700         int isupper(int c);
10701 </pre>
10702 <h6>Description</h6>
10703 <p><!--para 2 -->
10704  The isupper function tests for any character that is an uppercase letter or is one of a
10705  locale-specific set of characters for which none of iscntrl, isdigit, ispunct, or
10706  isspace is true. In the "C" locale, isupper returns true only for the uppercase
10707  letters (as defined in <a href="#5.2.1">5.2.1</a>).
10708
10709 <h5><a name="7.4.1.12" href="#7.4.1.12">7.4.1.12 The isxdigit function</a></h5>
10710 <h6>Synopsis</h6>
10711 <p><!--para 1 -->
10712 <pre>
10713         #include <a href="#7.4">&lt;ctype.h&gt;</a>
10714         int isxdigit(int c);
10715 </pre>
10716 <h6>Description</h6>
10717 <p><!--para 2 -->
10718  The isxdigit function tests for any hexadecimal-digit character (as defined in <a href="#6.4.4.1">6.4.4.1</a>).
10719
10720 <h4><a name="7.4.2" href="#7.4.2">7.4.2 Character case mapping functions</a></h4>
10721
10722 <h5><a name="7.4.2.1" href="#7.4.2.1">7.4.2.1 The tolower function</a></h5>
10723 <h6>Synopsis</h6>
10724 <p><!--para 1 -->
10725 <pre>
10726         #include <a href="#7.4">&lt;ctype.h&gt;</a>
10727         int tolower(int c);
10728 </pre>
10729 <h6>Description</h6>
10730 <p><!--para 2 -->
10731  The tolower function converts an uppercase letter to a corresponding lowercase letter.
10732 <h6>Returns</h6>
10733 <p><!--para 3 -->
10734  If the argument is a character for which isupper is true and there are one or more
10735  corresponding characters, as specified by the current locale, for which islower is true,
10736  the tolower function returns one of the corresponding characters (always the same one
10737  for any given locale); otherwise, the argument is returned unchanged.
10738 <!--page 221 -->
10739
10740 <h5><a name="7.4.2.2" href="#7.4.2.2">7.4.2.2 The toupper function</a></h5>
10741 <h6>Synopsis</h6>
10742 <p><!--para 1 -->
10743 <pre>
10744          #include <a href="#7.4">&lt;ctype.h&gt;</a>
10745          int toupper(int c);
10746 </pre>
10747 <h6>Description</h6>
10748 <p><!--para 2 -->
10749  The toupper function converts a lowercase letter to a corresponding uppercase letter.
10750 <h6>Returns</h6>
10751 <p><!--para 3 -->
10752  If the argument is a character for which islower is true and there are one or more
10753  corresponding characters, as specified by the current locale, for which isupper is true,
10754  the toupper function returns one of the corresponding characters (always the same one
10755  for any given locale); otherwise, the argument is returned unchanged.
10756 <!--page 222 -->
10757
10758 <h3><a name="7.5" href="#7.5">7.5 Errors <errno.h></a></h3>
10759 <p><!--para 1 -->
10760  The header <a href="#7.5">&lt;errno.h&gt;</a> defines several macros, all relating to the reporting of error
10761  conditions.
10762 <p><!--para 2 -->
10763  The macros are
10764 <pre>
10765           EDOM
10766           EILSEQ
10767           ERANGE
10768 </pre>
10769  which expand to integer constant expressions with type int, distinct positive values, and
10770  which are suitable for use in #if preprocessing directives; and
10771 <pre>
10772           errno
10773 </pre>
10774  which expands to a modifiable lvalue<sup><a href="#note201"><b>201)</b></a></sup> that has type int and thread local storage
10775  duration, the value of which is set to a positive error number by several library functions.
10776  If a macro definition is suppressed in order to access an actual object, or a program
10777  defines an identifier with the name errno, the behavior is undefined.
10778 <p><!--para 3 -->
10779  The value of errno in the initial thread is zero at program startup (the initial value of
10780  errno in other threads is an indeterminate value), but is never set to zero by any library
10781  function.<sup><a href="#note202"><b>202)</b></a></sup> The value of errno may be set to nonzero by a library function call
10782  whether or not there is an error, provided the use of errno is not documented in the
10783  description of the function in this International Standard.
10784 <p><!--para 4 -->
10785  Additional macro definitions, beginning with E and a digit or E and an uppercase
10786  letter,<sup><a href="#note203"><b>203)</b></a></sup> may also be specified by the implementation.
10787  
10788  
10789  
10790  
10791 <!--page 223 -->
10792
10793 <h6>footnotes</h6>
10794 <p><small><a name="note201" href="#note201">201)</a> The macro errno need not be the identifier of an object. It might expand to a modifiable lvalue
10795  resulting from a function call (for example, *errno()).
10796 </small>
10797 <p><small><a name="note202" href="#note202">202)</a> Thus, a program that uses errno for error checking should set it to zero before a library function call,
10798  then inspect it before a subsequent library function call. Of course, a library function can save the
10799  value of errno on entry and then set it to zero, as long as the original value is restored if errno's
10800  value is still zero just before the return.
10801 </small>
10802 <p><small><a name="note203" href="#note203">203)</a> See ''future library directions'' (<a href="#7.30.3">7.30.3</a>).
10803 </small>
10804
10805 <h3><a name="7.6" href="#7.6">7.6 Floating-point environment <fenv.h></a></h3>
10806 <p><!--para 1 -->
10807  The header <a href="#7.6">&lt;fenv.h&gt;</a> defines several macros, and declares types and functions that
10808  provide access to the floating-point environment. The floating-point environment refers
10809  collectively to any floating-point status flags and control modes supported by the
10810  implementation.<sup><a href="#note204"><b>204)</b></a></sup> A floating-point status flag is a system variable whose value is set
10811  (but never cleared) when a floating-point exception is raised, which occurs as a side effect
10812  of exceptional floating-point arithmetic to provide auxiliary information.<sup><a href="#note205"><b>205)</b></a></sup> A floating-
10813  point control mode is a system variable whose value may be set by the user to affect the
10814  subsequent behavior of floating-point arithmetic.
10815 <p><!--para 2 -->
10816  The floating-point environment has thread storage duration. The initial state for a
10817  thread's floating-point environment is the current state of the floating-point environment
10818  of the thread that creates it at the time of creation.
10819 <p><!--para 3 -->
10820  Certain programming conventions support the intended model of use for the floating-
10821  point environment:<sup><a href="#note206"><b>206)</b></a></sup>
10822 <ul>
10823 <li>  a function call does not alter its caller's floating-point control modes, clear its caller's
10824  floating-point status flags, nor depend on the state of its caller's floating-point status
10825  flags unless the function is so documented;
10826 <li>  a function call is assumed to require default floating-point control modes, unless its
10827  documentation promises otherwise;
10828 <li>  a function call is assumed to have the potential for raising floating-point exceptions,
10829  unless its documentation promises otherwise.
10830 </ul>
10831 <p><!--para 4 -->
10832  The type
10833 <pre>
10834          fenv_t
10835 </pre>
10836  represents the entire floating-point environment.
10837 <p><!--para 5 -->
10838  The type
10839 <pre>
10840          fexcept_t
10841 </pre>
10842  represents the floating-point status flags collectively, including any status the
10843  implementation associates with the flags.
10844  
10845  
10846 <!--page 224 -->
10847 <p><!--para 6 -->
10848  Each of the macros
10849 <pre>
10850           FE_DIVBYZERO
10851           FE_INEXACT
10852           FE_INVALID
10853           FE_OVERFLOW
10854           FE_UNDERFLOW
10855 </pre>
10856  is defined if and only if the implementation supports the floating-point exception by
10857  means of the functions in 7.6.2.<sup><a href="#note207"><b>207)</b></a></sup> Additional implementation-defined floating-point
10858  exceptions, with macro definitions beginning with FE_ and an uppercase letter, may also
10859  be specified by the implementation. The defined macros expand to integer constant
10860  expressions with values such that bitwise ORs of all combinations of the macros result in
10861  distinct values, and furthermore, bitwise ANDs of all combinations of the macros result in
10862  zero.<sup><a href="#note208"><b>208)</b></a></sup>
10863 <p><!--para 7 -->
10864  The macro
10865 <pre>
10866           FE_ALL_EXCEPT
10867 </pre>
10868  is simply the bitwise OR of all floating-point exception macros defined by the
10869  implementation. If no such macros are defined, FE_ALL_EXCEPT shall be defined as 0.
10870 <p><!--para 8 -->
10871  Each of the macros
10872 <pre>
10873           FE_DOWNWARD
10874           FE_TONEAREST
10875           FE_TOWARDZERO
10876           FE_UPWARD
10877 </pre>
10878  is defined if and only if the implementation supports getting and setting the represented
10879  rounding direction by means of the fegetround and fesetround functions.
10880  Additional implementation-defined rounding directions, with macro definitions beginning
10881  with FE_ and an uppercase letter, may also be specified by the implementation. The
10882  defined macros expand to integer constant expressions whose values are distinct
10883  nonnegative values.<sup><a href="#note209"><b>209)</b></a></sup>
10884 <p><!--para 9 -->
10885  The macro
10886  
10887  
10888  
10889 <!--page 225 -->
10890 <pre>
10891           FE_DFL_ENV
10892 </pre>
10893  represents the default floating-point environment -- the one installed at program startup
10894 <ul>
10895 <li>  and has type ''pointer to const-qualified fenv_t''. It can be used as an argument to
10896 </ul>
10897  <a href="#7.6">&lt;fenv.h&gt;</a> functions that manage the floating-point environment.
10898 <p><!--para 10 -->
10899  Additional implementation-defined environments, with macro definitions beginning with
10900  FE_ and an uppercase letter, and having type ''pointer to const-qualified fenv_t'', may
10901  also be specified by the implementation.
10902
10903 <h6>footnotes</h6>
10904 <p><small><a name="note204" href="#note204">204)</a> This header is designed to support the floating-point exception status flags and directed-rounding
10905  control modes required by IEC 60559, and other similar floating-point state information. It is also
10906  designed to facilitate code portability among all systems.
10907 </small>
10908 <p><small><a name="note205" href="#note205">205)</a> A floating-point status flag is not an object and can be set more than once within an expression.
10909 </small>
10910 <p><small><a name="note206" href="#note206">206)</a> With these conventions, a programmer can safely assume default floating-point control modes (or be
10911  unaware of them). The responsibilities associated with accessing the floating-point environment fall
10912  on the programmer or program that does so explicitly.
10913 </small>
10914 <p><small><a name="note207" href="#note207">207)</a> The implementation supports a floating-point exception if there are circumstances where a call to at
10915  least one of the functions in <a href="#7.6.2">7.6.2</a>, using the macro as the appropriate argument, will succeed. It is not
10916  necessary for all the functions to succeed all the time.
10917 </small>
10918 <p><small><a name="note208" href="#note208">208)</a> The macros should be distinct powers of two.
10919 </small>
10920 <p><small><a name="note209" href="#note209">209)</a> Even though the rounding direction macros may expand to constants corresponding to the values of
10921  FLT_ROUNDS, they are not required to do so.
10922 </small>
10923
10924 <h4><a name="7.6.1" href="#7.6.1">7.6.1 The FENV_ACCESS pragma</a></h4>
10925 <h6>Synopsis</h6>
10926 <p><!--para 1 -->
10927 <pre>
10928           #include <a href="#7.6">&lt;fenv.h&gt;</a>
10929           #pragma STDC FENV_ACCESS on-off-switch
10930 </pre>
10931 <h6>Description</h6>
10932 <p><!--para 2 -->
10933  The FENV_ACCESS pragma provides a means to inform the implementation when a
10934  program might access the floating-point environment to test floating-point status flags or
10935  run under non-default floating-point control modes.<sup><a href="#note210"><b>210)</b></a></sup> The pragma shall occur either
10936  outside external declarations or preceding all explicit declarations and statements inside a
10937  compound statement. When outside external declarations, the pragma takes effect from
10938  its occurrence until another FENV_ACCESS pragma is encountered, or until the end of
10939  the translation unit. When inside a compound statement, the pragma takes effect from its
10940  occurrence until another FENV_ACCESS pragma is encountered (including within a
10941  nested compound statement), or until the end of the compound statement; at the end of a
10942  compound statement the state for the pragma is restored to its condition just before the
10943  compound statement. If this pragma is used in any other context, the behavior is
10944  undefined. If part of a program tests floating-point status flags, sets floating-point control
10945  modes, or runs under non-default mode settings, but was translated with the state for the
10946  FENV_ACCESS pragma ''off'', the behavior is undefined. The default state (''on'' or
10947  ''off'') for the pragma is implementation-defined. (When execution passes from a part of
10948  the program translated with FENV_ACCESS ''off'' to a part translated with
10949  FENV_ACCESS ''on'', the state of the floating-point status flags is unspecified and the
10950  floating-point control modes have their default settings.)
10951  
10952  
10953  
10954  
10955 <!--page 226 -->
10956 <p><!--para 3 -->
10957  EXAMPLE
10958 <pre>
10959          #include <a href="#7.6">&lt;fenv.h&gt;</a>
10960          void f(double x)
10961          {
10962                #pragma STDC FENV_ACCESS ON
10963                void g(double);
10964                void h(double);
10965                /* ... */
10966                g(x + 1);
10967                h(x + 1);
10968                /* ... */
10969          }
10970 </pre>
10971 <p><!--para 4 -->
10972  If the function g might depend on status flags set as a side effect of the first x + 1, or if the second
10973  x + 1 might depend on control modes set as a side effect of the call to function g, then the program shall
10974  contain an appropriately placed invocation of #pragma STDC FENV_ACCESS ON.<sup><a href="#note211"><b>211)</b></a></sup>
10975  
10976
10977 <h6>footnotes</h6>
10978 <p><small><a name="note210" href="#note210">210)</a> The purpose of the FENV_ACCESS pragma is to allow certain optimizations that could subvert flag
10979  tests and mode changes (e.g., global common subexpression elimination, code motion, and constant
10980  folding). In general, if the state of FENV_ACCESS is ''off'', the translator can assume that default
10981  modes are in effect and the flags are not tested.
10982 </small>
10983 <p><small><a name="note211" href="#note211">211)</a> The side effects impose a temporal ordering that requires two evaluations of x + 1. On the other
10984  hand, without the #pragma STDC FENV_ACCESS ON pragma, and assuming the default state is
10985  ''off'', just one evaluation of x + 1 would suffice.
10986 </small>
10987
10988 <h4><a name="7.6.2" href="#7.6.2">7.6.2 Floating-point exceptions</a></h4>
10989 <p><!--para 1 -->
10990  The following functions provide access to the floating-point status flags.<sup><a href="#note212"><b>212)</b></a></sup> The int
10991  input argument for the functions represents a subset of floating-point exceptions, and can
10992  be zero or the bitwise OR of one or more floating-point exception macros, for example
10993  FE_OVERFLOW | FE_INEXACT. For other argument values the behavior of these
10994  functions is undefined.
10995
10996 <h6>footnotes</h6>
10997 <p><small><a name="note212" href="#note212">212)</a> The functions fetestexcept, feraiseexcept, and feclearexcept support the basic
10998  abstraction of flags that are either set or clear. An implementation may endow floating-point status
10999  flags with more information -- for example, the address of the code which first raised the floating-
11000  point exception; the functions fegetexceptflag and fesetexceptflag deal with the full
11001  content of flags.
11002 </small>
11003
11004 <h5><a name="7.6.2.1" href="#7.6.2.1">7.6.2.1 The feclearexcept function</a></h5>
11005 <h6>Synopsis</h6>
11006 <p><!--para 1 -->
11007 <pre>
11008          #include <a href="#7.6">&lt;fenv.h&gt;</a>
11009          int feclearexcept(int excepts);
11010 </pre>
11011 <h6>Description</h6>
11012 <p><!--para 2 -->
11013  The feclearexcept function attempts to clear the supported floating-point exceptions
11014  represented by its argument.
11015 <h6>Returns</h6>
11016 <p><!--para 3 -->
11017  The feclearexcept function returns zero if the excepts argument is zero or if all
11018  the specified exceptions were successfully cleared. Otherwise, it returns a nonzero value.
11019  
11020  
11021 <!--page 227 -->
11022
11023 <h5><a name="7.6.2.2" href="#7.6.2.2">7.6.2.2 The fegetexceptflag function</a></h5>
11024 <h6>Synopsis</h6>
11025 <p><!--para 1 -->
11026 <pre>
11027           #include <a href="#7.6">&lt;fenv.h&gt;</a>
11028           int fegetexceptflag(fexcept_t *flagp,
11029                int excepts);
11030 </pre>
11031 <h6>Description</h6>
11032 <p><!--para 2 -->
11033  The fegetexceptflag function attempts to store an implementation-defined
11034  representation of the states of the floating-point status flags indicated by the argument
11035  excepts in the object pointed to by the argument flagp.
11036 <h6>Returns</h6>
11037 <p><!--para 3 -->
11038  The fegetexceptflag function returns zero if the representation was successfully
11039  stored. Otherwise, it returns a nonzero value.
11040
11041 <h5><a name="7.6.2.3" href="#7.6.2.3">7.6.2.3 The feraiseexcept function</a></h5>
11042 <h6>Synopsis</h6>
11043 <p><!--para 1 -->
11044 <pre>
11045           #include <a href="#7.6">&lt;fenv.h&gt;</a>
11046           int feraiseexcept(int excepts);
11047 </pre>
11048 <h6>Description</h6>
11049 <p><!--para 2 -->
11050  The feraiseexcept function attempts to raise the supported floating-point exceptions
11051  represented by its argument.<sup><a href="#note213"><b>213)</b></a></sup> The order in which these floating-point exceptions are
11052  raised is unspecified, except as stated in <a href="#F.8.6">F.8.6</a>. Whether the feraiseexcept function
11053  additionally raises the ''inexact'' floating-point exception whenever it raises the
11054  ''overflow'' or ''underflow'' floating-point exception is implementation-defined.
11055 <h6>Returns</h6>
11056 <p><!--para 3 -->
11057  The feraiseexcept function returns zero if the excepts argument is zero or if all
11058  the specified exceptions were successfully raised. Otherwise, it returns a nonzero value.
11059  
11060  
11061  
11062  
11063 <!--page 228 -->
11064
11065 <h6>footnotes</h6>
11066 <p><small><a name="note213" href="#note213">213)</a> The effect is intended to be similar to that of floating-point exceptions raised by arithmetic operations.
11067  Hence, enabled traps for floating-point exceptions raised by this function are taken. The specification
11068  in <a href="#F.8.6">F.8.6</a> is in the same spirit.
11069 </small>
11070
11071 <h5><a name="7.6.2.4" href="#7.6.2.4">7.6.2.4 The fesetexceptflag function</a></h5>
11072 <h6>Synopsis</h6>
11073 <p><!--para 1 -->
11074 <pre>
11075          #include <a href="#7.6">&lt;fenv.h&gt;</a>
11076          int fesetexceptflag(const fexcept_t *flagp,
11077               int excepts);
11078 </pre>
11079 <h6>Description</h6>
11080 <p><!--para 2 -->
11081  The fesetexceptflag function attempts to set the floating-point status flags
11082  indicated by the argument excepts to the states stored in the object pointed to by
11083  flagp. The value of *flagp shall have been set by a previous call to
11084  fegetexceptflag whose second argument represented at least those floating-point
11085  exceptions represented by the argument excepts. This function does not raise floating-
11086  point exceptions, but only sets the state of the flags.
11087 <h6>Returns</h6>
11088 <p><!--para 3 -->
11089  The fesetexceptflag function returns zero if the excepts argument is zero or if
11090  all the specified flags were successfully set to the appropriate state. Otherwise, it returns
11091  a nonzero value.
11092
11093 <h5><a name="7.6.2.5" href="#7.6.2.5">7.6.2.5 The fetestexcept function</a></h5>
11094 <h6>Synopsis</h6>
11095 <p><!--para 1 -->
11096 <pre>
11097          #include <a href="#7.6">&lt;fenv.h&gt;</a>
11098          int fetestexcept(int excepts);
11099 </pre>
11100 <h6>Description</h6>
11101 <p><!--para 2 -->
11102  The fetestexcept function determines which of a specified subset of the floating-
11103  point exception flags are currently set. The excepts argument specifies the floating-
11104  point status flags to be queried.<sup><a href="#note214"><b>214)</b></a></sup>
11105 <h6>Returns</h6>
11106 <p><!--para 3 -->
11107  The fetestexcept function returns the value of the bitwise OR of the floating-point
11108  exception macros corresponding to the currently set floating-point exceptions included in
11109  excepts.
11110 <p><!--para 4 -->
11111  EXAMPLE       Call f if ''invalid'' is set, then g if ''overflow'' is set:
11112  
11113  
11114  
11115  
11116 <!--page 229 -->
11117 <pre>
11118          #include <a href="#7.6">&lt;fenv.h&gt;</a>
11119          /* ... */
11120          {
11121                  #pragma STDC FENV_ACCESS ON
11122                  int set_excepts;
11123                  feclearexcept(FE_INVALID | FE_OVERFLOW);
11124                  // maybe raise exceptions
11125                  set_excepts = fetestexcept(FE_INVALID | FE_OVERFLOW);
11126                  if (set_excepts &amp; FE_INVALID) f();
11127                  if (set_excepts &amp; FE_OVERFLOW) g();
11128                  /* ... */
11129          }
11130 </pre>
11131  
11132
11133 <h6>footnotes</h6>
11134 <p><small><a name="note214" href="#note214">214)</a> This mechanism allows testing several floating-point exceptions with just one function call.
11135 </small>
11136
11137 <h4><a name="7.6.3" href="#7.6.3">7.6.3 Rounding</a></h4>
11138 <p><!--para 1 -->
11139  The fegetround and fesetround functions provide control of rounding direction
11140  modes.
11141
11142 <h5><a name="7.6.3.1" href="#7.6.3.1">7.6.3.1 The fegetround function</a></h5>
11143 <h6>Synopsis</h6>
11144 <p><!--para 1 -->
11145 <pre>
11146          #include <a href="#7.6">&lt;fenv.h&gt;</a>
11147          int fegetround(void);
11148 </pre>
11149 <h6>Description</h6>
11150 <p><!--para 2 -->
11151  The fegetround function gets the current rounding direction.
11152 <h6>Returns</h6>
11153 <p><!--para 3 -->
11154  The fegetround function returns the value of the rounding direction macro
11155  representing the current rounding direction or a negative value if there is no such
11156  rounding direction macro or the current rounding direction is not determinable.
11157
11158 <h5><a name="7.6.3.2" href="#7.6.3.2">7.6.3.2 The fesetround function</a></h5>
11159 <h6>Synopsis</h6>
11160 <p><!--para 1 -->
11161 <pre>
11162          #include <a href="#7.6">&lt;fenv.h&gt;</a>
11163          int fesetround(int round);
11164 </pre>
11165 <h6>Description</h6>
11166 <p><!--para 2 -->
11167  The fesetround function establishes the rounding direction represented by its
11168  argument round. If the argument is not equal to the value of a rounding direction macro,
11169  the rounding direction is not changed.
11170 <h6>Returns</h6>
11171 <p><!--para 3 -->
11172  The fesetround function returns zero if and only if the requested rounding direction
11173  was established.
11174 <!--page 230 -->
11175 <p><!--para 4 -->
11176  EXAMPLE Save, set, and restore the rounding direction. Report an error and abort if setting the
11177  rounding direction fails.
11178 <pre>
11179         #include <a href="#7.6">&lt;fenv.h&gt;</a>
11180         #include <a href="#7.2">&lt;assert.h&gt;</a>
11181         void f(int round_dir)
11182         {
11183               #pragma STDC FENV_ACCESS ON
11184               int save_round;
11185               int setround_ok;
11186               save_round = fegetround();
11187               setround_ok = fesetround(round_dir);
11188               assert(setround_ok == 0);
11189               /* ... */
11190               fesetround(save_round);
11191               /* ... */
11192         }
11193 </pre>
11194  
11195
11196 <h4><a name="7.6.4" href="#7.6.4">7.6.4 Environment</a></h4>
11197 <p><!--para 1 -->
11198  The functions in this section manage the floating-point environment -- status flags and
11199  control modes -- as one entity.
11200
11201 <h5><a name="7.6.4.1" href="#7.6.4.1">7.6.4.1 The fegetenv function</a></h5>
11202 <h6>Synopsis</h6>
11203 <p><!--para 1 -->
11204 <pre>
11205         #include <a href="#7.6">&lt;fenv.h&gt;</a>
11206         int fegetenv(fenv_t *envp);
11207 </pre>
11208 <h6>Description</h6>
11209 <p><!--para 2 -->
11210  The fegetenv function attempts to store the current floating-point environment in the
11211  object pointed to by envp.
11212 <h6>Returns</h6>
11213 <p><!--para 3 -->
11214  The fegetenv function returns zero if the environment was successfully stored.
11215  Otherwise, it returns a nonzero value.
11216
11217 <h5><a name="7.6.4.2" href="#7.6.4.2">7.6.4.2 The feholdexcept function</a></h5>
11218 <h6>Synopsis</h6>
11219 <p><!--para 1 -->
11220 <pre>
11221         #include <a href="#7.6">&lt;fenv.h&gt;</a>
11222         int feholdexcept(fenv_t *envp);
11223 </pre>
11224 <h6>Description</h6>
11225 <p><!--para 2 -->
11226  The feholdexcept function saves the current floating-point environment in the object
11227  pointed to by envp, clears the floating-point status flags, and then installs a non-stop
11228  (continue on floating-point exceptions) mode, if available, for all floating-point
11229  exceptions.<sup><a href="#note215"><b>215)</b></a></sup>
11230 <!--page 231 -->
11231 <h6>Returns</h6>
11232 <p><!--para 3 -->
11233  The feholdexcept function returns zero if and only if non-stop floating-point
11234  exception handling was successfully installed.
11235
11236 <h6>footnotes</h6>
11237 <p><small><a name="note215" href="#note215">215)</a> IEC 60559 systems have a default non-stop mode, and typically at least one other mode for trap
11238  handling or aborting; if the system provides only the non-stop mode then installing it is trivial. For
11239  such systems, the feholdexcept function can be used in conjunction with the feupdateenv
11240  function to write routines that hide spurious floating-point exceptions from their callers.
11241 </small>
11242
11243 <h5><a name="7.6.4.3" href="#7.6.4.3">7.6.4.3 The fesetenv function</a></h5>
11244 <h6>Synopsis</h6>
11245 <p><!--para 1 -->
11246 <pre>
11247          #include <a href="#7.6">&lt;fenv.h&gt;</a>
11248          int fesetenv(const fenv_t *envp);
11249 </pre>
11250 <h6>Description</h6>
11251 <p><!--para 2 -->
11252  The fesetenv function attempts to establish the floating-point environment represented
11253  by the object pointed to by envp. The argument envp shall point to an object set by a
11254  call to fegetenv or feholdexcept, or equal a floating-point environment macro.
11255  Note that fesetenv merely installs the state of the floating-point status flags
11256  represented through its argument, and does not raise these floating-point exceptions.
11257 <h6>Returns</h6>
11258 <p><!--para 3 -->
11259  The fesetenv function returns zero if the environment was successfully established.
11260  Otherwise, it returns a nonzero value.
11261
11262 <h5><a name="7.6.4.4" href="#7.6.4.4">7.6.4.4 The feupdateenv function</a></h5>
11263 <h6>Synopsis</h6>
11264 <p><!--para 1 -->
11265 <pre>
11266          #include <a href="#7.6">&lt;fenv.h&gt;</a>
11267          int feupdateenv(const fenv_t *envp);
11268 </pre>
11269 <h6>Description</h6>
11270 <p><!--para 2 -->
11271  The feupdateenv function attempts to save the currently raised floating-point
11272  exceptions in its automatic storage, install the floating-point environment represented by
11273  the object pointed to by envp, and then raise the saved floating-point exceptions. The
11274  argument envp shall point to an object set by a call to feholdexcept or fegetenv,
11275  or equal a floating-point environment macro.
11276 <h6>Returns</h6>
11277 <p><!--para 3 -->
11278  The feupdateenv function returns zero if all the actions were successfully carried out.
11279  Otherwise, it returns a nonzero value.
11280  
11281  
11282  
11283  
11284 <!--page 232 -->
11285 <p><!--para 4 -->
11286  EXAMPLE   Hide spurious underflow floating-point exceptions:
11287 <!--page 233 -->
11288 <pre>
11289        #include <a href="#7.6">&lt;fenv.h&gt;</a>
11290        double f(double x)
11291        {
11292              #pragma STDC FENV_ACCESS ON
11293              double result;
11294              fenv_t save_env;
11295              if (feholdexcept(&amp;save_env))
11296                    return /* indication of an environmental problem */;
11297              // compute result
11298              if (/* test spurious underflow */)
11299                    if (feclearexcept(FE_UNDERFLOW))
11300                             return /* indication of an environmental problem */;
11301              if (feupdateenv(&amp;save_env))
11302                    return /* indication of an environmental problem */;
11303              return result;
11304        }
11305 </pre>
11306
11307 <h3><a name="7.7" href="#7.7">7.7 Characteristics of floating types <float.h></a></h3>
11308 <p><!--para 1 -->
11309  The header <a href="#7.7">&lt;float.h&gt;</a> defines several macros that expand to various limits and
11310  parameters of the standard floating-point types.
11311 <p><!--para 2 -->
11312  The macros, their meanings, and the constraints (or restrictions) on their values are listed
11313  in <a href="#5.2.4.2.2">5.2.4.2.2</a>.
11314 <!--page 234 -->
11315
11316 <h3><a name="7.8" href="#7.8">7.8 Format conversion of integer types <inttypes.h></a></h3>
11317 <p><!--para 1 -->
11318  The header <a href="#7.8">&lt;inttypes.h&gt;</a> includes the header <a href="#7.20">&lt;stdint.h&gt;</a> and extends it with
11319  additional facilities provided by hosted implementations.
11320 <p><!--para 2 -->
11321  It declares functions for manipulating greatest-width integers and converting numeric
11322  character strings to greatest-width integers, and it declares the type
11323 <pre>
11324           imaxdiv_t
11325 </pre>
11326  which is a structure type that is the type of the value returned by the imaxdiv function.
11327  For each type declared in <a href="#7.20">&lt;stdint.h&gt;</a>, it defines corresponding macros for conversion
11328  specifiers for use with the formatted input/output functions.<sup><a href="#note216"><b>216)</b></a></sup>
11329 <p><b> Forward references</b>: integer types <a href="#7.20">&lt;stdint.h&gt;</a> (<a href="#7.20">7.20</a>), formatted input/output
11330  functions (<a href="#7.21.6">7.21.6</a>), formatted wide character input/output functions (<a href="#7.28.2">7.28.2</a>).
11331
11332 <h6>footnotes</h6>
11333 <p><small><a name="note216" href="#note216">216)</a> See ''future library directions'' (<a href="#7.30.4">7.30.4</a>).
11334 </small>
11335
11336 <h4><a name="7.8.1" href="#7.8.1">7.8.1 Macros for format specifiers</a></h4>
11337 <p><!--para 1 -->
11338  Each of the following object-like macros expands to a character string literal containing a *
11339  conversion specifier, possibly modified by a length modifier, suitable for use within the
11340  format argument of a formatted input/output function when converting the corresponding
11341  integer type. These macro names have the general form of PRI (character string literals
11342  for the fprintf and fwprintf family) or SCN (character string literals for the
11343  fscanf and fwscanf family),<sup><a href="#note217"><b>217)</b></a></sup> followed by the conversion specifier, followed by a
11344  name corresponding to a similar type name in <a href="#7.20.1">7.20.1</a>. In these names, N represents the
11345  width of the type as described in <a href="#7.20.1">7.20.1</a>. For example, PRIdFAST32 can be used in a
11346  format string to print the value of an integer of type int_fast32_t.
11347 <p><!--para 2 -->
11348  The fprintf macros for signed integers are:
11349 <pre>
11350         PRIdN             PRIdLEASTN                PRIdFASTN          PRIdMAX             PRIdPTR
11351         PRIiN             PRIiLEASTN                PRIiFASTN          PRIiMAX             PRIiPTR
11352 </pre>
11353 <p><!--para 3 -->
11354  The fprintf macros for unsigned integers are:
11355 <pre>
11356         PRIoN             PRIoLEASTN                PRIoFASTN          PRIoMAX             PRIoPTR
11357         PRIuN             PRIuLEASTN                PRIuFASTN          PRIuMAX             PRIuPTR
11358         PRIxN             PRIxLEASTN                PRIxFASTN          PRIxMAX             PRIxPTR
11359         PRIXN             PRIXLEASTN                PRIXFASTN          PRIXMAX             PRIXPTR
11360 </pre>
11361 <p><!--para 4 -->
11362  The fscanf macros for signed integers are:
11363  
11364  
11365  
11366 <!--page 235 -->
11367 <pre>
11368         SCNdN           SCNdLEASTN               SCNdFASTN              SCNdMAX             SCNdPTR
11369         SCNiN           SCNiLEASTN               SCNiFASTN              SCNiMAX             SCNiPTR
11370 </pre>
11371 <p><!--para 5 -->
11372  The fscanf macros for unsigned integers are:
11373 <pre>
11374         SCNoN           SCNoLEASTN               SCNoFASTN              SCNoMAX             SCNoPTR
11375         SCNuN           SCNuLEASTN               SCNuFASTN              SCNuMAX             SCNuPTR
11376         SCNxN           SCNxLEASTN               SCNxFASTN              SCNxMAX             SCNxPTR
11377 </pre>
11378 <p><!--para 6 -->
11379  For each type that the implementation provides in <a href="#7.20">&lt;stdint.h&gt;</a>, the corresponding
11380  fprintf macros shall be defined and the corresponding fscanf macros shall be
11381  defined unless the implementation does not have a suitable fscanf length modifier for
11382  the type.
11383 <p><!--para 7 -->
11384  EXAMPLE
11385 <pre>
11386          #include <a href="#7.8">&lt;inttypes.h&gt;</a>
11387          #include <a href="#7.28">&lt;wchar.h&gt;</a>
11388          int main(void)
11389          {
11390                uintmax_t i = UINTMAX_MAX;    // this type always exists
11391                wprintf(L"The largest integer value is %020"
11392                      PRIxMAX "\n", i);
11393                return 0;
11394          }
11395 </pre>
11396  
11397
11398 <h6>footnotes</h6>
11399 <p><small><a name="note217" href="#note217">217)</a> Separate macros are given for use with fprintf and fscanf functions because, in the general case,
11400  different format specifiers may be required for fprintf and fscanf, even when the type is the
11401  same.
11402 </small>
11403
11404 <h4><a name="7.8.2" href="#7.8.2">7.8.2 Functions for greatest-width integer types</a></h4>
11405
11406 <h5><a name="7.8.2.1" href="#7.8.2.1">7.8.2.1 The imaxabs function</a></h5>
11407 <h6>Synopsis</h6>
11408 <p><!--para 1 -->
11409 <pre>
11410          #include <a href="#7.8">&lt;inttypes.h&gt;</a>
11411          intmax_t imaxabs(intmax_t j);
11412 </pre>
11413 <h6>Description</h6>
11414 <p><!--para 2 -->
11415  The imaxabs function computes the absolute value of an integer j. If the result cannot
11416  be represented, the behavior is undefined.<sup><a href="#note218"><b>218)</b></a></sup>
11417 <h6>Returns</h6>
11418 <p><!--para 3 -->
11419  The imaxabs function returns the absolute value.
11420  
11421  
11422  
11423  
11424 <!--page 236 -->
11425
11426 <h6>footnotes</h6>
11427 <p><small><a name="note218" href="#note218">218)</a> The absolute value of the most negative number cannot be represented in two's complement.
11428 </small>
11429
11430 <h5><a name="7.8.2.2" href="#7.8.2.2">7.8.2.2 The imaxdiv function</a></h5>
11431 <h6>Synopsis</h6>
11432 <p><!--para 1 -->
11433 <pre>
11434         #include <a href="#7.8">&lt;inttypes.h&gt;</a>
11435         imaxdiv_t imaxdiv(intmax_t numer, intmax_t denom);
11436 </pre>
11437 <h6>Description</h6>
11438 <p><!--para 2 -->
11439  The imaxdiv function computes numer / denom and numer % denom in a single
11440  operation.
11441 <h6>Returns</h6>
11442 <p><!--para 3 -->
11443  The imaxdiv function returns a structure of type imaxdiv_t comprising both the
11444  quotient and the remainder. The structure shall contain (in either order) the members
11445  quot (the quotient) and rem (the remainder), each of which has type intmax_t. If
11446  either part of the result cannot be represented, the behavior is undefined.
11447
11448 <h5><a name="7.8.2.3" href="#7.8.2.3">7.8.2.3 The strtoimax and strtoumax functions</a></h5>
11449 <h6>Synopsis</h6>
11450 <p><!--para 1 -->
11451 <pre>
11452         #include <a href="#7.8">&lt;inttypes.h&gt;</a>
11453         intmax_t strtoimax(const char * restrict nptr,
11454              char ** restrict endptr, int base);
11455         uintmax_t strtoumax(const char * restrict nptr,
11456              char ** restrict endptr, int base);
11457 </pre>
11458 <h6>Description</h6>
11459 <p><!--para 2 -->
11460  The strtoimax and strtoumax functions are equivalent to the strtol, strtoll,
11461  strtoul, and strtoull functions, except that the initial portion of the string is
11462  converted to intmax_t and uintmax_t representation, respectively.
11463 <h6>Returns</h6>
11464 <p><!--para 3 -->
11465  The strtoimax and strtoumax functions return the converted value, if any. If no
11466  conversion could be performed, zero is returned. If the correct value is outside the range
11467  of representable values, INTMAX_MAX, INTMAX_MIN, or UINTMAX_MAX is returned
11468  (according to the return type and sign of the value, if any), and the value of the macro
11469  ERANGE is stored in errno.
11470 <p><b> Forward references</b>: the strtol, strtoll, strtoul, and strtoull functions
11471  (<a href="#7.22.1.4">7.22.1.4</a>).
11472 <!--page 237 -->
11473
11474 <h5><a name="7.8.2.4" href="#7.8.2.4">7.8.2.4 The wcstoimax and wcstoumax functions</a></h5>
11475 <h6>Synopsis</h6>
11476 <p><!--para 1 -->
11477 <pre>
11478          #include <a href="#7.19">&lt;stddef.h&gt;</a>           // for wchar_t
11479          #include <a href="#7.8">&lt;inttypes.h&gt;</a>
11480          intmax_t wcstoimax(const wchar_t * restrict nptr,
11481               wchar_t ** restrict endptr, int base);
11482          uintmax_t wcstoumax(const wchar_t * restrict nptr,
11483               wchar_t ** restrict endptr, int base);
11484 </pre>
11485 <h6>Description</h6>
11486 <p><!--para 2 -->
11487  The wcstoimax and wcstoumax functions are equivalent to the wcstol, wcstoll,
11488  wcstoul, and wcstoull functions except that the initial portion of the wide string is
11489  converted to intmax_t and uintmax_t representation, respectively.
11490 <h6>Returns</h6>
11491 <p><!--para 3 -->
11492  The wcstoimax function returns the converted value, if any. If no conversion could be
11493  performed, zero is returned. If the correct value is outside the range of representable
11494  values, INTMAX_MAX, INTMAX_MIN, or UINTMAX_MAX is returned (according to the
11495  return type and sign of the value, if any), and the value of the macro ERANGE is stored in
11496  errno.
11497 <p><b> Forward references</b>: the wcstol, wcstoll, wcstoul, and wcstoull functions
11498  (<a href="#7.28.4.1.2">7.28.4.1.2</a>).
11499 <!--page 238 -->
11500
11501 <h3><a name="7.9" href="#7.9">7.9 Alternative spellings <iso646.h></a></h3>
11502 <p><!--para 1 -->
11503  The header <a href="#7.9">&lt;iso646.h&gt;</a> defines the following eleven macros (on the left) that expand
11504  to the corresponding tokens (on the right):
11505 <!--page 239 -->
11506 <pre>
11507        and           &amp;&amp;
11508        and_eq        &amp;=
11509        bitand        &amp;
11510        bitor         |
11511        compl         ~
11512        not           !
11513        not_eq        !=
11514        or            ||
11515        or_eq         |=
11516        xor           ^
11517        xor_eq        ^=
11518 </pre>
11519
11520 <h3><a name="7.10" href="#7.10">7.10 Sizes of integer types <limits.h></a></h3>
11521 <p><!--para 1 -->
11522  The header <a href="#7.10">&lt;limits.h&gt;</a> defines several macros that expand to various limits and
11523  parameters of the standard integer types.
11524 <p><!--para 2 -->
11525  The macros, their meanings, and the constraints (or restrictions) on their values are listed
11526  in <a href="#5.2.4.2.1">5.2.4.2.1</a>.
11527 <!--page 240 -->
11528
11529 <h3><a name="7.11" href="#7.11">7.11 Localization <locale.h></a></h3>
11530 <p><!--para 1 -->
11531  The header <a href="#7.11">&lt;locale.h&gt;</a> declares two functions, one type, and defines several macros.
11532 <p><!--para 2 -->
11533  The type is
11534 <pre>
11535         struct lconv
11536 </pre>
11537  which contains members related to the formatting of numeric values. The structure shall
11538  contain at least the following members, in any order. The semantics of the members and
11539  their normal ranges are explained in <a href="#7.11.2.1">7.11.2.1</a>. In the "C" locale, the members shall have
11540  the values specified in the comments.
11541 <!--page 241 -->
11542 <pre>
11543         char   *decimal_point;                 //   "."
11544         char   *thousands_sep;                 //   ""
11545         char   *grouping;                      //   ""
11546         char   *mon_decimal_point;             //   ""
11547         char   *mon_thousands_sep;             //   ""
11548         char   *mon_grouping;                  //   ""
11549         char   *positive_sign;                 //   ""
11550         char   *negative_sign;                 //   ""
11551         char   *currency_symbol;               //   ""
11552         char   frac_digits;                    //   CHAR_MAX
11553         char   p_cs_precedes;                  //   CHAR_MAX
11554         char   n_cs_precedes;                  //   CHAR_MAX
11555         char   p_sep_by_space;                 //   CHAR_MAX
11556         char   n_sep_by_space;                 //   CHAR_MAX
11557         char   p_sign_posn;                    //   CHAR_MAX
11558         char   n_sign_posn;                    //   CHAR_MAX
11559         char   *int_curr_symbol;               //   ""
11560         char   int_frac_digits;                //   CHAR_MAX
11561         char   int_p_cs_precedes;              //   CHAR_MAX
11562         char   int_n_cs_precedes;              //   CHAR_MAX
11563         char   int_p_sep_by_space;             //   CHAR_MAX
11564         char   int_n_sep_by_space;             //   CHAR_MAX
11565         char   int_p_sign_posn;                //   CHAR_MAX
11566         char   int_n_sign_posn;                //   CHAR_MAX
11567 </pre>
11568 <p><!--para 3 -->
11569  The macros defined are NULL (described in <a href="#7.19">7.19</a>); and
11570 <pre>
11571           LC_ALL
11572           LC_COLLATE
11573           LC_CTYPE
11574           LC_MONETARY
11575           LC_NUMERIC
11576           LC_TIME
11577 </pre>
11578  which expand to integer constant expressions with distinct values, suitable for use as the
11579  first argument to the setlocale function.<sup><a href="#note219"><b>219)</b></a></sup> Additional macro definitions, beginning
11580  with the characters LC_ and an uppercase letter,<sup><a href="#note220"><b>220)</b></a></sup> may also be specified by the
11581  implementation.
11582
11583 <h6>footnotes</h6>
11584 <p><small><a name="note219" href="#note219">219)</a> ISO/IEC 9945-2 specifies locale and charmap formats that may be used to specify locales for C.
11585 </small>
11586 <p><small><a name="note220" href="#note220">220)</a> See ''future library directions'' (<a href="#7.30.5">7.30.5</a>).
11587 </small>
11588
11589 <h4><a name="7.11.1" href="#7.11.1">7.11.1 Locale control</a></h4>
11590
11591 <h5><a name="7.11.1.1" href="#7.11.1.1">7.11.1.1 The setlocale function</a></h5>
11592 <h6>Synopsis</h6>
11593 <p><!--para 1 -->
11594 <pre>
11595           #include <a href="#7.11">&lt;locale.h&gt;</a>
11596           char *setlocale(int category, const char *locale);
11597 </pre>
11598 <h6>Description</h6>
11599 <p><!--para 2 -->
11600  The setlocale function selects the appropriate portion of the program's locale as
11601  specified by the category and locale arguments. The setlocale function may be
11602  used to change or query the program's entire current locale or portions thereof. The value
11603  LC_ALL for category names the program's entire locale; the other values for
11604  category name only a portion of the program's locale. LC_COLLATE affects the
11605  behavior of the strcoll and strxfrm functions. LC_CTYPE affects the behavior of
11606  the character handling functions<sup><a href="#note221"><b>221)</b></a></sup> and the multibyte and wide character functions.
11607  LC_MONETARY affects the monetary formatting information returned by the
11608  localeconv function. LC_NUMERIC affects the decimal-point character for the
11609  formatted input/output functions and the string conversion functions, as well as the
11610  nonmonetary formatting information returned by the localeconv function. LC_TIME
11611  affects the behavior of the strftime and wcsftime functions.
11612 <p><!--para 3 -->
11613  A value of "C" for locale specifies the minimal environment for C translation; a value
11614  of "" for locale specifies the locale-specific native environment. Other
11615  implementation-defined strings may be passed as the second argument to setlocale.
11616  
11617 <!--page 242 -->
11618 <p><!--para 4 -->
11619  At program startup, the equivalent of
11620 <pre>
11621          setlocale(LC_ALL, "C");
11622 </pre>
11623  is executed.
11624 <p><!--para 5 -->
11625  A call to the setlocale function may introduce a data race with other calls to the
11626  setlocale function or with calls to functions that are affected by the current locale.
11627  The implementation shall behave as if no library function calls the setlocale function.
11628 <h6>Returns</h6>
11629 <p><!--para 6 -->
11630  If a pointer to a string is given for locale and the selection can be honored, the
11631  setlocale function returns a pointer to the string associated with the specified
11632  category for the new locale. If the selection cannot be honored, the setlocale
11633  function returns a null pointer and the program's locale is not changed.
11634 <p><!--para 7 -->
11635  A null pointer for locale causes the setlocale function to return a pointer to the
11636  string associated with the category for the program's current locale; the program's
11637  locale is not changed.<sup><a href="#note222"><b>222)</b></a></sup>
11638 <p><!--para 8 -->
11639  The pointer to string returned by the setlocale function is such that a subsequent call
11640  with that string value and its associated category will restore that part of the program's
11641  locale. The string pointed to shall not be modified by the program, but may be
11642  overwritten by a subsequent call to the setlocale function.
11643 <p><b> Forward references</b>: formatted input/output functions (<a href="#7.21.6">7.21.6</a>), multibyte/wide
11644  character conversion functions (<a href="#7.22.7">7.22.7</a>), multibyte/wide string conversion functions
11645  (<a href="#7.22.8">7.22.8</a>), numeric conversion functions (<a href="#7.22.1">7.22.1</a>), the strcoll function (<a href="#7.23.4.3">7.23.4.3</a>), the
11646  strftime function (<a href="#7.26.3.5">7.26.3.5</a>), the strxfrm function (<a href="#7.23.4.5">7.23.4.5</a>).
11647
11648 <h6>footnotes</h6>
11649 <p><small><a name="note221" href="#note221">221)</a> The only functions in <a href="#7.4">7.4</a> whose behavior is not affected by the current locale are isdigit and
11650  isxdigit.
11651 </small>
11652 <p><small><a name="note222" href="#note222">222)</a> The implementation shall arrange to encode in a string the various categories due to a heterogeneous
11653  locale when category has the value LC_ALL.
11654 </small>
11655
11656 <h4><a name="7.11.2" href="#7.11.2">7.11.2 Numeric formatting convention inquiry</a></h4>
11657
11658 <h5><a name="7.11.2.1" href="#7.11.2.1">7.11.2.1 The localeconv function</a></h5>
11659 <h6>Synopsis</h6>
11660 <p><!--para 1 -->
11661 <pre>
11662          #include <a href="#7.11">&lt;locale.h&gt;</a>
11663          struct lconv *localeconv(void);
11664 </pre>
11665 <h6>Description</h6>
11666 <p><!--para 2 -->
11667  The localeconv function sets the components of an object with type struct lconv
11668  with values appropriate for the formatting of numeric quantities (monetary and otherwise)
11669  according to the rules of the current locale.
11670  
11671  
11672  
11673 <!--page 243 -->
11674 <p><!--para 3 -->
11675  The members of the structure with type char * are pointers to strings, any of which
11676  (except decimal_point) can point to "", to indicate that the value is not available in
11677  the current locale or is of zero length. Apart from grouping and mon_grouping, the
11678  strings shall start and end in the initial shift state. The members with type char are
11679  nonnegative numbers, any of which can be CHAR_MAX to indicate that the value is not
11680  available in the current locale. The members include the following:
11681  char *decimal_point
11682 <pre>
11683            The decimal-point character used to format nonmonetary quantities.
11684 </pre>
11685  char *thousands_sep
11686 <pre>
11687            The character used to separate groups of digits before the decimal-point
11688            character in formatted nonmonetary quantities.
11689 </pre>
11690  char *grouping
11691 <pre>
11692            A string whose elements indicate the size of each group of digits in
11693            formatted nonmonetary quantities.
11694 </pre>
11695  char *mon_decimal_point
11696 <pre>
11697            The decimal-point used to format monetary quantities.
11698 </pre>
11699  char *mon_thousands_sep
11700 <pre>
11701            The separator for groups of digits before the decimal-point in formatted
11702            monetary quantities.
11703 </pre>
11704  char *mon_grouping
11705 <pre>
11706            A string whose elements indicate the size of each group of digits in
11707            formatted monetary quantities.
11708 </pre>
11709  char *positive_sign
11710 <pre>
11711            The string used to indicate a nonnegative-valued formatted monetary
11712            quantity.
11713 </pre>
11714  char *negative_sign
11715 <pre>
11716            The string used to indicate a negative-valued formatted monetary quantity.
11717 </pre>
11718  char *currency_symbol
11719 <pre>
11720            The local currency symbol applicable to the current locale.
11721 </pre>
11722  char frac_digits
11723 <pre>
11724            The number of fractional digits (those after the decimal-point) to be
11725            displayed in a locally formatted monetary quantity.
11726 </pre>
11727  char p_cs_precedes
11728 <!--page 244 -->
11729 <pre>
11730            Set to 1 or 0 if the currency_symbol respectively precedes or
11731            succeeds the value for a nonnegative locally formatted monetary quantity.
11732 </pre>
11733  char n_cs_precedes
11734 <pre>
11735            Set to 1 or 0 if the currency_symbol respectively precedes or
11736            succeeds the value for a negative locally formatted monetary quantity.
11737 </pre>
11738  char p_sep_by_space
11739 <pre>
11740            Set to a value indicating the separation of the currency_symbol, the
11741            sign string, and the value for a nonnegative locally formatted monetary
11742            quantity.
11743 </pre>
11744  char n_sep_by_space
11745 <pre>
11746            Set to a value indicating the separation of the currency_symbol, the
11747            sign string, and the value for a negative locally formatted monetary
11748            quantity.
11749 </pre>
11750  char p_sign_posn
11751 <pre>
11752            Set to a value indicating the positioning of the positive_sign for a
11753            nonnegative locally formatted monetary quantity.
11754 </pre>
11755  char n_sign_posn
11756 <pre>
11757            Set to a value indicating the positioning of the negative_sign for a
11758            negative locally formatted monetary quantity.
11759 </pre>
11760  char *int_curr_symbol
11761 <pre>
11762            The international currency symbol applicable to the current locale. The
11763            first three characters contain the alphabetic international currency symbol
11764            in accordance with those specified in ISO 4217. The fourth character
11765            (immediately preceding the null character) is the character used to separate
11766            the international currency symbol from the monetary quantity.
11767 </pre>
11768  char int_frac_digits
11769 <pre>
11770            The number of fractional digits (those after the decimal-point) to be
11771            displayed in an internationally formatted monetary quantity.
11772 </pre>
11773  char int_p_cs_precedes
11774 <pre>
11775            Set to 1 or 0 if the int_curr_symbol respectively precedes or
11776            succeeds the value for a nonnegative internationally formatted monetary
11777            quantity.
11778 </pre>
11779  char int_n_cs_precedes
11780 <pre>
11781            Set to 1 or 0 if the int_curr_symbol respectively precedes or
11782            succeeds the value for a negative internationally formatted monetary
11783            quantity.
11784 </pre>
11785  char int_p_sep_by_space
11786 <!--page 245 -->
11787 <pre>
11788            Set to a value indicating the separation of the int_curr_symbol, the
11789            sign string, and the value for a nonnegative internationally formatted
11790            monetary quantity.
11791 </pre>
11792  char int_n_sep_by_space
11793 <pre>
11794            Set to a value indicating the separation of the int_curr_symbol, the
11795            sign string, and the value for a negative internationally formatted monetary
11796            quantity.
11797 </pre>
11798  char int_p_sign_posn
11799 <pre>
11800            Set to a value indicating the positioning of the positive_sign for a
11801            nonnegative internationally formatted monetary quantity.
11802 </pre>
11803  char int_n_sign_posn
11804 <pre>
11805            Set to a value indicating the positioning of the negative_sign for a
11806            negative internationally formatted monetary quantity.
11807 </pre>
11808 <p><!--para 4 -->
11809  The elements of grouping and mon_grouping are interpreted according to the
11810  following:
11811  CHAR_MAX      No further grouping is to be performed.
11812  0             The previous element is to be repeatedly used for the remainder of the
11813 <pre>
11814                digits.
11815 </pre>
11816  other         The integer value is the number of digits that compose the current group.
11817 <pre>
11818                The next element is examined to determine the size of the next group of
11819                digits before the current group.
11820 </pre>
11821 <p><!--para 5 -->
11822  The values of p_sep_by_space, n_sep_by_space, int_p_sep_by_space,
11823  and int_n_sep_by_space are interpreted according to the following:
11824  0   No space separates the currency symbol and value.
11825  1   If the currency symbol and sign string are adjacent, a space separates them from the
11826 <pre>
11827      value; otherwise, a space separates the currency symbol from the value.
11828 </pre>
11829  2   If the currency symbol and sign string are adjacent, a space separates them;
11830 <pre>
11831      otherwise, a space separates the sign string from the value.
11832 </pre>
11833  For int_p_sep_by_space and int_n_sep_by_space, the fourth character of
11834  int_curr_symbol is used instead of a space.
11835 <p><!--para 6 -->
11836  The values of p_sign_posn, n_sign_posn, int_p_sign_posn,                            and
11837  int_n_sign_posn are interpreted according to the following:
11838  0   Parentheses surround the quantity and currency symbol.
11839  1   The sign string precedes the quantity and currency symbol.
11840  2   The sign string succeeds the quantity and currency symbol.
11841  3   The sign string immediately precedes the currency symbol.
11842  4   The sign string immediately succeeds the currency symbol.
11843 <!--page 246 -->
11844 <p><!--para 7 -->
11845  The implementation shall behave as if no library function calls the localeconv
11846  function.
11847 <h6>Returns</h6>
11848 <p><!--para 8 -->
11849  The localeconv function returns a pointer to the filled-in object. The structure
11850  pointed to by the return value shall not be modified by the program, but may be
11851  overwritten by a subsequent call to the localeconv function. In addition, calls to the
11852  setlocale function with categories LC_ALL, LC_MONETARY, or LC_NUMERIC may
11853  overwrite the contents of the structure.
11854 <p><!--para 9 -->
11855  EXAMPLE 1 The following table illustrates rules which may well be used by four countries to format
11856  monetary quantities.
11857 <pre>
11858                                Local format                                     International format
11859 </pre>
11860  
11861  Country            Positive                  Negative                    Positive               Negative
11862  
11863  Country1     1.234,56 mk             -1.234,56 mk                  FIM   1.234,56         FIM -1.234,56
11864  Country2     L.1.234                 -L.1.234                      ITL   1.234            -ITL 1.234
11865  Country3     fl. 1.234,56              fl. -1.234,56                   NLG   1.234,56         NLG -1.234,56
11866  Country4     SFrs.1,234.56           SFrs.1,234.56C                CHF   1,234.56         CHF 1,234.56C
11867 <p><!--para 10 -->
11868  For these four countries, the respective values for the monetary members of the structure returned by
11869  localeconv could be:
11870 <pre>
11871                                    Country1              Country2              Country3            Country4
11872 </pre>
11873  
11874  mon_decimal_point                 ","                   ""                   ","                 "."
11875  mon_thousands_sep                 "."                   "."                  "."                 ","
11876  mon_grouping                      "\3"                  "\3"                 "\3"                "\3"
11877  positive_sign                     ""                    ""                   ""                  ""
11878  negative_sign                     "-"                   "-"                  "-"                 "C"
11879  currency_symbol                   "mk"                  "L."                 "\u0192"            "SFrs."
11880  frac_digits                       2                     0                    2                   2
11881  p_cs_precedes                     0                     1                    1                   1
11882  n_cs_precedes                     0                     1                    1                   1
11883  p_sep_by_space                    1                     0                    1                   0
11884  n_sep_by_space                    1                     0                    2                   0
11885  p_sign_posn                       1                     1                    1                   1
11886  n_sign_posn                       1                     1                    4                   2
11887  int_curr_symbol                   "FIM "                "ITL "               "NLG "              "CHF "
11888  int_frac_digits                   2                     0                    2                   2
11889  int_p_cs_precedes                 1                     1                    1                   1
11890  int_n_cs_precedes                 1                     1                    1                   1
11891  int_p_sep_by_space                1                     1                    1                   1
11892  int_n_sep_by_space                2                     1                    2                   1
11893  int_p_sign_posn                   1                     1                    1                   1
11894  int_n_sign_posn                   4                     1                    4                   2
11895 <!--page 247 -->
11896 <p><!--para 11 -->
11897  EXAMPLE 2 The following table illustrates how the cs_precedes, sep_by_space, and sign_posn members
11898  affect the formatted value.
11899 <pre>
11900                                                                p_sep_by_space
11901 </pre>
11902  
11903  p_cs_precedes           p_sign_posn                0                   1                  2
11904  
11905 <pre>
11906                  0                    0         (<a href="#1.25">1.25</a>$)            (<a href="#1.25">1.25</a> $)            (<a href="#1.25">1.25</a>$)
11907                                       1         +1.25$             +1.25 $             + <a href="#1.25">1.25</a>$
11908                                       2         <a href="#1.25">1.25</a>$+             <a href="#1.25">1.25</a> $+             <a href="#1.25">1.25</a>$ +
11909                                       3         <a href="#1.25">1.25</a>+$             <a href="#1.25">1.25</a> +$             <a href="#1.25">1.25</a>+ $
11910                                       4         <a href="#1.25">1.25</a>$+             <a href="#1.25">1.25</a> $+             <a href="#1.25">1.25</a>$ +
11911 </pre>
11912  
11913 <!--page 248 -->
11914 <pre>
11915                  1                    0         ($1.25)            ($ <a href="#1.25">1.25</a>)            ($1.25)
11916                                       1         +$1.25             +$ <a href="#1.25">1.25</a>             + $1.25
11917                                       2         $1.25+             $ <a href="#1.25">1.25</a>+             $1.25 +
11918                                       3         +$1.25             +$ <a href="#1.25">1.25</a>             + $1.25
11919                                       4         $+1.25             $+ <a href="#1.25">1.25</a>             $ +1.25
11920 </pre>
11921
11922 <h3><a name="7.12" href="#7.12">7.12 Mathematics <math.h></a></h3>
11923 <p><!--para 1 -->
11924  The header <a href="#7.12">&lt;math.h&gt;</a> declares two types and many mathematical functions and defines
11925  several macros. Most synopses specify a family of functions consisting of a principal
11926  function with one or more double parameters, a double return value, or both; and
11927  other functions with the same name but with f and l suffixes, which are corresponding
11928  functions with float and long double parameters, return values, or both.<sup><a href="#note223"><b>223)</b></a></sup>
11929  Integer arithmetic functions and conversion functions are discussed later.
11930 <p><!--para 2 -->
11931  The types
11932 <pre>
11933          float_t
11934          double_t
11935 </pre>
11936  are floating types at least as wide as float and double, respectively, and such that
11937  double_t is at least as wide as float_t. If FLT_EVAL_METHOD equals 0,
11938  float_t and double_t are float and double, respectively; if
11939  FLT_EVAL_METHOD equals 1, they are both double; if FLT_EVAL_METHOD equals
11940  2, they are both long double; and for other values of FLT_EVAL_METHOD, they are
11941  otherwise implementation-defined.<sup><a href="#note224"><b>224)</b></a></sup>
11942 <p><!--para 3 -->
11943  The macro
11944 <pre>
11945          HUGE_VAL
11946 </pre>
11947  expands to a positive double constant expression, not necessarily representable as a
11948  float. The macros
11949 <pre>
11950          HUGE_VALF
11951          HUGE_VALL
11952 </pre>
11953  are respectively float and long double analogs of HUGE_VAL.<sup><a href="#note225"><b>225)</b></a></sup>
11954 <p><!--para 4 -->
11955  The macro
11956 <pre>
11957          INFINITY
11958 </pre>
11959  expands to a constant expression of type float representing positive or unsigned
11960  infinity, if available; else to a positive constant of type float that overflows at
11961  
11962  
11963  
11964 <!--page 249 -->
11965  translation time.<sup><a href="#note226"><b>226)</b></a></sup>
11966 <p><!--para 5 -->
11967  The macro
11968 <pre>
11969           NAN
11970 </pre>
11971  is defined if and only if the implementation supports quiet NaNs for the float type. It
11972  expands to a constant expression of type float representing a quiet NaN.
11973 <p><!--para 6 -->
11974  The number classification macros
11975 <pre>
11976           FP_INFINITE
11977           FP_NAN
11978           FP_NORMAL
11979           FP_SUBNORMAL
11980           FP_ZERO
11981 </pre>
11982  represent the mutually exclusive kinds of floating-point values. They expand to integer
11983  constant expressions with distinct values. Additional implementation-defined floating-
11984  point classifications, with macro definitions beginning with FP_ and an uppercase letter,
11985  may also be specified by the implementation.
11986 <p><!--para 7 -->
11987  The macro
11988 <pre>
11989           FP_FAST_FMA
11990 </pre>
11991  is optionally defined. If defined, it indicates that the fma function generally executes
11992  about as fast as, or faster than, a multiply and an add of double operands.<sup><a href="#note227"><b>227)</b></a></sup> The
11993  macros
11994 <pre>
11995           FP_FAST_FMAF
11996           FP_FAST_FMAL
11997 </pre>
11998  are, respectively, float and long double analogs of FP_FAST_FMA. If defined,
11999  these macros expand to the integer constant 1.
12000 <p><!--para 8 -->
12001  The macros
12002 <pre>
12003           FP_ILOGB0
12004           FP_ILOGBNAN
12005 </pre>
12006  expand to integer constant expressions whose values are returned by ilogb(x) if x is
12007  zero or NaN, respectively. The value of FP_ILOGB0 shall be either INT_MIN or
12008  -INT_MAX. The value of FP_ILOGBNAN shall be either INT_MAX or INT_MIN.
12009  
12010  
12011 <!--page 250 -->
12012 <p><!--para 9 -->
12013  The macros
12014 <pre>
12015          MATH_ERRNO
12016          MATH_ERREXCEPT
12017 </pre>
12018  expand to the integer constants 1 and 2, respectively; the macro
12019 <pre>
12020          math_errhandling
12021 </pre>
12022  expands to an expression that has type int and the value MATH_ERRNO,
12023  MATH_ERREXCEPT, or the bitwise OR of both. The value of math_errhandling is
12024  constant for the duration of the program. It is unspecified whether
12025  math_errhandling is a macro or an identifier with external linkage. If a macro
12026  definition is suppressed or a program defines an identifier with the name
12027  math_errhandling, the behavior is undefined.               If the expression
12028  math_errhandling &amp; MATH_ERREXCEPT can be nonzero, the implementation
12029  shall define the macros FE_DIVBYZERO, FE_INVALID, and FE_OVERFLOW in
12030  <a href="#7.6">&lt;fenv.h&gt;</a>.
12031
12032 <h6>footnotes</h6>
12033 <p><small><a name="note223" href="#note223">223)</a> Particularly on systems with wide expression evaluation, a <a href="#7.12">&lt;math.h&gt;</a> function might pass arguments
12034  and return values in wider format than the synopsis prototype indicates.
12035 </small>
12036 <p><small><a name="note224" href="#note224">224)</a> The types float_t and double_t are intended to be the implementation's most efficient types at
12037  least as wide as float and double, respectively. For FLT_EVAL_METHOD equal 0, 1, or 2, the
12038  type float_t is the narrowest type used by the implementation to evaluate floating expressions.
12039 </small>
12040 <p><small><a name="note225" href="#note225">225)</a> HUGE_VAL, HUGE_VALF, and HUGE_VALL can be positive infinities in an implementation that
12041  supports infinities.
12042 </small>
12043 <p><small><a name="note226" href="#note226">226)</a> In this case, using INFINITY will violate the constraint in <a href="#6.4.4">6.4.4</a> and thus require a diagnostic.
12044 </small>
12045 <p><small><a name="note227" href="#note227">227)</a> Typically, the FP_FAST_FMA macro is defined if and only if the fma function is implemented
12046  directly with a hardware multiply-add instruction. Software implementations are expected to be
12047  substantially slower.
12048 </small>
12049
12050 <h4><a name="7.12.1" href="#7.12.1">7.12.1 Treatment of error conditions</a></h4>
12051 <p><!--para 1 -->
12052  The behavior of each of the functions in <a href="#7.12">&lt;math.h&gt;</a> is specified for all representable
12053  values of its input arguments, except where stated otherwise. Each function shall execute
12054  as if it were a single operation without raising SIGFPE and without generating any of the
12055  floating-point exceptions ''invalid'', ''divide-by-zero'', or ''overflow'' except to reflect
12056  the result of the function.
12057 <p><!--para 2 -->
12058  For all functions, a domain error occurs if an input argument is outside the domain over
12059  which the mathematical function is defined. The description of each function lists any
12060  required domain errors; an implementation may define additional domain errors, provided
12061  that such errors are consistent with the mathematical definition of the function.<sup><a href="#note228"><b>228)</b></a></sup> On a
12062  domain error, the function returns an implementation-defined value; if the integer
12063  expression math_errhandling &amp; MATH_ERRNO is nonzero, the integer expression
12064  errno acquires the value EDOM; if the integer expression math_errhandling &amp;
12065  MATH_ERREXCEPT is nonzero, the ''invalid'' floating-point exception is raised.
12066 <p><!--para 3 -->
12067  Similarly, a pole error (also known as a singularity or infinitary) occurs if the
12068  mathematical function has an exact infinite result as the finite input argument(s) are
12069  approached in the limit (for example, log(0.0)). The description of each function lists
12070  any required pole errors; an implementation may define additional pole errors, provided
12071  that such errors are consistent with the mathematical definition of the function. On a pole
12072  error, the function returns an implementation-defined value; if the integer expression
12073  
12074  
12075 <!--page 251 -->
12076  math_errhandling &amp; MATH_ERRNO is nonzero, the integer expression errno
12077  acquires the value ERANGE; if the integer expression math_errhandling &amp;
12078  MATH_ERREXCEPT is nonzero, the ''divide-by-zero'' floating-point exception is raised.
12079 <p><!--para 4 -->
12080  Likewise, a range error occurs if the mathematical result of the function cannot be
12081  represented in an object of the specified type, due to extreme magnitude.
12082 <p><!--para 5 -->
12083  A floating result overflows if the magnitude of the mathematical result is finite but so
12084  large that the mathematical result cannot be represented without extraordinary roundoff
12085  error in an object of the specified type. If a floating result overflows and default rounding
12086  is in effect, then the function returns the value of the macro HUGE_VAL, HUGE_VALF, or *
12087  HUGE_VALL according to the return type, with the same sign as the correct value of the
12088  function; if the integer expression math_errhandling &amp; MATH_ERRNO is nonzero,
12089  the integer expression errno acquires the value ERANGE; if the integer expression
12090  math_errhandling &amp; MATH_ERREXCEPT is nonzero, the ''overflow'' floating-
12091  point exception is raised.
12092 <p><!--para 6 -->
12093  The result underflows if the magnitude of the mathematical result is so small that the
12094  mathematical result cannot be represented, without extraordinary roundoff error, in an
12095  object of the specified type.<sup><a href="#note229"><b>229)</b></a></sup> If the result underflows, the function returns an
12096  implementation-defined value whose magnitude is no greater than the smallest
12097  normalized positive number in the specified type; if the integer expression
12098  math_errhandling &amp; MATH_ERRNO is nonzero, whether errno acquires the
12099  value    ERANGE       is    implementation-defined;     if   the  integer   expression
12100  math_errhandling &amp; MATH_ERREXCEPT is nonzero, whether the ''underflow''
12101  floating-point exception is raised is implementation-defined.
12102 <p><!--para 7 -->
12103  If a domain, pole, or range error occurs and the integer expression
12104  math_errhandling &amp; MATH_ERRNO is zero,<sup><a href="#note230"><b>230)</b></a></sup> then errno shall either be set to
12105  the value corresponding to the error or left unmodified. If no such error occurs, errno
12106  shall be left unmodified regardless of the setting of math_errhandling.
12107  
12108  
12109  
12110  
12111 <!--page 252 -->
12112
12113 <h6>footnotes</h6>
12114 <p><small><a name="note228" href="#note228">228)</a> In an implementation that supports infinities, this allows an infinity as an argument to be a domain
12115  error if the mathematical domain of the function does not include the infinity.
12116 </small>
12117 <p><small><a name="note229" href="#note229">229)</a> The term underflow here is intended to encompass both ''gradual underflow'' as in IEC 60559 and
12118  also ''flush-to-zero'' underflow.
12119 </small>
12120 <p><small><a name="note230" href="#note230">230)</a> Math errors are being indicated by the floating-point exception flags rather than by errno.
12121 </small>
12122
12123 <h4><a name="7.12.2" href="#7.12.2">7.12.2 The FP_CONTRACT pragma</a></h4>
12124 <h6>Synopsis</h6>
12125 <p><!--para 1 -->
12126 <pre>
12127           #include <a href="#7.12">&lt;math.h&gt;</a>
12128           #pragma STDC FP_CONTRACT on-off-switch
12129 </pre>
12130 <h6>Description</h6>
12131 <p><!--para 2 -->
12132  The FP_CONTRACT pragma can be used to allow (if the state is ''on'') or disallow (if the
12133  state is ''off'') the implementation to contract expressions (<a href="#6.5">6.5</a>). Each pragma can occur
12134  either outside external declarations or preceding all explicit declarations and statements
12135  inside a compound statement. When outside external declarations, the pragma takes
12136  effect from its occurrence until another FP_CONTRACT pragma is encountered, or until
12137  the end of the translation unit. When inside a compound statement, the pragma takes
12138  effect from its occurrence until another FP_CONTRACT pragma is encountered
12139  (including within a nested compound statement), or until the end of the compound
12140  statement; at the end of a compound statement the state for the pragma is restored to its
12141  condition just before the compound statement. If this pragma is used in any other
12142  context, the behavior is undefined. The default state (''on'' or ''off'') for the pragma is
12143  implementation-defined.
12144
12145 <h4><a name="7.12.3" href="#7.12.3">7.12.3 Classification macros</a></h4>
12146 <p><!--para 1 -->
12147  In the synopses in this subclause, real-floating indicates that the argument shall be an
12148  expression of real floating type.
12149
12150 <h5><a name="7.12.3.1" href="#7.12.3.1">7.12.3.1 The fpclassify macro</a></h5>
12151 <h6>Synopsis</h6>
12152 <p><!--para 1 -->
12153 <pre>
12154           #include <a href="#7.12">&lt;math.h&gt;</a>
12155           int fpclassify(real-floating x);
12156 </pre>
12157 <h6>Description</h6>
12158 <p><!--para 2 -->
12159  The fpclassify macro classifies its argument value as NaN, infinite, normal,
12160  subnormal, zero, or into another implementation-defined category. First, an argument
12161  represented in a format wider than its semantic type is converted to its semantic type.
12162  Then classification is based on the type of the argument.<sup><a href="#note231"><b>231)</b></a></sup>
12163 <h6>Returns</h6>
12164 <p><!--para 3 -->
12165  The fpclassify macro returns the value of the number classification macro
12166  appropriate to the value of its argument.                                *
12167  
12168  
12169 <!--page 253 -->
12170
12171 <h6>footnotes</h6>
12172 <p><small><a name="note231" href="#note231">231)</a> Since an expression can be evaluated with more range and precision than its type has, it is important to
12173  know the type that classification is based on. For example, a normal long double value might
12174  become subnormal when converted to double, and zero when converted to float.
12175 </small>
12176
12177 <h5><a name="7.12.3.2" href="#7.12.3.2">7.12.3.2 The isfinite macro</a></h5>
12178 <h6>Synopsis</h6>
12179 <p><!--para 1 -->
12180 <pre>
12181          #include <a href="#7.12">&lt;math.h&gt;</a>
12182          int isfinite(real-floating x);
12183 </pre>
12184 <h6>Description</h6>
12185 <p><!--para 2 -->
12186  The isfinite macro determines whether its argument has a finite value (zero,
12187  subnormal, or normal, and not infinite or NaN). First, an argument represented in a
12188  format wider than its semantic type is converted to its semantic type. Then determination
12189  is based on the type of the argument.
12190 <h6>Returns</h6>
12191 <p><!--para 3 -->
12192  The isfinite macro returns a nonzero value if and only if its argument has a finite
12193  value.
12194
12195 <h5><a name="7.12.3.3" href="#7.12.3.3">7.12.3.3 The isinf macro</a></h5>
12196 <h6>Synopsis</h6>
12197 <p><!--para 1 -->
12198 <pre>
12199          #include <a href="#7.12">&lt;math.h&gt;</a>
12200          int isinf(real-floating x);
12201 </pre>
12202 <h6>Description</h6>
12203 <p><!--para 2 -->
12204  The isinf macro determines whether its argument value is an infinity (positive or
12205  negative). First, an argument represented in a format wider than its semantic type is
12206  converted to its semantic type. Then determination is based on the type of the argument.
12207 <h6>Returns</h6>
12208 <p><!--para 3 -->
12209  The isinf macro returns a nonzero value if and only if its argument has an infinite
12210  value.
12211
12212 <h5><a name="7.12.3.4" href="#7.12.3.4">7.12.3.4 The isnan macro</a></h5>
12213 <h6>Synopsis</h6>
12214 <p><!--para 1 -->
12215 <pre>
12216          #include <a href="#7.12">&lt;math.h&gt;</a>
12217          int isnan(real-floating x);
12218 </pre>
12219 <h6>Description</h6>
12220 <p><!--para 2 -->
12221  The isnan macro determines whether its argument value is a NaN. First, an argument
12222  represented in a format wider than its semantic type is converted to its semantic type.
12223  Then determination is based on the type of the argument.<sup><a href="#note232"><b>232)</b></a></sup>
12224  
12225  
12226 <!--page 254 -->
12227 <h6>Returns</h6>
12228 <p><!--para 3 -->
12229  The isnan macro returns a nonzero value if and only if its argument has a NaN value.
12230
12231 <h6>footnotes</h6>
12232 <p><small><a name="note232" href="#note232">232)</a> For the isnan macro, the type for determination does not matter unless the implementation supports
12233  NaNs in the evaluation type but not in the semantic type.
12234 </small>
12235
12236 <h5><a name="7.12.3.5" href="#7.12.3.5">7.12.3.5 The isnormal macro</a></h5>
12237 <h6>Synopsis</h6>
12238 <p><!--para 1 -->
12239 <pre>
12240          #include <a href="#7.12">&lt;math.h&gt;</a>
12241          int isnormal(real-floating x);
12242 </pre>
12243 <h6>Description</h6>
12244 <p><!--para 2 -->
12245  The isnormal macro determines whether its argument value is normal (neither zero,
12246  subnormal, infinite, nor NaN). First, an argument represented in a format wider than its
12247  semantic type is converted to its semantic type. Then determination is based on the type
12248  of the argument.
12249 <h6>Returns</h6>
12250 <p><!--para 3 -->
12251  The isnormal macro returns a nonzero value if and only if its argument has a normal
12252  value.
12253
12254 <h5><a name="7.12.3.6" href="#7.12.3.6">7.12.3.6 The signbit macro</a></h5>
12255 <h6>Synopsis</h6>
12256 <p><!--para 1 -->
12257 <pre>
12258          #include <a href="#7.12">&lt;math.h&gt;</a>
12259          int signbit(real-floating x);
12260 </pre>
12261 <h6>Description</h6>
12262 <p><!--para 2 -->
12263  The signbit macro determines whether the sign of its argument value is negative.<sup><a href="#note233"><b>233)</b></a></sup>
12264 <h6>Returns</h6>
12265 <p><!--para 3 -->
12266  The signbit macro returns a nonzero value if and only if the sign of its argument value
12267  is negative.
12268  
12269  
12270  
12271  
12272 <!--page 255 -->
12273
12274 <h6>footnotes</h6>
12275 <p><small><a name="note233" href="#note233">233)</a> The signbit macro reports the sign of all values, including infinities, zeros, and NaNs. If zero is
12276  unsigned, it is treated as positive.
12277 </small>
12278
12279 <h4><a name="7.12.4" href="#7.12.4">7.12.4 Trigonometric functions</a></h4>
12280
12281 <h5><a name="7.12.4.1" href="#7.12.4.1">7.12.4.1 The acos functions</a></h5>
12282 <h6>Synopsis</h6>
12283 <p><!--para 1 -->
12284 <pre>
12285          #include <a href="#7.12">&lt;math.h&gt;</a>
12286          double acos(double x);
12287          float acosf(float x);
12288          long double acosl(long double x);
12289 </pre>
12290 <h6>Description</h6>
12291 <p><!--para 2 -->
12292  The acos functions compute the principal value of the arc cosine of x. A domain error
12293  occurs for arguments not in the interval [-1, +1].
12294 <h6>Returns</h6>
12295 <p><!--para 3 -->
12296  The acos functions return arccos x in the interval [0, pi ] radians.
12297
12298 <h5><a name="7.12.4.2" href="#7.12.4.2">7.12.4.2 The asin functions</a></h5>
12299 <h6>Synopsis</h6>
12300 <p><!--para 1 -->
12301 <pre>
12302          #include <a href="#7.12">&lt;math.h&gt;</a>
12303          double asin(double x);
12304          float asinf(float x);
12305          long double asinl(long double x);
12306 </pre>
12307 <h6>Description</h6>
12308 <p><!--para 2 -->
12309  The asin functions compute the principal value of the arc sine of x. A domain error
12310  occurs for arguments not in the interval [-1, +1].
12311 <h6>Returns</h6>
12312 <p><!--para 3 -->
12313  The asin functions return arcsin x in the interval [-pi /2, +pi /2] radians.
12314
12315 <h5><a name="7.12.4.3" href="#7.12.4.3">7.12.4.3 The atan functions</a></h5>
12316 <h6>Synopsis</h6>
12317 <p><!--para 1 -->
12318 <pre>
12319          #include <a href="#7.12">&lt;math.h&gt;</a>
12320          double atan(double x);
12321          float atanf(float x);
12322          long double atanl(long double x);
12323 </pre>
12324 <h6>Description</h6>
12325 <p><!--para 2 -->
12326  The atan functions compute the principal value of the arc tangent of x.
12327 <!--page 256 -->
12328 <h6>Returns</h6>
12329 <p><!--para 3 -->
12330  The atan functions return arctan x in the interval [-pi /2, +pi /2] radians.
12331
12332 <h5><a name="7.12.4.4" href="#7.12.4.4">7.12.4.4 The atan2 functions</a></h5>
12333 <h6>Synopsis</h6>
12334 <p><!--para 1 -->
12335 <pre>
12336         #include <a href="#7.12">&lt;math.h&gt;</a>
12337         double atan2(double y, double x);
12338         float atan2f(float y, float x);
12339         long double atan2l(long double y, long double x);
12340 </pre>
12341 <h6>Description</h6>
12342 <p><!--para 2 -->
12343  The atan2 functions compute the value of the arc tangent of y/x, using the signs of both
12344  arguments to determine the quadrant of the return value. A domain error may occur if
12345  both arguments are zero.
12346 <h6>Returns</h6>
12347 <p><!--para 3 -->
12348  The atan2 functions return arctan y/x in the interval [-pi , +pi ] radians.
12349
12350 <h5><a name="7.12.4.5" href="#7.12.4.5">7.12.4.5 The cos functions</a></h5>
12351 <h6>Synopsis</h6>
12352 <p><!--para 1 -->
12353 <pre>
12354         #include <a href="#7.12">&lt;math.h&gt;</a>
12355         double cos(double x);
12356         float cosf(float x);
12357         long double cosl(long double x);
12358 </pre>
12359 <h6>Description</h6>
12360 <p><!--para 2 -->
12361  The cos functions compute the cosine of x (measured in radians).
12362 <h6>Returns</h6>
12363 <p><!--para 3 -->
12364  The cos functions return cos x.
12365
12366 <h5><a name="7.12.4.6" href="#7.12.4.6">7.12.4.6 The sin functions</a></h5>
12367 <h6>Synopsis</h6>
12368 <p><!--para 1 -->
12369 <pre>
12370         #include <a href="#7.12">&lt;math.h&gt;</a>
12371         double sin(double x);
12372         float sinf(float x);
12373         long double sinl(long double x);
12374 </pre>
12375 <h6>Description</h6>
12376 <p><!--para 2 -->
12377  The sin functions compute the sine of x (measured in radians).
12378 <!--page 257 -->
12379 <h6>Returns</h6>
12380 <p><!--para 3 -->
12381  The sin functions return sin x.
12382
12383 <h5><a name="7.12.4.7" href="#7.12.4.7">7.12.4.7 The tan functions</a></h5>
12384 <h6>Synopsis</h6>
12385 <p><!--para 1 -->
12386 <pre>
12387          #include <a href="#7.12">&lt;math.h&gt;</a>
12388          double tan(double x);
12389          float tanf(float x);
12390          long double tanl(long double x);
12391 </pre>
12392 <h6>Description</h6>
12393 <p><!--para 2 -->
12394  The tan functions return the tangent of x (measured in radians).
12395 <h6>Returns</h6>
12396 <p><!--para 3 -->
12397  The tan functions return tan x.
12398
12399 <h4><a name="7.12.5" href="#7.12.5">7.12.5 Hyperbolic functions</a></h4>
12400
12401 <h5><a name="7.12.5.1" href="#7.12.5.1">7.12.5.1 The acosh functions</a></h5>
12402 <h6>Synopsis</h6>
12403 <p><!--para 1 -->
12404 <pre>
12405          #include <a href="#7.12">&lt;math.h&gt;</a>
12406          double acosh(double x);
12407          float acoshf(float x);
12408          long double acoshl(long double x);
12409 </pre>
12410 <h6>Description</h6>
12411 <p><!--para 2 -->
12412  The acosh functions compute the (nonnegative) arc hyperbolic cosine of x. A domain
12413  error occurs for arguments less than 1.
12414 <h6>Returns</h6>
12415 <p><!--para 3 -->
12416  The acosh functions return arcosh x in the interval [0, +(inf)].
12417
12418 <h5><a name="7.12.5.2" href="#7.12.5.2">7.12.5.2 The asinh functions</a></h5>
12419 <h6>Synopsis</h6>
12420 <p><!--para 1 -->
12421 <pre>
12422          #include <a href="#7.12">&lt;math.h&gt;</a>
12423          double asinh(double x);
12424          float asinhf(float x);
12425          long double asinhl(long double x);
12426 </pre>
12427 <h6>Description</h6>
12428 <p><!--para 2 -->
12429  The asinh functions compute the arc hyperbolic sine of x.
12430 <!--page 258 -->
12431 <h6>Returns</h6>
12432 <p><!--para 3 -->
12433  The asinh functions return arsinh x.
12434
12435 <h5><a name="7.12.5.3" href="#7.12.5.3">7.12.5.3 The atanh functions</a></h5>
12436 <h6>Synopsis</h6>
12437 <p><!--para 1 -->
12438 <pre>
12439         #include <a href="#7.12">&lt;math.h&gt;</a>
12440         double atanh(double x);
12441         float atanhf(float x);
12442         long double atanhl(long double x);
12443 </pre>
12444 <h6>Description</h6>
12445 <p><!--para 2 -->
12446  The atanh functions compute the arc hyperbolic tangent of x. A domain error occurs
12447  for arguments not in the interval [-1, +1]. A pole error may occur if the argument equals
12448  -1 or +1.
12449 <h6>Returns</h6>
12450 <p><!--para 3 -->
12451  The atanh functions return artanh x.
12452
12453 <h5><a name="7.12.5.4" href="#7.12.5.4">7.12.5.4 The cosh functions</a></h5>
12454 <h6>Synopsis</h6>
12455 <p><!--para 1 -->
12456 <pre>
12457         #include <a href="#7.12">&lt;math.h&gt;</a>
12458         double cosh(double x);
12459         float coshf(float x);
12460         long double coshl(long double x);
12461 </pre>
12462 <h6>Description</h6>
12463 <p><!--para 2 -->
12464  The cosh functions compute the hyperbolic cosine of x. A range error occurs if the
12465  magnitude of x is too large.
12466 <h6>Returns</h6>
12467 <p><!--para 3 -->
12468  The cosh functions return cosh x.
12469
12470 <h5><a name="7.12.5.5" href="#7.12.5.5">7.12.5.5 The sinh functions</a></h5>
12471 <h6>Synopsis</h6>
12472 <p><!--para 1 -->
12473 <pre>
12474         #include <a href="#7.12">&lt;math.h&gt;</a>
12475         double sinh(double x);
12476         float sinhf(float x);
12477         long double sinhl(long double x);
12478 </pre>
12479 <h6>Description</h6>
12480 <p><!--para 2 -->
12481  The sinh functions compute the hyperbolic sine of x. A range error occurs if the
12482  magnitude of x is too large.
12483 <!--page 259 -->
12484 <h6>Returns</h6>
12485 <p><!--para 3 -->
12486  The sinh functions return sinh x.
12487
12488 <h5><a name="7.12.5.6" href="#7.12.5.6">7.12.5.6 The tanh functions</a></h5>
12489 <h6>Synopsis</h6>
12490 <p><!--para 1 -->
12491 <pre>
12492          #include <a href="#7.12">&lt;math.h&gt;</a>
12493          double tanh(double x);
12494          float tanhf(float x);
12495          long double tanhl(long double x);
12496 </pre>
12497 <h6>Description</h6>
12498 <p><!--para 2 -->
12499  The tanh functions compute the hyperbolic tangent of x.
12500 <h6>Returns</h6>
12501 <p><!--para 3 -->
12502  The tanh functions return tanh x.
12503
12504 <h4><a name="7.12.6" href="#7.12.6">7.12.6 Exponential and logarithmic functions</a></h4>
12505
12506 <h5><a name="7.12.6.1" href="#7.12.6.1">7.12.6.1 The exp functions</a></h5>
12507 <h6>Synopsis</h6>
12508 <p><!--para 1 -->
12509 <pre>
12510          #include <a href="#7.12">&lt;math.h&gt;</a>
12511          double exp(double x);
12512          float expf(float x);
12513          long double expl(long double x);
12514 </pre>
12515 <h6>Description</h6>
12516 <p><!--para 2 -->
12517  The exp functions compute the base-e exponential of x. A range error occurs if the
12518  magnitude of x is too large.
12519 <h6>Returns</h6>
12520 <p><!--para 3 -->
12521  The exp functions return ex .
12522
12523 <h5><a name="7.12.6.2" href="#7.12.6.2">7.12.6.2 The exp2 functions</a></h5>
12524 <h6>Synopsis</h6>
12525 <p><!--para 1 -->
12526 <pre>
12527          #include <a href="#7.12">&lt;math.h&gt;</a>
12528          double exp2(double x);
12529          float exp2f(float x);
12530          long double exp2l(long double x);
12531 </pre>
12532 <h6>Description</h6>
12533 <p><!--para 2 -->
12534  The exp2 functions compute the base-2 exponential of x. A range error occurs if the
12535  magnitude of x is too large.
12536 <!--page 260 -->
12537 <h6>Returns</h6>
12538 <p><!--para 3 -->
12539  The exp2 functions return 2x .
12540
12541 <h5><a name="7.12.6.3" href="#7.12.6.3">7.12.6.3 The expm1 functions</a></h5>
12542 <h6>Synopsis</h6>
12543 <p><!--para 1 -->
12544 <pre>
12545          #include <a href="#7.12">&lt;math.h&gt;</a>
12546          double expm1(double x);
12547          float expm1f(float x);
12548          long double expm1l(long double x);
12549 </pre>
12550 <h6>Description</h6>
12551 <p><!--para 2 -->
12552  The expm1 functions compute the base-e exponential of the argument, minus 1. A range
12553  error occurs if x is too large.<sup><a href="#note234"><b>234)</b></a></sup>
12554 <h6>Returns</h6>
12555 <p><!--para 3 -->
12556  The expm1 functions return ex - 1.
12557
12558 <h6>footnotes</h6>
12559 <p><small><a name="note234" href="#note234">234)</a> For small magnitude x, expm1(x) is expected to be more accurate than exp(x) - 1.
12560 </small>
12561
12562 <h5><a name="7.12.6.4" href="#7.12.6.4">7.12.6.4 The frexp functions</a></h5>
12563 <h6>Synopsis</h6>
12564 <p><!--para 1 -->
12565 <pre>
12566          #include <a href="#7.12">&lt;math.h&gt;</a>
12567          double frexp(double value, int *exp);
12568          float frexpf(float value, int *exp);
12569          long double frexpl(long double value, int *exp);
12570 </pre>
12571 <h6>Description</h6>
12572 <p><!--para 2 -->
12573  The frexp functions break a floating-point number into a normalized fraction and an
12574  integral power of 2. They store the integer in the int object pointed to by exp.
12575 <h6>Returns</h6>
12576 <p><!--para 3 -->
12577  If value is not a floating-point number or if the integral power of 2 is outside the range
12578  of int, the results are unspecified. Otherwise, the frexp functions return the value x,
12579  such that x has a magnitude in the interval [1/2, 1) or zero, and value equals x x 2*exp .
12580  If value is zero, both parts of the result are zero.
12581  
12582  
12583  
12584  
12585 <!--page 261 -->
12586
12587 <h5><a name="7.12.6.5" href="#7.12.6.5">7.12.6.5 The ilogb functions</a></h5>
12588 <h6>Synopsis</h6>
12589 <p><!--para 1 -->
12590 <pre>
12591          #include <a href="#7.12">&lt;math.h&gt;</a>
12592          int ilogb(double x);
12593          int ilogbf(float x);
12594          int ilogbl(long double x);
12595 </pre>
12596 <h6>Description</h6>
12597 <p><!--para 2 -->
12598  The ilogb functions extract the exponent of x as a signed int value. If x is zero they
12599  compute the value FP_ILOGB0; if x is infinite they compute the value INT_MAX; if x is
12600  a NaN they compute the value FP_ILOGBNAN; otherwise, they are equivalent to calling
12601  the corresponding logb function and casting the returned value to type int. A domain
12602  error or range error may occur if x is zero, infinite, or NaN. If the correct value is outside
12603  the range of the return type, the numeric result is unspecified.
12604 <h6>Returns</h6>
12605 <p><!--para 3 -->
12606  The ilogb functions return the exponent of x as a signed int value.
12607 <p><b> Forward references</b>: the logb functions (<a href="#7.12.6.11">7.12.6.11</a>).
12608
12609 <h5><a name="7.12.6.6" href="#7.12.6.6">7.12.6.6 The ldexp functions</a></h5>
12610 <h6>Synopsis</h6>
12611 <p><!--para 1 -->
12612 <pre>
12613          #include <a href="#7.12">&lt;math.h&gt;</a>
12614          double ldexp(double x, int exp);
12615          float ldexpf(float x, int exp);
12616          long double ldexpl(long double x, int exp);
12617 </pre>
12618 <h6>Description</h6>
12619 <p><!--para 2 -->
12620  The ldexp functions multiply a floating-point number by an integral power of 2. A
12621  range error may occur.
12622 <h6>Returns</h6>
12623 <p><!--para 3 -->
12624  The ldexp functions return x x 2exp .
12625
12626 <h5><a name="7.12.6.7" href="#7.12.6.7">7.12.6.7 The log functions</a></h5>
12627 <h6>Synopsis</h6>
12628 <p><!--para 1 -->
12629 <!--page 262 -->
12630 <pre>
12631          #include <a href="#7.12">&lt;math.h&gt;</a>
12632          double log(double x);
12633          float logf(float x);
12634          long double logl(long double x);
12635 </pre>
12636 <h6>Description</h6>
12637 <p><!--para 2 -->
12638  The log functions compute the base-e (natural) logarithm of x. A domain error occurs if
12639  the argument is negative. A pole error may occur if the argument is zero.
12640 <h6>Returns</h6>
12641 <p><!--para 3 -->
12642  The log functions return loge x.
12643
12644 <h5><a name="7.12.6.8" href="#7.12.6.8">7.12.6.8 The log10 functions</a></h5>
12645 <h6>Synopsis</h6>
12646 <p><!--para 1 -->
12647 <pre>
12648          #include <a href="#7.12">&lt;math.h&gt;</a>
12649          double log10(double x);
12650          float log10f(float x);
12651          long double log10l(long double x);
12652 </pre>
12653 <h6>Description</h6>
12654 <p><!--para 2 -->
12655  The log10 functions compute the base-10 (common) logarithm of x. A domain error
12656  occurs if the argument is negative. A pole error may occur if the argument is zero.
12657 <h6>Returns</h6>
12658 <p><!--para 3 -->
12659  The log10 functions return log10 x.
12660
12661 <h5><a name="7.12.6.9" href="#7.12.6.9">7.12.6.9 The log1p functions</a></h5>
12662 <h6>Synopsis</h6>
12663 <p><!--para 1 -->
12664 <pre>
12665          #include <a href="#7.12">&lt;math.h&gt;</a>
12666          double log1p(double x);
12667          float log1pf(float x);
12668          long double log1pl(long double x);
12669 </pre>
12670 <h6>Description</h6>
12671 <p><!--para 2 -->
12672  The log1p functions compute the base-e (natural) logarithm of 1 plus the argument.<sup><a href="#note235"><b>235)</b></a></sup>
12673  A domain error occurs if the argument is less than -1. A pole error may occur if the
12674  argument equals -1.
12675 <h6>Returns</h6>
12676 <p><!--para 3 -->
12677  The log1p functions return loge (1 + x).
12678  
12679  
12680  
12681  
12682 <!--page 263 -->
12683
12684 <h6>footnotes</h6>
12685 <p><small><a name="note235" href="#note235">235)</a> For small magnitude x, log1p(x) is expected to be more accurate than log(1 + x).
12686 </small>
12687
12688 <h5><a name="7.12.6.10" href="#7.12.6.10">7.12.6.10 The log2 functions</a></h5>
12689 <h6>Synopsis</h6>
12690 <p><!--para 1 -->
12691 <pre>
12692          #include <a href="#7.12">&lt;math.h&gt;</a>
12693          double log2(double x);
12694          float log2f(float x);
12695          long double log2l(long double x);
12696 </pre>
12697 <h6>Description</h6>
12698 <p><!--para 2 -->
12699  The log2 functions compute the base-2 logarithm of x. A domain error occurs if the
12700  argument is less than zero. A pole error may occur if the argument is zero.
12701 <h6>Returns</h6>
12702 <p><!--para 3 -->
12703  The log2 functions return log2 x.
12704
12705 <h5><a name="7.12.6.11" href="#7.12.6.11">7.12.6.11 The logb functions</a></h5>
12706 <h6>Synopsis</h6>
12707 <p><!--para 1 -->
12708 <pre>
12709          #include <a href="#7.12">&lt;math.h&gt;</a>
12710          double logb(double x);
12711          float logbf(float x);
12712          long double logbl(long double x);
12713 </pre>
12714 <h6>Description</h6>
12715 <p><!--para 2 -->
12716  The logb functions extract the exponent of x, as a signed integer value in floating-point
12717  format. If x is subnormal it is treated as though it were normalized; thus, for positive
12718  finite x,
12719 <pre>
12720        1 &lt;= x x FLT_RADIX-logb(x) &lt; FLT_RADIX
12721 </pre>
12722  A domain error or pole error may occur if the argument is zero.
12723 <h6>Returns</h6>
12724 <p><!--para 3 -->
12725  The logb functions return the signed exponent of x.
12726
12727 <h5><a name="7.12.6.12" href="#7.12.6.12">7.12.6.12 The modf functions</a></h5>
12728 <h6>Synopsis</h6>
12729 <p><!--para 1 -->
12730 <pre>
12731          #include <a href="#7.12">&lt;math.h&gt;</a>
12732          double modf(double value, double *iptr);
12733          float modff(float value, float *iptr);
12734          long double modfl(long double value, long double *iptr);
12735 </pre>
12736 <h6>Description</h6>
12737 <p><!--para 2 -->
12738  The modf functions break the argument value into integral and fractional parts, each of
12739  which has the same type and sign as the argument. They store the integral part (in
12740 <!--page 264 -->
12741  floating-point format) in the object pointed to by iptr.
12742 <h6>Returns</h6>
12743 <p><!--para 3 -->
12744  The modf functions return the signed fractional part of value.
12745
12746 <h5><a name="7.12.6.13" href="#7.12.6.13">7.12.6.13 The scalbn and scalbln functions</a></h5>
12747 <h6>Synopsis</h6>
12748 <p><!--para 1 -->
12749 <pre>
12750         #include <a href="#7.12">&lt;math.h&gt;</a>
12751         double scalbn(double x, int n);
12752         float scalbnf(float x, int n);
12753         long double scalbnl(long double x, int n);
12754         double scalbln(double x, long int n);
12755         float scalblnf(float x, long int n);
12756         long double scalblnl(long double x, long int n);
12757 </pre>
12758 <h6>Description</h6>
12759 <p><!--para 2 -->
12760  The scalbn and scalbln functions compute x x FLT_RADIXn efficiently, not
12761  normally by computing FLT_RADIXn explicitly. A range error may occur.
12762 <h6>Returns</h6>
12763 <p><!--para 3 -->
12764  The scalbn and scalbln functions return x x FLT_RADIXn .
12765
12766 <h4><a name="7.12.7" href="#7.12.7">7.12.7 Power and absolute-value functions</a></h4>
12767
12768 <h5><a name="7.12.7.1" href="#7.12.7.1">7.12.7.1 The cbrt functions</a></h5>
12769 <h6>Synopsis</h6>
12770 <p><!--para 1 -->
12771 <pre>
12772         #include <a href="#7.12">&lt;math.h&gt;</a>
12773         double cbrt(double x);
12774         float cbrtf(float x);
12775         long double cbrtl(long double x);
12776 </pre>
12777 <h6>Description</h6>
12778 <p><!--para 2 -->
12779  The cbrt functions compute the real cube root of x.
12780 <h6>Returns</h6>
12781 <p><!--para 3 -->
12782  The cbrt functions return x1/3 .
12783 <!--page 265 -->
12784
12785 <h5><a name="7.12.7.2" href="#7.12.7.2">7.12.7.2 The fabs functions</a></h5>
12786 <h6>Synopsis</h6>
12787 <p><!--para 1 -->
12788 <pre>
12789          #include <a href="#7.12">&lt;math.h&gt;</a>
12790          double fabs(double x);
12791          float fabsf(float x);
12792          long double fabsl(long double x);
12793 </pre>
12794 <h6>Description</h6>
12795 <p><!--para 2 -->
12796  The fabs functions compute the absolute value of a floating-point number x.
12797 <h6>Returns</h6>
12798 <p><!--para 3 -->
12799  The fabs functions return | x |.
12800
12801 <h5><a name="7.12.7.3" href="#7.12.7.3">7.12.7.3 The hypot functions</a></h5>
12802 <h6>Synopsis</h6>
12803 <p><!--para 1 -->
12804 <pre>
12805          #include <a href="#7.12">&lt;math.h&gt;</a>
12806          double hypot(double x, double y);
12807          float hypotf(float x, float y);
12808          long double hypotl(long double x, long double y);
12809 </pre>
12810 <h6>Description</h6>
12811 <p><!--para 2 -->
12812  The hypot functions compute the square root of the sum of the squares of x and y,
12813  without undue overflow or underflow. A range error may occur.
12814 <p><!--para 3 -->
12815 <h6>Returns</h6>
12816 <p><!--para 4 -->
12817  The hypot functions return (sqrt)x2 + y2 .
12818 <pre>
12819                             -
12820                             -----
12821 </pre>
12822
12823 <h5><a name="7.12.7.4" href="#7.12.7.4">7.12.7.4 The pow functions</a></h5>
12824 <h6>Synopsis</h6>
12825 <p><!--para 1 -->
12826 <pre>
12827          #include <a href="#7.12">&lt;math.h&gt;</a>
12828          double pow(double x, double y);
12829          float powf(float x, float y);
12830          long double powl(long double x, long double y);
12831 </pre>
12832 <h6>Description</h6>
12833 <p><!--para 2 -->
12834  The pow functions compute x raised to the power y. A domain error occurs if x is finite
12835  and negative and y is finite and not an integer value. A range error may occur. A domain
12836  error may occur if x is zero and y is zero. A domain error or pole error may occur if x is
12837  zero and y is less than zero.
12838 <!--page 266 -->
12839 <h6>Returns</h6>
12840 <p><!--para 3 -->
12841  The pow functions return xy .
12842
12843 <h5><a name="7.12.7.5" href="#7.12.7.5">7.12.7.5 The sqrt functions</a></h5>
12844 <h6>Synopsis</h6>
12845 <p><!--para 1 -->
12846 <pre>
12847         #include <a href="#7.12">&lt;math.h&gt;</a>
12848         double sqrt(double x);
12849         float sqrtf(float x);
12850         long double sqrtl(long double x);
12851 </pre>
12852 <h6>Description</h6>
12853 <p><!--para 2 -->
12854  The sqrt functions compute the nonnegative square root of x. A domain error occurs if
12855  the argument is less than zero.
12856 <h6>Returns</h6>
12857 <p><!--para 3 -->
12858  The sqrt functions return (sqrt)x.
12859 <pre>
12860                            -
12861                            -
12862 </pre>
12863
12864 <h4><a name="7.12.8" href="#7.12.8">7.12.8 Error and gamma functions</a></h4>
12865
12866 <h5><a name="7.12.8.1" href="#7.12.8.1">7.12.8.1 The erf functions</a></h5>
12867 <h6>Synopsis</h6>
12868 <p><!--para 1 -->
12869 <pre>
12870         #include <a href="#7.12">&lt;math.h&gt;</a>
12871         double erf(double x);
12872         float erff(float x);
12873         long double erfl(long double x);
12874 </pre>
12875 <h6>Description</h6>
12876 <p><!--para 2 -->
12877  The erf functions compute the error function of x.
12878 <h6>Returns</h6>
12879 <p><!--para 3 -->
12880 <pre>
12881                                     2        x
12882                                          (integral)       e-t dt.
12883                                                    2
12884 </pre>
12885  The erf functions return erf x =
12886 <pre>
12887                                     (sqrt)pi
12888                                     -
12889                                     -    0
12890 </pre>
12891  
12892
12893 <h5><a name="7.12.8.2" href="#7.12.8.2">7.12.8.2 The erfc functions</a></h5>
12894 <h6>Synopsis</h6>
12895 <p><!--para 1 -->
12896 <pre>
12897         #include <a href="#7.12">&lt;math.h&gt;</a>
12898         double erfc(double x);
12899         float erfcf(float x);
12900         long double erfcl(long double x);
12901 </pre>
12902 <h6>Description</h6>
12903 <p><!--para 2 -->
12904  The erfc functions compute the complementary error function of x. A range error
12905  occurs if x is too large.
12906 <!--page 267 -->
12907 <h6>Returns</h6>
12908 <p><!--para 3 -->
12909 <pre>
12910                                                      2       (inf)
12911                                                          (integral)       e-t dt.
12912                                                                    2
12913 </pre>
12914  The erfc functions return erfc x = 1 - erf x =
12915 <pre>
12916                                                   (sqrt)pi
12917                                                   -
12918                                                   -      x
12919 </pre>
12920  
12921
12922 <h5><a name="7.12.8.3" href="#7.12.8.3">7.12.8.3 The lgamma functions</a></h5>
12923 <h6>Synopsis</h6>
12924 <p><!--para 1 -->
12925 <pre>
12926          #include <a href="#7.12">&lt;math.h&gt;</a>
12927          double lgamma(double x);
12928          float lgammaf(float x);
12929          long double lgammal(long double x);
12930 </pre>
12931 <h6>Description</h6>
12932 <p><!--para 2 -->
12933  The lgamma functions compute the natural logarithm of the absolute value of gamma of
12934  x. A range error occurs if x is too large. A pole error may occur if x is a negative integer
12935  or zero.
12936 <h6>Returns</h6>
12937 <p><!--para 3 -->
12938  The lgamma functions return loge | (Gamma)(x) |.
12939
12940 <h5><a name="7.12.8.4" href="#7.12.8.4">7.12.8.4 The tgamma functions</a></h5>
12941 <h6>Synopsis</h6>
12942 <p><!--para 1 -->
12943 <pre>
12944          #include <a href="#7.12">&lt;math.h&gt;</a>
12945          double tgamma(double x);
12946          float tgammaf(float x);
12947          long double tgammal(long double x);
12948 </pre>
12949 <h6>Description</h6>
12950 <p><!--para 2 -->
12951  The tgamma functions compute the gamma function of x. A domain error or pole error
12952  may occur if x is a negative integer or zero. A range error occurs if the magnitude of x is
12953  too large and may occur if the magnitude of x is too small.
12954 <h6>Returns</h6>
12955 <p><!--para 3 -->
12956  The tgamma functions return (Gamma)(x).
12957 <!--page 268 -->
12958
12959 <h4><a name="7.12.9" href="#7.12.9">7.12.9 Nearest integer functions</a></h4>
12960
12961 <h5><a name="7.12.9.1" href="#7.12.9.1">7.12.9.1 The ceil functions</a></h5>
12962 <h6>Synopsis</h6>
12963 <p><!--para 1 -->
12964 <pre>
12965         #include <a href="#7.12">&lt;math.h&gt;</a>
12966         double ceil(double x);
12967         float ceilf(float x);
12968         long double ceill(long double x);
12969 </pre>
12970 <h6>Description</h6>
12971 <p><!--para 2 -->
12972  The ceil functions compute the smallest integer value not less than x.
12973 <h6>Returns</h6>
12974 <p><!--para 3 -->
12975  The ceil functions return [^x^], expressed as a floating-point number.
12976
12977 <h5><a name="7.12.9.2" href="#7.12.9.2">7.12.9.2 The floor functions</a></h5>
12978 <h6>Synopsis</h6>
12979 <p><!--para 1 -->
12980 <pre>
12981         #include <a href="#7.12">&lt;math.h&gt;</a>
12982         double floor(double x);
12983         float floorf(float x);
12984         long double floorl(long double x);
12985 </pre>
12986 <h6>Description</h6>
12987 <p><!--para 2 -->
12988  The floor functions compute the largest integer value not greater than x.
12989 <h6>Returns</h6>
12990 <p><!--para 3 -->
12991  The floor functions return [_x_], expressed as a floating-point number.
12992
12993 <h5><a name="7.12.9.3" href="#7.12.9.3">7.12.9.3 The nearbyint functions</a></h5>
12994 <h6>Synopsis</h6>
12995 <p><!--para 1 -->
12996 <pre>
12997         #include <a href="#7.12">&lt;math.h&gt;</a>
12998         double nearbyint(double x);
12999         float nearbyintf(float x);
13000         long double nearbyintl(long double x);
13001 </pre>
13002 <h6>Description</h6>
13003 <p><!--para 2 -->
13004  The nearbyint functions round their argument to an integer value in floating-point
13005  format, using the current rounding direction and without raising the ''inexact'' floating-
13006  point exception.
13007 <!--page 269 -->
13008 <h6>Returns</h6>
13009 <p><!--para 3 -->
13010  The nearbyint functions return the rounded integer value.
13011
13012 <h5><a name="7.12.9.4" href="#7.12.9.4">7.12.9.4 The rint functions</a></h5>
13013 <h6>Synopsis</h6>
13014 <p><!--para 1 -->
13015 <pre>
13016          #include <a href="#7.12">&lt;math.h&gt;</a>
13017          double rint(double x);
13018          float rintf(float x);
13019          long double rintl(long double x);
13020 </pre>
13021 <h6>Description</h6>
13022 <p><!--para 2 -->
13023  The rint functions differ from the nearbyint functions (<a href="#7.12.9.3">7.12.9.3</a>) only in that the
13024  rint functions may raise the ''inexact'' floating-point exception if the result differs in
13025  value from the argument.
13026 <h6>Returns</h6>
13027 <p><!--para 3 -->
13028  The rint functions return the rounded integer value.
13029
13030 <h5><a name="7.12.9.5" href="#7.12.9.5">7.12.9.5 The lrint and llrint functions</a></h5>
13031 <h6>Synopsis</h6>
13032 <p><!--para 1 -->
13033 <pre>
13034          #include <a href="#7.12">&lt;math.h&gt;</a>
13035          long int lrint(double x);
13036          long int lrintf(float x);
13037          long int lrintl(long double x);
13038          long long int llrint(double x);
13039          long long int llrintf(float x);
13040          long long int llrintl(long double x);
13041 </pre>
13042 <h6>Description</h6>
13043 <p><!--para 2 -->
13044  The lrint and llrint functions round their argument to the nearest integer value,
13045  rounding according to the current rounding direction. If the rounded value is outside the
13046  range of the return type, the numeric result is unspecified and a domain error or range
13047  error may occur.
13048 <h6>Returns</h6>
13049 <p><!--para 3 -->
13050  The lrint and llrint functions return the rounded integer value.
13051 <!--page 270 -->
13052
13053 <h5><a name="7.12.9.6" href="#7.12.9.6">7.12.9.6 The round functions</a></h5>
13054 <h6>Synopsis</h6>
13055 <p><!--para 1 -->
13056 <pre>
13057         #include <a href="#7.12">&lt;math.h&gt;</a>
13058         double round(double x);
13059         float roundf(float x);
13060         long double roundl(long double x);
13061 </pre>
13062 <h6>Description</h6>
13063 <p><!--para 2 -->
13064  The round functions round their argument to the nearest integer value in floating-point
13065  format, rounding halfway cases away from zero, regardless of the current rounding
13066  direction.
13067 <h6>Returns</h6>
13068 <p><!--para 3 -->
13069  The round functions return the rounded integer value.
13070
13071 <h5><a name="7.12.9.7" href="#7.12.9.7">7.12.9.7 The lround and llround functions</a></h5>
13072 <h6>Synopsis</h6>
13073 <p><!--para 1 -->
13074 <pre>
13075         #include <a href="#7.12">&lt;math.h&gt;</a>
13076         long int lround(double x);
13077         long int lroundf(float x);
13078         long int lroundl(long double x);
13079         long long int llround(double x);
13080         long long int llroundf(float x);
13081         long long int llroundl(long double x);
13082 </pre>
13083 <h6>Description</h6>
13084 <p><!--para 2 -->
13085  The lround and llround functions round their argument to the nearest integer value,
13086  rounding halfway cases away from zero, regardless of the current rounding direction. If
13087  the rounded value is outside the range of the return type, the numeric result is unspecified
13088  and a domain error or range error may occur.
13089 <h6>Returns</h6>
13090 <p><!--para 3 -->
13091  The lround and llround functions return the rounded integer value.
13092
13093 <h5><a name="7.12.9.8" href="#7.12.9.8">7.12.9.8 The trunc functions</a></h5>
13094 <h6>Synopsis</h6>
13095 <p><!--para 1 -->
13096 <!--page 271 -->
13097 <pre>
13098         #include <a href="#7.12">&lt;math.h&gt;</a>
13099         double trunc(double x);
13100         float truncf(float x);
13101         long double truncl(long double x);
13102 </pre>
13103 <h6>Description</h6>
13104 <p><!--para 2 -->
13105  The trunc functions round their argument to the integer value, in floating format,
13106  nearest to but no larger in magnitude than the argument.
13107 <h6>Returns</h6>
13108 <p><!--para 3 -->
13109  The trunc functions return the truncated integer value.
13110
13111 <h4><a name="7.12.10" href="#7.12.10">7.12.10 Remainder functions</a></h4>
13112
13113 <h5><a name="7.12.10.1" href="#7.12.10.1">7.12.10.1 The fmod functions</a></h5>
13114 <h6>Synopsis</h6>
13115 <p><!--para 1 -->
13116 <pre>
13117           #include <a href="#7.12">&lt;math.h&gt;</a>
13118           double fmod(double x, double y);
13119           float fmodf(float x, float y);
13120           long double fmodl(long double x, long double y);
13121 </pre>
13122 <h6>Description</h6>
13123 <p><!--para 2 -->
13124  The fmod functions compute the floating-point remainder of x/y.
13125 <h6>Returns</h6>
13126 <p><!--para 3 -->
13127  The fmod functions return the value x - ny, for some integer n such that, if y is nonzero,
13128  the result has the same sign as x and magnitude less than the magnitude of y. If y is zero,
13129  whether a domain error occurs or the fmod functions return zero is implementation-
13130  defined.
13131
13132 <h5><a name="7.12.10.2" href="#7.12.10.2">7.12.10.2 The remainder functions</a></h5>
13133 <h6>Synopsis</h6>
13134 <p><!--para 1 -->
13135 <pre>
13136           #include <a href="#7.12">&lt;math.h&gt;</a>
13137           double remainder(double x, double y);
13138           float remainderf(float x, float y);
13139           long double remainderl(long double x, long double y);
13140 </pre>
13141 <h6>Description</h6>
13142 <p><!--para 2 -->
13143  The remainder functions compute the remainder x REM y required by IEC 60559.<sup><a href="#note236"><b>236)</b></a></sup>
13144  
13145  
13146  
13147  
13148 <!--page 272 -->
13149 <h6>Returns</h6>
13150 <p><!--para 3 -->
13151  The remainder functions return x REM y. If y is zero, whether a domain error occurs
13152  or the functions return zero is implementation defined.
13153
13154 <h6>footnotes</h6>
13155 <p><small><a name="note236" href="#note236">236)</a> ''When y != 0, the remainder r = x REM y is defined regardless of the rounding mode by the
13156  mathematical relation r = x - ny, where n is the integer nearest the exact value of x/y; whenever
13157  | n - x/y | = 1/2, then n is even. If r = 0, its sign shall be that of x.'' This definition is applicable for *
13158  all implementations.
13159 </small>
13160
13161 <h5><a name="7.12.10.3" href="#7.12.10.3">7.12.10.3 The remquo functions</a></h5>
13162 <h6>Synopsis</h6>
13163 <p><!--para 1 -->
13164 <pre>
13165         #include <a href="#7.12">&lt;math.h&gt;</a>
13166         double remquo(double x, double y, int *quo);
13167         float remquof(float x, float y, int *quo);
13168         long double remquol(long double x, long double y,
13169              int *quo);
13170 </pre>
13171 <h6>Description</h6>
13172 <p><!--para 2 -->
13173  The remquo functions compute the same remainder as the remainder functions. In
13174  the object pointed to by quo they store a value whose sign is the sign of x/y and whose
13175  magnitude is congruent modulo 2n to the magnitude of the integral quotient of x/y, where
13176  n is an implementation-defined integer greater than or equal to 3.
13177 <h6>Returns</h6>
13178 <p><!--para 3 -->
13179  The remquo functions return x REM y. If y is zero, the value stored in the object
13180  pointed to by quo is unspecified and whether a domain error occurs or the functions
13181  return zero is implementation defined.
13182
13183 <h4><a name="7.12.11" href="#7.12.11">7.12.11 Manipulation functions</a></h4>
13184
13185 <h5><a name="7.12.11.1" href="#7.12.11.1">7.12.11.1 The copysign functions</a></h5>
13186 <h6>Synopsis</h6>
13187 <p><!--para 1 -->
13188 <pre>
13189         #include <a href="#7.12">&lt;math.h&gt;</a>
13190         double copysign(double x, double y);
13191         float copysignf(float x, float y);
13192         long double copysignl(long double x, long double y);
13193 </pre>
13194 <h6>Description</h6>
13195 <p><!--para 2 -->
13196  The copysign functions produce a value with the magnitude of x and the sign of y.
13197  They produce a NaN (with the sign of y) if x is a NaN. On implementations that
13198  represent a signed zero but do not treat negative zero consistently in arithmetic
13199  operations, the copysign functions regard the sign of zero as positive.
13200 <h6>Returns</h6>
13201 <p><!--para 3 -->
13202  The copysign functions return a value with the magnitude of x and the sign of y.
13203 <!--page 273 -->
13204
13205 <h5><a name="7.12.11.2" href="#7.12.11.2">7.12.11.2 The nan functions</a></h5>
13206 <h6>Synopsis</h6>
13207 <p><!--para 1 -->
13208 <pre>
13209          #include <a href="#7.12">&lt;math.h&gt;</a>
13210          double nan(const char *tagp);
13211          float nanf(const char *tagp);
13212          long double nanl(const char *tagp);
13213 </pre>
13214 <h6>Description</h6>
13215 <p><!--para 2 -->
13216  The call nan("n-char-sequence") is equivalent to strtod("NAN(n-char-
13217  sequence)",     (char**)       NULL); the call nan("") is equivalent to
13218  strtod("NAN()", (char**) NULL). If tagp does not point to an n-char
13219  sequence or an empty string, the call is equivalent to strtod("NAN", (char**)
13220  NULL). Calls to nanf and nanl are equivalent to the corresponding calls to strtof
13221  and strtold.
13222 <h6>Returns</h6>
13223 <p><!--para 3 -->
13224  The nan functions return a quiet NaN, if available, with content indicated through tagp.
13225  If the implementation does not support quiet NaNs, the functions return zero.
13226 <p><b> Forward references</b>: the strtod, strtof, and strtold functions (<a href="#7.22.1.3">7.22.1.3</a>).
13227
13228 <h5><a name="7.12.11.3" href="#7.12.11.3">7.12.11.3 The nextafter functions</a></h5>
13229 <h6>Synopsis</h6>
13230 <p><!--para 1 -->
13231 <pre>
13232          #include <a href="#7.12">&lt;math.h&gt;</a>
13233          double nextafter(double x, double y);
13234          float nextafterf(float x, float y);
13235          long double nextafterl(long double x, long double y);
13236 </pre>
13237 <h6>Description</h6>
13238 <p><!--para 2 -->
13239  The nextafter functions determine the next representable value, in the type of the
13240  function, after x in the direction of y, where x and y are first converted to the type of the
13241  function.<sup><a href="#note237"><b>237)</b></a></sup> The nextafter functions return y if x equals y. A range error may occur
13242  if the magnitude of x is the largest finite value representable in the type and the result is
13243  infinite or not representable in the type.
13244 <h6>Returns</h6>
13245 <p><!--para 3 -->
13246  The nextafter functions return the next representable value in the specified format
13247  after x in the direction of y.
13248  
13249  
13250 <!--page 274 -->
13251
13252 <h6>footnotes</h6>
13253 <p><small><a name="note237" href="#note237">237)</a> The argument values are converted to the type of the function, even by a macro implementation of the
13254  function.
13255 </small>
13256
13257 <h5><a name="7.12.11.4" href="#7.12.11.4">7.12.11.4 The nexttoward functions</a></h5>
13258 <h6>Synopsis</h6>
13259 <p><!--para 1 -->
13260 <pre>
13261          #include <a href="#7.12">&lt;math.h&gt;</a>
13262          double nexttoward(double x, long double y);
13263          float nexttowardf(float x, long double y);
13264          long double nexttowardl(long double x, long double y);
13265 </pre>
13266 <h6>Description</h6>
13267 <p><!--para 2 -->
13268  The nexttoward functions are equivalent to the nextafter functions except that the
13269  second parameter has type long double and the functions return y converted to the
13270  type of the function if x equals y.<sup><a href="#note238"><b>238)</b></a></sup>
13271
13272 <h6>footnotes</h6>
13273 <p><small><a name="note238" href="#note238">238)</a> The result of the nexttoward functions is determined in the type of the function, without loss of
13274  range or precision in a floating second argument.
13275 </small>
13276
13277 <h4><a name="7.12.12" href="#7.12.12">7.12.12 Maximum, minimum, and positive difference functions</a></h4>
13278
13279 <h5><a name="7.12.12.1" href="#7.12.12.1">7.12.12.1 The fdim functions</a></h5>
13280 <h6>Synopsis</h6>
13281 <p><!--para 1 -->
13282 <pre>
13283          #include <a href="#7.12">&lt;math.h&gt;</a>
13284          double fdim(double x, double y);
13285          float fdimf(float x, float y);
13286          long double fdiml(long double x, long double y);
13287 </pre>
13288 <h6>Description</h6>
13289 <p><!--para 2 -->
13290  The fdim functions determine the positive difference between their arguments:
13291 <pre>
13292        {x - y if x &gt; y
13293        {
13294        {+0     if x &lt;= y
13295 </pre>
13296  A range error may occur.
13297 <h6>Returns</h6>
13298 <p><!--para 3 -->
13299  The fdim functions return the positive difference value.
13300
13301 <h5><a name="7.12.12.2" href="#7.12.12.2">7.12.12.2 The fmax functions</a></h5>
13302 <h6>Synopsis</h6>
13303 <p><!--para 1 -->
13304 <pre>
13305          #include <a href="#7.12">&lt;math.h&gt;</a>
13306          double fmax(double x, double y);
13307          float fmaxf(float x, float y);
13308          long double fmaxl(long double x, long double y);
13309 </pre>
13310  
13311  
13312  
13313 <!--page 275 -->
13314 <h6>Description</h6>
13315 <p><!--para 2 -->
13316  The fmax functions determine the maximum numeric value of their arguments.<sup><a href="#note239"><b>239)</b></a></sup>
13317 <h6>Returns</h6>
13318 <p><!--para 3 -->
13319  The fmax functions return the maximum numeric value of their arguments.
13320
13321 <h6>footnotes</h6>
13322 <p><small><a name="note239" href="#note239">239)</a> NaN arguments are treated as missing data: if one argument is a NaN and the other numeric, then the
13323  fmax functions choose the numeric value. See <a href="#F.10.9.2">F.10.9.2</a>.
13324 </small>
13325
13326 <h5><a name="7.12.12.3" href="#7.12.12.3">7.12.12.3 The fmin functions</a></h5>
13327 <h6>Synopsis</h6>
13328 <p><!--para 1 -->
13329 <pre>
13330          #include <a href="#7.12">&lt;math.h&gt;</a>
13331          double fmin(double x, double y);
13332          float fminf(float x, float y);
13333          long double fminl(long double x, long double y);
13334 </pre>
13335 <h6>Description</h6>
13336 <p><!--para 2 -->
13337  The fmin functions determine the minimum numeric value of their arguments.<sup><a href="#note240"><b>240)</b></a></sup>
13338 <h6>Returns</h6>
13339 <p><!--para 3 -->
13340  The fmin functions return the minimum numeric value of their arguments.
13341
13342 <h6>footnotes</h6>
13343 <p><small><a name="note240" href="#note240">240)</a> The fmin functions are analogous to the fmax functions in their treatment of NaNs.
13344 </small>
13345
13346 <h4><a name="7.12.13" href="#7.12.13">7.12.13 Floating multiply-add</a></h4>
13347
13348 <h5><a name="7.12.13.1" href="#7.12.13.1">7.12.13.1 The fma functions</a></h5>
13349 <h6>Synopsis</h6>
13350 <p><!--para 1 -->
13351 <pre>
13352          #include <a href="#7.12">&lt;math.h&gt;</a>
13353          double fma(double x, double y, double z);
13354          float fmaf(float x, float y, float z);
13355          long double fmal(long double x, long double y,
13356               long double z);
13357 </pre>
13358 <h6>Description</h6>
13359 <p><!--para 2 -->
13360  The fma functions compute (x x y) + z, rounded as one ternary operation: they compute
13361  the value (as if) to infinite precision and round once to the result format, according to the
13362  current rounding mode. A range error may occur.
13363 <h6>Returns</h6>
13364 <p><!--para 3 -->
13365  The fma functions return (x x y) + z, rounded as one ternary operation.
13366  
13367  
13368  
13369  
13370 <!--page 276 -->
13371
13372 <h4><a name="7.12.14" href="#7.12.14">7.12.14 Comparison macros</a></h4>
13373 <p><!--para 1 -->
13374  The relational and equality operators support the usual mathematical relationships
13375  between numeric values. For any ordered pair of numeric values exactly one of the
13376  relationships -- less, greater, and equal -- is true. Relational operators may raise the
13377  ''invalid'' floating-point exception when argument values are NaNs. For a NaN and a
13378  numeric value, or for two NaNs, just the unordered relationship is true.<sup><a href="#note241"><b>241)</b></a></sup> The following
13379  subclauses provide macros that are quiet (non floating-point exception raising) versions
13380  of the relational operators, and other comparison macros that facilitate writing efficient
13381  code that accounts for NaNs without suffering the ''invalid'' floating-point exception. In
13382  the synopses in this subclause, real-floating indicates that the argument shall be an
13383  expression of real floating type<sup><a href="#note242"><b>242)</b></a></sup> (both arguments need not have the same type).<sup><a href="#note243"><b>243)</b></a></sup>
13384
13385 <h6>footnotes</h6>
13386 <p><small><a name="note241" href="#note241">241)</a> IEC 60559 requires that the built-in relational operators raise the ''invalid'' floating-point exception if
13387  the operands compare unordered, as an error indicator for programs written without consideration of
13388  NaNs; the result in these cases is false.
13389 </small>
13390 <p><small><a name="note242" href="#note242">242)</a> If any argument is of integer type, or any other type that is not a real floating type, the behavior is
13391  undefined.
13392 </small>
13393 <p><small><a name="note243" href="#note243">243)</a> Whether an argument represented in a format wider than its semantic type is converted to the semantic
13394  type is unspecified.
13395 </small>
13396
13397 <h5><a name="7.12.14.1" href="#7.12.14.1">7.12.14.1 The isgreater macro</a></h5>
13398 <h6>Synopsis</h6>
13399 <p><!--para 1 -->
13400 <pre>
13401           #include <a href="#7.12">&lt;math.h&gt;</a>
13402           int isgreater(real-floating x, real-floating y);
13403 </pre>
13404 <h6>Description</h6>
13405 <p><!--para 2 -->
13406  The isgreater macro determines whether its first argument is greater than its second
13407  argument. The value of isgreater(x, y) is always equal to (x) &gt; (y); however,
13408  unlike (x) &gt; (y), isgreater(x, y) does not raise the ''invalid'' floating-point
13409  exception when x and y are unordered.
13410 <h6>Returns</h6>
13411 <p><!--para 3 -->
13412  The isgreater macro returns the value of (x) &gt; (y).
13413
13414 <h5><a name="7.12.14.2" href="#7.12.14.2">7.12.14.2 The isgreaterequal macro</a></h5>
13415 <h6>Synopsis</h6>
13416 <p><!--para 1 -->
13417 <pre>
13418           #include <a href="#7.12">&lt;math.h&gt;</a>
13419           int isgreaterequal(real-floating x, real-floating y);
13420 </pre>
13421  
13422  
13423  
13424  
13425 <!--page 277 -->
13426 <h6>Description</h6>
13427 <p><!--para 2 -->
13428  The isgreaterequal macro determines whether its first argument is greater than or
13429  equal to its second argument. The value of isgreaterequal(x, y) is always equal
13430  to (x) &gt;= (y); however, unlike (x) &gt;= (y), isgreaterequal(x, y) does
13431  not raise the ''invalid'' floating-point exception when x and y are unordered.
13432 <h6>Returns</h6>
13433 <p><!--para 3 -->
13434  The isgreaterequal macro returns the value of (x) &gt;= (y).
13435
13436 <h5><a name="7.12.14.3" href="#7.12.14.3">7.12.14.3 The isless macro</a></h5>
13437 <h6>Synopsis</h6>
13438 <p><!--para 1 -->
13439 <pre>
13440          #include <a href="#7.12">&lt;math.h&gt;</a>
13441          int isless(real-floating x, real-floating y);
13442 </pre>
13443 <h6>Description</h6>
13444 <p><!--para 2 -->
13445  The isless macro determines whether its first argument is less than its second
13446  argument. The value of isless(x, y) is always equal to (x) &lt; (y); however,
13447  unlike (x) &lt; (y), isless(x, y) does not raise the ''invalid'' floating-point
13448  exception when x and y are unordered.
13449 <h6>Returns</h6>
13450 <p><!--para 3 -->
13451  The isless macro returns the value of (x) &lt; (y).
13452
13453 <h5><a name="7.12.14.4" href="#7.12.14.4">7.12.14.4 The islessequal macro</a></h5>
13454 <h6>Synopsis</h6>
13455 <p><!--para 1 -->
13456 <pre>
13457          #include <a href="#7.12">&lt;math.h&gt;</a>
13458          int islessequal(real-floating x, real-floating y);
13459 </pre>
13460 <h6>Description</h6>
13461 <p><!--para 2 -->
13462  The islessequal macro determines whether its first argument is less than or equal to
13463  its second argument. The value of islessequal(x, y) is always equal to
13464  (x) &lt;= (y); however, unlike (x) &lt;= (y), islessequal(x, y) does not raise
13465  the ''invalid'' floating-point exception when x and y are unordered.
13466 <h6>Returns</h6>
13467 <p><!--para 3 -->
13468  The islessequal macro returns the value of (x) &lt;= (y).
13469 <!--page 278 -->
13470
13471 <h5><a name="7.12.14.5" href="#7.12.14.5">7.12.14.5 The islessgreater macro</a></h5>
13472 <h6>Synopsis</h6>
13473 <p><!--para 1 -->
13474 <pre>
13475         #include <a href="#7.12">&lt;math.h&gt;</a>
13476         int islessgreater(real-floating x, real-floating y);
13477 </pre>
13478 <h6>Description</h6>
13479 <p><!--para 2 -->
13480  The islessgreater macro determines whether its first argument is less than or
13481  greater than its second argument. The islessgreater(x, y) macro is similar to
13482  (x) &lt; (y) || (x) &gt; (y); however, islessgreater(x, y) does not raise
13483  the ''invalid'' floating-point exception when x and y are unordered (nor does it evaluate x
13484  and y twice).
13485 <h6>Returns</h6>
13486 <p><!--para 3 -->
13487  The islessgreater macro returns the value of (x) &lt; (y) || (x) &gt; (y).
13488
13489 <h5><a name="7.12.14.6" href="#7.12.14.6">7.12.14.6 The isunordered macro</a></h5>
13490 <h6>Synopsis</h6>
13491 <p><!--para 1 -->
13492 <pre>
13493         #include <a href="#7.12">&lt;math.h&gt;</a>
13494         int isunordered(real-floating x, real-floating y);
13495 </pre>
13496 <h6>Description</h6>
13497 <p><!--para 2 -->
13498  The isunordered macro determines whether its arguments are unordered.
13499 <h6>Returns</h6>
13500 <p><!--para 3 -->
13501  The isunordered macro returns 1 if its arguments are unordered and 0 otherwise.
13502 <!--page 279 -->
13503
13504 <h3><a name="7.13" href="#7.13">7.13 Nonlocal jumps <setjmp.h></a></h3>
13505 <p><!--para 1 -->
13506  The header <a href="#7.13">&lt;setjmp.h&gt;</a> defines the macro setjmp, and declares one function and
13507  one type, for bypassing the normal function call and return discipline.<sup><a href="#note244"><b>244)</b></a></sup>
13508 <p><!--para 2 -->
13509  The type declared is
13510 <pre>
13511          jmp_buf
13512 </pre>
13513  which is an array type suitable for holding the information needed to restore a calling
13514  environment. The environment of a call to the setjmp macro consists of information
13515  sufficient for a call to the longjmp function to return execution to the correct block and
13516  invocation of that block, were it called recursively. It does not include the state of the
13517  floating-point status flags, of open files, or of any other component of the abstract
13518  machine.
13519 <p><!--para 3 -->
13520  It is unspecified whether setjmp is a macro or an identifier declared with external
13521  linkage. If a macro definition is suppressed in order to access an actual function, or a
13522  program defines an external identifier with the name setjmp, the behavior is undefined.
13523
13524 <h6>footnotes</h6>
13525 <p><small><a name="note244" href="#note244">244)</a> These functions are useful for dealing with unusual conditions encountered in a low-level function of
13526  a program.
13527 </small>
13528
13529 <h4><a name="7.13.1" href="#7.13.1">7.13.1 Save calling environment</a></h4>
13530
13531 <h5><a name="7.13.1.1" href="#7.13.1.1">7.13.1.1 The setjmp macro</a></h5>
13532 <h6>Synopsis</h6>
13533 <p><!--para 1 -->
13534 <pre>
13535          #include <a href="#7.13">&lt;setjmp.h&gt;</a>
13536          int setjmp(jmp_buf env);
13537 </pre>
13538 <h6>Description</h6>
13539 <p><!--para 2 -->
13540  The setjmp macro saves its calling environment in its jmp_buf argument for later use
13541  by the longjmp function.
13542 <h6>Returns</h6>
13543 <p><!--para 3 -->
13544  If the return is from a direct invocation, the setjmp macro returns the value zero. If the
13545  return is from a call to the longjmp function, the setjmp macro returns a nonzero
13546  value.
13547 <h6>Environmental limits</h6>
13548 <p><!--para 4 -->
13549  An invocation of the setjmp macro shall appear only in one of the following contexts:
13550 <ul>
13551 <li>  the entire controlling expression of a selection or iteration statement;
13552 <li>  one operand of a relational or equality operator with the other operand an integer
13553  constant expression, with the resulting expression being the entire controlling
13554  
13555  
13556 <!--page 280 -->
13557    expression of a selection or iteration statement;
13558 <li>  the operand of a unary ! operator with the resulting expression being the entire
13559  controlling expression of a selection or iteration statement; or
13560 <li>  the entire expression of an expression statement (possibly cast to void).
13561 </ul>
13562 <p><!--para 5 -->
13563  If the invocation appears in any other context, the behavior is undefined.
13564
13565 <h4><a name="7.13.2" href="#7.13.2">7.13.2 Restore calling environment</a></h4>
13566
13567 <h5><a name="7.13.2.1" href="#7.13.2.1">7.13.2.1 The longjmp function</a></h5>
13568 <h6>Synopsis</h6>
13569 <p><!--para 1 -->
13570 <pre>
13571           #include <a href="#7.13">&lt;setjmp.h&gt;</a>
13572           _Noreturn void longjmp(jmp_buf env, int val);
13573 </pre>
13574 <h6>Description</h6>
13575 <p><!--para 2 -->
13576  The longjmp function restores the environment saved by the most recent invocation of
13577  the setjmp macro in the same invocation of the program with the corresponding
13578  jmp_buf argument. If there has been no such invocation, or if the function containing
13579  the invocation of the setjmp macro has terminated execution<sup><a href="#note245"><b>245)</b></a></sup> in the interim, or if the
13580  invocation of the setjmp macro was within the scope of an identifier with variably
13581  modified type and execution has left that scope in the interim, the behavior is undefined.
13582 <p><!--para 3 -->
13583  All accessible objects have values, and all other components of the abstract machine<sup><a href="#note246"><b>246)</b></a></sup>
13584  have state, as of the time the longjmp function was called, except that the values of
13585  objects of automatic storage duration that are local to the function containing the
13586  invocation of the corresponding setjmp macro that do not have volatile-qualified type
13587  and have been changed between the setjmp invocation and longjmp call are
13588  indeterminate.
13589 <h6>Returns</h6>
13590 <p><!--para 4 -->
13591  After longjmp is completed, program execution continues as if the corresponding
13592  invocation of the setjmp macro had just returned the value specified by val. The
13593  longjmp function cannot cause the setjmp macro to return the value 0; if val is 0,
13594  the setjmp macro returns the value 1.
13595 <p><!--para 5 -->
13596  EXAMPLE The longjmp function that returns control back to the point of the setjmp invocation
13597  might cause memory associated with a variable length array object to be squandered.
13598  
13599  
13600  
13601  
13602 <!--page 281 -->
13603 <!--page 282 -->
13604 <pre>
13605          #include <a href="#7.13">&lt;setjmp.h&gt;</a>
13606          jmp_buf buf;
13607          void g(int n);
13608          void h(int n);
13609          int n = 6;
13610          void f(void)
13611          {
13612                int x[n];          // valid: f is not terminated
13613                setjmp(buf);
13614                g(n);
13615          }
13616          void g(int n)
13617          {
13618                int a[n];          // a may remain allocated
13619                h(n);
13620          }
13621          void h(int n)
13622          {
13623                int b[n];          // b may remain allocated
13624                longjmp(buf, 2);   // might cause memory loss
13625          }
13626 </pre>
13627
13628 <h6>footnotes</h6>
13629 <p><small><a name="note245" href="#note245">245)</a> For example, by executing a return statement or because another longjmp call has caused a
13630  transfer to a setjmp invocation in a function earlier in the set of nested calls.
13631 </small>
13632 <p><small><a name="note246" href="#note246">246)</a> This includes, but is not limited to, the floating-point status flags and the state of open files.
13633 </small>
13634
13635 <h3><a name="7.14" href="#7.14">7.14 Signal handling <signal.h></a></h3>
13636 <p><!--para 1 -->
13637  The header <a href="#7.14">&lt;signal.h&gt;</a> declares a type and two functions and defines several macros,
13638  for handling various signals (conditions that may be reported during program execution).
13639 <p><!--para 2 -->
13640  The type defined is
13641 <pre>
13642           sig_atomic_t
13643 </pre>
13644  which is the (possibly volatile-qualified) integer type of an object that can be accessed as
13645  an atomic entity, even in the presence of asynchronous interrupts.
13646 <p><!--para 3 -->
13647  The macros defined are
13648 <pre>
13649           SIG_DFL
13650           SIG_ERR
13651           SIG_IGN
13652 </pre>
13653  which expand to constant expressions with distinct values that have type compatible with
13654  the second argument to, and the return value of, the signal function, and whose values
13655  compare unequal to the address of any declarable function; and the following, which
13656  expand to positive integer constant expressions with type int and distinct values that are
13657  the signal numbers, each corresponding to the specified condition:
13658 <pre>
13659           SIGABRT abnormal termination, such as is initiated by the abort function
13660           SIGFPE        an erroneous arithmetic operation, such as zero divide or an operation
13661                         resulting in overflow
13662           SIGILL        detection of an invalid function image, such as an invalid instruction
13663           SIGINT        receipt of an interactive attention signal
13664           SIGSEGV an invalid access to storage
13665           SIGTERM a termination request sent to the program
13666 </pre>
13667 <p><!--para 4 -->
13668  An implementation need not generate any of these signals, except as a result of explicit
13669  calls to the raise function. Additional signals and pointers to undeclarable functions,
13670  with macro definitions beginning, respectively, with the letters SIG and an uppercase
13671  letter or with SIG_ and an uppercase letter,<sup><a href="#note247"><b>247)</b></a></sup> may also be specified by the
13672  implementation. The complete set of signals, their semantics, and their default handling
13673  is implementation-defined; all signal numbers shall be positive.
13674  
13675  
13676  
13677  
13678 <!--page 283 -->
13679
13680 <h6>footnotes</h6>
13681 <p><small><a name="note247" href="#note247">247)</a> See ''future library directions'' (<a href="#7.30.6">7.30.6</a>). The names of the signal numbers reflect the following terms
13682  (respectively): abort, floating-point exception, illegal instruction, interrupt, segmentation violation,
13683  and termination.
13684 </small>
13685
13686 <h4><a name="7.14.1" href="#7.14.1">7.14.1 Specify signal handling</a></h4>
13687
13688 <h5><a name="7.14.1.1" href="#7.14.1.1">7.14.1.1 The signal function</a></h5>
13689 <h6>Synopsis</h6>
13690 <p><!--para 1 -->
13691 <pre>
13692          #include <a href="#7.14">&lt;signal.h&gt;</a>
13693          void (*signal(int sig, void (*func)(int)))(int);
13694 </pre>
13695 <h6>Description</h6>
13696 <p><!--para 2 -->
13697  The signal function chooses one of three ways in which receipt of the signal number
13698  sig is to be subsequently handled. If the value of func is SIG_DFL, default handling
13699  for that signal will occur. If the value of func is SIG_IGN, the signal will be ignored.
13700  Otherwise, func shall point to a function to be called when that signal occurs. An
13701  invocation of such a function because of a signal, or (recursively) of any further functions
13702  called by that invocation (other than functions in the standard library),<sup><a href="#note248"><b>248)</b></a></sup> is called a
13703  signal handler.
13704 <p><!--para 3 -->
13705  When a signal occurs and func points to a function, it is implementation-defined
13706  whether the equivalent of signal(sig, SIG_DFL); is executed or the
13707  implementation prevents some implementation-defined set of signals (at least including
13708  sig) from occurring until the current signal handling has completed; in the case of
13709  SIGILL, the implementation may alternatively define that no action is taken. Then the
13710  equivalent of (*func)(sig); is executed. If and when the function returns, if the
13711  value of sig is SIGFPE, SIGILL, SIGSEGV, or any other implementation-defined
13712  value corresponding to a computational exception, the behavior is undefined; otherwise
13713  the program will resume execution at the point it was interrupted.
13714 <p><!--para 4 -->
13715  If the signal occurs as the result of calling the abort or raise function, the signal
13716  handler shall not call the raise function.
13717 <p><!--para 5 -->
13718  If the signal occurs other than as the result of calling the abort or raise function, the
13719  behavior is undefined if the signal handler refers to any object with static or thread
13720  storage duration that is not a lock-free atomic object other than by assigning a value to an
13721  object declared as volatile sig_atomic_t, or the signal handler calls any function
13722  in the standard library other than the abort function, the _Exit function, the
13723  quick_exit function, or the signal function with the first argument equal to the
13724  signal number corresponding to the signal that caused the invocation of the handler.
13725  Furthermore, if such a call to the signal function results in a SIG_ERR return, the
13726  value of errno is indeterminate.<sup><a href="#note249"><b>249)</b></a></sup>
13727  
13728  
13729 <!--page 284 -->
13730 <p><!--para 6 -->
13731  At program startup, the equivalent of
13732 <pre>
13733         signal(sig, SIG_IGN);
13734 </pre>
13735  may be executed for some signals selected in an implementation-defined manner; the
13736  equivalent of
13737 <pre>
13738         signal(sig, SIG_DFL);
13739 </pre>
13740  is executed for all other signals defined by the implementation.
13741 <p><!--para 7 -->
13742  The implementation shall behave as if no library function calls the signal function.
13743 <h6>Returns</h6>
13744 <p><!--para 8 -->
13745  If the request can be honored, the signal function returns the value of func for the
13746  most recent successful call to signal for the specified signal sig. Otherwise, a value of
13747  SIG_ERR is returned and a positive value is stored in errno.
13748 <p><b> Forward references</b>: the abort function (<a href="#7.22.4.1">7.22.4.1</a>), the exit function (<a href="#7.22.4.4">7.22.4.4</a>), the
13749  _Exit function (<a href="#7.22.4.5">7.22.4.5</a>), the quick_exit function (<a href="#7.22.4.7">7.22.4.7</a>).
13750
13751 <h6>footnotes</h6>
13752 <p><small><a name="note248" href="#note248">248)</a> This includes functions called indirectly via standard library functions (e.g., a SIGABRT handler
13753  called via the abort function).
13754 </small>
13755 <p><small><a name="note249" href="#note249">249)</a> If any signal is generated by an asynchronous signal handler, the behavior is undefined.
13756 </small>
13757
13758 <h4><a name="7.14.2" href="#7.14.2">7.14.2 Send signal</a></h4>
13759
13760 <h5><a name="7.14.2.1" href="#7.14.2.1">7.14.2.1 The raise function</a></h5>
13761 <h6>Synopsis</h6>
13762 <p><!--para 1 -->
13763 <pre>
13764         #include <a href="#7.14">&lt;signal.h&gt;</a>
13765         int raise(int sig);
13766 </pre>
13767 <h6>Description</h6>
13768 <p><!--para 2 -->
13769  The raise function carries out the actions described in <a href="#7.14.1.1">7.14.1.1</a> for the signal sig. If a
13770  signal handler is called, the raise function shall not return until after the signal handler
13771  does.
13772 <h6>Returns</h6>
13773 <p><!--para 3 -->
13774  The raise function returns zero if successful, nonzero if unsuccessful.
13775 <!--page 285 -->
13776
13777 <h3><a name="7.15" href="#7.15">7.15 Alignment <stdalign.h></a></h3>
13778 <p><!--para 1 -->
13779  The header <a href="#7.15">&lt;stdalign.h&gt;</a> defines two macros.
13780 <p><!--para 2 -->
13781  The macro
13782 <pre>
13783          alignas
13784 </pre>
13785  expands to _Alignas.
13786 <p><!--para 3 -->
13787  The remaining macro is suitable for use in #if preprocessing directives. It is
13788 <pre>
13789          __alignas_is_defined
13790 </pre>
13791  which expands to the integer constant 1.
13792 <!--page 286 -->
13793
13794 <h3><a name="7.16" href="#7.16">7.16 Variable arguments <stdarg.h></a></h3>
13795 <p><!--para 1 -->
13796  The header <a href="#7.16">&lt;stdarg.h&gt;</a> declares a type and defines four macros, for advancing
13797  through a list of arguments whose number and types are not known to the called function
13798  when it is translated.
13799 <p><!--para 2 -->
13800  A function may be called with a variable number of arguments of varying types. As
13801  described in <a href="#6.9.1">6.9.1</a>, its parameter list contains one or more parameters. The rightmost
13802  parameter plays a special role in the access mechanism, and will be designated parmN in
13803  this description.
13804 <p><!--para 3 -->
13805  The type declared is
13806 <pre>
13807          va_list
13808 </pre>
13809  which is a complete object type suitable for holding information needed by the macros
13810  va_start, va_arg, va_end, and va_copy. If access to the varying arguments is
13811  desired, the called function shall declare an object (generally referred to as ap in this
13812  subclause) having type va_list. The object ap may be passed as an argument to
13813  another function; if that function invokes the va_arg macro with parameter ap, the
13814  value of ap in the calling function is indeterminate and shall be passed to the va_end
13815  macro prior to any further reference to ap.<sup><a href="#note250"><b>250)</b></a></sup>
13816
13817 <h6>footnotes</h6>
13818 <p><small><a name="note250" href="#note250">250)</a> It is permitted to create a pointer to a va_list and pass that pointer to another function, in which
13819  case the original function may make further use of the original list after the other function returns.
13820 </small>
13821
13822 <h4><a name="7.16.1" href="#7.16.1">7.16.1 Variable argument list access macros</a></h4>
13823 <p><!--para 1 -->
13824  The va_start and va_arg macros described in this subclause shall be implemented
13825  as macros, not functions. It is unspecified whether va_copy and va_end are macros or
13826  identifiers declared with external linkage. If a macro definition is suppressed in order to
13827  access an actual function, or a program defines an external identifier with the same name,
13828  the behavior is undefined. Each invocation of the va_start and va_copy macros
13829  shall be matched by a corresponding invocation of the va_end macro in the same
13830  function.
13831
13832 <h5><a name="7.16.1.1" href="#7.16.1.1">7.16.1.1 The va_arg macro</a></h5>
13833 <h6>Synopsis</h6>
13834 <p><!--para 1 -->
13835 <pre>
13836          #include <a href="#7.16">&lt;stdarg.h&gt;</a>
13837          type va_arg(va_list ap, type);
13838 </pre>
13839 <h6>Description</h6>
13840 <p><!--para 2 -->
13841  The va_arg macro expands to an expression that has the specified type and the value of
13842  the next argument in the call. The parameter ap shall have been initialized by the
13843  va_start or va_copy macro (without an intervening invocation of the va_end
13844  
13845 <!--page 287 -->
13846  macro for the same ap). Each invocation of the va_arg macro modifies ap so that the
13847  values of successive arguments are returned in turn. The parameter type shall be a type
13848  name specified such that the type of a pointer to an object that has the specified type can
13849  be obtained simply by postfixing a * to type. If there is no actual next argument, or if
13850  type is not compatible with the type of the actual next argument (as promoted according
13851  to the default argument promotions), the behavior is undefined, except for the following
13852  cases:
13853 <ul>
13854 <li>  one type is a signed integer type, the other type is the corresponding unsigned integer
13855  type, and the value is representable in both types;
13856 <li>  one type is pointer to void and the other is a pointer to a character type.
13857 </ul>
13858 <h6>Returns</h6>
13859 <p><!--para 3 -->
13860  The first invocation of the va_arg macro after that of the va_start macro returns the
13861  value of the argument after that specified by parmN . Successive invocations return the
13862  values of the remaining arguments in succession.
13863
13864 <h5><a name="7.16.1.2" href="#7.16.1.2">7.16.1.2 The va_copy macro</a></h5>
13865 <h6>Synopsis</h6>
13866 <p><!--para 1 -->
13867 <pre>
13868          #include <a href="#7.16">&lt;stdarg.h&gt;</a>
13869          void va_copy(va_list dest, va_list src);
13870 </pre>
13871 <h6>Description</h6>
13872 <p><!--para 2 -->
13873  The va_copy macro initializes dest as a copy of src, as if the va_start macro had
13874  been applied to dest followed by the same sequence of uses of the va_arg macro as
13875  had previously been used to reach the present state of src. Neither the va_copy nor
13876  va_start macro shall be invoked to reinitialize dest without an intervening
13877  invocation of the va_end macro for the same dest.
13878 <h6>Returns</h6>
13879 <p><!--para 3 -->
13880  The va_copy macro returns no value.
13881
13882 <h5><a name="7.16.1.3" href="#7.16.1.3">7.16.1.3 The va_end macro</a></h5>
13883 <h6>Synopsis</h6>
13884 <p><!--para 1 -->
13885 <pre>
13886          #include <a href="#7.16">&lt;stdarg.h&gt;</a>
13887          void va_end(va_list ap);
13888 </pre>
13889 <h6>Description</h6>
13890 <p><!--para 2 -->
13891  The va_end macro facilitates a normal return from the function whose variable
13892  argument list was referred to by the expansion of the va_start macro, or the function
13893  containing the expansion of the va_copy macro, that initialized the va_list ap. The
13894  va_end macro may modify ap so that it is no longer usable (without being reinitialized
13895 <!--page 288 -->
13896  by the va_start or va_copy macro). If there is no corresponding invocation of the
13897  va_start or va_copy macro, or if the va_end macro is not invoked before the
13898  return, the behavior is undefined.
13899 <h6>Returns</h6>
13900 <p><!--para 3 -->
13901  The va_end macro returns no value.
13902
13903 <h5><a name="7.16.1.4" href="#7.16.1.4">7.16.1.4 The va_start macro</a></h5>
13904 <h6>Synopsis</h6>
13905 <p><!--para 1 -->
13906 <pre>
13907          #include <a href="#7.16">&lt;stdarg.h&gt;</a>
13908          void va_start(va_list ap, parmN);
13909 </pre>
13910 <h6>Description</h6>
13911 <p><!--para 2 -->
13912  The va_start macro shall be invoked before any access to the unnamed arguments.
13913 <p><!--para 3 -->
13914  The va_start macro initializes ap for subsequent use by the va_arg and va_end
13915  macros. Neither the va_start nor va_copy macro shall be invoked to reinitialize ap
13916  without an intervening invocation of the va_end macro for the same ap.
13917 <p><!--para 4 -->
13918  The parameter parmN is the identifier of the rightmost parameter in the variable
13919  parameter list in the function definition (the one just before the , ...). If the parameter
13920  parmN is declared with the register storage class, with a function or array type, or
13921  with a type that is not compatible with the type that results after application of the default
13922  argument promotions, the behavior is undefined.
13923 <h6>Returns</h6>
13924 <p><!--para 5 -->
13925  The va_start macro returns no value.
13926 <p><!--para 6 -->
13927  EXAMPLE 1 The function f1 gathers into an array a list of arguments that are pointers to strings (but not
13928  more than MAXARGS arguments), then passes the array as a single argument to function f2. The number of
13929  pointers is specified by the first argument to f1.
13930 <!--page 289 -->
13931 <pre>
13932          #include <a href="#7.16">&lt;stdarg.h&gt;</a>
13933          #define MAXARGS   31
13934          void f1(int n_ptrs, ...)
13935          {
13936                va_list ap;
13937                char *array[MAXARGS];
13938                int ptr_no = 0;
13939                    if (n_ptrs &gt; MAXARGS)
13940                          n_ptrs = MAXARGS;
13941                    va_start(ap, n_ptrs);
13942                    while (ptr_no &lt; n_ptrs)
13943                          array[ptr_no++] = va_arg(ap, char *);
13944                    va_end(ap);
13945                    f2(n_ptrs, array);
13946           }
13947 </pre>
13948  Each call to f1 is required to have visible the definition of the function or a declaration such as
13949 <pre>
13950           void f1(int, ...);
13951 </pre>
13952  
13953 <p><!--para 7 -->
13954  EXAMPLE 2 The function f3 is similar, but saves the status of the variable argument list after the
13955  indicated number of arguments; after f2 has been called once with the whole list, the trailing part of the list
13956  is gathered again and passed to function f4.
13957 <!--page 290 -->
13958 <pre>
13959           #include <a href="#7.16">&lt;stdarg.h&gt;</a>
13960           #define MAXARGS 31
13961           void f3(int n_ptrs, int f4_after, ...)
13962           {
13963                 va_list ap, ap_save;
13964                 char *array[MAXARGS];
13965                 int ptr_no = 0;
13966                 if (n_ptrs &gt; MAXARGS)
13967                       n_ptrs = MAXARGS;
13968                 va_start(ap, f4_after);
13969                 while (ptr_no &lt; n_ptrs) {
13970                       array[ptr_no++] = va_arg(ap, char *);
13971                       if (ptr_no == f4_after)
13972                             va_copy(ap_save, ap);
13973                 }
13974                 va_end(ap);
13975                 f2(n_ptrs, array);
13976                    // Now process the saved copy.
13977                    n_ptrs -= f4_after;
13978                    ptr_no = 0;
13979                    while (ptr_no &lt; n_ptrs)
13980                          array[ptr_no++] = va_arg(ap_save, char *);
13981                    va_end(ap_save);
13982                    f4(n_ptrs, array);
13983           }
13984 </pre>
13985
13986 <h3><a name="7.17" href="#7.17">7.17 Atomics <stdatomic.h></a></h3>
13987
13988 <h4><a name="7.17.1" href="#7.17.1">7.17.1 Introduction</a></h4>
13989 <p><!--para 1 -->
13990  The header <a href="#7.17">&lt;stdatomic.h&gt;</a> defines several macros and declares several types and
13991  functions for performing atomic operations on data shared between threads.
13992 <p><!--para 2 -->
13993  Implementations that define the macro __STDC_NO_THREADS__ need not provide
13994  this header nor support any of its facilities.
13995 <p><!--para 3 -->
13996  The macros defined are the atomic lock-free macros
13997 <pre>
13998         ATOMIC_CHAR_LOCK_FREE
13999         ATOMIC_CHAR16_T_LOCK_FREE
14000         ATOMIC_CHAR32_T_LOCK_FREE
14001         ATOMIC_WCHAR_T_LOCK_FREE
14002         ATOMIC_SHORT_LOCK_FREE
14003         ATOMIC_INT_LOCK_FREE
14004         ATOMIC_LONG_LOCK_FREE
14005         ATOMIC_LLONG_LOCK_FREE
14006         ATOMIC_ADDRESS_LOCK_FREE
14007 </pre>
14008  which indicate the lock-free property of the corresponding atomic types (both signed and
14009  unsigned); and
14010 <pre>
14011         ATOMIC_FLAG_INIT
14012 </pre>
14013  which expands to an initializer for an object of type atomic_flag.
14014 <p><!--para 4 -->
14015  The types include
14016 <pre>
14017         memory_order
14018 </pre>
14019  which is an enumerated type whose enumerators identify memory ordering constraints;
14020 <pre>
14021         atomic_flag
14022 </pre>
14023  which is a structure type representing a lock-free, primitive atomic flag;
14024 <pre>
14025         atomic_bool
14026 </pre>
14027  which is a structure type representing the atomic analog of the type _Bool;
14028 <pre>
14029         atomic_address
14030 </pre>
14031  which is a structure type representing the atomic analog of a pointer type; and several
14032  atomic analogs of integer types.
14033 <p><!--para 5 -->
14034  In the following operation definitions:
14035 <ul>
14036 <li>  An A refers to one of the atomic types.
14037 <!--page 291 -->
14038 <li>  A C refers to its corresponding non-atomic type. The atomic_address atomic
14039  type corresponds to the void * non-atomic type.
14040 <li>  An M refers to the type of the other argument for arithmetic operations. For atomic
14041  integer types, M is C. For atomic address types, M is ptrdiff_t.
14042 <li>  The functions not ending in _explicit have the same semantics as the
14043  corresponding _explicit function with memory_order_seq_cst for the
14044  memory_order argument.
14045 </ul>
14046 <p><!--para 6 -->
14047  NOTE Many operations are volatile-qualified. The ''volatile as device register'' semantics have not
14048  changed in the standard. This qualification means that volatility is preserved when applying these
14049  operations to volatile objects.
14050  
14051
14052 <h4><a name="7.17.2" href="#7.17.2">7.17.2 Initialization</a></h4>
14053
14054 <h5><a name="7.17.2.1" href="#7.17.2.1">7.17.2.1 The ATOMIC_VAR_INIT macro</a></h5>
14055 <h6>Synopsis</h6>
14056 <p><!--para 1 -->
14057 <pre>
14058          #include <a href="#7.17">&lt;stdatomic.h&gt;</a>
14059          #define ATOMIC_VAR_INIT(C value)
14060 </pre>
14061 <h6>Description</h6>
14062 <p><!--para 2 -->
14063  The ATOMIC_VAR_INIT macro expands to a token sequence suitable for initializing an
14064  atomic object of a type that is initialization-compatible with value. An atomic object
14065  with automatic storage duration that is not explicitly initialized using
14066  ATOMIC_VAR_INIT is initially in an indeterminate state; however, the default (zero)
14067  initialization for objects with static or thread-local storage duration is guaranteed to
14068  produce a valid state.
14069 <p><!--para 3 -->
14070  Concurrent access to the variable being initialized, even via an atomic operation,
14071  constitutes a data race.
14072 <p><!--para 4 -->
14073  EXAMPLE
14074 <pre>
14075          atomic_int guide = ATOMIC_VAR_INIT(42);
14076 </pre>
14077  
14078
14079 <h5><a name="7.17.2.2" href="#7.17.2.2">7.17.2.2 The atomic_init generic function</a></h5>
14080 <h6>Synopsis</h6>
14081 <p><!--para 1 -->
14082 <pre>
14083          #include <a href="#7.17">&lt;stdatomic.h&gt;</a>
14084          void atomic_init(volatile A *obj, C value);
14085 </pre>
14086 <h6>Description</h6>
14087 <p><!--para 2 -->
14088  The atomic_init generic function initializes the atomic object pointed to by obj to
14089  the value value, while also initializing any additional state that the implementation
14090  might need to carry for the atomic object.
14091 <!--page 292 -->
14092 <p><!--para 3 -->
14093  Although this function initializes an atomic object, it does not avoid data races;
14094  concurrent access to the variable being initialized, even via an atomic operation,
14095  constitutes a data race.
14096 <h6>Returns</h6>
14097 <p><!--para 4 -->
14098  The atomic_init generic function returns no value.
14099 <p><!--para 5 -->
14100  EXAMPLE
14101 <pre>
14102          atomic_int guide;
14103          atomic_init(&amp;guide, 42);
14104 </pre>
14105  
14106
14107 <h4><a name="7.17.3" href="#7.17.3">7.17.3 Order and consistency</a></h4>
14108 <p><!--para 1 -->
14109  The enumerated type memory_order specifies the detailed regular (non-atomic)
14110  memory synchronization operations as defined in <a href="#5.1.2.4">5.1.2.4</a> and may provide for operation
14111  ordering. Its enumeration constants are as follows:
14112 <pre>
14113          memory_order_relaxed
14114          memory_order_consume
14115          memory_order_acquire
14116          memory_order_release
14117          memory_order_acq_rel
14118          memory_order_seq_cst
14119 </pre>
14120 <p><!--para 2 -->
14121  For memory_order_relaxed, no operation orders memory.
14122 <p><!--para 3 -->
14123  For       memory_order_release,       memory_order_acq_rel,             and
14124  memory_order_seq_cst, a store operation performs a release operation on the
14125  affected memory location.
14126 <p><!--para 4 -->
14127  For       memory_order_acquire,       memory_order_acq_rel,             and
14128  memory_order_seq_cst, a load operation performs an acquire operation on the
14129  affected memory location.
14130 <p><!--para 5 -->
14131  For memory_order_consume, a load operation performs a consume operation on the
14132  affected memory location.
14133 <p><!--para 6 -->
14134  For memory_order_seq_cst, there shall be a single total order S on all operations,
14135  consistent with the ''happens before'' order and modification orders for all affected
14136  locations, such that each memory_order_seq_cst operation that loads a value
14137  observes either the last preceding modification according to this order S, or the result of
14138  an operation that is not memory_order_seq_cst.
14139 <p><!--para 7 -->
14140  NOTE 1 Although it is not explicitly required that S include lock operations, it can always be extended to
14141  an order that does include lock and unlock operations, since the ordering between those is already included
14142  in the ''happens before'' ordering.
14143  
14144 <p><!--para 8 -->
14145  NOTE 2 Atomic operations specifying memory_order_relaxed are relaxed only with respect to
14146  memory ordering. Implementations must still guarantee that any given atomic access to a particular atomic
14147 <!--page 293 -->
14148  object be indivisible with respect to all other atomic accesses to that object.
14149  
14150 <p><!--para 9 -->
14151  For an atomic operation B that reads the value of an atomic object M, if there is a
14152  memory_order_seq_cst fence X sequenced before B, then B observes either the
14153  last memory_order_seq_cst modification of M preceding X in the total order S or
14154  a later modification of M in its modification order.
14155 <p><!--para 10 -->
14156  For atomic operations A and B on an atomic object M, where A modifies M and B takes
14157  its value, if there is a memory_order_seq_cst fence X such that A is sequenced
14158  before X and B follows X in S, then B observes either the effects of A or a later
14159  modification of M in its modification order.
14160 <p><!--para 11 -->
14161  For atomic operations A and B on an atomic object M, where A modifies M and B takes
14162  its value, if there are memory_order_seq_cst fences X and Y such that A is
14163  sequenced before X, Y is sequenced before B, and X precedes Y in S, then B observes
14164  either the effects of A or a later modification of M in its modification order.
14165 <p><!--para 12 -->
14166  Atomic read-modify-write operations shall always read the last value (in the modification
14167  order) stored before the write associated with the read-modify-write operation.
14168 <p><!--para 13 -->
14169  An atomic store shall only store a value that has been computed from constants and
14170  program input values by a finite sequence of program evaluations, such that each
14171  evaluation observes the values of variables as computed by the last prior assignment in
14172  the sequence.<sup><a href="#note251"><b>251)</b></a></sup> The ordering of evaluations in this sequence shall be such that
14173 <ul>
14174 <li>  If an evaluation B observes a value computed by A in a different thread, then B does
14175  not happen before A.
14176 <li>  If an evaluation A is included in the sequence, then all evaluations that assign to the
14177  same variable and happen before A are also included.
14178 </ul>
14179 <p><!--para 14 -->
14180  NOTE 3 The second requirement disallows ''out-of-thin-air'', or ''speculative'' stores of atomics when
14181  relaxed atomics are used. Since unordered operations are involved, evaluations may appear in this
14182  sequence out of thread order. For example, with x and y initially zero,
14183 <pre>
14184           // Thread 1:
14185           r1 = atomic_load_explicit(&amp;y, memory_order_relaxed);
14186           atomic_store_explicit(&amp;x, r1, memory_order_relaxed);
14187 </pre>
14188  
14189 <pre>
14190           // Thread 2:
14191           r2 = atomic_load_explicit(&amp;x, memory_order_relaxed);
14192           atomic_store_explicit(&amp;y, 42, memory_order_relaxed);
14193 </pre>
14194  is allowed to produce r1 == 42 &amp;&amp; r2 == 42. The sequence of evaluations justifying this consists of:
14195  
14196  
14197  
14198  
14199 <!--page 294 -->
14200 <pre>
14201          atomic_store_explicit(&amp;y, 42,               memory_order_relaxed);
14202          r1 = atomic_load_explicit(&amp;y,               memory_order_relaxed);
14203          atomic_store_explicit(&amp;x, r1,               memory_order_relaxed);
14204          r2 = atomic_load_explicit(&amp;x,               memory_order_relaxed);
14205 </pre>
14206  On the other hand,
14207 <pre>
14208          // Thread 1:
14209          r1 = atomic_load_explicit(&amp;y, memory_order_relaxed);
14210          atomic_store_explicit(&amp;x, r1, memory_order_relaxed);
14211 </pre>
14212  
14213 <pre>
14214          // Thread 2:
14215          r2 = atomic_load_explicit(&amp;x, memory_order_relaxed);
14216          atomic_store_explicit(&amp;y, r2, memory_order_relaxed);
14217 </pre>
14218  is not allowed to produce r1 == 42 &amp;&amp; r2 = 42, since there is no sequence of evaluations that results
14219  in the computation of 42. In the absence of ''relaxed'' operations and read-modify-write operations with
14220  weaker than memory_order_acq_rel ordering, the second requirement has no impact.
14221  
14222 <h6>Recommended practice</h6>
14223 <p><!--para 15 -->
14224  The requirements do not forbid r1 == 42 &amp;&amp; r2 == 42 in the following example,
14225  with x and y initially zero:
14226 <pre>
14227          // Thread 1:
14228          r1 = atomic_load_explicit(&amp;x, memory_order_relaxed);
14229          if (r1 == 42)
14230               atomic_store_explicit(&amp;y, r1, memory_order_relaxed);
14231 </pre>
14232  
14233 <pre>
14234          // Thread 2:
14235          r2 = atomic_load_explicit(&amp;y, memory_order_relaxed);
14236          if (r2 == 42)
14237               atomic_store_explicit(&amp;x, 42, memory_order_relaxed);
14238 </pre>
14239  However, this is not useful behavior, and implementations should not allow it.
14240 <p><!--para 16 -->
14241  Implementations should make atomic stores visible to atomic loads within a reasonable
14242  amount of time.
14243
14244 <h6>footnotes</h6>
14245 <p><small><a name="note251" href="#note251">251)</a> Among other implications, atomic variables shall not decay.
14246 </small>
14247
14248 <h5><a name="7.17.3.1" href="#7.17.3.1">7.17.3.1 The kill_dependency macro</a></h5>
14249 <h6>Synopsis</h6>
14250 <p><!--para 1 -->
14251 <pre>
14252          #include <a href="#7.17">&lt;stdatomic.h&gt;</a>
14253          type kill_dependency(type y);
14254 </pre>
14255 <h6>Description</h6>
14256 <p><!--para 2 -->
14257  The kill_dependency macro terminates a dependency chain; the argument does not
14258  carry a dependency to the return value.
14259 <!--page 295 -->
14260 <h6>Returns</h6>
14261 <p><!--para 3 -->
14262  The kill_dependency macro returns the value of y.
14263
14264 <h4><a name="7.17.4" href="#7.17.4">7.17.4 Fences</a></h4>
14265 <p><!--para 1 -->
14266  This subclause introduces synchronization primitives called fences. Fences can have
14267  acquire semantics, release semantics, or both. A fence with acquire semantics is called
14268  an acquire fence; a fence with release semantics is called a release fence.
14269 <p><!--para 2 -->
14270  A release fence A synchronizes with an acquire fence B if there exist atomic operations
14271  X and Y , both operating on some atomic object M, such that A is sequenced before X, X
14272  modifies M, Y is sequenced before B, and Y reads the value written by X or a value
14273  written by any side effect in the hypothetical release sequence X would head if it were a
14274  release operation.
14275 <p><!--para 3 -->
14276  A release fence A synchronizes with an atomic operation B that performs an acquire
14277  operation on an atomic object M if there exists an atomic operation X such that A is
14278  sequenced before X, X modifies M, and B reads the value written by X or a value written
14279  by any side effect in the hypothetical release sequence X would head if it were a release
14280  operation.
14281 <p><!--para 4 -->
14282  An atomic operation A that is a release operation on an atomic object M synchronizes
14283  with an acquire fence B if there exists some atomic operation X on M such that X is
14284  sequenced before B and reads the value written by A or a value written by any side effect
14285  in the release sequence headed by A.
14286
14287 <h5><a name="7.17.4.1" href="#7.17.4.1">7.17.4.1 The atomic_thread_fence function</a></h5>
14288 <h6>Synopsis</h6>
14289 <p><!--para 1 -->
14290 <pre>
14291          #include <a href="#7.17">&lt;stdatomic.h&gt;</a>
14292          void atomic_thread_fence(memory_order order);
14293 </pre>
14294 <h6>Description</h6>
14295 <p><!--para 2 -->
14296  Depending on the value of order, this operation:
14297 <ul>
14298 <li>  has no effects, if order == memory_order_relaxed;
14299 <li>  is an acquire fence, if order == memory_order_acquire or order ==
14300  memory_order_consume;
14301 <li>  is a release fence, if order == memory_order_release;
14302 <li>  is both an acquire fence              and   a    release   fence,    if   order     ==
14303  memory_order_acq_rel;
14304 <li>  is a sequentially consistent acquire and release fence, if order                    ==
14305  memory_order_seq_cst.
14306 <!--page 296 -->
14307 </ul>
14308 <h6>Returns</h6>
14309 <p><!--para 3 -->
14310  The atomic_thread_fence function returns no value.
14311
14312 <h5><a name="7.17.4.2" href="#7.17.4.2">7.17.4.2 The atomic_signal_fence function</a></h5>
14313 <h6>Synopsis</h6>
14314 <p><!--para 1 -->
14315 <pre>
14316          #include <a href="#7.17">&lt;stdatomic.h&gt;</a>
14317          void atomic_signal_fence(memory_order order);
14318 </pre>
14319 <h6>Description</h6>
14320 <p><!--para 2 -->
14321  Equivalent to atomic_thread_fence(order), except that ''synchronizes with''
14322  relationships are established only between a thread and a signal handler executed in the
14323  same thread.
14324 <p><!--para 3 -->
14325  NOTE 1 The atomic_signal_fence function can be used to specify the order in which actions
14326  performed by the thread become visible to the signal handler.
14327  
14328 <p><!--para 4 -->
14329  NOTE 2 Compiler optimizations and reorderings of loads and stores are inhibited in the same way as with
14330  atomic_thread_fence, but the hardware fence instructions that atomic_thread_fence would
14331  have inserted are not emitted.
14332  
14333 <h6>Returns</h6>
14334 <p><!--para 5 -->
14335  The atomic_signal_fence function returns no value.
14336
14337 <h4><a name="7.17.5" href="#7.17.5">7.17.5 Lock-free property</a></h4>
14338 <p><!--para 1 -->
14339  The atomic lock-free macros indicate the lock-free property of integer and address atomic
14340  types. A value of 0 indicates that the type is never lock-free; a value of 1 indicates that
14341  the type is sometimes lock-free; a value of 2 indicates that the type is always lock-free.
14342 <p><!--para 2 -->
14343  NOTE Operations that are lock-free should also be address-free. That is, atomic operations on the same
14344  memory location via two different addresses will communicate atomically. The implementation should not
14345  depend on any per-process state. This restriction enables communication via memory mapped into a
14346  process more than once and memory shared between two processes.
14347  
14348
14349 <h5><a name="7.17.5.1" href="#7.17.5.1">7.17.5.1 The atomic_is_lock_free generic function</a></h5>
14350 <h6>Synopsis</h6>
14351 <p><!--para 1 -->
14352 <pre>
14353          #include <a href="#7.17">&lt;stdatomic.h&gt;</a>
14354          _Bool atomic_is_lock_free(atomic_type const volatile *obj);
14355 </pre>
14356 <h6>Description</h6>
14357 <p><!--para 2 -->
14358  The atomic_is_lock_free generic function indicates whether or not the object
14359  pointed to by obj is lock-free. atomic_type can be any atomic type.
14360 <h6>Returns</h6>
14361 <p><!--para 3 -->
14362  The atomic_is_lock_free generic function returns nonzero (true) if and only if the
14363  object's operations are lock-free. The result of a lock-free query on one object cannot be
14364 <!--page 297 -->
14365  inferred from the result of a lock-free query on another object.
14366
14367 <h4><a name="7.17.6" href="#7.17.6">7.17.6 Atomic integer and address types</a></h4>
14368 <p><!--para 1 -->
14369  For each line in the following table, the atomic type name is declared as the
14370  corresponding direct type.
14371 <!--page 298 -->
14372 <pre>
14373             Atomic type name                              Direct type
14374         atomic_char                           _Atomic    char
14375         atomic_schar                          _Atomic    signed char
14376         atomic_uchar                          _Atomic    unsigned char
14377         atomic_short                          _Atomic    short
14378         atomic_ushort                         _Atomic    unsigned short
14379         atomic_int                            _Atomic    int
14380         atomic_uint                           _Atomic    unsigned int
14381         atomic_long                           _Atomic    long
14382         atomic_ulong                          _Atomic    unsigned long
14383         atomic_llong                          _Atomic    long long
14384         atomic_ullong                         _Atomic    unsigned long long
14385         atomic_char16_t                       _Atomic    char16_t
14386         atomic_char32_t                       _Atomic    char32_t
14387         atomic_wchar_t                        _Atomic    wchar_t
14388         atomic_int_least8_t                   _Atomic    int_least8_t
14389         atomic_uint_least8_t                  _Atomic    uint_least8_t
14390         atomic_int_least16_t                  _Atomic    int_least16_t
14391         atomic_uint_least16_t                 _Atomic    uint_least16_t
14392         atomic_int_least32_t                  _Atomic    int_least32_t
14393         atomic_uint_least32_t                 _Atomic    uint_least32_t
14394         atomic_int_least64_t                  _Atomic    int_least64_t
14395         atomic_uint_least64_t                 _Atomic    uint_least64_t
14396         atomic_int_fast8_t                    _Atomic    int_fast8_t
14397         atomic_uint_fast8_t                   _Atomic    uint_fast8_t
14398         atomic_int_fast16_t                   _Atomic    int_fast16_t
14399         atomic_uint_fast16_t                  _Atomic    uint_fast16_t
14400         atomic_int_fast32_t                   _Atomic    int_fast32_t
14401         atomic_uint_fast32_t                  _Atomic    uint_fast32_t
14402         atomic_int_fast64_t                   _Atomic    int_fast64_t
14403         atomic_uint_fast64_t                  _Atomic    uint_fast64_t
14404         atomic_intptr_t                       _Atomic    intptr_t
14405         atomic_uintptr_t                      _Atomic    uintptr_t
14406         atomic_size_t                         _Atomic    size_t
14407         atomic_ptrdiff_t                      _Atomic    ptrdiff_t
14408         atomic_intmax_t                       _Atomic    intmax_t
14409         atomic_uintmax_t                      _Atomic    uintmax_t
14410 </pre>
14411 <p><!--para 2 -->
14412  The semantics of the operations on these types are defined in <a href="#7.17.7">7.17.7</a>.
14413 <p><!--para 3 -->
14414  The atomic_bool type provides an atomic boolean.
14415 <!--page 299 -->
14416 <p><!--para 4 -->
14417  The atomic_address type provides atomic void * operations. The unit of
14418  addition/subtraction shall be one byte.
14419 <p><!--para 5 -->
14420  NOTE The representation of atomic integer and address types need not have the same size as their
14421  corresponding regular types. They should have the same size whenever possible, as it eases effort required
14422  to port existing code.
14423  
14424
14425 <h4><a name="7.17.7" href="#7.17.7">7.17.7 Operations on atomic types</a></h4>
14426 <p><!--para 1 -->
14427  There are only a few kinds of operations on atomic types, though there are many
14428  instances of those kinds. This subclause specifies each general kind.
14429
14430 <h5><a name="7.17.7.1" href="#7.17.7.1">7.17.7.1 The atomic_store generic functions</a></h5>
14431 <h6>Synopsis</h6>
14432 <p><!--para 1 -->
14433 <pre>
14434          #include <a href="#7.17">&lt;stdatomic.h&gt;</a>
14435          void atomic_store(volatile A *object, C desired);
14436          void atomic_store_explicit(volatile A *object,
14437               C desired, memory_order order);
14438 </pre>
14439 <h6>Description</h6>
14440 <p><!--para 2 -->
14441  The      order      argument    shall    not    be    memory_order_acquire,
14442  memory_order_consume, nor memory_order_acq_rel. Atomically replace the
14443  value pointed to by object with the value of desired. Memory is affected according
14444  to the value of order.
14445 <h6>Returns</h6>
14446 <p><!--para 3 -->
14447  The atomic_store generic functions return no value.
14448
14449 <h5><a name="7.17.7.2" href="#7.17.7.2">7.17.7.2 The atomic_load generic functions</a></h5>
14450 <h6>Synopsis</h6>
14451 <p><!--para 1 -->
14452 <pre>
14453          #include <a href="#7.17">&lt;stdatomic.h&gt;</a>
14454          C atomic_load(volatile A *object);
14455          C atomic_load_explicit(volatile A *object,
14456               memory_order order);
14457 </pre>
14458 <h6>Description</h6>
14459 <p><!--para 2 -->
14460  The order argument shall not be memory_order_release nor
14461  memory_order_acq_rel. Memory is affected according to the value of order.
14462 <h6>Returns</h6>
14463  Atomically returns the value pointed to by object.
14464 <!--page 300 -->
14465
14466 <h5><a name="7.17.7.3" href="#7.17.7.3">7.17.7.3 The atomic_exchange generic functions</a></h5>
14467 <h6>Synopsis</h6>
14468 <p><!--para 1 -->
14469 <pre>
14470           #include <a href="#7.17">&lt;stdatomic.h&gt;</a>
14471           C atomic_exchange(volatile A *object, C desired);
14472           C atomic_exchange_explicit(volatile A *object,
14473                C desired, memory_order order);
14474 </pre>
14475 <h6>Description</h6>
14476 <p><!--para 2 -->
14477  Atomically replace the value pointed to by object with desired. Memory is affected
14478  according to the value of order. These operations are read-modify-write operations
14479  (<a href="#5.1.2.4">5.1.2.4</a>).
14480 <h6>Returns</h6>
14481 <p><!--para 3 -->
14482  Atomically returns the value pointed to by object immediately before the effects.
14483
14484 <h5><a name="7.17.7.4" href="#7.17.7.4">7.17.7.4 The atomic_compare_exchange generic functions</a></h5>
14485 <h6>Synopsis</h6>
14486 <p><!--para 1 -->
14487 <pre>
14488           #include <a href="#7.17">&lt;stdatomic.h&gt;</a>
14489           _Bool atomic_compare_exchange_strong(volatile A *object,
14490                C *expected, C desired);
14491           _Bool atomic_compare_exchange_strong_explicit(
14492                volatile A *object, C *expected, C desired,
14493                memory_order success, memory_order failure);
14494           _Bool atomic_compare_exchange_weak(volatile A *object,
14495                C *expected, C desired);
14496           _Bool atomic_compare_exchange_weak_explicit(
14497                volatile A *object, C *expected, C desired,
14498                memory_order success, memory_order failure);
14499 </pre>
14500 <h6>Description</h6>
14501 <p><!--para 2 -->
14502  The failure argument shall not be memory_order_release nor
14503  memory_order_acq_rel. The failure argument shall be no stronger than the
14504  success argument. Atomically, compares the value pointed to by object for equality
14505  with that in expected, and if true, replaces the value pointed to by object with
14506  desired, and if false, updates the value in expected with the value pointed to by
14507  object. Further, if the comparison is true, memory is affected according to the value of
14508  success, and if the comparison is false, memory is affected according to the value of
14509  failure. These operations are atomic read-modify-write operations (<a href="#5.1.2.4">5.1.2.4</a>).
14510 <p><!--para 3 -->
14511  NOTE 1    The effect of the compare-and-exchange operations is
14512 <!--page 301 -->
14513 <pre>
14514           if (*object == *expected)
14515                 *object = desired;
14516           else
14517                 *expected = *object;
14518 </pre>
14519  
14520 <p><!--para 4 -->
14521  The weak compare-and-exchange operations may fail spuriously, that is, return zero
14522  while leaving the value pointed to by expected unchanged.
14523 <p><!--para 5 -->
14524  NOTE 2 This spurious failure enables implementation of compare-and-exchange on a broader class of
14525  machines, e.g. load-locked store-conditional machines.
14526  
14527 <p><!--para 6 -->
14528  EXAMPLE         A consequence of spurious failure is that nearly all uses of weak compare-and-exchange will
14529  be in a loop.
14530 <pre>
14531           exp = atomic_load(&amp;cur);
14532           do {
14533                 des = function(exp);
14534           } while (!atomic_compare_exchange_weak(&amp;cur, &amp;exp, des));
14535 </pre>
14536  When a compare-and-exchange is in a loop, the weak version will yield better performance on some
14537  platforms. When a weak compare-and-exchange would require a loop and a strong one would not, the
14538  strong one is preferable.
14539  
14540 <h6>Returns</h6>
14541 <p><!--para 7 -->
14542  The result of the comparison.
14543
14544 <h5><a name="7.17.7.5" href="#7.17.7.5">7.17.7.5 The atomic_fetch and modify generic functions</a></h5>
14545 <p><!--para 1 -->
14546  The following operations perform arithmetic and bitwise computations. All of these
14547  operations are applicable to an object of any atomic integer type. Only addition and
14548  subtraction are applicable to atomic_address. None of these operations is applicable
14549  to atomic_bool. The key, operator, and computation correspondence is:
14550   key            op          computation
14551   add            +       addition
14552   sub            -       subtraction
14553   or             |       bitwise inclusive or
14554   xor            ^       bitwise exclusive or
14555   and            &amp;       bitwise and
14556 <h6>Synopsis</h6>
14557 <p><!--para 2 -->
14558 <pre>
14559           #include <a href="#7.17">&lt;stdatomic.h&gt;</a>
14560           C atomic_fetch_key(volatile A *object, M operand);
14561           C atomic_fetch_key_explicit(volatile A *object,
14562                M operand, memory_order order);
14563 </pre>
14564 <h6>Description</h6>
14565 <p><!--para 3 -->
14566  Atomically replaces the value pointed to by object with the result of the computation
14567  applied to the value pointed to by object and the given operand. Memory is affected
14568  according to the value of order. These operations are atomic read-modify-write
14569 <!--page 302 -->
14570  operations (<a href="#5.1.2.4">5.1.2.4</a>). For signed integer types, arithmetic is defined to use two's
14571  complement representation with silent wrap-around on overflow; there are no undefined
14572  results. For address types, the result may be an undefined address, but the operations
14573  otherwise have no undefined behavior.
14574 <h6>Returns</h6>
14575 <p><!--para 4 -->
14576  Atomically, the value pointed to by object immediately before the effects.
14577 <p><!--para 5 -->
14578  NOTE The operation of the atomic_fetch and modify generic functions are nearly equivalent to the
14579  operation of the corresponding op= compound assignment operators. The only differences are that the
14580  compound assignment operators are not guaranteed to operate atomically, and the value yielded by a
14581  compound assignment operator is the updated value of the object, whereas the value returned by the
14582  atomic_fetch and modify generic functions is the previous value of the atomic object.
14583  
14584
14585 <h4><a name="7.17.8" href="#7.17.8">7.17.8 Atomic flag type and operations</a></h4>
14586 <p><!--para 1 -->
14587  The atomic_flag type provides the classic test-and-set functionality. It has two
14588  states, set and clear.
14589 <p><!--para 2 -->
14590  Operations on an object of type atomic_flag shall be lock free.
14591 <p><!--para 3 -->
14592  NOTE Hence the operations should also be address-free. No other type requires lock-free operations, so
14593  the atomic_flag type is the minimum hardware-implemented type needed to conform to this
14594  International standard. The remaining types can be emulated with atomic_flag, though with less than
14595  ideal properties.
14596  
14597 <p><!--para 4 -->
14598  The macro ATOMIC_FLAG_INIT may be used to initialize an atomic_flag to the
14599  clear state. An atomic_flag that is not explicitly initialized with
14600  ATOMIC_FLAG_INIT is initially in an indeterminate state.
14601 <p><!--para 5 -->
14602  EXAMPLE
14603 <pre>
14604          atomic_flag guard = ATOMIC_FLAG_INIT;
14605 </pre>
14606  
14607
14608 <h5><a name="7.17.8.1" href="#7.17.8.1">7.17.8.1 The atomic_flag_test_and_set functions</a></h5>
14609 <h6>Synopsis</h6>
14610 <p><!--para 1 -->
14611 <pre>
14612          #include <a href="#7.17">&lt;stdatomic.h&gt;</a>
14613          bool atomic_flag_test_and_set(
14614               volatile atomic_flag *object);
14615          bool atomic_flag_test_and_set_explicit(
14616               volatile atomic_flag *object, memory_order order);
14617 </pre>
14618 <h6>Description</h6>
14619 <p><!--para 2 -->
14620  Atomically sets the value pointed to by object to true. Memory is affected according
14621  to the value of order. These operations are atomic read-modify-write operations
14622  (<a href="#5.1.2.4">5.1.2.4</a>).
14623 <!--page 303 -->
14624 <h6>Returns</h6>
14625 <p><!--para 3 -->
14626  Atomically, the value of the object immediately before the effects.
14627
14628 <h5><a name="7.17.8.2" href="#7.17.8.2">7.17.8.2 The atomic_flag_clear functions</a></h5>
14629 <h6>Synopsis</h6>
14630 <p><!--para 1 -->
14631 <pre>
14632          #include <a href="#7.17">&lt;stdatomic.h&gt;</a>
14633          void atomic_flag_clear(volatile atomic_flag *object);
14634          void atomic_flag_clear_explicit(
14635               volatile atomic_flag *object, memory_order order);
14636 </pre>
14637 <h6>Description</h6>
14638 <p><!--para 2 -->
14639  The order argument shall not be memory_order_acquire nor
14640  memory_order_acq_rel. Atomically sets the value pointed to by object to false.
14641  Memory is affected according to the value of order.
14642 <h6>Returns</h6>
14643 <p><!--para 3 -->
14644  The atomic_flag_clear functions return no value.
14645 <!--page 304 -->
14646
14647 <h3><a name="7.18" href="#7.18">7.18 Boolean type and values <stdbool.h></a></h3>
14648 <p><!--para 1 -->
14649  The header <a href="#7.18">&lt;stdbool.h&gt;</a> defines four macros.
14650 <p><!--para 2 -->
14651  The macro
14652 <pre>
14653           bool
14654 </pre>
14655  expands to _Bool.
14656 <p><!--para 3 -->
14657  The remaining three macros are suitable for use in #if preprocessing directives. They
14658  are
14659 <pre>
14660           true
14661 </pre>
14662  which expands to the integer constant 1,
14663 <pre>
14664           false
14665 </pre>
14666  which expands to the integer constant 0, and
14667 <pre>
14668           __bool_true_false_are_defined
14669 </pre>
14670  which expands to the integer constant 1.
14671 <p><!--para 4 -->
14672  Notwithstanding the provisions of <a href="#7.1.3">7.1.3</a>, a program may undefine and perhaps then
14673  redefine the macros bool, true, and false.<sup><a href="#note252"><b>252)</b></a></sup>
14674  
14675  
14676  
14677  
14678 <!--page 305 -->
14679
14680 <h6>footnotes</h6>
14681 <p><small><a name="note252" href="#note252">252)</a> See ''future library directions'' (<a href="#7.30.7">7.30.7</a>).
14682 </small>
14683
14684 <h3><a name="7.19" href="#7.19">7.19 Common definitions <stddef.h></a></h3>
14685 <p><!--para 1 -->
14686  The header <a href="#7.19">&lt;stddef.h&gt;</a> defines the following macros and declares the following types.
14687  Some are also defined in other headers, as noted in their respective subclauses.
14688 <p><!--para 2 -->
14689  The types are
14690 <pre>
14691          ptrdiff_t
14692 </pre>
14693  which is the signed integer type of the result of subtracting two pointers;
14694 <pre>
14695          size_t
14696 </pre>
14697  which is the unsigned integer type of the result of the sizeof operator;
14698 <pre>
14699          max_align_t
14700 </pre>
14701  which is an object type whose alignment is as great as is supported by the implementation
14702  in all contexts; and
14703 <pre>
14704          wchar_t
14705 </pre>
14706  which is an integer type whose range of values can represent distinct codes for all
14707  members of the largest extended character set specified among the supported locales; the
14708  null character shall have the code value zero. Each member of the basic character set
14709  shall have a code value equal to its value when used as the lone character in an integer
14710  character      constant     if     an      implementation      does      not      define
14711  __STDC_MB_MIGHT_NEQ_WC__.
14712 <p><!--para 3 -->
14713  The macros are
14714 <pre>
14715          NULL
14716 </pre>
14717  which expands to an implementation-defined null pointer constant; and
14718 <pre>
14719          offsetof(type, member-designator)
14720 </pre>
14721  which expands to an integer constant expression that has type size_t, the value of
14722  which is the offset in bytes, to the structure member (designated by member-designator),
14723  from the beginning of its structure (designated by type). The type and member designator
14724  shall be such that given
14725 <pre>
14726          static type t;
14727 </pre>
14728  then the expression &amp;(t.member-designator) evaluates to an address constant. (If the
14729  specified member is a bit-field, the behavior is undefined.)
14730 <h6>Recommended practice</h6>
14731 <p><!--para 4 -->
14732  The types used for size_t and ptrdiff_t should not have an integer conversion rank
14733  greater than that of signed long int unless the implementation supports objects
14734  large enough to make this necessary.
14735 <!--page 306 -->
14736 <p><b> Forward references</b>: localization (<a href="#7.11">7.11</a>).
14737 <!--page 307 -->
14738
14739 <h3><a name="7.20" href="#7.20">7.20 Integer types <stdint.h></a></h3>
14740 <p><!--para 1 -->
14741  The header <a href="#7.20">&lt;stdint.h&gt;</a> declares sets of integer types having specified widths, and
14742  defines corresponding sets of macros.<sup><a href="#note253"><b>253)</b></a></sup> It also defines macros that specify limits of
14743  integer types corresponding to types defined in other standard headers.
14744 <p><!--para 2 -->
14745  Types are defined in the following categories:
14746 <ul>
14747 <li>  integer types having certain exact widths;
14748 <li>  integer types having at least certain specified widths;
14749 <li>  fastest integer types having at least certain specified widths;
14750 <li>  integer types wide enough to hold pointers to objects;
14751 <li>  integer types having greatest width.
14752 </ul>
14753  (Some of these types may denote the same type.)
14754 <p><!--para 3 -->
14755  Corresponding macros specify limits of the declared types and construct suitable
14756  constants.
14757 <p><!--para 4 -->
14758  For each type described herein that the implementation provides,<sup><a href="#note254"><b>254)</b></a></sup> <a href="#7.20">&lt;stdint.h&gt;</a> shall
14759  declare that typedef name and define the associated macros. Conversely, for each type
14760  described herein that the implementation does not provide, <a href="#7.20">&lt;stdint.h&gt;</a> shall not
14761  declare that typedef name nor shall it define the associated macros. An implementation
14762  shall provide those types described as ''required'', but need not provide any of the others
14763  (described as ''optional'').
14764
14765 <h6>footnotes</h6>
14766 <p><small><a name="note253" href="#note253">253)</a> See ''future library directions'' (<a href="#7.30.8">7.30.8</a>).
14767 </small>
14768 <p><small><a name="note254" href="#note254">254)</a> Some of these types may denote implementation-defined extended integer types.
14769 </small>
14770
14771 <h4><a name="7.20.1" href="#7.20.1">7.20.1 Integer types</a></h4>
14772 <p><!--para 1 -->
14773  When typedef names differing only in the absence or presence of the initial u are defined,
14774  they shall denote corresponding signed and unsigned types as described in <a href="#6.2.5">6.2.5</a>; an
14775  implementation providing one of these corresponding types shall also provide the other.
14776 <p><!--para 2 -->
14777  In the following descriptions, the symbol N represents an unsigned decimal integer with
14778  no leading zeros (e.g., 8 or 24, but not 04 or 048).
14779  
14780  
14781  
14782  
14783 <!--page 308 -->
14784
14785 <h5><a name="7.20.1.1" href="#7.20.1.1">7.20.1.1 Exact-width integer types</a></h5>
14786 <p><!--para 1 -->
14787  The typedef name intN_t designates a signed integer type with width N , no padding
14788  bits, and a two's complement representation. Thus, int8_t denotes such a signed
14789  integer type with a width of exactly 8 bits.
14790 <p><!--para 2 -->
14791  The typedef name uintN_t designates an unsigned integer type with width N and no
14792  padding bits. Thus, uint24_t denotes such an unsigned integer type with a width of
14793  exactly 24 bits.
14794 <p><!--para 3 -->
14795  These types are optional. However, if an implementation provides integer types with
14796  widths of 8, 16, 32, or 64 bits, no padding bits, and (for the signed types) that have a
14797  two's complement representation, it shall define the corresponding typedef names.
14798
14799 <h5><a name="7.20.1.2" href="#7.20.1.2">7.20.1.2 Minimum-width integer types</a></h5>
14800 <p><!--para 1 -->
14801  The typedef name int_leastN_t designates a signed integer type with a width of at
14802  least N , such that no signed integer type with lesser size has at least the specified width.
14803  Thus, int_least32_t denotes a signed integer type with a width of at least 32 bits.
14804 <p><!--para 2 -->
14805  The typedef name uint_leastN_t designates an unsigned integer type with a width
14806  of at least N , such that no unsigned integer type with lesser size has at least the specified
14807  width. Thus, uint_least16_t denotes an unsigned integer type with a width of at
14808  least 16 bits.
14809 <p><!--para 3 -->
14810  The following types are required:
14811 <pre>
14812           int_least8_t                                      uint_least8_t
14813           int_least16_t                                     uint_least16_t
14814           int_least32_t                                     uint_least32_t
14815           int_least64_t                                     uint_least64_t
14816 </pre>
14817  All other types of this form are optional.
14818
14819 <h5><a name="7.20.1.3" href="#7.20.1.3">7.20.1.3 Fastest minimum-width integer types</a></h5>
14820 <p><!--para 1 -->
14821  Each of the following types designates an integer type that is usually fastest<sup><a href="#note255"><b>255)</b></a></sup> to operate
14822  with among all integer types that have at least the specified width.
14823 <p><!--para 2 -->
14824  The typedef name int_fastN_t designates the fastest signed integer type with a width
14825  of at least N . The typedef name uint_fastN_t designates the fastest unsigned integer
14826  type with a width of at least N .
14827  
14828  
14829  
14830  
14831 <!--page 309 -->
14832 <p><!--para 3 -->
14833  The following types are required:
14834 <pre>
14835          int_fast8_t                                    uint_fast8_t
14836          int_fast16_t                                   uint_fast16_t
14837          int_fast32_t                                   uint_fast32_t
14838          int_fast64_t                                   uint_fast64_t
14839 </pre>
14840  All other types of this form are optional.
14841
14842 <h6>footnotes</h6>
14843 <p><small><a name="note255" href="#note255">255)</a> The designated type is not guaranteed to be fastest for all purposes; if the implementation has no clear
14844  grounds for choosing one type over another, it will simply pick some integer type satisfying the
14845  signedness and width requirements.
14846 </small>
14847
14848 <h5><a name="7.20.1.4" href="#7.20.1.4">7.20.1.4 Integer types capable of holding object pointers</a></h5>
14849 <p><!--para 1 -->
14850  The following type designates a signed integer type with the property that any valid
14851  pointer to void can be converted to this type, then converted back to pointer to void,
14852  and the result will compare equal to the original pointer:
14853 <pre>
14854          intptr_t
14855 </pre>
14856  The following type designates an unsigned integer type with the property that any valid
14857  pointer to void can be converted to this type, then converted back to pointer to void,
14858  and the result will compare equal to the original pointer:
14859 <pre>
14860          uintptr_t
14861 </pre>
14862  These types are optional.
14863
14864 <h5><a name="7.20.1.5" href="#7.20.1.5">7.20.1.5 Greatest-width integer types</a></h5>
14865 <p><!--para 1 -->
14866  The following type designates a signed integer type capable of representing any value of
14867  any signed integer type:
14868 <pre>
14869          intmax_t
14870 </pre>
14871  The following type designates an unsigned integer type capable of representing any value
14872  of any unsigned integer type:
14873 <pre>
14874          uintmax_t
14875 </pre>
14876  These types are required.
14877
14878 <h4><a name="7.20.2" href="#7.20.2">7.20.2 Limits of specified-width integer types</a></h4>
14879 <p><!--para 1 -->
14880  The following object-like macros specify the minimum and maximum limits of the types *
14881  declared in <a href="#7.20">&lt;stdint.h&gt;</a>. Each macro name corresponds to a similar type name in
14882  <a href="#7.20.1">7.20.1</a>.
14883 <p><!--para 2 -->
14884  Each instance of any defined macro shall be replaced by a constant expression suitable
14885  for use in #if preprocessing directives, and this expression shall have the same type as
14886  would an expression that is an object of the corresponding type converted according to
14887  the integer promotions. Its implementation-defined value shall be equal to or greater in
14888  magnitude (absolute value) than the corresponding value given below, with the same sign,
14889  except where stated to be exactly the given value.
14890 <!--page 310 -->
14891
14892 <h5><a name="7.20.2.1" href="#7.20.2.1">7.20.2.1 Limits of exact-width integer types</a></h5>
14893 <p><!--para 1 -->
14894 <ul>
14895 <li>  minimum values of exact-width signed integer types
14896 <pre>
14897      INTN_MIN                                  exactly -(2 N -1 )
14898 </pre>
14899 <li>  maximum values of exact-width signed integer types
14900 <pre>
14901      INTN_MAX                                  exactly 2 N -1 - 1
14902 </pre>
14903 <li>  maximum values of exact-width unsigned integer types
14904   UINTN_MAX                                    exactly 2 N - 1
14905 </ul>
14906
14907 <h5><a name="7.20.2.2" href="#7.20.2.2">7.20.2.2 Limits of minimum-width integer types</a></h5>
14908 <p><!--para 1 -->
14909 <ul>
14910 <li>  minimum values of minimum-width signed integer types
14911 <pre>
14912      INT_LEASTN_MIN                                    -(2 N -1 - 1)
14913 </pre>
14914 <li>  maximum values of minimum-width signed integer types
14915 <pre>
14916      INT_LEASTN_MAX                                    2 N -1 - 1
14917 </pre>
14918 <li>  maximum values of minimum-width unsigned integer types
14919   UINT_LEASTN_MAX                                      2N - 1
14920 </ul>
14921
14922 <h5><a name="7.20.2.3" href="#7.20.2.3">7.20.2.3 Limits of fastest minimum-width integer types</a></h5>
14923 <p><!--para 1 -->
14924 <ul>
14925 <li>  minimum values of fastest minimum-width signed integer types
14926 <pre>
14927      INT_FASTN_MIN                                     -(2 N -1 - 1)
14928 </pre>
14929 <li>  maximum values of fastest minimum-width signed integer types
14930   INT_FASTN_MAX                                        2 N -1 - 1
14931 <li>  maximum values of fastest minimum-width unsigned integer types
14932   UINT_FASTN_MAX                                       2N - 1
14933 </ul>
14934
14935 <h5><a name="7.20.2.4" href="#7.20.2.4">7.20.2.4 Limits of integer types capable of holding object pointers</a></h5>
14936 <p><!--para 1 -->
14937 <ul>
14938 <li>  minimum value of pointer-holding signed integer type
14939 <pre>
14940      INTPTR_MIN                                        -(215 - 1)
14941 </pre>
14942 <li>  maximum value of pointer-holding signed integer type
14943   INTPTR_MAX                                           215 - 1
14944 <li>  maximum value of pointer-holding unsigned integer type
14945   UINTPTR_MAX                                          216 - 1
14946 <!--page 311 -->
14947 </ul>
14948
14949 <h5><a name="7.20.2.5" href="#7.20.2.5">7.20.2.5 Limits of greatest-width integer types</a></h5>
14950 <p><!--para 1 -->
14951 <ul>
14952 <li>  minimum value of greatest-width signed integer type
14953    INTMAX_MIN                                                    -(263 - 1)
14954 <li>  maximum value of greatest-width signed integer type
14955    INTMAX_MAX                                                    263 - 1
14956 <li>  maximum value of greatest-width unsigned integer type
14957    UINTMAX_MAX                                                   264 - 1
14958 </ul>
14959
14960 <h4><a name="7.20.3" href="#7.20.3">7.20.3 Limits of other integer types</a></h4>
14961 <p><!--para 1 -->
14962  The following object-like macros specify the minimum and maximum limits of integer *
14963  types corresponding to types defined in other standard headers.
14964 <p><!--para 2 -->
14965  Each instance of these macros shall be replaced by a constant expression suitable for use
14966  in #if preprocessing directives, and this expression shall have the same type as would an
14967  expression that is an object of the corresponding type converted according to the integer
14968  promotions. Its implementation-defined value shall be equal to or greater in magnitude
14969  (absolute value) than the corresponding value given below, with the same sign. An
14970  implementation shall define only the macros corresponding to those typedef names it
14971  actually provides.<sup><a href="#note256"><b>256)</b></a></sup>
14972 <ul>
14973 <li>  limits of ptrdiff_t
14974    PTRDIFF_MIN                                                 -65535
14975    PTRDIFF_MAX                                                 +65535
14976 <li>  limits of sig_atomic_t
14977    SIG_ATOMIC_MIN                                              see below
14978    SIG_ATOMIC_MAX                                              see below
14979 <li>  limit of size_t
14980    SIZE_MAX                                                      65535
14981 <li>  limits of wchar_t
14982    WCHAR_MIN                                                   see below
14983    WCHAR_MAX                                                   see below
14984 <li>  limits of wint_t
14985  
14986  
14987  
14988  
14989 <!--page 312 -->
14990    WINT_MIN                                              see below
14991    WINT_MAX                                              see below
14992 </ul>
14993 <p><!--para 3 -->
14994  If sig_atomic_t (see <a href="#7.14">7.14</a>) is defined as a signed integer type, the value of
14995  SIG_ATOMIC_MIN shall be no greater than -127 and the value of SIG_ATOMIC_MAX
14996  shall be no less than 127; otherwise, sig_atomic_t is defined as an unsigned integer
14997  type, and the value of SIG_ATOMIC_MIN shall be 0 and the value of
14998  SIG_ATOMIC_MAX shall be no less than 255.
14999 <p><!--para 4 -->
15000  If wchar_t (see <a href="#7.19">7.19</a>) is defined as a signed integer type, the value of WCHAR_MIN
15001  shall be no greater than -127 and the value of WCHAR_MAX shall be no less than 127;
15002  otherwise, wchar_t is defined as an unsigned integer type, and the value of
15003  WCHAR_MIN shall be 0 and the value of WCHAR_MAX shall be no less than 255.<sup><a href="#note257"><b>257)</b></a></sup>
15004 <p><!--para 5 -->
15005  If wint_t (see <a href="#7.28">7.28</a>) is defined as a signed integer type, the value of WINT_MIN shall
15006  be no greater than -32767 and the value of WINT_MAX shall be no less than 32767;
15007  otherwise, wint_t is defined as an unsigned integer type, and the value of WINT_MIN
15008  shall be 0 and the value of WINT_MAX shall be no less than 65535.
15009
15010 <h6>footnotes</h6>
15011 <p><small><a name="note256" href="#note256">256)</a> A freestanding implementation need not provide all of these types.
15012 </small>
15013 <p><small><a name="note257" href="#note257">257)</a> The values WCHAR_MIN and WCHAR_MAX do not necessarily correspond to members of the extended
15014  character set.
15015 </small>
15016
15017 <h4><a name="7.20.4" href="#7.20.4">7.20.4 Macros for integer constants</a></h4>
15018 <p><!--para 1 -->
15019  The following function-like macros expand to integer constants suitable for initializing *
15020  objects that have integer types corresponding to types defined in <a href="#7.20">&lt;stdint.h&gt;</a>. Each
15021  macro name corresponds to a similar type name in <a href="#7.20.1.2">7.20.1.2</a> or <a href="#7.20.1.5">7.20.1.5</a>.
15022 <p><!--para 2 -->
15023  The argument in any instance of these macros shall be an unsuffixed integer constant (as
15024  defined in <a href="#6.4.4.1">6.4.4.1</a>) with a value that does not exceed the limits for the corresponding type.
15025 <p><!--para 3 -->
15026  Each invocation of one of these macros shall expand to an integer constant expression
15027  suitable for use in #if preprocessing directives. The type of the expression shall have
15028  the same type as would an expression of the corresponding type converted according to
15029  the integer promotions. The value of the expression shall be that of the argument.
15030
15031 <h5><a name="7.20.4.1" href="#7.20.4.1">7.20.4.1 Macros for minimum-width integer constants</a></h5>
15032 <p><!--para 1 -->
15033  The macro INTN_C(value) shall expand to an integer constant expression
15034  corresponding to the type int_leastN_t. The macro UINTN_C(value) shall expand
15035  to an integer constant expression corresponding to the type uint_leastN_t. For
15036  example, if uint_least64_t is a name for the type unsigned long long int,
15037  then UINT64_C(0x123) might expand to the integer constant 0x123ULL.
15038  
15039  
15040  
15041  
15042 <!--page 313 -->
15043
15044 <h5><a name="7.20.4.2" href="#7.20.4.2">7.20.4.2 Macros for greatest-width integer constants</a></h5>
15045 <p><!--para 1 -->
15046  The following macro expands to an integer constant expression having the value specified
15047  by its argument and the type intmax_t:
15048 <pre>
15049          INTMAX_C(value)
15050 </pre>
15051  The following macro expands to an integer constant expression having the value specified
15052  by its argument and the type uintmax_t:
15053 <!--page 314 -->
15054 <pre>
15055          UINTMAX_C(value)
15056 </pre>
15057
15058 <h3><a name="7.21" href="#7.21">7.21 Input/output <stdio.h></a></h3>
15059
15060 <h4><a name="7.21.1" href="#7.21.1">7.21.1 Introduction</a></h4>
15061 <p><!--para 1 -->
15062  The header <a href="#7.21">&lt;stdio.h&gt;</a> defines several macros, and declares three types and many
15063  functions for performing input and output.
15064 <p><!--para 2 -->
15065  The types declared are size_t (described in <a href="#7.19">7.19</a>);
15066 <pre>
15067         FILE
15068 </pre>
15069  which is an object type capable of recording all the information needed to control a
15070  stream, including its file position indicator, a pointer to its associated buffer (if any), an
15071  error indicator that records whether a read/write error has occurred, and an end-of-file
15072  indicator that records whether the end of the file has been reached; and
15073 <pre>
15074         fpos_t
15075 </pre>
15076  which is a complete object type other than an array type capable of recording all the
15077  information needed to specify uniquely every position within a file.
15078 <p><!--para 3 -->
15079  The macros are NULL (described in <a href="#7.19">7.19</a>);
15080 <pre>
15081         _IOFBF
15082         _IOLBF
15083         _IONBF
15084 </pre>
15085  which expand to integer constant expressions with distinct values, suitable for use as the
15086  third argument to the setvbuf function;
15087 <pre>
15088         BUFSIZ
15089 </pre>
15090  which expands to an integer constant expression that is the size of the buffer used by the
15091  setbuf function;
15092 <pre>
15093         EOF
15094 </pre>
15095  which expands to an integer constant expression, with type int and a negative value, that
15096  is returned by several functions to indicate end-of-file, that is, no more input from a
15097  stream;
15098 <pre>
15099         FOPEN_MAX
15100 </pre>
15101  which expands to an integer constant expression that is the minimum number of files that
15102  the implementation guarantees can be open simultaneously;
15103 <pre>
15104         FILENAME_MAX
15105 </pre>
15106  which expands to an integer constant expression that is the size needed for an array of
15107  char large enough to hold the longest file name string that the implementation
15108 <!--page 315 -->
15109  guarantees can be opened;<sup><a href="#note258"><b>258)</b></a></sup>
15110 <pre>
15111          L_tmpnam
15112 </pre>
15113  which expands to an integer constant expression that is the size needed for an array of
15114  char large enough to hold a temporary file name string generated by the tmpnam
15115  function;
15116 <pre>
15117          SEEK_CUR
15118          SEEK_END
15119          SEEK_SET
15120 </pre>
15121  which expand to integer constant expressions with distinct values, suitable for use as the
15122  third argument to the fseek function;
15123 <pre>
15124          TMP_MAX
15125 </pre>
15126  which expands to an integer constant expression that is the minimum number of unique
15127  file names that can be generated by the tmpnam function;
15128 <pre>
15129          stderr
15130          stdin
15131          stdout
15132 </pre>
15133  which are expressions of type ''pointer to FILE'' that point to the FILE objects
15134  associated, respectively, with the standard error, input, and output streams.
15135 <p><!--para 4 -->
15136  The header <a href="#7.28">&lt;wchar.h&gt;</a> declares a number of functions useful for wide character input
15137  and output. The wide character input/output functions described in that subclause
15138  provide operations analogous to most of those described here, except that the
15139  fundamental units internal to the program are wide characters. The external
15140  representation (in the file) is a sequence of ''generalized'' multibyte characters, as
15141  described further in <a href="#7.21.3">7.21.3</a>.
15142 <p><!--para 5 -->
15143  The input/output functions are given the following collective terms:
15144 <ul>
15145 <li>  The wide character input functions -- those functions described in <a href="#7.28">7.28</a> that perform
15146  input into wide characters and wide strings: fgetwc, fgetws, getwc, getwchar,
15147  fwscanf, wscanf, vfwscanf, and vwscanf.
15148 <li>  The wide character output functions -- those functions described in <a href="#7.28">7.28</a> that perform
15149  output from wide characters and wide strings: fputwc, fputws, putwc,
15150  putwchar, fwprintf, wprintf, vfwprintf, and vwprintf.
15151  
15152  
15153 <!--page 316 -->
15154 <li>  The wide character input/output functions -- the union of the ungetwc function, the
15155  wide character input functions, and the wide character output functions.
15156 <li>  The byte input/output functions -- those functions described in this subclause that
15157  perform input/output: fgetc, fgets, fprintf, fputc, fputs, fread,
15158  fscanf, fwrite, getc, getchar, printf, putc, putchar, puts, scanf, *
15159  ungetc, vfprintf, vfscanf, vprintf, and vscanf.
15160 </ul>
15161 <p><b> Forward references</b>: files (<a href="#7.21.3">7.21.3</a>), the fseek function (<a href="#7.21.9.2">7.21.9.2</a>), streams (<a href="#7.21.2">7.21.2</a>), the
15162  tmpnam function (<a href="#7.21.4.4">7.21.4.4</a>), <a href="#7.28">&lt;wchar.h&gt;</a> (<a href="#7.28">7.28</a>).
15163
15164 <h6>footnotes</h6>
15165 <p><small><a name="note258" href="#note258">258)</a> If the implementation imposes no practical limit on the length of file name strings, the value of
15166  FILENAME_MAX should instead be the recommended size of an array intended to hold a file name
15167  string. Of course, file name string contents are subject to other system-specific constraints; therefore
15168  all possible strings of length FILENAME_MAX cannot be expected to be opened successfully.
15169 </small>
15170
15171 <h4><a name="7.21.2" href="#7.21.2">7.21.2 Streams</a></h4>
15172 <p><!--para 1 -->
15173  Input and output, whether to or from physical devices such as terminals and tape drives,
15174  or whether to or from files supported on structured storage devices, are mapped into
15175  logical data streams, whose properties are more uniform than their various inputs and
15176  outputs. Two forms of mapping are supported, for text streams and for binary
15177  streams.<sup><a href="#note259"><b>259)</b></a></sup>
15178 <p><!--para 2 -->
15179  A text stream is an ordered sequence of characters composed into lines, each line
15180  consisting of zero or more characters plus a terminating new-line character. Whether the
15181  last line requires a terminating new-line character is implementation-defined. Characters
15182  may have to be added, altered, or deleted on input and output to conform to differing
15183  conventions for representing text in the host environment. Thus, there need not be a one-
15184  to-one correspondence between the characters in a stream and those in the external
15185  representation. Data read in from a text stream will necessarily compare equal to the data
15186  that were earlier written out to that stream only if: the data consist only of printing
15187  characters and the control characters horizontal tab and new-line; no new-line character is
15188  immediately preceded by space characters; and the last character is a new-line character.
15189  Whether space characters that are written out immediately before a new-line character
15190  appear when read in is implementation-defined.
15191 <p><!--para 3 -->
15192  A binary stream is an ordered sequence of characters that can transparently record
15193  internal data. Data read in from a binary stream shall compare equal to the data that were
15194  earlier written out to that stream, under the same implementation. Such a stream may,
15195  however, have an implementation-defined number of null characters appended to the end
15196  of the stream.
15197 <p><!--para 4 -->
15198  Each stream has an orientation. After a stream is associated with an external file, but
15199  before any operations are performed on it, the stream is without orientation. Once a wide
15200  character input/output function has been applied to a stream without orientation, the
15201  
15202  
15203 <!--page 317 -->
15204  stream becomes a wide-oriented stream. Similarly, once a byte input/output function has
15205  been applied to a stream without orientation, the stream becomes a byte-oriented stream.
15206  Only a call to the freopen function or the fwide function can otherwise alter the
15207  orientation of a stream. (A successful call to freopen removes any orientation.)<sup><a href="#note260"><b>260)</b></a></sup>
15208 <p><!--para 5 -->
15209  Byte input/output functions shall not be applied to a wide-oriented stream and wide
15210  character input/output functions shall not be applied to a byte-oriented stream. The
15211  remaining stream operations do not affect, and are not affected by, a stream's orientation,
15212  except for the following additional restrictions:
15213 <ul>
15214 <li>  Binary wide-oriented streams have the file-positioning restrictions ascribed to both
15215  text and binary streams.
15216 <li>  For wide-oriented streams, after a successful call to a file-positioning function that
15217  leaves the file position indicator prior to the end-of-file, a wide character output
15218  function can overwrite a partial multibyte character; any file contents beyond the
15219  byte(s) written are henceforth indeterminate.
15220 </ul>
15221 <p><!--para 6 -->
15222  Each wide-oriented stream has an associated mbstate_t object that stores the current
15223  parse state of the stream. A successful call to fgetpos stores a representation of the
15224  value of this mbstate_t object as part of the value of the fpos_t object. A later
15225  successful call to fsetpos using the same stored fpos_t value restores the value of
15226  the associated mbstate_t object as well as the position within the controlled stream.
15227 <h6>Environmental limits</h6>
15228 <p><!--para 7 -->
15229  An implementation shall support text files with lines containing at least 254 characters,
15230  including the terminating new-line character. The value of the macro BUFSIZ shall be at
15231  least 256.
15232 <p><b> Forward references</b>: the freopen function (<a href="#7.21.5.4">7.21.5.4</a>), the fwide function (<a href="#7.28.3.5">7.28.3.5</a>),
15233  mbstate_t (<a href="#7.29.1">7.29.1</a>), the fgetpos function (<a href="#7.21.9.1">7.21.9.1</a>), the fsetpos function
15234  (<a href="#7.21.9.3">7.21.9.3</a>).
15235  
15236  
15237  
15238  
15239 <!--page 318 -->
15240
15241 <h6>footnotes</h6>
15242 <p><small><a name="note259" href="#note259">259)</a> An implementation need not distinguish between text streams and binary streams. In such an
15243  implementation, there need be no new-line characters in a text stream nor any limit to the length of a
15244  line.
15245 </small>
15246 <p><small><a name="note260" href="#note260">260)</a> The three predefined streams stdin, stdout, and stderr are unoriented at program startup.
15247 </small>
15248
15249 <h4><a name="7.21.3" href="#7.21.3">7.21.3 Files</a></h4>
15250 <p><!--para 1 -->
15251  A stream is associated with an external file (which may be a physical device) by opening
15252  a file, which may involve creating a new file. Creating an existing file causes its former
15253  contents to be discarded, if necessary. If a file can support positioning requests (such as a
15254  disk file, as opposed to a terminal), then a file position indicator associated with the
15255  stream is positioned at the start (character number zero) of the file, unless the file is
15256  opened with append mode in which case it is implementation-defined whether the file
15257  position indicator is initially positioned at the beginning or the end of the file. The file
15258  position indicator is maintained by subsequent reads, writes, and positioning requests, to
15259  facilitate an orderly progression through the file.
15260 <p><!--para 2 -->
15261  Binary files are not truncated, except as defined in <a href="#7.21.5.3">7.21.5.3</a>. Whether a write on a text
15262  stream causes the associated file to be truncated beyond that point is implementation-
15263  defined.
15264 <p><!--para 3 -->
15265  When a stream is unbuffered, characters are intended to appear from the source or at the
15266  destination as soon as possible. Otherwise characters may be accumulated and
15267  transmitted to or from the host environment as a block. When a stream is fully buffered,
15268  characters are intended to be transmitted to or from the host environment as a block when
15269  a buffer is filled. When a stream is line buffered, characters are intended to be
15270  transmitted to or from the host environment as a block when a new-line character is
15271  encountered. Furthermore, characters are intended to be transmitted as a block to the host
15272  environment when a buffer is filled, when input is requested on an unbuffered stream, or
15273  when input is requested on a line buffered stream that requires the transmission of
15274  characters from the host environment. Support for these characteristics is
15275  implementation-defined, and may be affected via the setbuf and setvbuf functions.
15276 <p><!--para 4 -->
15277  A file may be disassociated from a controlling stream by closing the file. Output streams
15278  are flushed (any unwritten buffer contents are transmitted to the host environment) before
15279  the stream is disassociated from the file. The value of a pointer to a FILE object is
15280  indeterminate after the associated file is closed (including the standard text streams).
15281  Whether a file of zero length (on which no characters have been written by an output
15282  stream) actually exists is implementation-defined.
15283 <p><!--para 5 -->
15284  The file may be subsequently reopened, by the same or another program execution, and
15285  its contents reclaimed or modified (if it can be repositioned at its start). If the main
15286  function returns to its original caller, or if the exit function is called, all open files are
15287  closed (hence all output streams are flushed) before program termination. Other paths to
15288  program termination, such as calling the abort function, need not close all files
15289  properly.
15290 <p><!--para 6 -->
15291  The address of the FILE object used to control a stream may be significant; a copy of a
15292  FILE object need not serve in place of the original.
15293 <!--page 319 -->
15294 <p><!--para 7 -->
15295  At program startup, three text streams are predefined and need not be opened explicitly
15296 <ul>
15297 <li>  standard input (for reading conventional input), standard output (for writing
15298 </ul>
15299  conventional output), and standard error (for writing diagnostic output). As initially
15300  opened, the standard error stream is not fully buffered; the standard input and standard
15301  output streams are fully buffered if and only if the stream can be determined not to refer
15302  to an interactive device.
15303 <p><!--para 8 -->
15304  Functions that open additional (nontemporary) files require a file name, which is a string.
15305  The rules for composing valid file names are implementation-defined. Whether the same
15306  file can be simultaneously open multiple times is also implementation-defined.
15307 <p><!--para 9 -->
15308  Although both text and binary wide-oriented streams are conceptually sequences of wide
15309  characters, the external file associated with a wide-oriented stream is a sequence of
15310  multibyte characters, generalized as follows:
15311 <ul>
15312 <li>  Multibyte encodings within files may contain embedded null bytes (unlike multibyte
15313  encodings valid for use internal to the program).
15314 <li>  A file need not begin nor end in the initial shift state.<sup><a href="#note261"><b>261)</b></a></sup>
15315 </ul>
15316 <p><!--para 10 -->
15317  Moreover, the encodings used for multibyte characters may differ among files. Both the
15318  nature and choice of such encodings are implementation-defined.
15319 <p><!--para 11 -->
15320  The wide character input functions read multibyte characters from the stream and convert
15321  them to wide characters as if they were read by successive calls to the fgetwc function.
15322  Each conversion occurs as if by a call to the mbrtowc function, with the conversion state
15323  described by the stream's own mbstate_t object. The byte input functions read
15324  characters from the stream as if by successive calls to the fgetc function.
15325 <p><!--para 12 -->
15326  The wide character output functions convert wide characters to multibyte characters and
15327  write them to the stream as if they were written by successive calls to the fputwc
15328  function. Each conversion occurs as if by a call to the wcrtomb function, with the
15329  conversion state described by the stream's own mbstate_t object. The byte output
15330  functions write characters to the stream as if by successive calls to the fputc function.
15331 <p><!--para 13 -->
15332  In some cases, some of the byte input/output functions also perform conversions between
15333  multibyte characters and wide characters. These conversions also occur as if by calls to
15334  the mbrtowc and wcrtomb functions.
15335 <p><!--para 14 -->
15336  An encoding error occurs if the character sequence presented to the underlying
15337  mbrtowc function does not form a valid (generalized) multibyte character, or if the code
15338  value passed to the underlying wcrtomb does not correspond to a valid (generalized)
15339  
15340  
15341 <!--page 320 -->
15342  multibyte character. The wide character input/output functions and the byte input/output
15343  functions store the value of the macro EILSEQ in errno if and only if an encoding error
15344  occurs.
15345 <h6>Environmental limits</h6>
15346 <p><!--para 15 -->
15347  The value of FOPEN_MAX shall be at least eight, including the three standard text
15348  streams.
15349 <p><b> Forward references</b>: the exit function (<a href="#7.22.4.4">7.22.4.4</a>), the fgetc function (<a href="#7.21.7.1">7.21.7.1</a>), the
15350  fopen function (<a href="#7.21.5.3">7.21.5.3</a>), the fputc function (<a href="#7.21.7.3">7.21.7.3</a>), the setbuf function
15351  (<a href="#7.21.5.5">7.21.5.5</a>), the setvbuf function (<a href="#7.21.5.6">7.21.5.6</a>), the fgetwc function (<a href="#7.28.3.1">7.28.3.1</a>), the
15352  fputwc function (<a href="#7.28.3.3">7.28.3.3</a>), conversion state (<a href="#7.28.6">7.28.6</a>), the mbrtowc function
15353  (<a href="#7.28.6.3.2">7.28.6.3.2</a>), the wcrtomb function (<a href="#7.28.6.3.3">7.28.6.3.3</a>).
15354
15355 <h6>footnotes</h6>
15356 <p><small><a name="note261" href="#note261">261)</a> Setting the file position indicator to end-of-file, as with fseek(file, 0, SEEK_END), has
15357  undefined behavior for a binary stream (because of possible trailing null characters) or for any stream
15358  with state-dependent encoding that does not assuredly end in the initial shift state.
15359 </small>
15360
15361 <h4><a name="7.21.4" href="#7.21.4">7.21.4 Operations on files</a></h4>
15362
15363 <h5><a name="7.21.4.1" href="#7.21.4.1">7.21.4.1 The remove function</a></h5>
15364 <h6>Synopsis</h6>
15365 <p><!--para 1 -->
15366 <pre>
15367         #include <a href="#7.21">&lt;stdio.h&gt;</a>
15368         int remove(const char *filename);
15369 </pre>
15370 <h6>Description</h6>
15371 <p><!--para 2 -->
15372  The remove function causes the file whose name is the string pointed to by filename
15373  to be no longer accessible by that name. A subsequent attempt to open that file using that
15374  name will fail, unless it is created anew. If the file is open, the behavior of the remove
15375  function is implementation-defined.
15376 <h6>Returns</h6>
15377 <p><!--para 3 -->
15378  The remove function returns zero if the operation succeeds, nonzero if it fails.
15379
15380 <h5><a name="7.21.4.2" href="#7.21.4.2">7.21.4.2 The rename function</a></h5>
15381 <h6>Synopsis</h6>
15382 <p><!--para 1 -->
15383 <pre>
15384         #include <a href="#7.21">&lt;stdio.h&gt;</a>
15385         int rename(const char *old, const char *new);
15386 </pre>
15387 <h6>Description</h6>
15388 <p><!--para 2 -->
15389  The rename function causes the file whose name is the string pointed to by old to be
15390  henceforth known by the name given by the string pointed to by new. The file named
15391  old is no longer accessible by that name. If a file named by the string pointed to by new
15392  exists prior to the call to the rename function, the behavior is implementation-defined.
15393 <!--page 321 -->
15394 <h6>Returns</h6>
15395 <p><!--para 3 -->
15396  The rename function returns zero if the operation succeeds, nonzero if it fails,<sup><a href="#note262"><b>262)</b></a></sup> in
15397  which case if the file existed previously it is still known by its original name.
15398
15399 <h6>footnotes</h6>
15400 <p><small><a name="note262" href="#note262">262)</a> Among the reasons the implementation may cause the rename function to fail are that the file is open
15401  or that it is necessary to copy its contents to effectuate its renaming.
15402 </small>
15403
15404 <h5><a name="7.21.4.3" href="#7.21.4.3">7.21.4.3 The tmpfile function</a></h5>
15405 <h6>Synopsis</h6>
15406 <p><!--para 1 -->
15407 <pre>
15408          #include <a href="#7.21">&lt;stdio.h&gt;</a>
15409          FILE *tmpfile(void);
15410 </pre>
15411 <h6>Description</h6>
15412 <p><!--para 2 -->
15413  The tmpfile function creates a temporary binary file that is different from any other
15414  existing file and that will automatically be removed when it is closed or at program
15415  termination. If the program terminates abnormally, whether an open temporary file is
15416  removed is implementation-defined. The file is opened for update with "wb+" mode.
15417 <h6>Recommended practice</h6>
15418 <p><!--para 3 -->
15419  It should be possible to open at least TMP_MAX temporary files during the lifetime of the
15420  program (this limit may be shared with tmpnam) and there should be no limit on the
15421  number simultaneously open other than this limit and any limit on the number of open
15422  files (FOPEN_MAX).
15423 <h6>Returns</h6>
15424 <p><!--para 4 -->
15425  The tmpfile function returns a pointer to the stream of the file that it created. If the file
15426  cannot be created, the tmpfile function returns a null pointer.
15427 <p><b> Forward references</b>: the fopen function (<a href="#7.21.5.3">7.21.5.3</a>).
15428
15429 <h5><a name="7.21.4.4" href="#7.21.4.4">7.21.4.4 The tmpnam function</a></h5>
15430 <h6>Synopsis</h6>
15431 <p><!--para 1 -->
15432 <pre>
15433          #include <a href="#7.21">&lt;stdio.h&gt;</a>
15434          char *tmpnam(char *s);
15435 </pre>
15436 <h6>Description</h6>
15437 <p><!--para 2 -->
15438  The tmpnam function generates a string that is a valid file name and that is not the same
15439  as the name of an existing file.<sup><a href="#note263"><b>263)</b></a></sup> The function is potentially capable of generating at
15440  
15441  
15442 <!--page 322 -->
15443  least TMP_MAX different strings, but any or all of them may already be in use by existing
15444  files and thus not be suitable return values.
15445 <p><!--para 3 -->
15446  The tmpnam function generates a different string each time it is called.
15447 <p><!--para 4 -->
15448  Calls to the tmpnam function with a null pointer argument may introduce data races with
15449  each other. The implementation shall behave as if no library function calls the tmpnam
15450  function.
15451 <h6>Returns</h6>
15452 <p><!--para 5 -->
15453  If no suitable string can be generated, the tmpnam function returns a null pointer.
15454  Otherwise, if the argument is a null pointer, the tmpnam function leaves its result in an
15455  internal static object and returns a pointer to that object (subsequent calls to the tmpnam
15456  function may modify the same object). If the argument is not a null pointer, it is assumed
15457  to point to an array of at least L_tmpnam chars; the tmpnam function writes its result
15458  in that array and returns the argument as its value.
15459 <h6>Environmental limits</h6>
15460 <p><!--para 6 -->
15461  The value of the macro TMP_MAX shall be at least 25.
15462
15463 <h6>footnotes</h6>
15464 <p><small><a name="note263" href="#note263">263)</a> Files created using strings generated by the tmpnam function are temporary only in the sense that
15465  their names should not collide with those generated by conventional naming rules for the
15466  implementation. It is still necessary to use the remove function to remove such files when their use
15467  is ended, and before program termination.
15468 </small>
15469
15470 <h4><a name="7.21.5" href="#7.21.5">7.21.5 File access functions</a></h4>
15471
15472 <h5><a name="7.21.5.1" href="#7.21.5.1">7.21.5.1 The fclose function</a></h5>
15473 <h6>Synopsis</h6>
15474 <p><!--para 1 -->
15475 <pre>
15476         #include <a href="#7.21">&lt;stdio.h&gt;</a>
15477         int fclose(FILE *stream);
15478 </pre>
15479 <h6>Description</h6>
15480 <p><!--para 2 -->
15481  A successful call to the fclose function causes the stream pointed to by stream to be
15482  flushed and the associated file to be closed. Any unwritten buffered data for the stream
15483  are delivered to the host environment to be written to the file; any unread buffered data
15484  are discarded. Whether or not the call succeeds, the stream is disassociated from the file
15485  and any buffer set by the setbuf or setvbuf function is disassociated from the stream
15486  (and deallocated if it was automatically allocated).
15487 <h6>Returns</h6>
15488 <p><!--para 3 -->
15489  The fclose function returns zero if the stream was successfully closed, or EOF if any
15490  errors were detected.
15491 <!--page 323 -->
15492
15493 <h5><a name="7.21.5.2" href="#7.21.5.2">7.21.5.2 The fflush function</a></h5>
15494 <h6>Synopsis</h6>
15495 <p><!--para 1 -->
15496 <pre>
15497          #include <a href="#7.21">&lt;stdio.h&gt;</a>
15498          int fflush(FILE *stream);
15499 </pre>
15500 <h6>Description</h6>
15501 <p><!--para 2 -->
15502  If stream points to an output stream or an update stream in which the most recent
15503  operation was not input, the fflush function causes any unwritten data for that stream
15504  to be delivered to the host environment to be written to the file; otherwise, the behavior is
15505  undefined.
15506 <p><!--para 3 -->
15507  If stream is a null pointer, the fflush function performs this flushing action on all
15508  streams for which the behavior is defined above.
15509 <h6>Returns</h6>
15510 <p><!--para 4 -->
15511  The fflush function sets the error indicator for the stream and returns EOF if a write
15512  error occurs, otherwise it returns zero.
15513 <p><b> Forward references</b>: the fopen function (<a href="#7.21.5.3">7.21.5.3</a>).
15514
15515 <h5><a name="7.21.5.3" href="#7.21.5.3">7.21.5.3 The fopen function</a></h5>
15516 <h6>Synopsis</h6>
15517 <p><!--para 1 -->
15518 <pre>
15519          #include <a href="#7.21">&lt;stdio.h&gt;</a>
15520          FILE *fopen(const char * restrict filename,
15521               const char * restrict mode);
15522 </pre>
15523 <h6>Description</h6>
15524 <p><!--para 2 -->
15525  The fopen function opens the file whose name is the string pointed to by filename,
15526  and associates a stream with it.
15527 <p><!--para 3 -->
15528  The argument mode points to a string. If the string is one of the following, the file is
15529  open in the indicated mode. Otherwise, the behavior is undefined.<sup><a href="#note264"><b>264)</b></a></sup>
15530  r                     open text file for reading
15531  w                     truncate to zero length or create text file for writing
15532  wx                    create text file for writing
15533  a                     append; open or create text file for writing at end-of-file
15534  rb                    open binary file for reading
15535  wb                    truncate to zero length or create binary file for writing
15536  
15537  
15538 <!--page 324 -->
15539  wbx               create binary file for writing
15540  ab                append; open or create binary file for writing at end-of-file
15541  r+                open text file for update (reading and writing)
15542  w+                truncate to zero length or create text file for update
15543  w+x               create text file for update
15544  a+                append; open or create text file for update, writing at end-of-file
15545  r+b or rb+        open binary file for update (reading and writing)
15546  w+b or wb+        truncate to zero length or create binary file for update
15547  w+bx or wb+x      create binary file for update
15548  a+b or ab+        append; open or create binary file for update, writing at end-of-file
15549 <p><!--para 4 -->
15550  Opening a file with read mode ('r' as the first character in the mode argument) fails if
15551  the file does not exist or cannot be read.
15552 <p><!--para 5 -->
15553  Opening a file with exclusive mode ('x' as the last character in the mode argument)
15554  fails if the file already exists or cannot be created. Otherwise, the file is created with
15555  exclusive (also known as non-shared) access to the extent that the underlying system
15556  supports exclusive access.
15557 <p><!--para 6 -->
15558  Opening a file with append mode ('a' as the first character in the mode argument)
15559  causes all subsequent writes to the file to be forced to the then current end-of-file,
15560  regardless of intervening calls to the fseek function. In some implementations, opening
15561  a binary file with append mode ('b' as the second or third character in the above list of
15562  mode argument values) may initially position the file position indicator for the stream
15563  beyond the last data written, because of null character padding.
15564 <p><!--para 7 -->
15565  When a file is opened with update mode ('+' as the second or third character in the
15566  above list of mode argument values), both input and output may be performed on the
15567  associated stream. However, output shall not be directly followed by input without an
15568  intervening call to the fflush function or to a file positioning function (fseek,
15569  fsetpos, or rewind), and input shall not be directly followed by output without an
15570  intervening call to a file positioning function, unless the input operation encounters end-
15571  of-file. Opening (or creating) a text file with update mode may instead open (or create) a
15572  binary stream in some implementations.
15573 <p><!--para 8 -->
15574  When opened, a stream is fully buffered if and only if it can be determined not to refer to
15575  an interactive device. The error and end-of-file indicators for the stream are cleared.
15576 <h6>Returns</h6>
15577 <p><!--para 9 -->
15578  The fopen function returns a pointer to the object controlling the stream. If the open
15579  operation fails, fopen returns a null pointer.
15580 <p><b> Forward references</b>: file positioning functions (<a href="#7.21.9">7.21.9</a>).
15581 <!--page 325 -->
15582
15583 <h6>footnotes</h6>
15584 <p><small><a name="note264" href="#note264">264)</a> If the string begins with one of the above sequences, the implementation might choose to ignore the
15585  remaining characters, or it might use them to select different kinds of a file (some of which might not
15586  conform to the properties in <a href="#7.21.2">7.21.2</a>).
15587 </small>
15588
15589 <h5><a name="7.21.5.4" href="#7.21.5.4">7.21.5.4 The freopen function</a></h5>
15590 <h6>Synopsis</h6>
15591 <p><!--para 1 -->
15592 <pre>
15593          #include <a href="#7.21">&lt;stdio.h&gt;</a>
15594          FILE *freopen(const char * restrict filename,
15595               const char * restrict mode,
15596               FILE * restrict stream);
15597 </pre>
15598 <h6>Description</h6>
15599 <p><!--para 2 -->
15600  The freopen function opens the file whose name is the string pointed to by filename
15601  and associates the stream pointed to by stream with it. The mode argument is used just
15602  as in the fopen function.<sup><a href="#note265"><b>265)</b></a></sup>
15603 <p><!--para 3 -->
15604  If filename is a null pointer, the freopen function attempts to change the mode of
15605  the stream to that specified by mode, as if the name of the file currently associated with
15606  the stream had been used. It is implementation-defined which changes of mode are
15607  permitted (if any), and under what circumstances.
15608 <p><!--para 4 -->
15609  The freopen function first attempts to close any file that is associated with the specified
15610  stream. Failure to close the file is ignored. The error and end-of-file indicators for the
15611  stream are cleared.
15612 <h6>Returns</h6>
15613 <p><!--para 5 -->
15614  The freopen function returns a null pointer if the open operation fails. Otherwise,
15615  freopen returns the value of stream.
15616
15617 <h6>footnotes</h6>
15618 <p><small><a name="note265" href="#note265">265)</a> The primary use of the freopen function is to change the file associated with a standard text stream
15619  (stderr, stdin, or stdout), as those identifiers need not be modifiable lvalues to which the value
15620  returned by the fopen function may be assigned.
15621 </small>
15622
15623 <h5><a name="7.21.5.5" href="#7.21.5.5">7.21.5.5 The setbuf function</a></h5>
15624 <h6>Synopsis</h6>
15625 <p><!--para 1 -->
15626 <pre>
15627          #include <a href="#7.21">&lt;stdio.h&gt;</a>
15628          void setbuf(FILE * restrict stream,
15629               char * restrict buf);
15630 </pre>
15631 <h6>Description</h6>
15632 <p><!--para 2 -->
15633  Except that it returns no value, the setbuf function is equivalent to the setvbuf
15634  function invoked with the values _IOFBF for mode and BUFSIZ for size, or (if buf
15635  is a null pointer), with the value _IONBF for mode.
15636  
15637  
15638  
15639  
15640 <!--page 326 -->
15641 <h6>Returns</h6>
15642 <p><!--para 3 -->
15643  The setbuf function returns no value.
15644 <p><b> Forward references</b>: the setvbuf function (<a href="#7.21.5.6">7.21.5.6</a>).
15645
15646 <h5><a name="7.21.5.6" href="#7.21.5.6">7.21.5.6 The setvbuf function</a></h5>
15647 <h6>Synopsis</h6>
15648 <p><!--para 1 -->
15649 <pre>
15650          #include <a href="#7.21">&lt;stdio.h&gt;</a>
15651          int setvbuf(FILE * restrict stream,
15652               char * restrict buf,
15653               int mode, size_t size);
15654 </pre>
15655 <h6>Description</h6>
15656 <p><!--para 2 -->
15657  The setvbuf function may be used only after the stream pointed to by stream has
15658  been associated with an open file and before any other operation (other than an
15659  unsuccessful call to setvbuf) is performed on the stream. The argument mode
15660  determines how stream will be buffered, as follows: _IOFBF causes input/output to be
15661  fully buffered; _IOLBF causes input/output to be line buffered; _IONBF causes
15662  input/output to be unbuffered. If buf is not a null pointer, the array it points to may be
15663  used instead of a buffer allocated by the setvbuf function<sup><a href="#note266"><b>266)</b></a></sup> and the argument size
15664  specifies the size of the array; otherwise, size may determine the size of a buffer
15665  allocated by the setvbuf function. The contents of the array at any time are
15666  indeterminate.
15667 <h6>Returns</h6>
15668 <p><!--para 3 -->
15669  The setvbuf function returns zero on success, or nonzero if an invalid value is given
15670  for mode or if the request cannot be honored.
15671  
15672  
15673  
15674  
15675 <!--page 327 -->
15676
15677 <h6>footnotes</h6>
15678 <p><small><a name="note266" href="#note266">266)</a> The buffer has to have a lifetime at least as great as the open stream, so the stream should be closed
15679  before a buffer that has automatic storage duration is deallocated upon block exit.
15680 </small>
15681
15682 <h4><a name="7.21.6" href="#7.21.6">7.21.6 Formatted input/output functions</a></h4>
15683 <p><!--para 1 -->
15684  The formatted input/output functions shall behave as if there is a sequence point after the
15685  actions associated with each specifier.<sup><a href="#note267"><b>267)</b></a></sup>
15686
15687 <h6>footnotes</h6>
15688 <p><small><a name="note267" href="#note267">267)</a> The fprintf functions perform writes to memory for the %n specifier.
15689 </small>
15690
15691 <h5><a name="7.21.6.1" href="#7.21.6.1">7.21.6.1 The fprintf function</a></h5>
15692 <h6>Synopsis</h6>
15693 <p><!--para 1 -->
15694 <pre>
15695           #include <a href="#7.21">&lt;stdio.h&gt;</a>
15696           int fprintf(FILE * restrict stream,
15697                const char * restrict format, ...);
15698 </pre>
15699 <h6>Description</h6>
15700 <p><!--para 2 -->
15701  The fprintf function writes output to the stream pointed to by stream, under control
15702  of the string pointed to by format that specifies how subsequent arguments are
15703  converted for output. If there are insufficient arguments for the format, the behavior is
15704  undefined. If the format is exhausted while arguments remain, the excess arguments are
15705  evaluated (as always) but are otherwise ignored. The fprintf function returns when
15706  the end of the format string is encountered.
15707 <p><!--para 3 -->
15708  The format shall be a multibyte character sequence, beginning and ending in its initial
15709  shift state. The format is composed of zero or more directives: ordinary multibyte
15710  characters (not %), which are copied unchanged to the output stream; and conversion
15711  specifications, each of which results in fetching zero or more subsequent arguments,
15712  converting them, if applicable, according to the corresponding conversion specifier, and
15713  then writing the result to the output stream.
15714 <p><!--para 4 -->
15715  Each conversion specification is introduced by the character %. After the %, the following
15716  appear in sequence:
15717 <ul>
15718 <li>  Zero or more flags (in any order) that modify the meaning of the conversion
15719  specification.
15720 <li>  An optional minimum field width. If the converted value has fewer characters than the
15721  field width, it is padded with spaces (by default) on the left (or right, if the left
15722  adjustment flag, described later, has been given) to the field width. The field width
15723  takes the form of an asterisk * (described later) or a nonnegative decimal integer.<sup><a href="#note268"><b>268)</b></a></sup>
15724 <li>  An optional precision that gives the minimum number of digits to appear for the d, i,
15725  o, u, x, and X conversions, the number of digits to appear after the decimal-point
15726  character for a, A, e, E, f, and F conversions, the maximum number of significant
15727  digits for the g and G conversions, or the maximum number of bytes to be written for
15728  
15729  
15730 <!--page 328 -->
15731    s conversions. The precision takes the form of a period (.) followed either by an
15732    asterisk * (described later) or by an optional decimal integer; if only the period is
15733    specified, the precision is taken as zero. If a precision appears with any other
15734    conversion specifier, the behavior is undefined.
15735 <li>  An optional length modifier that specifies the size of the argument.
15736 <li>  A conversion specifier character that specifies the type of conversion to be applied.
15737 </ul>
15738 <p><!--para 5 -->
15739  As noted above, a field width, or precision, or both, may be indicated by an asterisk. In
15740  this case, an int argument supplies the field width or precision. The arguments
15741  specifying field width, or precision, or both, shall appear (in that order) before the
15742  argument (if any) to be converted. A negative field width argument is taken as a - flag
15743  followed by a positive field width. A negative precision argument is taken as if the
15744  precision were omitted.
15745 <p><!--para 6 -->
15746  The flag characters and their meanings are:
15747  -       The result of the conversion is left-justified within the field. (It is right-justified if
15748 <pre>
15749          this flag is not specified.)
15750 </pre>
15751  +       The result of a signed conversion always begins with a plus or minus sign. (It
15752 <pre>
15753          begins with a sign only when a negative value is converted if this flag is not
15754          specified.)<sup><a href="#note269"><b>269)</b></a></sup>
15755 </pre>
15756  space If the first character of a signed conversion is not a sign, or if a signed conversion
15757 <pre>
15758        results in no characters, a space is prefixed to the result. If the space and + flags
15759        both appear, the space flag is ignored.
15760 </pre>
15761  #       The result is converted to an ''alternative form''. For o conversion, it increases
15762 <pre>
15763          the precision, if and only if necessary, to force the first digit of the result to be a
15764          zero (if the value and precision are both 0, a single 0 is printed). For x (or X)
15765          conversion, a nonzero result has 0x (or 0X) prefixed to it. For a, A, e, E, f, F, g,
15766          and G conversions, the result of converting a floating-point number always
15767          contains a decimal-point character, even if no digits follow it. (Normally, a
15768          decimal-point character appears in the result of these conversions only if a digit
15769          follows it.) For g and G conversions, trailing zeros are not removed from the
15770          result. For other conversions, the behavior is undefined.
15771 </pre>
15772  0       For d, i, o, u, x, X, a, A, e, E, f, F, g, and G conversions, leading zeros
15773 <pre>
15774          (following any indication of sign or base) are used to pad to the field width rather
15775          than performing space padding, except when converting an infinity or NaN. If the
15776          0 and - flags both appear, the 0 flag is ignored. For d, i, o, u, x, and X
15777 </pre>
15778  
15779  
15780 <!--page 329 -->
15781 <pre>
15782            conversions, if a precision is specified, the 0 flag is ignored. For other
15783            conversions, the behavior is undefined.
15784 </pre>
15785 <p><!--para 7 -->
15786  The length modifiers and their meanings are:
15787  hh            Specifies that a following d, i, o, u, x, or X conversion specifier applies to a
15788 <pre>
15789                signed char or unsigned char argument (the argument will have
15790                been promoted according to the integer promotions, but its value shall be
15791                converted to signed char or unsigned char before printing); or that
15792                a following n conversion specifier applies to a pointer to a signed char
15793                argument.
15794 </pre>
15795  h             Specifies that a following d, i, o, u, x, or X conversion specifier applies to a
15796 <pre>
15797                short int or unsigned short int argument (the argument will
15798                have been promoted according to the integer promotions, but its value shall
15799                be converted to short int or unsigned short int before printing);
15800                or that a following n conversion specifier applies to a pointer to a short
15801                int argument.
15802 </pre>
15803  l (ell)       Specifies that a following d, i, o, u, x, or X conversion specifier applies to a
15804 <pre>
15805                long int or unsigned long int argument; that a following n
15806                conversion specifier applies to a pointer to a long int argument; that a
15807                following c conversion specifier applies to a wint_t argument; that a
15808                following s conversion specifier applies to a pointer to a wchar_t
15809                argument; or has no effect on a following a, A, e, E, f, F, g, or G conversion
15810                specifier.
15811 </pre>
15812  ll (ell-ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a
15813 <pre>
15814               long long int or unsigned long long int argument; or that a
15815               following n conversion specifier applies to a pointer to a long long int
15816               argument.
15817 </pre>
15818  j             Specifies that a following d, i, o, u, x, or X conversion specifier applies to
15819 <pre>
15820                an intmax_t or uintmax_t argument; or that a following n conversion
15821                specifier applies to a pointer to an intmax_t argument.
15822 </pre>
15823  z             Specifies that a following d, i, o, u, x, or X conversion specifier applies to a
15824 <pre>
15825                size_t or the corresponding signed integer type argument; or that a
15826                following n conversion specifier applies to a pointer to a signed integer type
15827                corresponding to size_t argument.
15828 </pre>
15829  t             Specifies that a following d, i, o, u, x, or X conversion specifier applies to a
15830 <!--page 330 -->
15831 <pre>
15832                ptrdiff_t or the corresponding unsigned integer type argument; or that a
15833                following n conversion specifier applies to a pointer to a ptrdiff_t
15834                argument.
15835 </pre>
15836  L              Specifies that a following a, A, e, E, f, F, g, or G conversion specifier
15837 <pre>
15838                 applies to a long double argument.
15839 </pre>
15840  If a length modifier appears with any conversion specifier other than as specified above,
15841  the behavior is undefined.
15842 <p><!--para 8 -->
15843  The conversion specifiers and their meanings are:
15844  d,i          The int argument is converted to signed decimal in the style [-]dddd. The
15845 <pre>
15846               precision specifies the minimum number of digits to appear; if the value
15847               being converted can be represented in fewer digits, it is expanded with
15848               leading zeros. The default precision is 1. The result of converting a zero
15849               value with a precision of zero is no characters.
15850 </pre>
15851  o,u,x,X The unsigned int argument is converted to unsigned octal (o), unsigned
15852 <pre>
15853          decimal (u), or unsigned hexadecimal notation (x or X) in the style dddd; the
15854          letters abcdef are used for x conversion and the letters ABCDEF for X
15855          conversion. The precision specifies the minimum number of digits to appear;
15856          if the value being converted can be represented in fewer digits, it is expanded
15857          with leading zeros. The default precision is 1. The result of converting a
15858          zero value with a precision of zero is no characters.
15859 </pre>
15860  f,F          A double argument representing a floating-point number is converted to
15861 <pre>
15862               decimal notation in the style [-]ddd.ddd, where the number of digits after
15863               the decimal-point character is equal to the precision specification. If the
15864               precision is missing, it is taken as 6; if the precision is zero and the # flag is
15865               not specified, no decimal-point character appears. If a decimal-point
15866               character appears, at least one digit appears before it. The value is rounded to
15867               the appropriate number of digits.
15868               A double argument representing an infinity is converted in one of the styles
15869               [-]inf or [-]infinity -- which style is implementation-defined. A
15870               double argument representing a NaN is converted in one of the styles
15871               [-]nan or [-]nan(n-char-sequence) -- which style, and the meaning of
15872               any n-char-sequence, is implementation-defined. The F conversion specifier
15873               produces INF, INFINITY, or NAN instead of inf, infinity, or nan,
15874               respectively.<sup><a href="#note270"><b>270)</b></a></sup>
15875 </pre>
15876  e,E          A double argument representing a floating-point number is converted in the
15877 <pre>
15878               style [-]d.ddd e(+-)dd, where there is one digit (which is nonzero if the
15879               argument is nonzero) before the decimal-point character and the number of
15880               digits after it is equal to the precision; if the precision is missing, it is taken as
15881 </pre>
15882  
15883  
15884 <!--page 331 -->
15885 <pre>
15886                6; if the precision is zero and the # flag is not specified, no decimal-point
15887                character appears. The value is rounded to the appropriate number of digits.
15888                The E conversion specifier produces a number with E instead of e
15889                introducing the exponent. The exponent always contains at least two digits,
15890                and only as many more digits as necessary to represent the exponent. If the
15891                value is zero, the exponent is zero.
15892                A double argument representing an infinity or NaN is converted in the style
15893                of an f or F conversion specifier.
15894 </pre>
15895  g,G           A double argument representing a floating-point number is converted in
15896 <pre>
15897                style f or e (or in style F or E in the case of a G conversion specifier),
15898                depending on the value converted and the precision. Let P equal the
15899                precision if nonzero, 6 if the precision is omitted, or 1 if the precision is zero.
15900                Then, if a conversion with style E would have an exponent of X:
15901                -- if P &gt; X &gt;= -4, the conversion is with style f (or F) and precision
15902                  P - (X + 1).
15903                -- otherwise, the conversion is with style e (or E) and precision P - 1.
15904                Finally, unless the # flag is used, any trailing zeros are removed from the
15905                fractional portion of the result and the decimal-point character is removed if
15906                there is no fractional portion remaining.
15907                A double argument representing an infinity or NaN is converted in the style
15908                of an f or F conversion specifier.
15909 </pre>
15910  a,A           A double argument representing a floating-point number is converted in the
15911 <pre>
15912                style [-]0xh.hhhh p(+-)d, where there is one hexadecimal digit (which is
15913                nonzero if the argument is a normalized floating-point number and is
15914                otherwise unspecified) before the decimal-point character<sup><a href="#note271"><b>271)</b></a></sup> and the number
15915                of hexadecimal digits after it is equal to the precision; if the precision is
15916                missing and FLT_RADIX is a power of 2, then the precision is sufficient for
15917                an exact representation of the value; if the precision is missing and
15918                FLT_RADIX is not a power of 2, then the precision is sufficient to
15919 </pre>
15920  
15921  
15922  
15923  
15924 <!--page 332 -->
15925 <pre>
15926                distinguish<sup><a href="#note272"><b>272)</b></a></sup> values of type double, except that trailing zeros may be
15927                omitted; if the precision is zero and the # flag is not specified, no decimal-
15928                point character appears. The letters abcdef are used for a conversion and
15929                the letters ABCDEF for A conversion. The A conversion specifier produces a
15930                number with X and P instead of x and p. The exponent always contains at
15931                least one digit, and only as many more digits as necessary to represent the
15932                decimal exponent of 2. If the value is zero, the exponent is zero.
15933                A double argument representing an infinity or NaN is converted in the style
15934                of an f or F conversion specifier.
15935 </pre>
15936  c             If no l length modifier is present, the int argument is converted to an
15937 <pre>
15938                unsigned char, and the resulting character is written.
15939                If an l length modifier is present, the wint_t argument is converted as if by
15940                an ls conversion specification with no precision and an argument that points
15941                to the initial element of a two-element array of wchar_t, the first element
15942                containing the wint_t argument to the lc conversion specification and the
15943                second a null wide character.
15944 </pre>
15945  s             If no l length modifier is present, the argument shall be a pointer to the initial
15946 <pre>
15947                element of an array of character type.<sup><a href="#note273"><b>273)</b></a></sup> Characters from the array are
15948                written up to (but not including) the terminating null character. If the
15949                precision is specified, no more than that many bytes are written. If the
15950                precision is not specified or is greater than the size of the array, the array shall
15951                contain a null character.
15952                If an l length modifier is present, the argument shall be a pointer to the initial
15953                element of an array of wchar_t type. Wide characters from the array are
15954                converted to multibyte characters (each as if by a call to the wcrtomb
15955                function, with the conversion state described by an mbstate_t object
15956                initialized to zero before the first wide character is converted) up to and
15957                including a terminating null wide character. The resulting multibyte
15958                characters are written up to (but not including) the terminating null character
15959                (byte). If no precision is specified, the array shall contain a null wide
15960                character. If a precision is specified, no more than that many bytes are
15961                written (including shift sequences, if any), and the array shall contain a null
15962                wide character if, to equal the multibyte character sequence length given by
15963 </pre>
15964  
15965 <!--page 333 -->
15966 <pre>
15967                 the precision, the function would need to access a wide character one past the
15968                 end of the array. In no case is a partial multibyte character written.<sup><a href="#note274"><b>274)</b></a></sup>
15969 </pre>
15970  p              The argument shall be a pointer to void. The value of the pointer is
15971 <pre>
15972                 converted to a sequence of printing characters, in an implementation-defined
15973                 manner.
15974 </pre>
15975  n              The argument shall be a pointer to signed integer into which is written the
15976 <pre>
15977                 number of characters written to the output stream so far by this call to
15978                 fprintf. No argument is converted, but one is consumed. If the conversion
15979                 specification includes any flags, a field width, or a precision, the behavior is
15980                 undefined.
15981 </pre>
15982  %              A % character is written. No argument is converted. The complete
15983 <pre>
15984                 conversion specification shall be %%.
15985 </pre>
15986 <p><!--para 9 -->
15987  If a conversion specification is invalid, the behavior is undefined.<sup><a href="#note275"><b>275)</b></a></sup> If any argument is
15988  not the correct type for the corresponding conversion specification, the behavior is
15989  undefined.
15990 <p><!--para 10 -->
15991  In no case does a nonexistent or small field width cause truncation of a field; if the result
15992  of a conversion is wider than the field width, the field is expanded to contain the
15993  conversion result.
15994 <p><!--para 11 -->
15995  For a and A conversions, if FLT_RADIX is a power of 2, the value is correctly rounded
15996  to a hexadecimal floating number with the given precision.
15997 <h6>Recommended practice</h6>
15998 <p><!--para 12 -->
15999  For a and A conversions, if FLT_RADIX is not a power of 2 and the result is not exactly
16000  representable in the given precision, the result should be one of the two adjacent numbers
16001  in hexadecimal floating style with the given precision, with the extra stipulation that the
16002  error should have a correct sign for the current rounding direction.
16003 <p><!--para 13 -->
16004  For e, E, f, F, g, and G conversions, if the number of significant decimal digits is at most
16005  DECIMAL_DIG, then the result should be correctly rounded.<sup><a href="#note276"><b>276)</b></a></sup> If the number of
16006  significant decimal digits is more than DECIMAL_DIG but the source value is exactly
16007  representable with DECIMAL_DIG digits, then the result should be an exact
16008  representation with trailing zeros. Otherwise, the source value is bounded by two
16009  adjacent decimal strings L &lt; U, both having DECIMAL_DIG significant digits; the value
16010  
16011  
16012 <!--page 334 -->
16013  of the resultant decimal string D should satisfy L &lt;= D &lt;= U, with the extra stipulation that
16014  the error should have a correct sign for the current rounding direction.
16015 <h6>Returns</h6>
16016 <p><!--para 14 -->
16017  The fprintf function returns the number of characters transmitted, or a negative value
16018  if an output or encoding error occurred.
16019 <h6>Environmental limits</h6>
16020 <p><!--para 15 -->
16021  The number of characters that can be produced by any single conversion shall be at least
16022  4095.
16023 <p><!--para 16 -->
16024  EXAMPLE 1         To print a date and time in the form ''Sunday, July 3, 10:02'' followed by pi to five decimal
16025  places:
16026 <pre>
16027           #include <a href="#7.12">&lt;math.h&gt;</a>
16028           #include <a href="#7.21">&lt;stdio.h&gt;</a>
16029           /* ... */
16030           char *weekday, *month;      // pointers to strings
16031           int day, hour, min;
16032           fprintf(stdout, "%s, %s %d, %.2d:%.2d\n",
16033                   weekday, month, day, hour, min);
16034           fprintf(stdout, "pi = %.5f\n", 4 * atan(1.0));
16035 </pre>
16036  
16037 <p><!--para 17 -->
16038  EXAMPLE 2 In this example, multibyte characters do not have a state-dependent encoding, and the
16039  members of the extended character set that consist of more than one byte each consist of exactly two bytes,
16040  the first of which is denoted here by a and the second by an uppercase letter.
16041 <p><!--para 18 -->
16042  Given the following wide string with length seven,
16043 <pre>
16044           static wchar_t wstr[] = L" X Yabc Z W";
16045 </pre>
16046  the seven calls
16047 <pre>
16048           fprintf(stdout,          "|1234567890123|\n");
16049           fprintf(stdout,          "|%13ls|\n", wstr);
16050           fprintf(stdout,          "|%-13.9ls|\n", wstr);
16051           fprintf(stdout,          "|%13.10ls|\n", wstr);
16052           fprintf(stdout,          "|%13.11ls|\n", wstr);
16053           fprintf(stdout,          "|%13.15ls|\n", &amp;wstr[2]);
16054           fprintf(stdout,          "|%13lc|\n", (wint_t) wstr[5]);
16055 </pre>
16056  will print the following seven lines:
16057 <pre>
16058           |1234567890123|
16059           |   X Yabc Z W|
16060           | X Yabc Z    |
16061           |     X Yabc Z|
16062           |   X Yabc Z W|
16063           |      abc Z W|
16064           |            Z|
16065 </pre>
16066  
16067 <p><b> Forward references</b>: conversion state (<a href="#7.28.6">7.28.6</a>), the wcrtomb function (<a href="#7.28.6.3.3">7.28.6.3.3</a>).
16068 <!--page 335 -->
16069
16070 <h6>footnotes</h6>
16071 <p><small><a name="note268" href="#note268">268)</a> Note that 0 is taken as a flag, not as the beginning of a field width.
16072 </small>
16073 <p><small><a name="note269" href="#note269">269)</a> The results of all floating conversions of a negative zero, and of negative values that round to zero,
16074  include a minus sign.
16075 </small>
16076 <p><small><a name="note270" href="#note270">270)</a> When applied to infinite and NaN values, the -, +, and space flag characters have their usual meaning;
16077  the # and 0 flag characters have no effect.
16078 </small>
16079 <p><small><a name="note271" href="#note271">271)</a> Binary implementations can choose the hexadecimal digit to the left of the decimal-point character so
16080  that subsequent digits align to nibble (4-bit) boundaries.
16081 </small>
16082 <p><small><a name="note272" href="#note272">272)</a> The precision p is sufficient to distinguish values of the source type if 16 p-1 &gt; b n where b is
16083  FLT_RADIX and n is the number of base-b digits in the significand of the source type. A smaller p
16084  might suffice depending on the implementation's scheme for determining the digit to the left of the
16085  decimal-point character.
16086 </small>
16087 <p><small><a name="note273" href="#note273">273)</a> No special provisions are made for multibyte characters.
16088 </small>
16089 <p><small><a name="note274" href="#note274">274)</a> Redundant shift sequences may result if multibyte characters have a state-dependent encoding.
16090 </small>
16091 <p><small><a name="note275" href="#note275">275)</a> See ''future library directions'' (<a href="#7.30.9">7.30.9</a>).
16092 </small>
16093 <p><small><a name="note276" href="#note276">276)</a> For binary-to-decimal conversion, the result format's values are the numbers representable with the
16094  given format specifier. The number of significant digits is determined by the format specifier, and in
16095  the case of fixed-point conversion by the source value as well.
16096 </small>
16097
16098 <h5><a name="7.21.6.2" href="#7.21.6.2">7.21.6.2 The fscanf function</a></h5>
16099 <h6>Synopsis</h6>
16100 <p><!--para 1 -->
16101 <pre>
16102          #include <a href="#7.21">&lt;stdio.h&gt;</a>
16103          int fscanf(FILE * restrict stream,
16104               const char * restrict format, ...);
16105 </pre>
16106 <h6>Description</h6>
16107 <p><!--para 2 -->
16108  The fscanf function reads input from the stream pointed to by stream, under control
16109  of the string pointed to by format that specifies the admissible input sequences and how
16110  they are to be converted for assignment, using subsequent arguments as pointers to the
16111  objects to receive the converted input. If there are insufficient arguments for the format,
16112  the behavior is undefined. If the format is exhausted while arguments remain, the excess
16113  arguments are evaluated (as always) but are otherwise ignored.
16114 <p><!--para 3 -->
16115  The format shall be a multibyte character sequence, beginning and ending in its initial
16116  shift state. The format is composed of zero or more directives: one or more white-space
16117  characters, an ordinary multibyte character (neither % nor a white-space character), or a
16118  conversion specification. Each conversion specification is introduced by the character %.
16119  After the %, the following appear in sequence:
16120 <ul>
16121 <li>  An optional assignment-suppressing character *.
16122 <li>  An optional decimal integer greater than zero that specifies the maximum field width
16123  (in characters).
16124 <li>  An optional length modifier that specifies the size of the receiving object.
16125 <li>  A conversion specifier character that specifies the type of conversion to be applied.
16126 </ul>
16127 <p><!--para 4 -->
16128  The fscanf function executes each directive of the format in turn. When all directives
16129  have been executed, or if a directive fails (as detailed below), the function returns.
16130  Failures are described as input failures (due to the occurrence of an encoding error or the
16131  unavailability of input characters), or matching failures (due to inappropriate input).
16132 <p><!--para 5 -->
16133  A directive composed of white-space character(s) is executed by reading input up to the
16134  first non-white-space character (which remains unread), or until no more characters can
16135  be read.
16136 <p><!--para 6 -->
16137  A directive that is an ordinary multibyte character is executed by reading the next
16138  characters of the stream. If any of those characters differ from the ones composing the
16139  directive, the directive fails and the differing and subsequent characters remain unread.
16140  Similarly, if end-of-file, an encoding error, or a read error prevents a character from being
16141  read, the directive fails.
16142 <p><!--para 7 -->
16143  A directive that is a conversion specification defines a set of matching input sequences, as
16144  described below for each specifier. A conversion specification is executed in the
16145 <!--page 336 -->
16146  following steps:
16147 <p><!--para 8 -->
16148  Input white-space characters (as specified by the isspace function) are skipped, unless
16149  the specification includes a [, c, or n specifier.<sup><a href="#note277"><b>277)</b></a></sup>
16150 <p><!--para 9 -->
16151  An input item is read from the stream, unless the specification includes an n specifier. An
16152  input item is defined as the longest sequence of input characters which does not exceed
16153  any specified field width and which is, or is a prefix of, a matching input sequence.<sup><a href="#note278"><b>278)</b></a></sup>
16154  The first character, if any, after the input item remains unread. If the length of the input
16155  item is zero, the execution of the directive fails; this condition is a matching failure unless
16156  end-of-file, an encoding error, or a read error prevented input from the stream, in which
16157  case it is an input failure.
16158 <p><!--para 10 -->
16159  Except in the case of a % specifier, the input item (or, in the case of a %n directive, the
16160  count of input characters) is converted to a type appropriate to the conversion specifier. If
16161  the input item is not a matching sequence, the execution of the directive fails: this
16162  condition is a matching failure. Unless assignment suppression was indicated by a *, the
16163  result of the conversion is placed in the object pointed to by the first argument following
16164  the format argument that has not already received a conversion result. If this object
16165  does not have an appropriate type, or if the result of the conversion cannot be represented
16166  in the object, the behavior is undefined.
16167 <p><!--para 11 -->
16168  The length modifiers and their meanings are:
16169  hh             Specifies that a following d, i, o, u, x, X, or n conversion specifier applies
16170 <pre>
16171                 to an argument with type pointer to signed char or unsigned char.
16172 </pre>
16173  h              Specifies that a following d, i, o, u, x, X, or n conversion specifier applies
16174 <pre>
16175                 to an argument with type pointer to short int or unsigned short
16176                 int.
16177 </pre>
16178  l (ell)        Specifies that a following d, i, o, u, x, X, or n conversion specifier applies
16179 <pre>
16180                 to an argument with type pointer to long int or unsigned long
16181                 int; that a following a, A, e, E, f, F, g, or G conversion specifier applies to
16182                 an argument with type pointer to double; or that a following c, s, or [
16183                 conversion specifier applies to an argument with type pointer to wchar_t.
16184 </pre>
16185  ll (ell-ell) Specifies that a following d, i, o, u, x, X, or n conversion specifier applies
16186 <pre>
16187               to an argument with type pointer to long long int or unsigned
16188               long long int.
16189 </pre>
16190  
16191  
16192  
16193 <!--page 337 -->
16194  j            Specifies that a following d, i, o, u, x, X, or n conversion specifier applies
16195 <pre>
16196               to an argument with type pointer to intmax_t or uintmax_t.
16197 </pre>
16198  z            Specifies that a following d, i, o, u, x, X, or n conversion specifier applies
16199 <pre>
16200               to an argument with type pointer to size_t or the corresponding signed
16201               integer type.
16202 </pre>
16203  t            Specifies that a following d, i, o, u, x, X, or n conversion specifier applies
16204 <pre>
16205               to an argument with type pointer to ptrdiff_t or the corresponding
16206               unsigned integer type.
16207 </pre>
16208  L            Specifies that a following a, A, e, E, f, F, g, or G conversion specifier
16209 <pre>
16210               applies to an argument with type pointer to long double.
16211 </pre>
16212  If a length modifier appears with any conversion specifier other than as specified above,
16213  the behavior is undefined.
16214 <p><!--para 12 -->
16215  The conversion specifiers and their meanings are:
16216  d           Matches an optionally signed decimal integer, whose format is the same as
16217 <pre>
16218              expected for the subject sequence of the strtol function with the value 10
16219              for the base argument. The corresponding argument shall be a pointer to
16220              signed integer.
16221 </pre>
16222  i           Matches an optionally signed integer, whose format is the same as expected
16223 <pre>
16224              for the subject sequence of the strtol function with the value 0 for the
16225              base argument. The corresponding argument shall be a pointer to signed
16226              integer.
16227 </pre>
16228  o           Matches an optionally signed octal integer, whose format is the same as
16229 <pre>
16230              expected for the subject sequence of the strtoul function with the value 8
16231              for the base argument. The corresponding argument shall be a pointer to
16232              unsigned integer.
16233 </pre>
16234  u           Matches an optionally signed decimal integer, whose format is the same as
16235 <pre>
16236              expected for the subject sequence of the strtoul function with the value 10
16237              for the base argument. The corresponding argument shall be a pointer to
16238              unsigned integer.
16239 </pre>
16240  x           Matches an optionally signed hexadecimal integer, whose format is the same
16241 <pre>
16242              as expected for the subject sequence of the strtoul function with the value
16243              16 for the base argument. The corresponding argument shall be a pointer to
16244              unsigned integer.
16245 </pre>
16246  a,e,f,g Matches an optionally signed floating-point number, infinity, or NaN, whose
16247 <!--page 338 -->
16248 <pre>
16249          format is the same as expected for the subject sequence of the strtod
16250          function. The corresponding argument shall be a pointer to floating.
16251 </pre>
16252  c             Matches a sequence of characters of exactly the number specified by the field
16253 <pre>
16254                width (1 if no field width is present in the directive).<sup><a href="#note279"><b>279)</b></a></sup>
16255                If no l length modifier is present, the corresponding argument shall be a
16256                pointer to the initial element of a character array large enough to accept the
16257                sequence. No null character is added.
16258                If an l length modifier is present, the input shall be a sequence of multibyte
16259                characters that begins in the initial shift state. Each multibyte character in the
16260                sequence is converted to a wide character as if by a call to the mbrtowc
16261                function, with the conversion state described by an mbstate_t object
16262                initialized to zero before the first multibyte character is converted. The
16263                corresponding argument shall be a pointer to the initial element of an array of
16264                wchar_t large enough to accept the resulting sequence of wide characters.
16265                No null wide character is added.
16266 </pre>
16267  s             Matches a sequence of non-white-space characters.<sup><a href="#note279"><b>279)</b></a></sup>
16268 <pre>
16269                If no l length modifier is present, the corresponding argument shall be a
16270                pointer to the initial element of a character array large enough to accept the
16271                sequence and a terminating null character, which will be added automatically.
16272                If an l length modifier is present, the input shall be a sequence of multibyte
16273                characters that begins in the initial shift state. Each multibyte character is
16274                converted to a wide character as if by a call to the mbrtowc function, with
16275                the conversion state described by an mbstate_t object initialized to zero
16276                before the first multibyte character is converted. The corresponding argument
16277                shall be a pointer to the initial element of an array of wchar_t large enough
16278                to accept the sequence and the terminating null wide character, which will be
16279                added automatically.
16280 </pre>
16281  [             Matches a nonempty sequence of characters from a set of expected characters
16282 <pre>
16283                (the scanset).<sup><a href="#note279"><b>279)</b></a></sup>
16284                If no l length modifier is present, the corresponding argument shall be a
16285                pointer to the initial element of a character array large enough to accept the
16286                sequence and a terminating null character, which will be added automatically.
16287                If an l length modifier is present, the input shall be a sequence of multibyte
16288                characters that begins in the initial shift state. Each multibyte character is
16289                converted to a wide character as if by a call to the mbrtowc function, with
16290                the conversion state described by an mbstate_t object initialized to zero
16291 </pre>
16292  
16293 <!--page 339 -->
16294 <pre>
16295                 before the first multibyte character is converted. The corresponding argument
16296                 shall be a pointer to the initial element of an array of wchar_t large enough
16297                 to accept the sequence and the terminating null wide character, which will be
16298                 added automatically.
16299                 The conversion specifier includes all subsequent characters in the format
16300                 string, up to and including the matching right bracket (]). The characters
16301                 between the brackets (the scanlist) compose the scanset, unless the character
16302                 after the left bracket is a circumflex (^), in which case the scanset contains all
16303                 characters that do not appear in the scanlist between the circumflex and the
16304                 right bracket. If the conversion specifier begins with [] or [^], the right
16305                 bracket character is in the scanlist and the next following right bracket
16306                 character is the matching right bracket that ends the specification; otherwise
16307                 the first following right bracket character is the one that ends the
16308                 specification. If a - character is in the scanlist and is not the first, nor the
16309                 second where the first character is a ^, nor the last character, the behavior is
16310                 implementation-defined.
16311 </pre>
16312  p              Matches an implementation-defined set of sequences, which should be the
16313 <pre>
16314                 same as the set of sequences that may be produced by the %p conversion of
16315                 the fprintf function. The corresponding argument shall be a pointer to a
16316                 pointer to void. The input item is converted to a pointer value in an
16317                 implementation-defined manner. If the input item is a value converted earlier
16318                 during the same program execution, the pointer that results shall compare
16319                 equal to that value; otherwise the behavior of the %p conversion is undefined.
16320 </pre>
16321  n              No input is consumed. The corresponding argument shall be a pointer to
16322 <pre>
16323                 signed integer into which is to be written the number of characters read from
16324                 the input stream so far by this call to the fscanf function. Execution of a
16325                 %n directive does not increment the assignment count returned at the
16326                 completion of execution of the fscanf function. No argument is converted,
16327                 but one is consumed. If the conversion specification includes an assignment-
16328                 suppressing character or a field width, the behavior is undefined.
16329 </pre>
16330  %              Matches a single % character; no conversion or assignment occurs. The
16331 <pre>
16332                 complete conversion specification shall be %%.
16333 </pre>
16334 <p><!--para 13 -->
16335  If a conversion specification is invalid, the behavior is undefined.<sup><a href="#note280"><b>280)</b></a></sup>
16336 <p><!--para 14 -->
16337  The conversion specifiers A, E, F, G, and X are also valid and behave the same as,
16338  respectively, a, e, f, g, and x.
16339  
16340  
16341  
16342 <!--page 340 -->
16343 <p><!--para 15 -->
16344  Trailing white space (including new-line characters) is left unread unless matched by a
16345  directive. The success of literal matches and suppressed assignments is not directly
16346  determinable other than via the %n directive.
16347 <h6>Returns</h6>
16348 <p><!--para 16 -->
16349  The fscanf function returns the value of the macro EOF if an input failure occurs
16350  before the first conversion (if any) has completed. Otherwise, the function returns the
16351  number of input items assigned, which can be fewer than provided for, or even zero, in
16352  the event of an early matching failure.
16353 <p><!--para 17 -->
16354  EXAMPLE 1        The call:
16355 <pre>
16356           #include <a href="#7.21">&lt;stdio.h&gt;</a>
16357           /* ... */
16358           int n, i; float x; char name[50];
16359           n = fscanf(stdin, "%d%f%s", &amp;i, &amp;x, name);
16360 </pre>
16361  with the input line:
16362 <pre>
16363           25 54.32E-1 thompson
16364 </pre>
16365  will assign to n the value 3, to i the value 25, to x the value 5.432, and to name the sequence
16366  thompson\0.
16367  
16368 <p><!--para 18 -->
16369  EXAMPLE 2        The call:
16370 <pre>
16371           #include <a href="#7.21">&lt;stdio.h&gt;</a>
16372           /* ... */
16373           int i; float x; char name[50];
16374           fscanf(stdin, "%2d%f%*d %[0123456789]", &amp;i, &amp;x, name);
16375 </pre>
16376  with input:
16377 <pre>
16378           56789 0123 56a72
16379 </pre>
16380  will assign to i the value 56 and to x the value 789.0, will skip 0123, and will assign to name the
16381  sequence 56\0. The next character read from the input stream will be a.
16382  
16383 <p><!--para 19 -->
16384  EXAMPLE 3        To accept repeatedly from stdin a quantity, a unit of measure, and an item name:
16385 <pre>
16386           #include <a href="#7.21">&lt;stdio.h&gt;</a>
16387           /* ... */
16388           int count; float quant; char units[21], item[21];
16389           do {
16390                   count = fscanf(stdin, "%f%20s of %20s", &amp;quant, units, item);
16391                   fscanf(stdin,"%*[^\n]");
16392           } while (!feof(stdin) &amp;&amp; !ferror(stdin));
16393 </pre>
16394 <p><!--para 20 -->
16395  If the stdin stream contains the following lines:
16396 <!--page 341 -->
16397 <pre>
16398           2 quarts of oil
16399           -12.8degrees Celsius
16400           lots of luck
16401           10.0LBS     of
16402           dirt
16403           100ergs of energy
16404 </pre>
16405  the execution of the above example will be analogous to the following assignments:
16406 <pre>
16407            quant     =   2; strcpy(units, "quarts"); strcpy(item, "oil");
16408            count     =   3;
16409            quant     =   -12.8; strcpy(units, "degrees");
16410            count     =   2; // "C" fails to match "o"
16411            count     =   0; // "l" fails to match "%f"
16412            quant     =   10.0; strcpy(units, "LBS"); strcpy(item, "dirt");
16413            count     =   3;
16414            count     =   0; // "100e" fails to match "%f"
16415            count     =   EOF;
16416 </pre>
16417  
16418 <p><!--para 21 -->
16419  EXAMPLE 4         In:
16420 <pre>
16421            #include <a href="#7.21">&lt;stdio.h&gt;</a>
16422            /* ... */
16423            int d1, d2, n1, n2, i;
16424            i = sscanf("123", "%d%n%n%d", &amp;d1, &amp;n1, &amp;n2, &amp;d2);
16425 </pre>
16426  the value 123 is assigned to d1 and the value 3 to n1. Because %n can never get an input failure the value
16427  of 3 is also assigned to n2. The value of d2 is not affected. The value 1 is assigned to i.
16428  
16429 <p><!--para 22 -->
16430  EXAMPLE 5 In these examples, multibyte characters do have a state-dependent encoding, and the
16431  members of the extended character set that consist of more than one byte each consist of exactly two bytes,
16432  the first of which is denoted here by a and the second by an uppercase letter, but are only recognized as
16433  such when in the alternate shift state. The shift sequences are denoted by (uparrow) and (downarrow), in which the first causes
16434  entry into the alternate shift state.
16435 <p><!--para 23 -->
16436  After the call:
16437 <pre>
16438            #include <a href="#7.21">&lt;stdio.h&gt;</a>
16439            /* ... */
16440            char str[50];
16441            fscanf(stdin, "a%s", str);
16442 </pre>
16443  with the input line:
16444 <pre>
16445            a(uparrow) X Y(downarrow) bc
16446 </pre>
16447  str will contain (uparrow) X Y(downarrow)\0 assuming that none of the bytes of the shift sequences (or of the multibyte
16448  characters, in the more general case) appears to be a single-byte white-space character.
16449 <p><!--para 24 -->
16450  In contrast, after the call:
16451 <pre>
16452            #include <a href="#7.21">&lt;stdio.h&gt;</a>
16453            #include <a href="#7.19">&lt;stddef.h&gt;</a>
16454            /* ... */
16455            wchar_t wstr[50];
16456            fscanf(stdin, "a%ls", wstr);
16457 </pre>
16458  with the same input line, wstr will contain the two wide characters that correspond to X and Y and a
16459  terminating null wide character.
16460 <p><!--para 25 -->
16461  However, the call:
16462 <!--page 342 -->
16463 <pre>
16464          #include <a href="#7.21">&lt;stdio.h&gt;</a>
16465          #include <a href="#7.19">&lt;stddef.h&gt;</a>
16466          /* ... */
16467          wchar_t wstr[50];
16468          fscanf(stdin, "a(uparrow) X(downarrow)%ls", wstr);
16469 </pre>
16470  with the same input line will return zero due to a matching failure against the (downarrow) sequence in the format
16471  string.
16472 <p><!--para 26 -->
16473  Assuming that the first byte of the multibyte character X is the same as the first byte of the multibyte
16474  character Y, after the call:
16475 <pre>
16476          #include <a href="#7.21">&lt;stdio.h&gt;</a>
16477          #include <a href="#7.19">&lt;stddef.h&gt;</a>
16478          /* ... */
16479          wchar_t wstr[50];
16480          fscanf(stdin, "a(uparrow) Y(downarrow)%ls", wstr);
16481 </pre>
16482  with the same input line, zero will again be returned, but stdin will be left with a partially consumed
16483  multibyte character.
16484  
16485 <p><b> Forward references</b>: the strtod, strtof, and strtold functions (<a href="#7.22.1.3">7.22.1.3</a>), the
16486  strtol, strtoll, strtoul, and strtoull functions (<a href="#7.22.1.4">7.22.1.4</a>), conversion state
16487  (<a href="#7.28.6">7.28.6</a>), the wcrtomb function (<a href="#7.28.6.3.3">7.28.6.3.3</a>).
16488
16489 <h6>footnotes</h6>
16490 <p><small><a name="note277" href="#note277">277)</a> These white-space characters are not counted against a specified field width.
16491 </small>
16492 <p><small><a name="note278" href="#note278">278)</a> fscanf pushes back at most one input character onto the input stream. Therefore, some sequences
16493  that are acceptable to strtod, strtol, etc., are unacceptable to fscanf.
16494 </small>
16495 <p><small><a name="note279" href="#note279">279)</a> No special provisions are made for multibyte characters in the matching rules used by the c, s, and [
16496  conversion specifiers -- the extent of the input field is determined on a byte-by-byte basis. The
16497  resulting field is nevertheless a sequence of multibyte characters that begins in the initial shift state.
16498 </small>
16499 <p><small><a name="note280" href="#note280">280)</a> See ''future library directions'' (<a href="#7.30.9">7.30.9</a>).
16500 </small>
16501
16502 <h5><a name="7.21.6.3" href="#7.21.6.3">7.21.6.3 The printf function</a></h5>
16503 <h6>Synopsis</h6>
16504 <p><!--para 1 -->
16505 <pre>
16506          #include <a href="#7.21">&lt;stdio.h&gt;</a>
16507          int printf(const char * restrict format, ...);
16508 </pre>
16509 <h6>Description</h6>
16510 <p><!--para 2 -->
16511  The printf function is equivalent to fprintf with the argument stdout interposed
16512  before the arguments to printf.
16513 <h6>Returns</h6>
16514 <p><!--para 3 -->
16515  The printf function returns the number of characters transmitted, or a negative value if
16516  an output or encoding error occurred.
16517
16518 <h5><a name="7.21.6.4" href="#7.21.6.4">7.21.6.4 The scanf function</a></h5>
16519 <h6>Synopsis</h6>
16520 <p><!--para 1 -->
16521 <pre>
16522          #include <a href="#7.21">&lt;stdio.h&gt;</a>
16523          int scanf(const char * restrict format, ...);
16524 </pre>
16525 <h6>Description</h6>
16526 <p><!--para 2 -->
16527  The scanf function is equivalent to fscanf with the argument stdin interposed
16528  before the arguments to scanf.
16529 <!--page 343 -->
16530 <h6>Returns</h6>
16531 <p><!--para 3 -->
16532  The scanf function returns the value of the macro EOF if an input failure occurs before
16533  the first conversion (if any) has completed. Otherwise, the scanf function returns the
16534  number of input items assigned, which can be fewer than provided for, or even zero, in
16535  the event of an early matching failure.
16536
16537 <h5><a name="7.21.6.5" href="#7.21.6.5">7.21.6.5 The snprintf function</a></h5>
16538 <h6>Synopsis</h6>
16539 <p><!--para 1 -->
16540 <pre>
16541          #include <a href="#7.21">&lt;stdio.h&gt;</a>
16542          int snprintf(char * restrict s, size_t n,
16543               const char * restrict format, ...);
16544 </pre>
16545 <h6>Description</h6>
16546 <p><!--para 2 -->
16547  The snprintf function is equivalent to fprintf, except that the output is written into
16548  an array (specified by argument s) rather than to a stream. If n is zero, nothing is written,
16549  and s may be a null pointer. Otherwise, output characters beyond the n-1st are
16550  discarded rather than being written to the array, and a null character is written at the end
16551  of the characters actually written into the array. If copying takes place between objects
16552  that overlap, the behavior is undefined.
16553 <h6>Returns</h6>
16554 <p><!--para 3 -->
16555  The snprintf function returns the number of characters that would have been written
16556  had n been sufficiently large, not counting the terminating null character, or a negative
16557  value if an encoding error occurred. Thus, the null-terminated output has been
16558  completely written if and only if the returned value is nonnegative and less than n.
16559
16560 <h5><a name="7.21.6.6" href="#7.21.6.6">7.21.6.6 The sprintf function</a></h5>
16561 <h6>Synopsis</h6>
16562 <p><!--para 1 -->
16563 <pre>
16564          #include <a href="#7.21">&lt;stdio.h&gt;</a>
16565          int sprintf(char * restrict s,
16566               const char * restrict format, ...);
16567 </pre>
16568 <h6>Description</h6>
16569 <p><!--para 2 -->
16570  The sprintf function is equivalent to fprintf, except that the output is written into
16571  an array (specified by the argument s) rather than to a stream. A null character is written
16572  at the end of the characters written; it is not counted as part of the returned value. If
16573  copying takes place between objects that overlap, the behavior is undefined.
16574 <h6>Returns</h6>
16575 <p><!--para 3 -->
16576  The sprintf function returns the number of characters written in the array, not
16577  counting the terminating null character, or a negative value if an encoding error occurred.
16578 <!--page 344 -->
16579
16580 <h5><a name="7.21.6.7" href="#7.21.6.7">7.21.6.7 The sscanf function</a></h5>
16581 <h6>Synopsis</h6>
16582 <p><!--para 1 -->
16583 <pre>
16584         #include <a href="#7.21">&lt;stdio.h&gt;</a>
16585         int sscanf(const char * restrict s,
16586              const char * restrict format, ...);
16587 </pre>
16588 <h6>Description</h6>
16589 <p><!--para 2 -->
16590  The sscanf function is equivalent to fscanf, except that input is obtained from a
16591  string (specified by the argument s) rather than from a stream. Reaching the end of the
16592  string is equivalent to encountering end-of-file for the fscanf function. If copying
16593  takes place between objects that overlap, the behavior is undefined.
16594 <h6>Returns</h6>
16595 <p><!--para 3 -->
16596  The sscanf function returns the value of the macro EOF if an input failure occurs
16597  before the first conversion (if any) has completed. Otherwise, the sscanf function
16598  returns the number of input items assigned, which can be fewer than provided for, or even
16599  zero, in the event of an early matching failure.
16600
16601 <h5><a name="7.21.6.8" href="#7.21.6.8">7.21.6.8 The vfprintf function</a></h5>
16602 <h6>Synopsis</h6>
16603 <p><!--para 1 -->
16604 <pre>
16605         #include <a href="#7.16">&lt;stdarg.h&gt;</a>
16606         #include <a href="#7.21">&lt;stdio.h&gt;</a>
16607         int vfprintf(FILE * restrict stream,
16608              const char * restrict format,
16609              va_list arg);
16610 </pre>
16611 <h6>Description</h6>
16612 <p><!--para 2 -->
16613  The vfprintf function is equivalent to fprintf, with the variable argument list
16614  replaced by arg, which shall have been initialized by the va_start macro (and
16615  possibly subsequent va_arg calls). The vfprintf function does not invoke the
16616  va_end macro.<sup><a href="#note281"><b>281)</b></a></sup>
16617 <h6>Returns</h6>
16618 <p><!--para 3 -->
16619  The vfprintf function returns the number of characters transmitted, or a negative
16620  value if an output or encoding error occurred.
16621 <p><!--para 4 -->
16622  EXAMPLE       The following shows the use of the vfprintf function in a general error-reporting routine.
16623  
16624  
16625  
16626  
16627 <!--page 345 -->
16628 <pre>
16629          #include <a href="#7.16">&lt;stdarg.h&gt;</a>
16630          #include <a href="#7.21">&lt;stdio.h&gt;</a>
16631          void error(char *function_name, char *format, ...)
16632          {
16633                va_list args;
16634                va_start(args, format);
16635                // print out name of function causing error
16636                fprintf(stderr, "ERROR in %s: ", function_name);
16637                // print out remainder of message
16638                vfprintf(stderr, format, args);
16639                va_end(args);
16640          }
16641 </pre>
16642  
16643
16644 <h6>footnotes</h6>
16645 <p><small><a name="note281" href="#note281">281)</a> As the functions vfprintf, vfscanf, vprintf, vscanf, vsnprintf, vsprintf, and
16646  vsscanf invoke the va_arg macro, the value of arg after the return is indeterminate.
16647 </small>
16648
16649 <h5><a name="7.21.6.9" href="#7.21.6.9">7.21.6.9 The vfscanf function</a></h5>
16650 <h6>Synopsis</h6>
16651 <p><!--para 1 -->
16652 <pre>
16653          #include <a href="#7.16">&lt;stdarg.h&gt;</a>
16654          #include <a href="#7.21">&lt;stdio.h&gt;</a>
16655          int vfscanf(FILE * restrict stream,
16656               const char * restrict format,
16657               va_list arg);
16658 </pre>
16659 <h6>Description</h6>
16660 <p><!--para 2 -->
16661  The vfscanf function is equivalent to fscanf, with the variable argument list
16662  replaced by arg, which shall have been initialized by the va_start macro (and
16663  possibly subsequent va_arg calls). The vfscanf function does not invoke the
16664  va_end macro.<sup><a href="#note281"><b>281)</b></a></sup>
16665 <h6>Returns</h6>
16666 <p><!--para 3 -->
16667  The vfscanf function returns the value of the macro EOF if an input failure occurs
16668  before the first conversion (if any) has completed. Otherwise, the vfscanf function
16669  returns the number of input items assigned, which can be fewer than provided for, or even
16670  zero, in the event of an early matching failure.
16671
16672 <h5><a name="7.21.6.10" href="#7.21.6.10">7.21.6.10 The vprintf function</a></h5>
16673 <h6>Synopsis</h6>
16674 <p><!--para 1 -->
16675 <pre>
16676          #include <a href="#7.16">&lt;stdarg.h&gt;</a>
16677          #include <a href="#7.21">&lt;stdio.h&gt;</a>
16678          int vprintf(const char * restrict format,
16679               va_list arg);
16680 </pre>
16681 <h6>Description</h6>
16682 <p><!--para 2 -->
16683  The vprintf function is equivalent to printf, with the variable argument list
16684  replaced by arg, which shall have been initialized by the va_start macro (and
16685 <!--page 346 -->
16686  possibly subsequent va_arg calls). The vprintf function does not invoke the
16687  va_end macro.<sup><a href="#note281"><b>281)</b></a></sup>
16688 <h6>Returns</h6>
16689 <p><!--para 3 -->
16690  The vprintf function returns the number of characters transmitted, or a negative value
16691  if an output or encoding error occurred.
16692
16693 <h5><a name="7.21.6.11" href="#7.21.6.11">7.21.6.11 The vscanf function</a></h5>
16694 <h6>Synopsis</h6>
16695 <p><!--para 1 -->
16696 <pre>
16697         #include <a href="#7.16">&lt;stdarg.h&gt;</a>
16698         #include <a href="#7.21">&lt;stdio.h&gt;</a>
16699         int vscanf(const char * restrict format,
16700              va_list arg);
16701 </pre>
16702 <h6>Description</h6>
16703 <p><!--para 2 -->
16704  The vscanf function is equivalent to scanf, with the variable argument list replaced
16705  by arg, which shall have been initialized by the va_start macro (and possibly
16706  subsequent va_arg calls). The vscanf function does not invoke the va_end
16707  macro.<sup><a href="#note281"><b>281)</b></a></sup>
16708 <h6>Returns</h6>
16709 <p><!--para 3 -->
16710  The vscanf function returns the value of the macro EOF if an input failure occurs
16711  before the first conversion (if any) has completed. Otherwise, the vscanf function
16712  returns the number of input items assigned, which can be fewer than provided for, or even
16713  zero, in the event of an early matching failure.
16714
16715 <h5><a name="7.21.6.12" href="#7.21.6.12">7.21.6.12 The vsnprintf function</a></h5>
16716 <h6>Synopsis</h6>
16717 <p><!--para 1 -->
16718 <pre>
16719         #include <a href="#7.16">&lt;stdarg.h&gt;</a>
16720         #include <a href="#7.21">&lt;stdio.h&gt;</a>
16721         int vsnprintf(char * restrict s, size_t n,
16722              const char * restrict format,
16723              va_list arg);
16724 </pre>
16725 <h6>Description</h6>
16726 <p><!--para 2 -->
16727  The vsnprintf function is equivalent to snprintf, with the variable argument list
16728  replaced by arg, which shall have been initialized by the va_start macro (and
16729  possibly subsequent va_arg calls). The vsnprintf function does not invoke the
16730  va_end macro.<sup><a href="#note281"><b>281)</b></a></sup> If copying takes place between objects that overlap, the behavior is
16731  undefined.
16732 <!--page 347 -->
16733 <h6>Returns</h6>
16734 <p><!--para 3 -->
16735  The vsnprintf function returns the number of characters that would have been written
16736  had n been sufficiently large, not counting the terminating null character, or a negative
16737  value if an encoding error occurred. Thus, the null-terminated output has been
16738  completely written if and only if the returned value is nonnegative and less than n.
16739
16740 <h5><a name="7.21.6.13" href="#7.21.6.13">7.21.6.13 The vsprintf function</a></h5>
16741 <h6>Synopsis</h6>
16742 <p><!--para 1 -->
16743 <pre>
16744          #include <a href="#7.16">&lt;stdarg.h&gt;</a>
16745          #include <a href="#7.21">&lt;stdio.h&gt;</a>
16746          int vsprintf(char * restrict s,
16747               const char * restrict format,
16748               va_list arg);
16749 </pre>
16750 <h6>Description</h6>
16751 <p><!--para 2 -->
16752  The vsprintf function is equivalent to sprintf, with the variable argument list
16753  replaced by arg, which shall have been initialized by the va_start macro (and
16754  possibly subsequent va_arg calls). The vsprintf function does not invoke the
16755  va_end macro.<sup><a href="#note281"><b>281)</b></a></sup> If copying takes place between objects that overlap, the behavior is
16756  undefined.
16757 <h6>Returns</h6>
16758 <p><!--para 3 -->
16759  The vsprintf function returns the number of characters written in the array, not
16760  counting the terminating null character, or a negative value if an encoding error occurred.
16761
16762 <h5><a name="7.21.6.14" href="#7.21.6.14">7.21.6.14 The vsscanf function</a></h5>
16763 <h6>Synopsis</h6>
16764 <p><!--para 1 -->
16765 <pre>
16766          #include <a href="#7.16">&lt;stdarg.h&gt;</a>
16767          #include <a href="#7.21">&lt;stdio.h&gt;</a>
16768          int vsscanf(const char * restrict s,
16769               const char * restrict format,
16770               va_list arg);
16771 </pre>
16772 <h6>Description</h6>
16773 <p><!--para 2 -->
16774  The vsscanf function is equivalent to sscanf, with the variable argument list
16775  replaced by arg, which shall have been initialized by the va_start macro (and
16776  possibly subsequent va_arg calls). The vsscanf function does not invoke the
16777  va_end macro.<sup><a href="#note281"><b>281)</b></a></sup>
16778 <h6>Returns</h6>
16779 <p><!--para 3 -->
16780  The vsscanf function returns the value of the macro EOF if an input failure occurs
16781  before the first conversion (if any) has completed. Otherwise, the vsscanf function
16782 <!--page 348 -->
16783  returns the number of input items assigned, which can be fewer than provided for, or even
16784  zero, in the event of an early matching failure.
16785
16786 <h4><a name="7.21.7" href="#7.21.7">7.21.7 Character input/output functions</a></h4>
16787
16788 <h5><a name="7.21.7.1" href="#7.21.7.1">7.21.7.1 The fgetc function</a></h5>
16789 <h6>Synopsis</h6>
16790 <p><!--para 1 -->
16791 <pre>
16792          #include <a href="#7.21">&lt;stdio.h&gt;</a>
16793          int fgetc(FILE *stream);
16794 </pre>
16795 <h6>Description</h6>
16796 <p><!--para 2 -->
16797  If the end-of-file indicator for the input stream pointed to by stream is not set and a
16798  next character is present, the fgetc function obtains that character as an unsigned
16799  char converted to an int and advances the associated file position indicator for the
16800  stream (if defined).
16801 <h6>Returns</h6>
16802 <p><!--para 3 -->
16803  If the end-of-file indicator for the stream is set, or if the stream is at end-of-file, the end-
16804  of-file indicator for the stream is set and the fgetc function returns EOF. Otherwise, the
16805  fgetc function returns the next character from the input stream pointed to by stream.
16806  If a read error occurs, the error indicator for the stream is set and the fgetc function
16807  returns EOF.<sup><a href="#note282"><b>282)</b></a></sup>
16808
16809 <h6>footnotes</h6>
16810 <p><small><a name="note282" href="#note282">282)</a> An end-of-file and a read error can be distinguished by use of the feof and ferror functions.
16811 </small>
16812
16813 <h5><a name="7.21.7.2" href="#7.21.7.2">7.21.7.2 The fgets function</a></h5>
16814 <h6>Synopsis</h6>
16815 <p><!--para 1 -->
16816 <pre>
16817          #include <a href="#7.21">&lt;stdio.h&gt;</a>
16818          char *fgets(char * restrict s, int n,
16819               FILE * restrict stream);
16820 </pre>
16821 <h6>Description</h6>
16822 <p><!--para 2 -->
16823  The fgets function reads at most one less than the number of characters specified by n
16824  from the stream pointed to by stream into the array pointed to by s. No additional
16825  characters are read after a new-line character (which is retained) or after end-of-file. A
16826  null character is written immediately after the last character read into the array.
16827 <h6>Returns</h6>
16828 <p><!--para 3 -->
16829  The fgets function returns s if successful. If end-of-file is encountered and no
16830  characters have been read into the array, the contents of the array remain unchanged and a
16831  null pointer is returned. If a read error occurs during the operation, the array contents are
16832  indeterminate and a null pointer is returned.
16833  
16834 <!--page 349 -->
16835
16836 <h5><a name="7.21.7.3" href="#7.21.7.3">7.21.7.3 The fputc function</a></h5>
16837 <h6>Synopsis</h6>
16838 <p><!--para 1 -->
16839 <pre>
16840          #include <a href="#7.21">&lt;stdio.h&gt;</a>
16841          int fputc(int c, FILE *stream);
16842 </pre>
16843 <h6>Description</h6>
16844 <p><!--para 2 -->
16845  The fputc function writes the character specified by c (converted to an unsigned
16846  char) to the output stream pointed to by stream, at the position indicated by the
16847  associated file position indicator for the stream (if defined), and advances the indicator
16848  appropriately. If the file cannot support positioning requests, or if the stream was opened
16849  with append mode, the character is appended to the output stream.
16850 <h6>Returns</h6>
16851 <p><!--para 3 -->
16852  The fputc function returns the character written. If a write error occurs, the error
16853  indicator for the stream is set and fputc returns EOF.
16854
16855 <h5><a name="7.21.7.4" href="#7.21.7.4">7.21.7.4 The fputs function</a></h5>
16856 <h6>Synopsis</h6>
16857 <p><!--para 1 -->
16858 <pre>
16859          #include <a href="#7.21">&lt;stdio.h&gt;</a>
16860          int fputs(const char * restrict s,
16861               FILE * restrict stream);
16862 </pre>
16863 <h6>Description</h6>
16864 <p><!--para 2 -->
16865  The fputs function writes the string pointed to by s to the stream pointed to by
16866  stream. The terminating null character is not written.
16867 <h6>Returns</h6>
16868 <p><!--para 3 -->
16869  The fputs function returns EOF if a write error occurs; otherwise it returns a
16870  nonnegative value.
16871
16872 <h5><a name="7.21.7.5" href="#7.21.7.5">7.21.7.5 The getc function</a></h5>
16873 <h6>Synopsis</h6>
16874 <p><!--para 1 -->
16875 <pre>
16876          #include <a href="#7.21">&lt;stdio.h&gt;</a>
16877          int getc(FILE *stream);
16878 </pre>
16879 <h6>Description</h6>
16880 <p><!--para 2 -->
16881  The getc function is equivalent to fgetc, except that if it is implemented as a macro, it
16882  may evaluate stream more than once, so the argument should never be an expression
16883  with side effects.
16884 <!--page 350 -->
16885 <h6>Returns</h6>
16886 <p><!--para 3 -->
16887  The getc function returns the next character from the input stream pointed to by
16888  stream. If the stream is at end-of-file, the end-of-file indicator for the stream is set and
16889  getc returns EOF. If a read error occurs, the error indicator for the stream is set and
16890  getc returns EOF.
16891
16892 <h5><a name="7.21.7.6" href="#7.21.7.6">7.21.7.6 The getchar function</a></h5>
16893 <h6>Synopsis</h6>
16894 <p><!--para 1 -->
16895 <pre>
16896         #include <a href="#7.21">&lt;stdio.h&gt;</a>
16897         int getchar(void);
16898 </pre>
16899 <h6>Description</h6>
16900 <p><!--para 2 -->
16901  The getchar function is equivalent to getc with the argument stdin.
16902 <h6>Returns</h6>
16903 <p><!--para 3 -->
16904  The getchar function returns the next character from the input stream pointed to by
16905  stdin. If the stream is at end-of-file, the end-of-file indicator for the stream is set and
16906  getchar returns EOF. If a read error occurs, the error indicator for the stream is set and
16907  getchar returns EOF.                                                                       *
16908
16909 <h5><a name="7.21.7.7" href="#7.21.7.7">7.21.7.7 The putc function</a></h5>
16910 <h6>Synopsis</h6>
16911 <p><!--para 1 -->
16912 <pre>
16913         #include <a href="#7.21">&lt;stdio.h&gt;</a>
16914         int putc(int c, FILE *stream);
16915 </pre>
16916 <h6>Description</h6>
16917 <p><!--para 2 -->
16918  The putc function is equivalent to fputc, except that if it is implemented as a macro, it
16919  may evaluate stream more than once, so that argument should never be an expression
16920  with side effects.
16921 <h6>Returns</h6>
16922 <p><!--para 3 -->
16923  The putc function returns the character written. If a write error occurs, the error
16924  indicator for the stream is set and putc returns EOF.
16925
16926 <h5><a name="7.21.7.8" href="#7.21.7.8">7.21.7.8 The putchar function</a></h5>
16927 <h6>Synopsis</h6>
16928 <p><!--para 1 -->
16929 <pre>
16930         #include <a href="#7.21">&lt;stdio.h&gt;</a>
16931         int putchar(int c);
16932 </pre>
16933 <h6>Description</h6>
16934 <p><!--para 2 -->
16935  The putchar function is equivalent to putc with the second argument stdout.
16936 <!--page 351 -->
16937 <h6>Returns</h6>
16938 <p><!--para 3 -->
16939  The putchar function returns the character written. If a write error occurs, the error
16940  indicator for the stream is set and putchar returns EOF.
16941
16942 <h5><a name="7.21.7.9" href="#7.21.7.9">7.21.7.9 The puts function</a></h5>
16943 <h6>Synopsis</h6>
16944 <p><!--para 1 -->
16945 <pre>
16946          #include <a href="#7.21">&lt;stdio.h&gt;</a>
16947          int puts(const char *s);
16948 </pre>
16949 <h6>Description</h6>
16950 <p><!--para 2 -->
16951  The puts function writes the string pointed to by s to the stream pointed to by stdout,
16952  and appends a new-line character to the output. The terminating null character is not
16953  written.
16954 <h6>Returns</h6>
16955 <p><!--para 3 -->
16956  The puts function returns EOF if a write error occurs; otherwise it returns a nonnegative
16957  value.
16958
16959 <h5><a name="7.21.7.10" href="#7.21.7.10">7.21.7.10 The ungetc function</a></h5>
16960 <h6>Synopsis</h6>
16961 <p><!--para 1 -->
16962 <pre>
16963          #include <a href="#7.21">&lt;stdio.h&gt;</a>
16964          int ungetc(int c, FILE *stream);
16965 </pre>
16966 <h6>Description</h6>
16967 <p><!--para 2 -->
16968  The ungetc function pushes the character specified by c (converted to an unsigned
16969  char) back onto the input stream pointed to by stream. Pushed-back characters will be
16970  returned by subsequent reads on that stream in the reverse order of their pushing. A
16971  successful intervening call (with the stream pointed to by stream) to a file positioning
16972  function (fseek, fsetpos, or rewind) discards any pushed-back characters for the
16973  stream. The external storage corresponding to the stream is unchanged.
16974 <p><!--para 3 -->
16975  One character of pushback is guaranteed. If the ungetc function is called too many
16976  times on the same stream without an intervening read or file positioning operation on that
16977  stream, the operation may fail.
16978 <p><!--para 4 -->
16979  If the value of c equals that of the macro EOF, the operation fails and the input stream is
16980  unchanged.
16981 <p><!--para 5 -->
16982  A successful call to the ungetc function clears the end-of-file indicator for the stream.
16983  The value of the file position indicator for the stream after reading or discarding all
16984  pushed-back characters shall be the same as it was before the characters were pushed
16985  back. For a text stream, the value of its file position indicator after a successful call to the
16986  ungetc function is unspecified until all pushed-back characters are read or discarded.
16987 <!--page 352 -->
16988  For a binary stream, its file position indicator is decremented by each successful call to
16989  the ungetc function; if its value was zero before a call, it is indeterminate after the
16990  call.<sup><a href="#note283"><b>283)</b></a></sup>
16991 <h6>Returns</h6>
16992 <p><!--para 6 -->
16993  The ungetc function returns the character pushed back after conversion, or EOF if the
16994  operation fails.
16995 <p><b> Forward references</b>: file positioning functions (<a href="#7.21.9">7.21.9</a>).
16996
16997 <h6>footnotes</h6>
16998 <p><small><a name="note283" href="#note283">283)</a> See ''future library directions'' (<a href="#7.30.9">7.30.9</a>).
16999 </small>
17000
17001 <h4><a name="7.21.8" href="#7.21.8">7.21.8 Direct input/output functions</a></h4>
17002
17003 <h5><a name="7.21.8.1" href="#7.21.8.1">7.21.8.1 The fread function</a></h5>
17004 <h6>Synopsis</h6>
17005 <p><!--para 1 -->
17006 <pre>
17007           #include <a href="#7.21">&lt;stdio.h&gt;</a>
17008           size_t fread(void * restrict ptr,
17009                size_t size, size_t nmemb,
17010                FILE * restrict stream);
17011 </pre>
17012 <h6>Description</h6>
17013 <p><!--para 2 -->
17014  The fread function reads, into the array pointed to by ptr, up to nmemb elements
17015  whose size is specified by size, from the stream pointed to by stream. For each
17016  object, size calls are made to the fgetc function and the results stored, in the order
17017  read, in an array of unsigned char exactly overlaying the object. The file position
17018  indicator for the stream (if defined) is advanced by the number of characters successfully
17019  read. If an error occurs, the resulting value of the file position indicator for the stream is
17020  indeterminate. If a partial element is read, its value is indeterminate.
17021 <h6>Returns</h6>
17022 <p><!--para 3 -->
17023  The fread function returns the number of elements successfully read, which may be
17024  less than nmemb if a read error or end-of-file is encountered. If size or nmemb is zero,
17025  fread returns zero and the contents of the array and the state of the stream remain
17026  unchanged.
17027  
17028  
17029  
17030  
17031 <!--page 353 -->
17032
17033 <h5><a name="7.21.8.2" href="#7.21.8.2">7.21.8.2 The fwrite function</a></h5>
17034 <h6>Synopsis</h6>
17035 <p><!--para 1 -->
17036 <pre>
17037          #include <a href="#7.21">&lt;stdio.h&gt;</a>
17038          size_t fwrite(const void * restrict ptr,
17039               size_t size, size_t nmemb,
17040               FILE * restrict stream);
17041 </pre>
17042 <h6>Description</h6>
17043 <p><!--para 2 -->
17044  The fwrite function writes, from the array pointed to by ptr, up to nmemb elements
17045  whose size is specified by size, to the stream pointed to by stream. For each object,
17046  size calls are made to the fputc function, taking the values (in order) from an array of
17047  unsigned char exactly overlaying the object. The file position indicator for the
17048  stream (if defined) is advanced by the number of characters successfully written. If an
17049  error occurs, the resulting value of the file position indicator for the stream is
17050  indeterminate.
17051 <h6>Returns</h6>
17052 <p><!--para 3 -->
17053  The fwrite function returns the number of elements successfully written, which will be
17054  less than nmemb only if a write error is encountered. If size or nmemb is zero,
17055  fwrite returns zero and the state of the stream remains unchanged.
17056
17057 <h4><a name="7.21.9" href="#7.21.9">7.21.9 File positioning functions</a></h4>
17058
17059 <h5><a name="7.21.9.1" href="#7.21.9.1">7.21.9.1 The fgetpos function</a></h5>
17060 <h6>Synopsis</h6>
17061 <p><!--para 1 -->
17062 <pre>
17063          #include <a href="#7.21">&lt;stdio.h&gt;</a>
17064          int fgetpos(FILE * restrict stream,
17065               fpos_t * restrict pos);
17066 </pre>
17067 <h6>Description</h6>
17068 <p><!--para 2 -->
17069  The fgetpos function stores the current values of the parse state (if any) and file
17070  position indicator for the stream pointed to by stream in the object pointed to by pos.
17071  The values stored contain unspecified information usable by the fsetpos function for
17072  repositioning the stream to its position at the time of the call to the fgetpos function.
17073 <h6>Returns</h6>
17074 <p><!--para 3 -->
17075  If successful, the fgetpos function returns zero; on failure, the fgetpos function
17076  returns nonzero and stores an implementation-defined positive value in errno.
17077 <p><b> Forward references</b>: the fsetpos function (<a href="#7.21.9.3">7.21.9.3</a>).
17078 <!--page 354 -->
17079
17080 <h5><a name="7.21.9.2" href="#7.21.9.2">7.21.9.2 The fseek function</a></h5>
17081 <h6>Synopsis</h6>
17082 <p><!--para 1 -->
17083 <pre>
17084         #include <a href="#7.21">&lt;stdio.h&gt;</a>
17085         int fseek(FILE *stream, long int offset, int whence);
17086 </pre>
17087 <h6>Description</h6>
17088 <p><!--para 2 -->
17089  The fseek function sets the file position indicator for the stream pointed to by stream.
17090  If a read or write error occurs, the error indicator for the stream is set and fseek fails.
17091 <p><!--para 3 -->
17092  For a binary stream, the new position, measured in characters from the beginning of the
17093  file, is obtained by adding offset to the position specified by whence. The specified
17094  position is the beginning of the file if whence is SEEK_SET, the current value of the file
17095  position indicator if SEEK_CUR, or end-of-file if SEEK_END. A binary stream need not
17096  meaningfully support fseek calls with a whence value of SEEK_END.
17097 <p><!--para 4 -->
17098  For a text stream, either offset shall be zero, or offset shall be a value returned by
17099  an earlier successful call to the ftell function on a stream associated with the same file
17100  and whence shall be SEEK_SET.
17101 <p><!--para 5 -->
17102  After determining the new position, a successful call to the fseek function undoes any
17103  effects of the ungetc function on the stream, clears the end-of-file indicator for the
17104  stream, and then establishes the new position. After a successful fseek call, the next
17105  operation on an update stream may be either input or output.
17106 <h6>Returns</h6>
17107 <p><!--para 6 -->
17108  The fseek function returns nonzero only for a request that cannot be satisfied.
17109 <p><b> Forward references</b>: the ftell function (<a href="#7.21.9.4">7.21.9.4</a>).
17110
17111 <h5><a name="7.21.9.3" href="#7.21.9.3">7.21.9.3 The fsetpos function</a></h5>
17112 <h6>Synopsis</h6>
17113 <p><!--para 1 -->
17114 <pre>
17115         #include <a href="#7.21">&lt;stdio.h&gt;</a>
17116         int fsetpos(FILE *stream, const fpos_t *pos);
17117 </pre>
17118 <h6>Description</h6>
17119 <p><!--para 2 -->
17120  The fsetpos function sets the mbstate_t object (if any) and file position indicator
17121  for the stream pointed to by stream according to the value of the object pointed to by
17122  pos, which shall be a value obtained from an earlier successful call to the fgetpos
17123  function on a stream associated with the same file. If a read or write error occurs, the
17124  error indicator for the stream is set and fsetpos fails.
17125 <p><!--para 3 -->
17126  A successful call to the fsetpos function undoes any effects of the ungetc function
17127  on the stream, clears the end-of-file indicator for the stream, and then establishes the new
17128  parse state and position. After a successful fsetpos call, the next operation on an
17129 <!--page 355 -->
17130  update stream may be either input or output.
17131 <h6>Returns</h6>
17132 <p><!--para 4 -->
17133  If successful, the fsetpos function returns zero; on failure, the fsetpos function
17134  returns nonzero and stores an implementation-defined positive value in errno.
17135
17136 <h5><a name="7.21.9.4" href="#7.21.9.4">7.21.9.4 The ftell function</a></h5>
17137 <h6>Synopsis</h6>
17138 <p><!--para 1 -->
17139 <pre>
17140          #include <a href="#7.21">&lt;stdio.h&gt;</a>
17141          long int ftell(FILE *stream);
17142 </pre>
17143 <h6>Description</h6>
17144 <p><!--para 2 -->
17145  The ftell function obtains the current value of the file position indicator for the stream
17146  pointed to by stream. For a binary stream, the value is the number of characters from
17147  the beginning of the file. For a text stream, its file position indicator contains unspecified
17148  information, usable by the fseek function for returning the file position indicator for the
17149  stream to its position at the time of the ftell call; the difference between two such
17150  return values is not necessarily a meaningful measure of the number of characters written
17151  or read.
17152 <h6>Returns</h6>
17153 <p><!--para 3 -->
17154  If successful, the ftell function returns the current value of the file position indicator
17155  for the stream. On failure, the ftell function returns -1L and stores an
17156  implementation-defined positive value in errno.
17157
17158 <h5><a name="7.21.9.5" href="#7.21.9.5">7.21.9.5 The rewind function</a></h5>
17159 <h6>Synopsis</h6>
17160 <p><!--para 1 -->
17161 <pre>
17162          #include <a href="#7.21">&lt;stdio.h&gt;</a>
17163          void rewind(FILE *stream);
17164 </pre>
17165 <h6>Description</h6>
17166 <p><!--para 2 -->
17167  The rewind function sets the file position indicator for the stream pointed to by
17168  stream to the beginning of the file. It is equivalent to
17169 <pre>
17170          (void)fseek(stream, 0L, SEEK_SET)
17171 </pre>
17172  except that the error indicator for the stream is also cleared.
17173 <h6>Returns</h6>
17174 <p><!--para 3 -->
17175  The rewind function returns no value.
17176 <!--page 356 -->
17177
17178 <h4><a name="7.21.10" href="#7.21.10">7.21.10 Error-handling functions</a></h4>
17179
17180 <h5><a name="7.21.10.1" href="#7.21.10.1">7.21.10.1 The clearerr function</a></h5>
17181 <h6>Synopsis</h6>
17182 <p><!--para 1 -->
17183 <pre>
17184         #include <a href="#7.21">&lt;stdio.h&gt;</a>
17185         void clearerr(FILE *stream);
17186 </pre>
17187 <h6>Description</h6>
17188 <p><!--para 2 -->
17189  The clearerr function clears the end-of-file and error indicators for the stream pointed
17190  to by stream.
17191 <h6>Returns</h6>
17192 <p><!--para 3 -->
17193  The clearerr function returns no value.
17194
17195 <h5><a name="7.21.10.2" href="#7.21.10.2">7.21.10.2 The feof function</a></h5>
17196 <h6>Synopsis</h6>
17197 <p><!--para 1 -->
17198 <pre>
17199         #include <a href="#7.21">&lt;stdio.h&gt;</a>
17200         int feof(FILE *stream);
17201 </pre>
17202 <h6>Description</h6>
17203 <p><!--para 2 -->
17204  The feof function tests the end-of-file indicator for the stream pointed to by stream.
17205 <h6>Returns</h6>
17206 <p><!--para 3 -->
17207  The feof function returns nonzero if and only if the end-of-file indicator is set for
17208  stream.
17209
17210 <h5><a name="7.21.10.3" href="#7.21.10.3">7.21.10.3 The ferror function</a></h5>
17211 <h6>Synopsis</h6>
17212 <p><!--para 1 -->
17213 <pre>
17214         #include <a href="#7.21">&lt;stdio.h&gt;</a>
17215         int ferror(FILE *stream);
17216 </pre>
17217 <h6>Description</h6>
17218 <p><!--para 2 -->
17219  The ferror function tests the error indicator for the stream pointed to by stream.
17220 <h6>Returns</h6>
17221 <p><!--para 3 -->
17222  The ferror function returns nonzero if and only if the error indicator is set for
17223  stream.
17224 <!--page 357 -->
17225
17226 <h5><a name="7.21.10.4" href="#7.21.10.4">7.21.10.4 The perror function</a></h5>
17227 <h6>Synopsis</h6>
17228 <p><!--para 1 -->
17229 <pre>
17230          #include <a href="#7.21">&lt;stdio.h&gt;</a>
17231          void perror(const char *s);
17232 </pre>
17233 <h6>Description</h6>
17234 <p><!--para 2 -->
17235  The perror function maps the error number in the integer expression errno to an
17236  error message. It writes a sequence of characters to the standard error stream thus: first
17237  (if s is not a null pointer and the character pointed to by s is not the null character), the
17238  string pointed to by s followed by a colon (:) and a space; then an appropriate error
17239  message string followed by a new-line character. The contents of the error message
17240  strings are the same as those returned by the strerror function with argument errno.
17241 <h6>Returns</h6>
17242 <p><!--para 3 -->
17243  The perror function returns no value.
17244 <p><b> Forward references</b>: the strerror function (<a href="#7.23.6.2">7.23.6.2</a>).
17245 <!--page 358 -->
17246
17247 <h3><a name="7.22" href="#7.22">7.22 General utilities <stdlib.h></a></h3>
17248 <p><!--para 1 -->
17249  The header <a href="#7.22">&lt;stdlib.h&gt;</a> declares five types and several functions of general utility, and
17250  defines several macros.<sup><a href="#note284"><b>284)</b></a></sup>
17251 <p><!--para 2 -->
17252  The types declared are size_t and wchar_t (both described in <a href="#7.19">7.19</a>),
17253 <pre>
17254           div_t
17255 </pre>
17256  which is a structure type that is the type of the value returned by the div function,
17257 <pre>
17258           ldiv_t
17259 </pre>
17260  which is a structure type that is the type of the value returned by the ldiv function, and
17261 <pre>
17262           lldiv_t
17263 </pre>
17264  which is a structure type that is the type of the value returned by the lldiv function.
17265 <p><!--para 3 -->
17266  The macros defined are NULL (described in <a href="#7.19">7.19</a>);
17267 <pre>
17268           EXIT_FAILURE
17269 </pre>
17270  and
17271 <pre>
17272           EXIT_SUCCESS
17273 </pre>
17274  which expand to integer constant expressions that can be used as the argument to the
17275  exit function to return unsuccessful or successful termination status, respectively, to the
17276  host environment;
17277 <pre>
17278           RAND_MAX
17279 </pre>
17280  which expands to an integer constant expression that is the maximum value returned by
17281  the rand function; and
17282 <pre>
17283           MB_CUR_MAX
17284 </pre>
17285  which expands to a positive integer expression with type size_t that is the maximum
17286  number of bytes in a multibyte character for the extended character set specified by the
17287  current locale (category LC_CTYPE), which is never greater than MB_LEN_MAX.
17288  
17289  
17290  
17291  
17292 <!--page 359 -->
17293
17294 <h6>footnotes</h6>
17295 <p><small><a name="note284" href="#note284">284)</a> See ''future library directions'' (<a href="#7.30.10">7.30.10</a>).
17296 </small>
17297
17298 <h4><a name="7.22.1" href="#7.22.1">7.22.1 Numeric conversion functions</a></h4>
17299 <p><!--para 1 -->
17300  The functions atof, atoi, atol, and atoll need not affect the value of the integer
17301  expression errno on an error. If the value of the result cannot be represented, the
17302  behavior is undefined.
17303
17304 <h5><a name="7.22.1.1" href="#7.22.1.1">7.22.1.1 The atof function</a></h5>
17305 <h6>Synopsis</h6>
17306 <p><!--para 1 -->
17307 <pre>
17308          #include <a href="#7.22">&lt;stdlib.h&gt;</a>
17309          double atof(const char *nptr);
17310 </pre>
17311 <h6>Description</h6>
17312 <p><!--para 2 -->
17313  The atof function converts the initial portion of the string pointed to by nptr to
17314  double representation. Except for the behavior on error, it is equivalent to
17315 <pre>
17316          strtod(nptr, (char **)NULL)
17317 </pre>
17318 <h6>Returns</h6>
17319 <p><!--para 3 -->
17320  The atof function returns the converted value.
17321 <p><b> Forward references</b>: the strtod, strtof, and strtold functions (<a href="#7.22.1.3">7.22.1.3</a>).
17322
17323 <h5><a name="7.22.1.2" href="#7.22.1.2">7.22.1.2 The atoi, atol, and atoll functions</a></h5>
17324 <h6>Synopsis</h6>
17325 <p><!--para 1 -->
17326 <pre>
17327          #include <a href="#7.22">&lt;stdlib.h&gt;</a>
17328          int atoi(const char *nptr);
17329          long int atol(const char *nptr);
17330          long long int atoll(const char *nptr);
17331 </pre>
17332 <h6>Description</h6>
17333 <p><!--para 2 -->
17334  The atoi, atol, and atoll functions convert the initial portion of the string pointed
17335  to by nptr to int, long int, and long long int representation, respectively.
17336  Except for the behavior on error, they are equivalent to
17337 <pre>
17338          atoi: (int)strtol(nptr, (char **)NULL, 10)
17339          atol: strtol(nptr, (char **)NULL, 10)
17340          atoll: strtoll(nptr, (char **)NULL, 10)
17341 </pre>
17342 <h6>Returns</h6>
17343 <p><!--para 3 -->
17344  The atoi, atol, and atoll functions return the converted value.
17345 <p><b> Forward references</b>: the strtol, strtoll, strtoul, and strtoull functions
17346  (<a href="#7.22.1.4">7.22.1.4</a>).
17347 <!--page 360 -->
17348
17349 <h5><a name="7.22.1.3" href="#7.22.1.3">7.22.1.3 The strtod, strtof, and strtold functions</a></h5>
17350 <h6>Synopsis</h6>
17351 <p><!--para 1 -->
17352 <pre>
17353         #include <a href="#7.22">&lt;stdlib.h&gt;</a>
17354         double strtod(const char * restrict nptr,
17355              char ** restrict endptr);
17356         float strtof(const char * restrict nptr,
17357              char ** restrict endptr);
17358         long double strtold(const char * restrict nptr,
17359              char ** restrict endptr);
17360 </pre>
17361 <h6>Description</h6>
17362 <p><!--para 2 -->
17363  The strtod, strtof, and strtold functions convert the initial portion of the string
17364  pointed to by nptr to double, float, and long double representation,
17365  respectively. First, they decompose the input string into three parts: an initial, possibly
17366  empty, sequence of white-space characters (as specified by the isspace function), a
17367  subject sequence resembling a floating-point constant or representing an infinity or NaN;
17368  and a final string of one or more unrecognized characters, including the terminating null
17369  character of the input string. Then, they attempt to convert the subject sequence to a
17370  floating-point number, and return the result.
17371 <p><!--para 3 -->
17372  The expected form of the subject sequence is an optional plus or minus sign, then one of
17373  the following:
17374 <ul>
17375 <li>  a nonempty sequence of decimal digits optionally containing a decimal-point
17376  character, then an optional exponent part as defined in <a href="#6.4.4.2">6.4.4.2</a>;
17377 <li>  a 0x or 0X, then a nonempty sequence of hexadecimal digits optionally containing a
17378  decimal-point character, then an optional binary exponent part as defined in <a href="#6.4.4.2">6.4.4.2</a>;
17379 <li>  INF or INFINITY, ignoring case
17380 <li>  NAN or NAN(n-char-sequence<sub>opt</sub>), ignoring case in the NAN part, where:
17381 <pre>
17382           n-char-sequence:
17383                  digit
17384                  nondigit
17385                  n-char-sequence digit
17386                  n-char-sequence nondigit
17387 </pre>
17388 </ul>
17389  The subject sequence is defined as the longest initial subsequence of the input string,
17390  starting with the first non-white-space character, that is of the expected form. The subject
17391  sequence contains no characters if the input string is not of the expected form.
17392 <p><!--para 4 -->
17393  If the subject sequence has the expected form for a floating-point number, the sequence of
17394  characters starting with the first digit or the decimal-point character (whichever occurs
17395  first) is interpreted as a floating constant according to the rules of <a href="#6.4.4.2">6.4.4.2</a>, except that the
17396 <!--page 361 -->
17397  decimal-point character is used in place of a period, and that if neither an exponent part
17398  nor a decimal-point character appears in a decimal floating point number, or if a binary
17399  exponent part does not appear in a hexadecimal floating point number, an exponent part
17400  of the appropriate type with value zero is assumed to follow the last digit in the string. If
17401  the subject sequence begins with a minus sign, the sequence is interpreted as negated.<sup><a href="#note285"><b>285)</b></a></sup>
17402  A character sequence INF or INFINITY is interpreted as an infinity, if representable in
17403  the return type, else like a floating constant that is too large for the range of the return
17404  type. A character sequence NAN or NAN(n-char-sequence<sub>opt</sub>), is interpreted as a quiet
17405  NaN, if supported in the return type, else like a subject sequence part that does not have
17406  the expected form; the meaning of the n-char sequences is implementation-defined.<sup><a href="#note286"><b>286)</b></a></sup> A
17407  pointer to the final string is stored in the object pointed to by endptr, provided that
17408  endptr is not a null pointer.
17409 <p><!--para 5 -->
17410  If the subject sequence has the hexadecimal form and FLT_RADIX is a power of 2, the
17411  value resulting from the conversion is correctly rounded.
17412 <p><!--para 6 -->
17413  In other than the "C" locale, additional locale-specific subject sequence forms may be
17414  accepted.
17415 <p><!--para 7 -->
17416  If the subject sequence is empty or does not have the expected form, no conversion is
17417  performed; the value of nptr is stored in the object pointed to by endptr, provided
17418  that endptr is not a null pointer.
17419 <h6>Recommended practice</h6>
17420 <p><!--para 8 -->
17421  If the subject sequence has the hexadecimal form, FLT_RADIX is not a power of 2, and
17422  the result is not exactly representable, the result should be one of the two numbers in the
17423  appropriate internal format that are adjacent to the hexadecimal floating source value,
17424  with the extra stipulation that the error should have a correct sign for the current rounding
17425  direction.
17426 <p><!--para 9 -->
17427  If the subject sequence has the decimal form and at most DECIMAL_DIG (defined in
17428  <a href="#7.7">&lt;float.h&gt;</a>) significant digits, the result should be correctly rounded. If the subject
17429  sequence D has the decimal form and more than DECIMAL_DIG significant digits,
17430  consider the two bounding, adjacent decimal strings L and U, both having
17431  DECIMAL_DIG significant digits, such that the values of L, D, and U satisfy L &lt;= D &lt;= U.
17432  The result should be one of the (equal or adjacent) values that would be obtained by
17433  correctly rounding L and U according to the current rounding direction, with the extra
17434  
17435 <!--page 362 -->
17436  stipulation that the error with respect to D should have a correct sign for the current
17437  rounding direction.<sup><a href="#note287"><b>287)</b></a></sup>
17438 <h6>Returns</h6>
17439 <p><!--para 10 -->
17440  The functions return the converted value, if any. If no conversion could be performed,
17441  zero is returned. If the correct value overflows and default rounding is in effect (<a href="#7.12.1">7.12.1</a>),
17442  plus or minus HUGE_VAL, HUGE_VALF, or HUGE_VALL is returned (according to the
17443  return type and sign of the value), and the value of the macro ERANGE is stored in
17444  errno. If the result underflows (<a href="#7.12.1">7.12.1</a>), the functions return a value whose magnitude is
17445  no greater than the smallest normalized positive number in the return type; whether
17446  errno acquires the value ERANGE is implementation-defined.
17447
17448 <h6>footnotes</h6>
17449 <p><small><a name="note285" href="#note285">285)</a> It is unspecified whether a minus-signed sequence is converted to a negative number directly or by
17450  negating the value resulting from converting the corresponding unsigned sequence (see <a href="#F.5">F.5</a>); the two
17451  methods may yield different results if rounding is toward positive or negative infinity. In either case,
17452  the functions honor the sign of zero if floating-point arithmetic supports signed zeros.
17453 </small>
17454 <p><small><a name="note286" href="#note286">286)</a> An implementation may use the n-char sequence to determine extra information to be represented in
17455  the NaN's significand.
17456 </small>
17457 <p><small><a name="note287" href="#note287">287)</a> DECIMAL_DIG, defined in <a href="#7.7">&lt;float.h&gt;</a>, should be sufficiently large that L and U will usually round
17458  to the same internal floating value, but if not will round to adjacent values.
17459 </small>
17460
17461 <h5><a name="7.22.1.4" href="#7.22.1.4">7.22.1.4 The strtol, strtoll, strtoul, and strtoull functions</a></h5>
17462 <h6>Synopsis</h6>
17463 <p><!--para 1 -->
17464 <pre>
17465          #include <a href="#7.22">&lt;stdlib.h&gt;</a>
17466          long int strtol(
17467               const char * restrict nptr,
17468               char ** restrict endptr,
17469               int base);
17470          long long int strtoll(
17471               const char * restrict nptr,
17472               char ** restrict endptr,
17473               int base);
17474          unsigned long int strtoul(
17475               const char * restrict nptr,
17476               char ** restrict endptr,
17477               int base);
17478          unsigned long long int strtoull(
17479               const char * restrict nptr,
17480               char ** restrict endptr,
17481               int base);
17482 </pre>
17483 <h6>Description</h6>
17484 <p><!--para 2 -->
17485  The strtol, strtoll, strtoul, and strtoull functions convert the initial
17486  portion of the string pointed to by nptr to long int, long long int, unsigned
17487  long int, and unsigned long long int representation, respectively. First,
17488  they decompose the input string into three parts: an initial, possibly empty, sequence of
17489  white-space characters (as specified by the isspace function), a subject sequence
17490  
17491  
17492 <!--page 363 -->
17493  resembling an integer represented in some radix determined by the value of base, and a
17494  final string of one or more unrecognized characters, including the terminating null
17495  character of the input string. Then, they attempt to convert the subject sequence to an
17496  integer, and return the result.
17497 <p><!--para 3 -->
17498  If the value of base is zero, the expected form of the subject sequence is that of an
17499  integer constant as described in <a href="#6.4.4.1">6.4.4.1</a>, optionally preceded by a plus or minus sign, but
17500  not including an integer suffix. If the value of base is between 2 and 36 (inclusive), the
17501  expected form of the subject sequence is a sequence of letters and digits representing an
17502  integer with the radix specified by base, optionally preceded by a plus or minus sign,
17503  but not including an integer suffix. The letters from a (or A) through z (or Z) are
17504  ascribed the values 10 through 35; only letters and digits whose ascribed values are less
17505  than that of base are permitted. If the value of base is 16, the characters 0x or 0X may
17506  optionally precede the sequence of letters and digits, following the sign if present.
17507 <p><!--para 4 -->
17508  The subject sequence is defined as the longest initial subsequence of the input string,
17509  starting with the first non-white-space character, that is of the expected form. The subject
17510  sequence contains no characters if the input string is empty or consists entirely of white
17511  space, or if the first non-white-space character is other than a sign or a permissible letter
17512  or digit.
17513 <p><!--para 5 -->
17514  If the subject sequence has the expected form and the value of base is zero, the sequence
17515  of characters starting with the first digit is interpreted as an integer constant according to
17516  the rules of <a href="#6.4.4.1">6.4.4.1</a>. If the subject sequence has the expected form and the value of base
17517  is between 2 and 36, it is used as the base for conversion, ascribing to each letter its value
17518  as given above. If the subject sequence begins with a minus sign, the value resulting from
17519  the conversion is negated (in the return type). A pointer to the final string is stored in the
17520  object pointed to by endptr, provided that endptr is not a null pointer.
17521 <p><!--para 6 -->
17522  In other than the "C" locale, additional locale-specific subject sequence forms may be
17523  accepted.
17524 <p><!--para 7 -->
17525  If the subject sequence is empty or does not have the expected form, no conversion is
17526  performed; the value of nptr is stored in the object pointed to by endptr, provided
17527  that endptr is not a null pointer.
17528 <h6>Returns</h6>
17529 <p><!--para 8 -->
17530  The strtol, strtoll, strtoul, and strtoull functions return the converted
17531  value, if any. If no conversion could be performed, zero is returned. If the correct value
17532  is outside the range of representable values, LONG_MIN, LONG_MAX, LLONG_MIN,
17533  LLONG_MAX, ULONG_MAX, or ULLONG_MAX is returned (according to the return type
17534  and sign of the value, if any), and the value of the macro ERANGE is stored in errno.
17535 <!--page 364 -->
17536
17537 <h4><a name="7.22.2" href="#7.22.2">7.22.2 Pseudo-random sequence generation functions</a></h4>
17538
17539 <h5><a name="7.22.2.1" href="#7.22.2.1">7.22.2.1 The rand function</a></h5>
17540 <h6>Synopsis</h6>
17541 <p><!--para 1 -->
17542 <pre>
17543          #include <a href="#7.22">&lt;stdlib.h&gt;</a>
17544          int rand(void);
17545 </pre>
17546 <h6>Description</h6>
17547 <p><!--para 2 -->
17548  The rand function computes a sequence of pseudo-random integers in the range 0 to
17549  RAND_MAX.<sup><a href="#note288"><b>288)</b></a></sup>
17550 <p><!--para 3 -->
17551  The rand function is not required to avoid data races. The implementation shall behave
17552  as if no library function calls the rand function.
17553 <h6>Returns</h6>
17554 <p><!--para 4 -->
17555  The rand function returns a pseudo-random integer.
17556 <h6>Environmental limits</h6>
17557 <p><!--para 5 -->
17558  The value of the RAND_MAX macro shall be at least 32767.
17559
17560 <h6>footnotes</h6>
17561 <p><small><a name="note288" href="#note288">288)</a> There are no guarantees as to the quality of the random sequence produced and some implementations
17562  are known to produce sequences with distressingly non-random low-order bits. Applications with
17563  particular requirements should use a generator that is known to be sufficient for their needs.
17564 </small>
17565
17566 <h5><a name="7.22.2.2" href="#7.22.2.2">7.22.2.2 The srand function</a></h5>
17567 <h6>Synopsis</h6>
17568 <p><!--para 1 -->
17569 <pre>
17570          #include <a href="#7.22">&lt;stdlib.h&gt;</a>
17571          void srand(unsigned int seed);
17572 </pre>
17573 <h6>Description</h6>
17574 <p><!--para 2 -->
17575  The srand function uses the argument as a seed for a new sequence of pseudo-random
17576  numbers to be returned by subsequent calls to rand. If srand is then called with the
17577  same seed value, the sequence of pseudo-random numbers shall be repeated. If rand is
17578  called before any calls to srand have been made, the same sequence shall be generated
17579  as when srand is first called with a seed value of 1.
17580 <p><!--para 3 -->
17581  The implementation shall behave as if no library function calls the srand function.
17582 <h6>Returns</h6>
17583 <p><!--para 4 -->
17584  The srand function returns no value.
17585  
17586  
17587  
17588  
17589 <!--page 365 -->
17590 <p><!--para 5 -->
17591  EXAMPLE       The following functions define a portable implementation of rand and srand.
17592 <pre>
17593          static unsigned long int next = 1;
17594          int rand(void)   // RAND_MAX assumed to be 32767
17595          {
17596                next = next * 1103515245 + 12345;
17597                return (unsigned int)(next/65536) % 32768;
17598          }
17599          void srand(unsigned int seed)
17600          {
17601                next = seed;
17602          }
17603 </pre>
17604  
17605
17606 <h4><a name="7.22.3" href="#7.22.3">7.22.3 Memory management functions</a></h4>
17607 <p><!--para 1 -->
17608  The order and contiguity of storage allocated by successive calls to the
17609  aligned_alloc, calloc, malloc, and realloc functions is unspecified. The
17610  pointer returned if the allocation succeeds is suitably aligned so that it may be assigned to
17611  a pointer to any type of object with a fundamental alignment requirement and then used
17612  to access such an object or an array of such objects in the space allocated (until the space
17613  is explicitly deallocated). The lifetime of an allocated object extends from the allocation
17614  until the deallocation. Each such allocation shall yield a pointer to an object disjoint from
17615  any other object. The pointer returned points to the start (lowest byte address) of the
17616  allocated space. If the space cannot be allocated, a null pointer is returned. If the size of
17617  the space requested is zero, the behavior is implementation-defined: either a null pointer
17618  is returned, or the behavior is as if the size were some nonzero value, except that the
17619  returned pointer shall not be used to access an object.
17620
17621 <h5><a name="7.22.3.1" href="#7.22.3.1">7.22.3.1 The aligned_alloc function</a></h5>
17622 <h6>Synopsis</h6>
17623 <p><!--para 1 -->
17624 <pre>
17625          #include <a href="#7.22">&lt;stdlib.h&gt;</a>
17626          void *aligned_alloc(size_t alignment, size_t size);
17627 </pre>
17628 <h6>Description</h6>
17629 <p><!--para 2 -->
17630  The aligned_alloc function allocates space for an object whose alignment is
17631  specified by alignment, whose size is specified by size, and whose value is
17632  indeterminate. The value of alignment shall be a valid alignment supported by the
17633  implementation and the value of size shall be an integral multiple of alignment.
17634 <h6>Returns</h6>
17635 <p><!--para 3 -->
17636  The aligned_alloc function returns either a null pointer or a pointer to the allocated
17637  space.
17638 <!--page 366 -->
17639
17640 <h5><a name="7.22.3.2" href="#7.22.3.2">7.22.3.2 The calloc function</a></h5>
17641 <h6>Synopsis</h6>
17642 <p><!--para 1 -->
17643 <pre>
17644          #include <a href="#7.22">&lt;stdlib.h&gt;</a>
17645          void *calloc(size_t nmemb, size_t size);
17646 </pre>
17647 <h6>Description</h6>
17648 <p><!--para 2 -->
17649  The calloc function allocates space for an array of nmemb objects, each of whose size
17650  is size. The space is initialized to all bits zero.<sup><a href="#note289"><b>289)</b></a></sup>
17651 <h6>Returns</h6>
17652 <p><!--para 3 -->
17653  The calloc function returns either a null pointer or a pointer to the allocated space.
17654
17655 <h6>footnotes</h6>
17656 <p><small><a name="note289" href="#note289">289)</a> Note that this need not be the same as the representation of floating-point zero or a null pointer
17657  constant.
17658 </small>
17659
17660 <h5><a name="7.22.3.3" href="#7.22.3.3">7.22.3.3 The free function</a></h5>
17661 <h6>Synopsis</h6>
17662 <p><!--para 1 -->
17663 <pre>
17664          #include <a href="#7.22">&lt;stdlib.h&gt;</a>
17665          void free(void *ptr);
17666 </pre>
17667 <h6>Description</h6>
17668 <p><!--para 2 -->
17669  The free function causes the space pointed to by ptr to be deallocated, that is, made
17670  available for further allocation. If ptr is a null pointer, no action occurs. Otherwise, if
17671  the argument does not match a pointer earlier returned by a memory management
17672  function, or if the space has been deallocated by a call to free or realloc, the
17673  behavior is undefined.
17674 <h6>Returns</h6>
17675 <p><!--para 3 -->
17676  The free function returns no value.
17677
17678 <h5><a name="7.22.3.4" href="#7.22.3.4">7.22.3.4 The malloc function</a></h5>
17679 <h6>Synopsis</h6>
17680 <p><!--para 1 -->
17681 <pre>
17682          #include <a href="#7.22">&lt;stdlib.h&gt;</a>
17683          void *malloc(size_t size);
17684 </pre>
17685 <h6>Description</h6>
17686 <p><!--para 2 -->
17687  The malloc function allocates space for an object whose size is specified by size and
17688  whose value is indeterminate.
17689  
17690  
17691  
17692  
17693 <!--page 367 -->
17694 <h6>Returns</h6>
17695 <p><!--para 3 -->
17696  The malloc function returns either a null pointer or a pointer to the allocated space.
17697
17698 <h5><a name="7.22.3.5" href="#7.22.3.5">7.22.3.5 The realloc function</a></h5>
17699 <h6>Synopsis</h6>
17700 <p><!--para 1 -->
17701 <pre>
17702          #include <a href="#7.22">&lt;stdlib.h&gt;</a>
17703          void *realloc(void *ptr, size_t size);
17704 </pre>
17705 <h6>Description</h6>
17706 <p><!--para 2 -->
17707  The realloc function deallocates the old object pointed to by ptr and returns a
17708  pointer to a new object that has the size specified by size. The contents of the new
17709  object shall be the same as that of the old object prior to deallocation, up to the lesser of
17710  the new and old sizes. Any bytes in the new object beyond the size of the old object have
17711  indeterminate values.
17712 <p><!--para 3 -->
17713  If ptr is a null pointer, the realloc function behaves like the malloc function for the
17714  specified size. Otherwise, if ptr does not match a pointer earlier returned by a memory
17715  management function, or if the space has been deallocated by a call to the free or
17716  realloc function, the behavior is undefined. If memory for the new object cannot be
17717  allocated, the old object is not deallocated and its value is unchanged.
17718 <h6>Returns</h6>
17719 <p><!--para 4 -->
17720  The realloc function returns a pointer to the new object (which may have the same
17721  value as a pointer to the old object), or a null pointer if the new object could not be
17722  allocated.
17723
17724 <h4><a name="7.22.4" href="#7.22.4">7.22.4 Communication with the environment</a></h4>
17725
17726 <h5><a name="7.22.4.1" href="#7.22.4.1">7.22.4.1 The abort function</a></h5>
17727 <h6>Synopsis</h6>
17728 <p><!--para 1 -->
17729 <pre>
17730          #include <a href="#7.22">&lt;stdlib.h&gt;</a>
17731          _Noreturn void abort(void);
17732 </pre>
17733 <h6>Description</h6>
17734 <p><!--para 2 -->
17735  The abort function causes abnormal program termination to occur, unless the signal
17736  SIGABRT is being caught and the signal handler does not return. Whether open streams
17737  with unwritten buffered data are flushed, open streams are closed, or temporary files are
17738  removed is implementation-defined. An implementation-defined form of the status
17739  unsuccessful termination is returned to the host environment by means of the function
17740  call raise(SIGABRT).
17741 <!--page 368 -->
17742 <h6>Returns</h6>
17743 <p><!--para 3 -->
17744  The abort function does not return to its caller.
17745
17746 <h5><a name="7.22.4.2" href="#7.22.4.2">7.22.4.2 The atexit function</a></h5>
17747 <h6>Synopsis</h6>
17748 <p><!--para 1 -->
17749 <pre>
17750         #include <a href="#7.22">&lt;stdlib.h&gt;</a>
17751         int atexit(void (*func)(void));
17752 </pre>
17753 <h6>Description</h6>
17754 <p><!--para 2 -->
17755  The atexit function registers the function pointed to by func, to be called without
17756  arguments at normal program termination.<sup><a href="#note290"><b>290)</b></a></sup>
17757 <h6>Environmental limits</h6>
17758 <p><!--para 3 -->
17759  The implementation shall support the registration of at least 32 functions.
17760 <h6>Returns</h6>
17761 <p><!--para 4 -->
17762  The atexit function returns zero if the registration succeeds, nonzero if it fails.
17763 <p><b> Forward references</b>: the at_quick_exit function (<a href="#7.22.4.3">7.22.4.3</a>), the exit function
17764  (<a href="#7.22.4.4">7.22.4.4</a>).
17765
17766 <h6>footnotes</h6>
17767 <p><small><a name="note290" href="#note290">290)</a> The atexit function registrations are distinct from the at_quick_exit registrations, so
17768  applications may need to call both registration functions with the same argument.
17769 </small>
17770
17771 <h5><a name="7.22.4.3" href="#7.22.4.3">7.22.4.3 The at_quick_exit function</a></h5>
17772 <h6>Synopsis</h6>
17773 <p><!--para 1 -->
17774 <pre>
17775         #include <a href="#7.22">&lt;stdlib.h&gt;</a>
17776         int at_quick_exit(void (*func)(void));
17777 </pre>
17778 <h6>Description</h6>
17779 <p><!--para 2 -->
17780  The at_quick_exit function registers the function pointed to by func, to be called
17781  without arguments should quick_exit be called.<sup><a href="#note291"><b>291)</b></a></sup>
17782 <h6>Environmental limits</h6>
17783 <p><!--para 3 -->
17784  The implementation shall support the registration of at least 32 functions.
17785 <h6>Returns</h6>
17786 <p><!--para 4 -->
17787  The at_quick_exit function returns zero if the registration succeeds, nonzero if it
17788  fails.
17789 <p><b> Forward references</b>: the quick_exit function (<a href="#7.22.4.7">7.22.4.7</a>).
17790  
17791  
17792 <!--page 369 -->
17793
17794 <h6>footnotes</h6>
17795 <p><small><a name="note291" href="#note291">291)</a> The at_quick_exit function registrations are distinct from the atexit registrations, so
17796  applications may need to call both registration functions with the same argument.
17797 </small>
17798
17799 <h5><a name="7.22.4.4" href="#7.22.4.4">7.22.4.4 The exit function</a></h5>
17800 <h6>Synopsis</h6>
17801 <p><!--para 1 -->
17802 <pre>
17803          #include <a href="#7.22">&lt;stdlib.h&gt;</a>
17804          _Noreturn void exit(int status);
17805 </pre>
17806 <h6>Description</h6>
17807 <p><!--para 2 -->
17808  The exit function causes normal program termination to occur. No functions registered
17809  by the at_quick_exit function are called. If a program calls the exit function
17810  more than once, or calls the quick_exit function in addition to the exit function, the
17811  behavior is undefined.
17812 <p><!--para 3 -->
17813  First, all functions registered by the atexit function are called, in the reverse order of
17814  their registration,<sup><a href="#note292"><b>292)</b></a></sup> except that a function is called after any previously registered
17815  functions that had already been called at the time it was registered. If, during the call to
17816  any such function, a call to the longjmp function is made that would terminate the call
17817  to the registered function, the behavior is undefined.
17818 <p><!--para 4 -->
17819  Next, all open streams with unwritten buffered data are flushed, all open streams are
17820  closed, and all files created by the tmpfile function are removed.
17821 <p><!--para 5 -->
17822  Finally, control is returned to the host environment. If the value of status is zero or
17823  EXIT_SUCCESS, an implementation-defined form of the status successful termination is
17824  returned. If the value of status is EXIT_FAILURE, an implementation-defined form
17825  of the status unsuccessful termination is returned. Otherwise the status returned is
17826  implementation-defined.
17827 <h6>Returns</h6>
17828 <p><!--para 6 -->
17829  The exit function cannot return to its caller.
17830
17831 <h6>footnotes</h6>
17832 <p><small><a name="note292" href="#note292">292)</a> Each function is called as many times as it was registered, and in the correct order with respect to
17833  other registered functions.
17834 </small>
17835
17836 <h5><a name="7.22.4.5" href="#7.22.4.5">7.22.4.5 The _Exit function</a></h5>
17837 <h6>Synopsis</h6>
17838 <p><!--para 1 -->
17839 <pre>
17840          #include <a href="#7.22">&lt;stdlib.h&gt;</a>
17841          _Noreturn void _Exit(int status);
17842 </pre>
17843 <h6>Description</h6>
17844 <p><!--para 2 -->
17845  The _Exit function causes normal program termination to occur and control to be
17846  returned to the host environment. No functions registered by the atexit function, the
17847  at_quick_exit function, or signal handlers registered by the signal function are
17848  called. The status returned to the host environment is determined in the same way as for
17849  
17850  
17851 <!--page 370 -->
17852  the exit function (<a href="#7.22.4.4">7.22.4.4</a>). Whether open streams with unwritten buffered data are
17853  flushed, open streams are closed, or temporary files are removed is implementation-
17854  defined.
17855 <h6>Returns</h6>
17856 <p><!--para 3 -->
17857  The _Exit function cannot return to its caller.
17858
17859 <h5><a name="7.22.4.6" href="#7.22.4.6">7.22.4.6 The getenv function</a></h5>
17860 <h6>Synopsis</h6>
17861 <p><!--para 1 -->
17862 <pre>
17863          #include <a href="#7.22">&lt;stdlib.h&gt;</a>
17864          char *getenv(const char *name);
17865 </pre>
17866 <h6>Description</h6>
17867 <p><!--para 2 -->
17868  The getenv function searches an environment list, provided by the host environment,
17869  for a string that matches the string pointed to by name. The set of environment names
17870  and the method for altering the environment list are implementation-defined. The
17871  getenv function need not avoid data races with other threads of execution that modify
17872  the environment list.<sup><a href="#note293"><b>293)</b></a></sup>
17873 <p><!--para 3 -->
17874  The implementation shall behave as if no library function calls the getenv function.
17875 <h6>Returns</h6>
17876 <p><!--para 4 -->
17877  The getenv function returns a pointer to a string associated with the matched list
17878  member. The string pointed to shall not be modified by the program, but may be
17879  overwritten by a subsequent call to the getenv function. If the specified name cannot
17880  be found, a null pointer is returned.
17881
17882 <h6>footnotes</h6>
17883 <p><small><a name="note293" href="#note293">293)</a> Many implementations provide non-standard functions that modify the environment list.
17884 </small>
17885
17886 <h5><a name="7.22.4.7" href="#7.22.4.7">7.22.4.7 The quick_exit function</a></h5>
17887 <h6>Synopsis</h6>
17888 <p><!--para 1 -->
17889 <pre>
17890          #include <a href="#7.22">&lt;stdlib.h&gt;</a>
17891          _Noreturn void quick_exit(int status);
17892 </pre>
17893 <h6>Description</h6>
17894 <p><!--para 2 -->
17895  The quick_exit function causes normal program termination to occur. No functions
17896  registered by the atexit function or signal handlers registered by the signal function
17897  are called. If a program calls the quick_exit function more than once, or calls the
17898  exit function in addition to the quick_exit function, the behavior is undefined.
17899 <p><!--para 3 -->
17900  The quick_exit function first calls all functions registered by the at_quick_exit
17901  function, in the reverse order of their registration,<sup><a href="#note294"><b>294)</b></a></sup> except that a function is called after
17902  
17903  
17904 <!--page 371 -->
17905  any previously registered functions that had already been called at the time it was
17906  registered. If, during the call to any such function, a call to the longjmp function is
17907  made that would terminate the call to the registered function, the behavior is undefined.
17908 <p><!--para 4 -->
17909  Then control is returned to the host environment by means of the function call
17910  _Exit(status).
17911 <h6>Returns</h6>
17912 <p><!--para 5 -->
17913  The quick_exit function cannot return to its caller.
17914
17915 <h6>footnotes</h6>
17916 <p><small><a name="note294" href="#note294">294)</a> Each function is called as many times as it was registered, and in the correct order with respect to
17917  other registered functions.
17918 </small>
17919
17920 <h5><a name="7.22.4.8" href="#7.22.4.8">7.22.4.8 The system function</a></h5>
17921 <h6>Synopsis</h6>
17922 <p><!--para 1 -->
17923 <pre>
17924          #include <a href="#7.22">&lt;stdlib.h&gt;</a>
17925          int system(const char *string);
17926 </pre>
17927 <h6>Description</h6>
17928 <p><!--para 2 -->
17929  If string is a null pointer, the system function determines whether the host
17930  environment has a command processor. If string is not a null pointer, the system
17931  function passes the string pointed to by string to that command processor to be
17932  executed in a manner which the implementation shall document; this might then cause the
17933  program calling system to behave in a non-conforming manner or to terminate.
17934 <h6>Returns</h6>
17935 <p><!--para 3 -->
17936  If the argument is a null pointer, the system function returns nonzero only if a
17937  command processor is available. If the argument is not a null pointer, and the system
17938  function does return, it returns an implementation-defined value.
17939
17940 <h4><a name="7.22.5" href="#7.22.5">7.22.5 Searching and sorting utilities</a></h4>
17941 <p><!--para 1 -->
17942  These utilities make use of a comparison function to search or sort arrays of unspecified
17943  type. Where an argument declared as size_t nmemb specifies the length of the array
17944  for a function, nmemb can have the value zero on a call to that function; the comparison
17945  function is not called, a search finds no matching element, and sorting performs no
17946  rearrangement. Pointer arguments on such a call shall still have valid values, as described
17947  in <a href="#7.1.4">7.1.4</a>.
17948 <p><!--para 2 -->
17949  The implementation shall ensure that the second argument of the comparison function
17950  (when called from bsearch), or both arguments (when called from qsort), are
17951  pointers to elements of the array.<sup><a href="#note295"><b>295)</b></a></sup> The first argument when called from bsearch
17952  shall equal key.
17953  
17954  
17955  
17956 <!--page 372 -->
17957 <p><!--para 3 -->
17958  The comparison function shall not alter the contents of the array. The implementation
17959  may reorder elements of the array between calls to the comparison function, but shall not
17960  alter the contents of any individual element.
17961 <p><!--para 4 -->
17962  When the same objects (consisting of size bytes, irrespective of their current positions
17963  in the array) are passed more than once to the comparison function, the results shall be
17964  consistent with one another. That is, for qsort they shall define a total ordering on the
17965  array, and for bsearch the same object shall always compare the same way with the
17966  key.
17967 <p><!--para 5 -->
17968  A sequence point occurs immediately before and immediately after each call to the
17969  comparison function, and also between any call to the comparison function and any
17970  movement of the objects passed as arguments to that call.
17971
17972 <h6>footnotes</h6>
17973 <p><small><a name="note295" href="#note295">295)</a> That is, if the value passed is p, then the following expressions are always nonzero:
17974
17975 <pre>
17976           ((char *)p - (char *)base) % size == 0
17977           (char *)p &gt;= (char *)base
17978           (char *)p &lt; (char *)base + nmemb * size
17979 </pre>
17980  
17981 </small>
17982
17983 <h5><a name="7.22.5.1" href="#7.22.5.1">7.22.5.1 The bsearch function</a></h5>
17984 <h6>Synopsis</h6>
17985 <p><!--para 1 -->
17986 <pre>
17987           #include <a href="#7.22">&lt;stdlib.h&gt;</a>
17988           void *bsearch(const void *key, const void *base,
17989                size_t nmemb, size_t size,
17990                int (*compar)(const void *, const void *));
17991 </pre>
17992 <h6>Description</h6>
17993 <p><!--para 2 -->
17994  The bsearch function searches an array of nmemb objects, the initial element of which
17995  is pointed to by base, for an element that matches the object pointed to by key. The
17996  size of each element of the array is specified by size.
17997 <p><!--para 3 -->
17998  The comparison function pointed to by compar is called with two arguments that point
17999  to the key object and to an array element, in that order. The function shall return an
18000  integer less than, equal to, or greater than zero if the key object is considered,
18001  respectively, to be less than, to match, or to be greater than the array element. The array
18002  shall consist of: all the elements that compare less than, all the elements that compare
18003  equal to, and all the elements that compare greater than the key object, in that order.<sup><a href="#note296"><b>296)</b></a></sup>
18004 <h6>Returns</h6>
18005 <p><!--para 4 -->
18006  The bsearch function returns a pointer to a matching element of the array, or a null
18007  pointer if no match is found. If two elements compare as equal, which element is
18008  
18009  
18010 <!--page 373 -->
18011  matched is unspecified.
18012
18013 <h6>footnotes</h6>
18014 <p><small><a name="note296" href="#note296">296)</a> In practice, the entire array is sorted according to the comparison function.
18015 </small>
18016
18017 <h5><a name="7.22.5.2" href="#7.22.5.2">7.22.5.2 The qsort function</a></h5>
18018 <h6>Synopsis</h6>
18019 <p><!--para 1 -->
18020 <pre>
18021          #include <a href="#7.22">&lt;stdlib.h&gt;</a>
18022          void qsort(void *base, size_t nmemb, size_t size,
18023               int (*compar)(const void *, const void *));
18024 </pre>
18025 <h6>Description</h6>
18026 <p><!--para 2 -->
18027  The qsort function sorts an array of nmemb objects, the initial element of which is
18028  pointed to by base. The size of each object is specified by size.
18029 <p><!--para 3 -->
18030  The contents of the array are sorted into ascending order according to a comparison
18031  function pointed to by compar, which is called with two arguments that point to the
18032  objects being compared. The function shall return an integer less than, equal to, or
18033  greater than zero if the first argument is considered to be respectively less than, equal to,
18034  or greater than the second.
18035 <p><!--para 4 -->
18036  If two elements compare as equal, their order in the resulting sorted array is unspecified.
18037 <h6>Returns</h6>
18038 <p><!--para 5 -->
18039  The qsort function returns no value.
18040
18041 <h4><a name="7.22.6" href="#7.22.6">7.22.6 Integer arithmetic functions</a></h4>
18042
18043 <h5><a name="7.22.6.1" href="#7.22.6.1">7.22.6.1 The abs, labs and llabs functions</a></h5>
18044 <h6>Synopsis</h6>
18045 <p><!--para 1 -->
18046 <pre>
18047          #include <a href="#7.22">&lt;stdlib.h&gt;</a>
18048          int abs(int j);
18049          long int labs(long int j);
18050          long long int llabs(long long int j);
18051 </pre>
18052 <h6>Description</h6>
18053 <p><!--para 2 -->
18054  The abs, labs, and llabs functions compute the absolute value of an integer j. If the
18055  result cannot be represented, the behavior is undefined.<sup><a href="#note297"><b>297)</b></a></sup>
18056 <h6>Returns</h6>
18057 <p><!--para 3 -->
18058  The abs, labs, and llabs, functions return the absolute value.
18059  
18060  
18061  
18062  
18063 <!--page 374 -->
18064
18065 <h6>footnotes</h6>
18066 <p><small><a name="note297" href="#note297">297)</a> The absolute value of the most negative number cannot be represented in two's complement.
18067 </small>
18068
18069 <h5><a name="7.22.6.2" href="#7.22.6.2">7.22.6.2 The div, ldiv, and lldiv functions</a></h5>
18070 <h6>Synopsis</h6>
18071 <p><!--para 1 -->
18072 <pre>
18073           #include <a href="#7.22">&lt;stdlib.h&gt;</a>
18074           div_t div(int numer, int denom);
18075           ldiv_t ldiv(long int numer, long int denom);
18076           lldiv_t lldiv(long long int numer, long long int denom);
18077 </pre>
18078 <h6>Description</h6>
18079 <p><!--para 2 -->
18080  The div, ldiv, and lldiv, functions compute numer / denom and numer %
18081  denom in a single operation.
18082 <h6>Returns</h6>
18083 <p><!--para 3 -->
18084  The div, ldiv, and lldiv functions return a structure of type div_t, ldiv_t, and
18085  lldiv_t, respectively, comprising both the quotient and the remainder. The structures
18086  shall contain (in either order) the members quot (the quotient) and rem (the remainder),
18087  each of which has the same type as the arguments numer and denom. If either part of
18088  the result cannot be represented, the behavior is undefined.
18089
18090 <h4><a name="7.22.7" href="#7.22.7">7.22.7 Multibyte/wide character conversion functions</a></h4>
18091 <p><!--para 1 -->
18092  The behavior of the multibyte character functions is affected by the LC_CTYPE category
18093  of the current locale. For a state-dependent encoding, each function is placed into its
18094  initial conversion state at program startup and can be returned to that state by a call for
18095  which its character pointer argument, s, is a null pointer. Subsequent calls with s as
18096  other than a null pointer cause the internal conversion state of the function to be altered as
18097  necessary. A call with s as a null pointer causes these functions to return a nonzero value
18098  if encodings have state dependency, and zero otherwise.<sup><a href="#note298"><b>298)</b></a></sup> Changing the LC_CTYPE
18099  category causes the conversion state of these functions to be indeterminate.
18100
18101 <h6>footnotes</h6>
18102 <p><small><a name="note298" href="#note298">298)</a> If the locale employs special bytes to change the shift state, these bytes do not produce separate wide
18103  character codes, but are grouped with an adjacent multibyte character.
18104 </small>
18105
18106 <h5><a name="7.22.7.1" href="#7.22.7.1">7.22.7.1 The mblen function</a></h5>
18107 <h6>Synopsis</h6>
18108 <p><!--para 1 -->
18109 <pre>
18110           #include <a href="#7.22">&lt;stdlib.h&gt;</a>
18111           int mblen(const char *s, size_t n);
18112 </pre>
18113 <h6>Description</h6>
18114 <p><!--para 2 -->
18115  If s is not a null pointer, the mblen function determines the number of bytes contained
18116  in the multibyte character pointed to by s. Except that the conversion state of the
18117  mbtowc function is not affected, it is equivalent to
18118  
18119  
18120  
18121 <!--page 375 -->
18122 <pre>
18123          mbtowc((wchar_t *)0, (const char *)0, 0);
18124          mbtowc((wchar_t *)0, s, n);
18125 </pre>
18126 <p><!--para 3 -->
18127  The implementation shall behave as if no library function calls the mblen function.
18128 <h6>Returns</h6>
18129 <p><!--para 4 -->
18130  If s is a null pointer, the mblen function returns a nonzero or zero value, if multibyte
18131  character encodings, respectively, do or do not have state-dependent encodings. If s is
18132  not a null pointer, the mblen function either returns 0 (if s points to the null character),
18133  or returns the number of bytes that are contained in the multibyte character (if the next n
18134  or fewer bytes form a valid multibyte character), or returns -1 (if they do not form a valid
18135  multibyte character).
18136 <p><b> Forward references</b>: the mbtowc function (<a href="#7.22.7.2">7.22.7.2</a>).
18137
18138 <h5><a name="7.22.7.2" href="#7.22.7.2">7.22.7.2 The mbtowc function</a></h5>
18139 <h6>Synopsis</h6>
18140 <p><!--para 1 -->
18141 <pre>
18142          #include <a href="#7.22">&lt;stdlib.h&gt;</a>
18143          int mbtowc(wchar_t * restrict pwc,
18144               const char * restrict s,
18145               size_t n);
18146 </pre>
18147 <h6>Description</h6>
18148 <p><!--para 2 -->
18149  If s is not a null pointer, the mbtowc function inspects at most n bytes beginning with
18150  the byte pointed to by s to determine the number of bytes needed to complete the next
18151  multibyte character (including any shift sequences). If the function determines that the
18152  next multibyte character is complete and valid, it determines the value of the
18153  corresponding wide character and then, if pwc is not a null pointer, stores that value in
18154  the object pointed to by pwc. If the corresponding wide character is the null wide
18155  character, the function is left in the initial conversion state.
18156 <p><!--para 3 -->
18157  The implementation shall behave as if no library function calls the mbtowc function.
18158 <h6>Returns</h6>
18159 <p><!--para 4 -->
18160  If s is a null pointer, the mbtowc function returns a nonzero or zero value, if multibyte
18161  character encodings, respectively, do or do not have state-dependent encodings. If s is
18162  not a null pointer, the mbtowc function either returns 0 (if s points to the null character),
18163  or returns the number of bytes that are contained in the converted multibyte character (if
18164  the next n or fewer bytes form a valid multibyte character), or returns -1 (if they do not
18165  form a valid multibyte character).
18166 <p><!--para 5 -->
18167  In no case will the value returned be greater than n or the value of the MB_CUR_MAX
18168  macro.
18169 <!--page 376 -->
18170
18171 <h5><a name="7.22.7.3" href="#7.22.7.3">7.22.7.3 The wctomb function</a></h5>
18172 <h6>Synopsis</h6>
18173 <p><!--para 1 -->
18174 <pre>
18175         #include <a href="#7.22">&lt;stdlib.h&gt;</a>
18176         int wctomb(char *s, wchar_t wc);
18177 </pre>
18178 <h6>Description</h6>
18179 <p><!--para 2 -->
18180  The wctomb function determines the number of bytes needed to represent the multibyte
18181  character corresponding to the wide character given by wc (including any shift
18182  sequences), and stores the multibyte character representation in the array whose first
18183  element is pointed to by s (if s is not a null pointer). At most MB_CUR_MAX characters
18184  are stored. If wc is a null wide character, a null byte is stored, preceded by any shift
18185  sequence needed to restore the initial shift state, and the function is left in the initial
18186  conversion state.
18187 <p><!--para 3 -->
18188  The implementation shall behave as if no library function calls the wctomb function.
18189 <h6>Returns</h6>
18190 <p><!--para 4 -->
18191  If s is a null pointer, the wctomb function returns a nonzero or zero value, if multibyte
18192  character encodings, respectively, do or do not have state-dependent encodings. If s is
18193  not a null pointer, the wctomb function returns -1 if the value of wc does not correspond
18194  to a valid multibyte character, or returns the number of bytes that are contained in the
18195  multibyte character corresponding to the value of wc.
18196 <p><!--para 5 -->
18197  In no case will the value returned be greater than the value of the MB_CUR_MAX macro.
18198
18199 <h4><a name="7.22.8" href="#7.22.8">7.22.8 Multibyte/wide string conversion functions</a></h4>
18200 <p><!--para 1 -->
18201  The behavior of the multibyte string functions is affected by the LC_CTYPE category of
18202  the current locale.
18203
18204 <h5><a name="7.22.8.1" href="#7.22.8.1">7.22.8.1 The mbstowcs function</a></h5>
18205 <h6>Synopsis</h6>
18206 <p><!--para 1 -->
18207 <pre>
18208         #include <a href="#7.22">&lt;stdlib.h&gt;</a>
18209         size_t mbstowcs(wchar_t * restrict pwcs,
18210              const char * restrict s,
18211              size_t n);
18212 </pre>
18213 <h6>Description</h6>
18214 <p><!--para 2 -->
18215  The mbstowcs function converts a sequence of multibyte characters that begins in the
18216  initial shift state from the array pointed to by s into a sequence of corresponding wide
18217  characters and stores not more than n wide characters into the array pointed to by pwcs.
18218  No multibyte characters that follow a null character (which is converted into a null wide
18219  character) will be examined or converted. Each multibyte character is converted as if by
18220  a call to the mbtowc function, except that the conversion state of the mbtowc function is
18221 <!--page 377 -->
18222  not affected.
18223 <p><!--para 3 -->
18224  No more than n elements will be modified in the array pointed to by pwcs. If copying
18225  takes place between objects that overlap, the behavior is undefined.
18226 <h6>Returns</h6>
18227 <p><!--para 4 -->
18228  If an invalid multibyte character is encountered, the mbstowcs function returns
18229  (size_t)(-1). Otherwise, the mbstowcs function returns the number of array
18230  elements modified, not including a terminating null wide character, if any.<sup><a href="#note299"><b>299)</b></a></sup>
18231
18232 <h6>footnotes</h6>
18233 <p><small><a name="note299" href="#note299">299)</a> The array will not be null-terminated if the value returned is n.
18234 </small>
18235
18236 <h5><a name="7.22.8.2" href="#7.22.8.2">7.22.8.2 The wcstombs function</a></h5>
18237 <h6>Synopsis</h6>
18238 <p><!--para 1 -->
18239 <pre>
18240           #include <a href="#7.22">&lt;stdlib.h&gt;</a>
18241           size_t wcstombs(char * restrict s,
18242                const wchar_t * restrict pwcs,
18243                size_t n);
18244 </pre>
18245 <h6>Description</h6>
18246 <p><!--para 2 -->
18247  The wcstombs function converts a sequence of wide characters from the array pointed
18248  to by pwcs into a sequence of corresponding multibyte characters that begins in the
18249  initial shift state, and stores these multibyte characters into the array pointed to by s,
18250  stopping if a multibyte character would exceed the limit of n total bytes or if a null
18251  character is stored. Each wide character is converted as if by a call to the wctomb
18252  function, except that the conversion state of the wctomb function is not affected.
18253 <p><!--para 3 -->
18254  No more than n bytes will be modified in the array pointed to by s. If copying takes place
18255  between objects that overlap, the behavior is undefined.
18256 <h6>Returns</h6>
18257 <p><!--para 4 -->
18258  If a wide character is encountered that does not correspond to a valid multibyte character,
18259  the wcstombs function returns (size_t)(-1). Otherwise, the wcstombs function
18260  returns the number of bytes modified, not including a terminating null character, if
18261  any.<sup><a href="#note299"><b>299)</b></a></sup>
18262  
18263  
18264  
18265  
18266 <!--page 378 -->
18267
18268 <h3><a name="7.23" href="#7.23">7.23 String handling <string.h></a></h3>
18269
18270 <h4><a name="7.23.1" href="#7.23.1">7.23.1 String function conventions</a></h4>
18271 <p><!--para 1 -->
18272  The header <a href="#7.23">&lt;string.h&gt;</a> declares one type and several functions, and defines one
18273  macro useful for manipulating arrays of character type and other objects treated as arrays
18274  of character type.<sup><a href="#note300"><b>300)</b></a></sup> The type is size_t and the macro is NULL (both described in
18275  <a href="#7.19">7.19</a>). Various methods are used for determining the lengths of the arrays, but in all cases
18276  a char * or void * argument points to the initial (lowest addressed) character of the
18277  array. If an array is accessed beyond the end of an object, the behavior is undefined.
18278 <p><!--para 2 -->
18279  Where an argument declared as size_t n specifies the length of the array for a
18280  function, n can have the value zero on a call to that function. Unless explicitly stated
18281  otherwise in the description of a particular function in this subclause, pointer arguments
18282  on such a call shall still have valid values, as described in <a href="#7.1.4">7.1.4</a>. On such a call, a
18283  function that locates a character finds no occurrence, a function that compares two
18284  character sequences returns zero, and a function that copies characters copies zero
18285  characters.
18286 <p><!--para 3 -->
18287  For all functions in this subclause, each character shall be interpreted as if it had the type
18288  unsigned char (and therefore every possible object representation is valid and has a
18289  different value).
18290
18291 <h6>footnotes</h6>
18292 <p><small><a name="note300" href="#note300">300)</a> See ''future library directions'' (<a href="#7.30.11">7.30.11</a>).
18293 </small>
18294
18295 <h4><a name="7.23.2" href="#7.23.2">7.23.2 Copying functions</a></h4>
18296
18297 <h5><a name="7.23.2.1" href="#7.23.2.1">7.23.2.1 The memcpy function</a></h5>
18298 <h6>Synopsis</h6>
18299 <p><!--para 1 -->
18300 <pre>
18301           #include <a href="#7.23">&lt;string.h&gt;</a>
18302           void *memcpy(void * restrict s1,
18303                const void * restrict s2,
18304                size_t n);
18305 </pre>
18306 <h6>Description</h6>
18307 <p><!--para 2 -->
18308  The memcpy function copies n characters from the object pointed to by s2 into the
18309  object pointed to by s1. If copying takes place between objects that overlap, the behavior
18310  is undefined.
18311 <h6>Returns</h6>
18312 <p><!--para 3 -->
18313  The memcpy function returns the value of s1.
18314  
18315  
18316  
18317  
18318 <!--page 379 -->
18319
18320 <h5><a name="7.23.2.2" href="#7.23.2.2">7.23.2.2 The memmove function</a></h5>
18321 <h6>Synopsis</h6>
18322 <p><!--para 1 -->
18323 <pre>
18324          #include <a href="#7.23">&lt;string.h&gt;</a>
18325          void *memmove(void *s1, const void *s2, size_t n);
18326 </pre>
18327 <h6>Description</h6>
18328 <p><!--para 2 -->
18329  The memmove function copies n characters from the object pointed to by s2 into the
18330  object pointed to by s1. Copying takes place as if the n characters from the object
18331  pointed to by s2 are first copied into a temporary array of n characters that does not
18332  overlap the objects pointed to by s1 and s2, and then the n characters from the
18333  temporary array are copied into the object pointed to by s1.
18334 <h6>Returns</h6>
18335 <p><!--para 3 -->
18336  The memmove function returns the value of s1.
18337
18338 <h5><a name="7.23.2.3" href="#7.23.2.3">7.23.2.3 The strcpy function</a></h5>
18339 <h6>Synopsis</h6>
18340 <p><!--para 1 -->
18341 <pre>
18342          #include <a href="#7.23">&lt;string.h&gt;</a>
18343          char *strcpy(char * restrict s1,
18344               const char * restrict s2);
18345 </pre>
18346 <h6>Description</h6>
18347 <p><!--para 2 -->
18348  The strcpy function copies the string pointed to by s2 (including the terminating null
18349  character) into the array pointed to by s1. If copying takes place between objects that
18350  overlap, the behavior is undefined.
18351 <h6>Returns</h6>
18352 <p><!--para 3 -->
18353  The strcpy function returns the value of s1.
18354
18355 <h5><a name="7.23.2.4" href="#7.23.2.4">7.23.2.4 The strncpy function</a></h5>
18356 <h6>Synopsis</h6>
18357 <p><!--para 1 -->
18358 <pre>
18359          #include <a href="#7.23">&lt;string.h&gt;</a>
18360          char *strncpy(char * restrict s1,
18361               const char * restrict s2,
18362               size_t n);
18363 </pre>
18364 <h6>Description</h6>
18365 <p><!--para 2 -->
18366  The strncpy function copies not more than n characters (characters that follow a null
18367  character are not copied) from the array pointed to by s2 to the array pointed to by
18368 <!--page 380 -->
18369  s1.<sup><a href="#note301"><b>301)</b></a></sup> If copying takes place between objects that overlap, the behavior is undefined.
18370 <p><!--para 3 -->
18371  If the array pointed to by s2 is a string that is shorter than n characters, null characters
18372  are appended to the copy in the array pointed to by s1, until n characters in all have been
18373  written.
18374 <h6>Returns</h6>
18375 <p><!--para 4 -->
18376  The strncpy function returns the value of s1.
18377
18378 <h6>footnotes</h6>
18379 <p><small><a name="note301" href="#note301">301)</a> Thus, if there is no null character in the first n characters of the array pointed to by s2, the result will
18380  not be null-terminated.
18381 </small>
18382
18383 <h4><a name="7.23.3" href="#7.23.3">7.23.3 Concatenation functions</a></h4>
18384
18385 <h5><a name="7.23.3.1" href="#7.23.3.1">7.23.3.1 The strcat function</a></h5>
18386 <h6>Synopsis</h6>
18387 <p><!--para 1 -->
18388 <pre>
18389           #include <a href="#7.23">&lt;string.h&gt;</a>
18390           char *strcat(char * restrict s1,
18391                const char * restrict s2);
18392 </pre>
18393 <h6>Description</h6>
18394 <p><!--para 2 -->
18395  The strcat function appends a copy of the string pointed to by s2 (including the
18396  terminating null character) to the end of the string pointed to by s1. The initial character
18397  of s2 overwrites the null character at the end of s1. If copying takes place between
18398  objects that overlap, the behavior is undefined.
18399 <h6>Returns</h6>
18400 <p><!--para 3 -->
18401  The strcat function returns the value of s1.
18402
18403 <h5><a name="7.23.3.2" href="#7.23.3.2">7.23.3.2 The strncat function</a></h5>
18404 <h6>Synopsis</h6>
18405 <p><!--para 1 -->
18406 <pre>
18407           #include <a href="#7.23">&lt;string.h&gt;</a>
18408           char *strncat(char * restrict s1,
18409                const char * restrict s2,
18410                size_t n);
18411 </pre>
18412 <h6>Description</h6>
18413 <p><!--para 2 -->
18414  The strncat function appends not more than n characters (a null character and
18415  characters that follow it are not appended) from the array pointed to by s2 to the end of
18416  the string pointed to by s1. The initial character of s2 overwrites the null character at the
18417  end of s1. A terminating null character is always appended to the result.<sup><a href="#note302"><b>302)</b></a></sup> If copying
18418  
18419 <!--page 381 -->
18420  takes place between objects that overlap, the behavior is undefined.
18421 <h6>Returns</h6>
18422 <p><!--para 3 -->
18423  The strncat function returns the value of s1.
18424 <p><b> Forward references</b>: the strlen function (<a href="#7.23.6.3">7.23.6.3</a>).
18425
18426 <h6>footnotes</h6>
18427 <p><small><a name="note302" href="#note302">302)</a> Thus, the maximum number of characters that can end up in the array pointed to by s1 is
18428  strlen(s1)+n+1.
18429 </small>
18430
18431 <h4><a name="7.23.4" href="#7.23.4">7.23.4 Comparison functions</a></h4>
18432 <p><!--para 1 -->
18433  The sign of a nonzero value returned by the comparison functions memcmp, strcmp,
18434  and strncmp is determined by the sign of the difference between the values of the first
18435  pair of characters (both interpreted as unsigned char) that differ in the objects being
18436  compared.
18437
18438 <h5><a name="7.23.4.1" href="#7.23.4.1">7.23.4.1 The memcmp function</a></h5>
18439 <h6>Synopsis</h6>
18440 <p><!--para 1 -->
18441 <pre>
18442          #include <a href="#7.23">&lt;string.h&gt;</a>
18443          int memcmp(const void *s1, const void *s2, size_t n);
18444 </pre>
18445 <h6>Description</h6>
18446 <p><!--para 2 -->
18447  The memcmp function compares the first n characters of the object pointed to by s1 to
18448  the first n characters of the object pointed to by s2.<sup><a href="#note303"><b>303)</b></a></sup>
18449 <h6>Returns</h6>
18450 <p><!--para 3 -->
18451  The memcmp function returns an integer greater than, equal to, or less than zero,
18452  accordingly as the object pointed to by s1 is greater than, equal to, or less than the object
18453  pointed to by s2.
18454
18455 <h6>footnotes</h6>
18456 <p><small><a name="note303" href="#note303">303)</a> The contents of ''holes'' used as padding for purposes of alignment within structure objects are
18457  indeterminate. Strings shorter than their allocated space and unions may also cause problems in
18458  comparison.
18459 </small>
18460
18461 <h5><a name="7.23.4.2" href="#7.23.4.2">7.23.4.2 The strcmp function</a></h5>
18462 <h6>Synopsis</h6>
18463 <p><!--para 1 -->
18464 <pre>
18465          #include <a href="#7.23">&lt;string.h&gt;</a>
18466          int strcmp(const char *s1, const char *s2);
18467 </pre>
18468 <h6>Description</h6>
18469 <p><!--para 2 -->
18470  The strcmp function compares the string pointed to by s1 to the string pointed to by
18471  s2.
18472 <h6>Returns</h6>
18473 <p><!--para 3 -->
18474  The strcmp function returns an integer greater than, equal to, or less than zero,
18475  accordingly as the string pointed to by s1 is greater than, equal to, or less than the string
18476  
18477 <!--page 382 -->
18478  pointed to by s2.
18479
18480 <h5><a name="7.23.4.3" href="#7.23.4.3">7.23.4.3 The strcoll function</a></h5>
18481 <h6>Synopsis</h6>
18482 <p><!--para 1 -->
18483 <pre>
18484         #include <a href="#7.23">&lt;string.h&gt;</a>
18485         int strcoll(const char *s1, const char *s2);
18486 </pre>
18487 <h6>Description</h6>
18488 <p><!--para 2 -->
18489  The strcoll function compares the string pointed to by s1 to the string pointed to by
18490  s2, both interpreted as appropriate to the LC_COLLATE category of the current locale.
18491 <h6>Returns</h6>
18492 <p><!--para 3 -->
18493  The strcoll function returns an integer greater than, equal to, or less than zero,
18494  accordingly as the string pointed to by s1 is greater than, equal to, or less than the string
18495  pointed to by s2 when both are interpreted as appropriate to the current locale.
18496
18497 <h5><a name="7.23.4.4" href="#7.23.4.4">7.23.4.4 The strncmp function</a></h5>
18498 <h6>Synopsis</h6>
18499 <p><!--para 1 -->
18500 <pre>
18501         #include <a href="#7.23">&lt;string.h&gt;</a>
18502         int strncmp(const char *s1, const char *s2, size_t n);
18503 </pre>
18504 <h6>Description</h6>
18505 <p><!--para 2 -->
18506  The strncmp function compares not more than n characters (characters that follow a
18507  null character are not compared) from the array pointed to by s1 to the array pointed to
18508  by s2.
18509 <h6>Returns</h6>
18510 <p><!--para 3 -->
18511  The strncmp function returns an integer greater than, equal to, or less than zero,
18512  accordingly as the possibly null-terminated array pointed to by s1 is greater than, equal
18513  to, or less than the possibly null-terminated array pointed to by s2.
18514
18515 <h5><a name="7.23.4.5" href="#7.23.4.5">7.23.4.5 The strxfrm function</a></h5>
18516 <h6>Synopsis</h6>
18517 <p><!--para 1 -->
18518 <pre>
18519         #include <a href="#7.23">&lt;string.h&gt;</a>
18520         size_t strxfrm(char * restrict s1,
18521              const char * restrict s2,
18522              size_t n);
18523 </pre>
18524 <h6>Description</h6>
18525 <p><!--para 2 -->
18526  The strxfrm function transforms the string pointed to by s2 and places the resulting
18527  string into the array pointed to by s1. The transformation is such that if the strcmp
18528  function is applied to two transformed strings, it returns a value greater than, equal to, or
18529 <!--page 383 -->
18530  less than zero, corresponding to the result of the strcoll function applied to the same
18531  two original strings. No more than n characters are placed into the resulting array
18532  pointed to by s1, including the terminating null character. If n is zero, s1 is permitted to
18533  be a null pointer. If copying takes place between objects that overlap, the behavior is
18534  undefined.
18535 <h6>Returns</h6>
18536 <p><!--para 3 -->
18537  The strxfrm function returns the length of the transformed string (not including the
18538  terminating null character). If the value returned is n or more, the contents of the array
18539  pointed to by s1 are indeterminate.
18540 <p><!--para 4 -->
18541  EXAMPLE The value of the following expression is the size of the array needed to hold the
18542  transformation of the string pointed to by s.
18543 <pre>
18544          1 + strxfrm(NULL, s, 0)
18545 </pre>
18546  
18547
18548 <h4><a name="7.23.5" href="#7.23.5">7.23.5 Search functions</a></h4>
18549
18550 <h5><a name="7.23.5.1" href="#7.23.5.1">7.23.5.1 The memchr function</a></h5>
18551 <h6>Synopsis</h6>
18552 <p><!--para 1 -->
18553 <pre>
18554          #include <a href="#7.23">&lt;string.h&gt;</a>
18555          void *memchr(const void *s, int c, size_t n);
18556 </pre>
18557 <h6>Description</h6>
18558 <p><!--para 2 -->
18559  The memchr function locates the first occurrence of c (converted to an unsigned
18560  char) in the initial n characters (each interpreted as unsigned char) of the object
18561  pointed to by s. The implementation shall behave as if it reads the characters sequentially
18562  and stops as soon as a matching character is found.
18563 <h6>Returns</h6>
18564 <p><!--para 3 -->
18565  The memchr function returns a pointer to the located character, or a null pointer if the
18566  character does not occur in the object.
18567
18568 <h5><a name="7.23.5.2" href="#7.23.5.2">7.23.5.2 The strchr function</a></h5>
18569 <h6>Synopsis</h6>
18570 <p><!--para 1 -->
18571 <pre>
18572          #include <a href="#7.23">&lt;string.h&gt;</a>
18573          char *strchr(const char *s, int c);
18574 </pre>
18575 <h6>Description</h6>
18576 <p><!--para 2 -->
18577  The strchr function locates the first occurrence of c (converted to a char) in the
18578  string pointed to by s. The terminating null character is considered to be part of the
18579  string.
18580 <!--page 384 -->
18581 <h6>Returns</h6>
18582 <p><!--para 3 -->
18583  The strchr function returns a pointer to the located character, or a null pointer if the
18584  character does not occur in the string.
18585
18586 <h5><a name="7.23.5.3" href="#7.23.5.3">7.23.5.3 The strcspn function</a></h5>
18587 <h6>Synopsis</h6>
18588 <p><!--para 1 -->
18589 <pre>
18590         #include <a href="#7.23">&lt;string.h&gt;</a>
18591         size_t strcspn(const char *s1, const char *s2);
18592 </pre>
18593 <h6>Description</h6>
18594 <p><!--para 2 -->
18595  The strcspn function computes the length of the maximum initial segment of the string
18596  pointed to by s1 which consists entirely of characters not from the string pointed to by
18597  s2.
18598 <h6>Returns</h6>
18599 <p><!--para 3 -->
18600  The strcspn function returns the length of the segment.
18601
18602 <h5><a name="7.23.5.4" href="#7.23.5.4">7.23.5.4 The strpbrk function</a></h5>
18603 <h6>Synopsis</h6>
18604 <p><!--para 1 -->
18605 <pre>
18606         #include <a href="#7.23">&lt;string.h&gt;</a>
18607         char *strpbrk(const char *s1, const char *s2);
18608 </pre>
18609 <h6>Description</h6>
18610 <p><!--para 2 -->
18611  The strpbrk function locates the first occurrence in the string pointed to by s1 of any
18612  character from the string pointed to by s2.
18613 <h6>Returns</h6>
18614 <p><!--para 3 -->
18615  The strpbrk function returns a pointer to the character, or a null pointer if no character
18616  from s2 occurs in s1.
18617
18618 <h5><a name="7.23.5.5" href="#7.23.5.5">7.23.5.5 The strrchr function</a></h5>
18619 <h6>Synopsis</h6>
18620 <p><!--para 1 -->
18621 <pre>
18622         #include <a href="#7.23">&lt;string.h&gt;</a>
18623         char *strrchr(const char *s, int c);
18624 </pre>
18625 <h6>Description</h6>
18626 <p><!--para 2 -->
18627  The strrchr function locates the last occurrence of c (converted to a char) in the
18628  string pointed to by s. The terminating null character is considered to be part of the
18629  string.
18630 <!--page 385 -->
18631 <h6>Returns</h6>
18632 <p><!--para 3 -->
18633  The strrchr function returns a pointer to the character, or a null pointer if c does not
18634  occur in the string.
18635
18636 <h5><a name="7.23.5.6" href="#7.23.5.6">7.23.5.6 The strspn function</a></h5>
18637 <h6>Synopsis</h6>
18638 <p><!--para 1 -->
18639 <pre>
18640          #include <a href="#7.23">&lt;string.h&gt;</a>
18641          size_t strspn(const char *s1, const char *s2);
18642 </pre>
18643 <h6>Description</h6>
18644 <p><!--para 2 -->
18645  The strspn function computes the length of the maximum initial segment of the string
18646  pointed to by s1 which consists entirely of characters from the string pointed to by s2.
18647 <h6>Returns</h6>
18648 <p><!--para 3 -->
18649  The strspn function returns the length of the segment.
18650
18651 <h5><a name="7.23.5.7" href="#7.23.5.7">7.23.5.7 The strstr function</a></h5>
18652 <h6>Synopsis</h6>
18653 <p><!--para 1 -->
18654 <pre>
18655          #include <a href="#7.23">&lt;string.h&gt;</a>
18656          char *strstr(const char *s1, const char *s2);
18657 </pre>
18658 <h6>Description</h6>
18659 <p><!--para 2 -->
18660  The strstr function locates the first occurrence in the string pointed to by s1 of the
18661  sequence of characters (excluding the terminating null character) in the string pointed to
18662  by s2.
18663 <h6>Returns</h6>
18664 <p><!--para 3 -->
18665  The strstr function returns a pointer to the located string, or a null pointer if the string
18666  is not found. If s2 points to a string with zero length, the function returns s1.
18667
18668 <h5><a name="7.23.5.8" href="#7.23.5.8">7.23.5.8 The strtok function</a></h5>
18669 <h6>Synopsis</h6>
18670 <p><!--para 1 -->
18671 <pre>
18672          #include <a href="#7.23">&lt;string.h&gt;</a>
18673          char *strtok(char * restrict s1,
18674               const char * restrict s2);
18675 </pre>
18676 <h6>Description</h6>
18677 <p><!--para 2 -->
18678  A sequence of calls to the strtok function breaks the string pointed to by s1 into a
18679  sequence of tokens, each of which is delimited by a character from the string pointed to
18680  by s2. The first call in the sequence has a non-null first argument; subsequent calls in the
18681  sequence have a null first argument. The separator string pointed to by s2 may be
18682  different from call to call.
18683 <!--page 386 -->
18684 <p><!--para 3 -->
18685  The first call in the sequence searches the string pointed to by s1 for the first character
18686  that is not contained in the current separator string pointed to by s2. If no such character
18687  is found, then there are no tokens in the string pointed to by s1 and the strtok function
18688  returns a null pointer. If such a character is found, it is the start of the first token.
18689 <p><!--para 4 -->
18690  The strtok function then searches from there for a character that is contained in the
18691  current separator string. If no such character is found, the current token extends to the
18692  end of the string pointed to by s1, and subsequent searches for a token will return a null
18693  pointer. If such a character is found, it is overwritten by a null character, which
18694  terminates the current token. The strtok function saves a pointer to the following
18695  character, from which the next search for a token will start.
18696 <p><!--para 5 -->
18697  Each subsequent call, with a null pointer as the value of the first argument, starts
18698  searching from the saved pointer and behaves as described above.
18699 <p><!--para 6 -->
18700  The strtok function is not required to avoid data races. The implementation shall
18701  behave as if no library function calls the strtok function.
18702 <h6>Returns</h6>
18703 <p><!--para 7 -->
18704  The strtok function returns a pointer to the first character of a token, or a null pointer
18705  if there is no token.
18706 <p><!--para 8 -->
18707  EXAMPLE
18708 <pre>
18709         #include <a href="#7.23">&lt;string.h&gt;</a>
18710         static char str[] = "?a???b,,,#c";
18711         char *t;
18712         t   =   strtok(str, "?");      //   t   points to the token "a"
18713         t   =   strtok(NULL, ",");     //   t   points to the token "??b"
18714         t   =   strtok(NULL, "#,");    //   t   points to the token "c"
18715         t   =   strtok(NULL, "?");     //   t   is a null pointer
18716 </pre>
18717  
18718
18719 <h4><a name="7.23.6" href="#7.23.6">7.23.6 Miscellaneous functions</a></h4>
18720
18721 <h5><a name="7.23.6.1" href="#7.23.6.1">7.23.6.1 The memset function</a></h5>
18722 <h6>Synopsis</h6>
18723 <p><!--para 1 -->
18724 <pre>
18725         #include <a href="#7.23">&lt;string.h&gt;</a>
18726         void *memset(void *s, int c, size_t n);
18727 </pre>
18728 <h6>Description</h6>
18729 <p><!--para 2 -->
18730  The memset function copies the value of c (converted to an unsigned char) into
18731  each of the first n characters of the object pointed to by s.
18732 <h6>Returns</h6>
18733 <p><!--para 3 -->
18734  The memset function returns the value of s.
18735 <!--page 387 -->
18736
18737 <h5><a name="7.23.6.2" href="#7.23.6.2">7.23.6.2 The strerror function</a></h5>
18738 <h6>Synopsis</h6>
18739 <p><!--para 1 -->
18740 <pre>
18741          #include <a href="#7.23">&lt;string.h&gt;</a>
18742          char *strerror(int errnum);
18743 </pre>
18744 <h6>Description</h6>
18745 <p><!--para 2 -->
18746  The strerror function maps the number in errnum to a message string. Typically,
18747  the values for errnum come from errno, but strerror shall map any value of type
18748  int to a message.
18749 <p><!--para 3 -->
18750  The strerror function is not required to avoid data races. The implementation shall
18751  behave as if no library function calls the strerror function.
18752 <h6>Returns</h6>
18753 <p><!--para 4 -->
18754  The strerror function returns a pointer to the string, the contents of which are locale-
18755  specific. The array pointed to shall not be modified by the program, but may be
18756  overwritten by a subsequent call to the strerror function.
18757
18758 <h5><a name="7.23.6.3" href="#7.23.6.3">7.23.6.3 The strlen function</a></h5>
18759 <h6>Synopsis</h6>
18760 <p><!--para 1 -->
18761 <pre>
18762          #include <a href="#7.23">&lt;string.h&gt;</a>
18763          size_t strlen(const char *s);
18764 </pre>
18765 <h6>Description</h6>
18766 <p><!--para 2 -->
18767  The strlen function computes the length of the string pointed to by s.
18768 <h6>Returns</h6>
18769 <p><!--para 3 -->
18770  The strlen function returns the number of characters that precede the terminating null
18771  character.
18772 <!--page 388 -->
18773
18774 <h3><a name="7.24" href="#7.24">7.24 Type-generic math <tgmath.h></a></h3>
18775 <p><!--para 1 -->
18776  The header <a href="#7.24">&lt;tgmath.h&gt;</a> includes the headers <a href="#7.12">&lt;math.h&gt;</a> and <a href="#7.3">&lt;complex.h&gt;</a> and
18777  defines several type-generic macros.
18778 <p><!--para 2 -->
18779  Of the <a href="#7.12">&lt;math.h&gt;</a> and <a href="#7.3">&lt;complex.h&gt;</a> functions without an f (float) or l (long
18780  double) suffix, several have one or more parameters whose corresponding real type is
18781  double. For each such function, except modf, there is a corresponding type-generic
18782  macro.<sup><a href="#note304"><b>304)</b></a></sup> The parameters whose corresponding real type is double in the function
18783  synopsis are generic parameters. Use of the macro invokes a function whose
18784  corresponding real type and type domain are determined by the arguments for the generic
18785  parameters.<sup><a href="#note305"><b>305)</b></a></sup>
18786 <p><!--para 3 -->
18787  Use of the macro invokes a function whose generic parameters have the corresponding
18788  real type determined as follows:
18789 <ul>
18790 <li>  First, if any argument for generic parameters has type long double, the type
18791  determined is long double.
18792 <li>  Otherwise, if any argument for generic parameters has type double or is of integer
18793  type, the type determined is double.
18794 <li>  Otherwise, the type determined is float.
18795 </ul>
18796 <p><!--para 4 -->
18797  For each unsuffixed function in <a href="#7.12">&lt;math.h&gt;</a> for which there is a function in
18798  <a href="#7.3">&lt;complex.h&gt;</a> with the same name except for a c prefix, the corresponding type-
18799  generic macro (for both functions) has the same name as the function in <a href="#7.12">&lt;math.h&gt;</a>. The
18800  corresponding type-generic macro for fabs and cabs is fabs.
18801  
18802  
18803  
18804  
18805 <!--page 389 -->
18806 <pre>
18807           <a href="#7.12">&lt;math.h&gt;</a>         <a href="#7.3">&lt;complex.h&gt;</a>              type-generic
18808            function           function                 macro
18809             acos              cacos                   acos
18810             asin              casin                   asin
18811             atan              catan                   atan
18812             acosh             cacosh                  acosh
18813             asinh             casinh                  asinh
18814             atanh             catanh                  atanh
18815             cos               ccos                    cos
18816             sin               csin                    sin
18817             tan               ctan                    tan
18818             cosh              ccosh                   cosh
18819             sinh              csinh                   sinh
18820             tanh              ctanh                   tanh
18821             exp               cexp                    exp
18822             log               clog                    log
18823             pow               cpow                    pow
18824             sqrt              csqrt                   sqrt
18825             fabs              cabs                    fabs
18826 </pre>
18827  If at least one argument for a generic parameter is complex, then use of the macro invokes
18828  a complex function; otherwise, use of the macro invokes a real function.
18829 <p><!--para 5 -->
18830  For each unsuffixed function in <a href="#7.12">&lt;math.h&gt;</a> without a c-prefixed counterpart in
18831  <a href="#7.3">&lt;complex.h&gt;</a> (except modf), the corresponding type-generic macro has the same
18832  name as the function. These type-generic macros are:
18833 <pre>
18834          atan2              fma                  llround              remainder
18835          cbrt               fmax                 log10                remquo
18836          ceil               fmin                 log1p                rint
18837          copysign           fmod                 log2                 round
18838          erf                frexp                logb                 scalbn
18839          erfc               hypot                lrint                scalbln
18840          exp2               ilogb                lround               tgamma
18841          expm1              ldexp                nearbyint            trunc
18842          fdim               lgamma               nextafter
18843          floor              llrint               nexttoward
18844 </pre>
18845  If all arguments for generic parameters are real, then use of the macro invokes a real
18846  function; otherwise, use of the macro results in undefined behavior.
18847 <!--page 390 -->
18848 <p><!--para 6 -->
18849  For each unsuffixed function in <a href="#7.3">&lt;complex.h&gt;</a> that is not a c-prefixed counterpart to a
18850  function in <a href="#7.12">&lt;math.h&gt;</a>, the corresponding type-generic macro has the same name as the
18851  function. These type-generic macros are:
18852 <pre>
18853         carg                     conj                     creal
18854         cimag                    cproj
18855 </pre>
18856  Use of the macro with any real or complex argument invokes a complex function.
18857 <p><!--para 7 -->
18858  EXAMPLE       With the declarations
18859 <pre>
18860          #include <a href="#7.24">&lt;tgmath.h&gt;</a>
18861          int n;
18862          float f;
18863          double d;
18864          long double ld;
18865          float complex fc;
18866          double complex dc;
18867          long double complex ldc;
18868 </pre>
18869  functions invoked by use of type-generic macros are shown in the following table:
18870 <!--page 391 -->
18871 <pre>
18872                   macro use                                  invokes
18873              exp(n)                              exp(n), the function
18874              acosh(f)                            acoshf(f)
18875              sin(d)                              sin(d), the function
18876              atan(ld)                            atanl(ld)
18877              log(fc)                             clogf(fc)
18878              sqrt(dc)                            csqrt(dc)
18879              pow(ldc, f)                         cpowl(ldc, f)
18880              remainder(n, n)                     remainder(n, n), the function
18881              nextafter(d, f)                     nextafter(d, f), the function
18882              nexttoward(f, ld)                   nexttowardf(f, ld)
18883              copysign(n, ld)                     copysignl(n, ld)
18884              ceil(fc)                            undefined behavior
18885              rint(dc)                            undefined behavior
18886              fmax(ldc, ld)                       undefined behavior
18887              carg(n)                             carg(n), the function
18888              cproj(f)                            cprojf(f)
18889              creal(d)                            creal(d), the function
18890              cimag(ld)                           cimagl(ld)
18891              fabs(fc)                            cabsf(fc)
18892              carg(dc)                            carg(dc), the function
18893              cproj(ldc)                          cprojl(ldc)
18894 </pre>
18895
18896 <h6>footnotes</h6>
18897 <p><small><a name="note304" href="#note304">304)</a> Like other function-like macros in Standard libraries, each type-generic macro can be suppressed to
18898  make available the corresponding ordinary function.
18899 </small>
18900 <p><small><a name="note305" href="#note305">305)</a> If the type of the argument is not compatible with the type of the parameter for the selected function,
18901  the behavior is undefined.
18902 </small>
18903
18904 <h3><a name="7.25" href="#7.25">7.25 Threads <threads.h></a></h3>
18905
18906 <h4><a name="7.25.1" href="#7.25.1">7.25.1 Introduction</a></h4>
18907 <p><!--para 1 -->
18908  The header <a href="#7.25">&lt;threads.h&gt;</a> defines macros, and declares types, enumeration constants,
18909  and functions that support multiple threads of execution.
18910 <p><!--para 2 -->
18911  Implementations that define the macro __STDC_NO_THREADS__ need not provide
18912  this header nor support any of its facilities.
18913 <p><!--para 3 -->
18914  The macros are
18915 <pre>
18916          ONCE_FLAG_INIT
18917 </pre>
18918  which expands to a value that can be used to initialize an object of type once_flag;
18919  and
18920 <pre>
18921          TSS_DTOR_ITERATIONS
18922 </pre>
18923  which expands to an integer constant expression representing the maximum number of
18924  times that destructors will be called when a thread terminates.
18925 <p><!--para 4 -->
18926  The types are
18927 <pre>
18928          cnd_t
18929 </pre>
18930  which is a complete object type that holds an identifier for a condition variable;
18931 <pre>
18932          thrd_t
18933 </pre>
18934  which is a complete object type that holds an identifier for a thread;
18935 <pre>
18936          tss_t
18937 </pre>
18938  which is a complete object type that holds an identifier for a thread-specific storage
18939  pointer;
18940 <pre>
18941          mtx_t
18942 </pre>
18943  which is a complete object type that holds an identifier for a mutex;
18944 <pre>
18945          tss_dtor_t
18946 </pre>
18947  which is the function pointer type void (*)(void*), used for a destructor for a
18948  thread-specific storage pointer;
18949 <pre>
18950          thrd_start_t
18951 </pre>
18952  which is the function pointer type int (*)(void*) that is passed to thrd_create
18953  to create a new thread;
18954 <pre>
18955          once_flag
18956 </pre>
18957  which is a complete object type that holds a flag for use by call_once; and
18958 <!--page 392 -->
18959 <pre>
18960         xtime
18961 </pre>
18962  which is a structure type that holds a time specified in seconds and nanoseconds. The
18963  structure shall contain at least the following members, in any order.
18964 <pre>
18965         time_t sec;
18966         long nsec;
18967 </pre>
18968 <p><!--para 5 -->
18969  The enumeration constants are
18970 <pre>
18971         mtx_plain
18972 </pre>
18973  which is passed to mtx_init to create a mutex object that supports neither timeout nor
18974  test and return;
18975 <pre>
18976         mtx_recursive
18977 </pre>
18978  which is passed to mtx_init to create a mutex object that supports recursive locking;
18979 <pre>
18980         mtx_timed
18981 </pre>
18982  which is passed to mtx_init to create a mutex object that supports timeout;
18983 <pre>
18984         mtx_try
18985 </pre>
18986  which is passed to mtx_init to create a mutex object that supports test and return;
18987 <pre>
18988         thrd_timeout
18989 </pre>
18990  which is returned by a timed wait function to indicate that the time specified in the call
18991  was reached without acquiring the requested resource;
18992 <pre>
18993         thrd_success
18994 </pre>
18995  which is returned by a function to indicate that the requested operation succeeded;
18996 <pre>
18997         thrd_busy
18998 </pre>
18999  which is returned by a function to indicate that the requested operation failed because a
19000  resource requested by a test and return function is already in use;
19001 <pre>
19002         thrd_error
19003 </pre>
19004  which is returned by a function to indicate that the requested operation failed; and
19005 <pre>
19006         thrd_nomem
19007 </pre>
19008  which is returned by a function to indicate that the requested operation failed because it
19009  was unable to allocate memory.
19010 <!--page 393 -->
19011
19012 <h4><a name="7.25.2" href="#7.25.2">7.25.2 Initialization functions</a></h4>
19013
19014 <h5><a name="7.25.2.1" href="#7.25.2.1">7.25.2.1 The call_once function</a></h5>
19015 <h6>Synopsis</h6>
19016 <p><!--para 1 -->
19017 <pre>
19018          #include <a href="#7.25">&lt;threads.h&gt;</a>
19019          void call_once(once_flag *flag, void (*func)(void));
19020 </pre>
19021 <h6>Description</h6>
19022 <p><!--para 2 -->
19023  The call_once function uses the once_flag pointed to by flag to ensure that
19024  func is called exactly once, the first time the call_once function is called with that
19025  value of flag. Completion of an effective call to the call_once function synchronizes
19026  with all subsequent calls to the call_once function with the same value of flag.
19027 <h6>Returns</h6>
19028 <p><!--para 3 -->
19029  The call_once function returns no value.
19030
19031 <h4><a name="7.25.3" href="#7.25.3">7.25.3 Condition variable functions</a></h4>
19032
19033 <h5><a name="7.25.3.1" href="#7.25.3.1">7.25.3.1 The cnd_broadcast function</a></h5>
19034 <h6>Synopsis</h6>
19035 <p><!--para 1 -->
19036 <pre>
19037          #include <a href="#7.25">&lt;threads.h&gt;</a>
19038          int cnd_broadcast(cnd_t *cond);
19039 </pre>
19040 <h6>Description</h6>
19041 <p><!--para 2 -->
19042  The cnd_broadcast function unblocks all of the threads that are blocked on the
19043  condition variable pointed to by cond at the time of the call. If no threads are blocked
19044  on the condition variable pointed to by cond at the time of the call, the function does
19045  nothing.
19046 <h6>Returns</h6>
19047 <p><!--para 3 -->
19048  The cnd_broadcast function returns thrd_success on success, or thrd_error
19049  if the request could not be honored.
19050
19051 <h5><a name="7.25.3.2" href="#7.25.3.2">7.25.3.2 The cnd_destroy function</a></h5>
19052 <h6>Synopsis</h6>
19053 <p><!--para 1 -->
19054 <pre>
19055          #include <a href="#7.25">&lt;threads.h&gt;</a>
19056          void cnd_destroy(cnd_t *cond);
19057 </pre>
19058 <h6>Description</h6>
19059 <p><!--para 2 -->
19060  The cnd_destroy function releases all resources used by the condition variable
19061  pointed to by cond. The cnd_destroy function requires that no threads be blocked
19062  waiting for the condition variable pointed to by cond.
19063 <!--page 394 -->
19064 <h6>Returns</h6>
19065 <p><!--para 3 -->
19066  The cnd_destroy function returns no value.
19067
19068 <h5><a name="7.25.3.3" href="#7.25.3.3">7.25.3.3 The cnd_init function</a></h5>
19069 <h6>Synopsis</h6>
19070 <p><!--para 1 -->
19071 <pre>
19072         #include <a href="#7.25">&lt;threads.h&gt;</a>
19073         int cnd_init(cnd_t *cond);
19074 </pre>
19075 <h6>Description</h6>
19076 <p><!--para 2 -->
19077  The cnd_init function creates a condition variable. If it succeeds it sets the variable
19078  pointed to by cond to a value that uniquely identifies the newly created condition
19079  variable. A thread that calls cnd_wait on a newly created condition variable will
19080  block.
19081 <h6>Returns</h6>
19082 <p><!--para 3 -->
19083  The cnd_init function returns thrd_success on success, or thrd_nomem if no
19084  memory could be allocated for the newly created condition, or thrd_error if the
19085  request could not be honored.
19086
19087 <h5><a name="7.25.3.4" href="#7.25.3.4">7.25.3.4 The cnd_signal function</a></h5>
19088 <h6>Synopsis</h6>
19089 <p><!--para 1 -->
19090 <pre>
19091         #include <a href="#7.25">&lt;threads.h&gt;</a>
19092         int cnd_signal(cnd_t *cond);
19093 </pre>
19094 <h6>Description</h6>
19095 <p><!--para 2 -->
19096  The cnd_signal function unblocks one of the threads that are blocked on the
19097  condition variable pointed to by cond at the time of the call. If no threads are blocked
19098  on the condition variable at the time of the call, the function does nothing and return
19099  success.
19100 <h6>Returns</h6>
19101 <p><!--para 3 -->
19102  The cnd_signal function returns thrd_success on success or thrd_error if
19103  the request could not be honored.
19104
19105 <h5><a name="7.25.3.5" href="#7.25.3.5">7.25.3.5 The cnd_timedwait function</a></h5>
19106 <h6>Synopsis</h6>
19107 <p><!--para 1 -->
19108 <!--page 395 -->
19109 <pre>
19110         #include <a href="#7.25">&lt;threads.h&gt;</a>
19111         int cnd_timedwait(cnd_t *cond, mtx_t *mtx,
19112              const xtime *xt);
19113 </pre>
19114 <h6>Description</h6>
19115 <p><!--para 2 -->
19116  The cnd_timedwait function atomically unlocks the mutex pointed to by mtx and
19117  endeavors to block until the condition variable pointed to by cond is signaled by a call to
19118  cnd_signal or to cnd_broadcast, or until after the time specified by the xtime
19119  object pointed to by xt. When the calling thread becomes unblocked it locks the variable
19120  pointed to by mtx before it returns. The cnd_timedwait function requires that the
19121  mutex pointed to by mtx be locked by the calling thread.
19122 <h6>Returns</h6>
19123 <p><!--para 3 -->
19124  The cnd_timedwait function returns thrd_success upon success, or
19125  thrd_timeout if the time specified in the call was reached without acquiring the
19126  requested resource, or thrd_error if the request could not be honored.
19127
19128 <h5><a name="7.25.3.6" href="#7.25.3.6">7.25.3.6 The cnd_wait function</a></h5>
19129 <h6>Synopsis</h6>
19130 <p><!--para 1 -->
19131 <pre>
19132          #include <a href="#7.25">&lt;threads.h&gt;</a>
19133          int cnd_wait(cnd_t *cond, mtx_t *mtx);
19134 </pre>
19135 <h6>Description</h6>
19136 <p><!--para 2 -->
19137  The cnd_wait function atomically unlocks the mutex pointed to by mtx and endeavors
19138  to block until the condition variable pointed to by cond is signaled by a call to
19139  cnd_signal or to cnd_broadcast. When the calling thread becomes unblocked it
19140  locks the mutex pointed to by mtx before it returns. If the mutex pointed to by mtx is
19141  not locked by the calling thread, the cnd_wait function will act as if the abort
19142  function is called.
19143 <h6>Returns</h6>
19144 <p><!--para 3 -->
19145  The cnd_wait function returns thrd_success on success or thrd_error if the
19146  request could not be honored.
19147
19148 <h4><a name="7.25.4" href="#7.25.4">7.25.4 Mutex functions</a></h4>
19149
19150 <h5><a name="7.25.4.1" href="#7.25.4.1">7.25.4.1 The mtx_destroy function</a></h5>
19151 <h6>Synopsis</h6>
19152 <p><!--para 1 -->
19153 <pre>
19154          #include <a href="#7.25">&lt;threads.h&gt;</a>
19155          void mtx_destroy(mtx_t *mtx);
19156 </pre>
19157 <h6>Description</h6>
19158 <p><!--para 2 -->
19159  The mtx_destroy function releases any resources used by the mutex pointed to by
19160  mtx. No threads can be blocked waiting for the mutex pointed to by mtx.
19161 <!--page 396 -->
19162 <h6>Returns</h6>
19163 <p><!--para 3 -->
19164  The mtx_destroy function returns no value.
19165
19166 <h5><a name="7.25.4.2" href="#7.25.4.2">7.25.4.2 The mtx_init function</a></h5>
19167 <h6>Synopsis</h6>
19168 <p><!--para 1 -->
19169 <pre>
19170         #include <a href="#7.25">&lt;threads.h&gt;</a>
19171         int mtx_init(mtx_t *mtx, int type);
19172 </pre>
19173 <h6>Description</h6>
19174 <p><!--para 2 -->
19175  The mtx_init function creates a mutex object with properties indicated by type,
19176  which must have one of the six values:
19177  mtx_plain for a simple non-recursive mutex,
19178  mtx_timed for a non-recursive mutex that supports timeout,
19179  mtx_try      for a non-recursive mutex that supports test and return,
19180  mtx_plain | mtx_recursive for a simple recursive mutex,
19181  mtx_timed | mtx_recursive for a recursive mutex that supports timeout, or
19182  mtx_try | mtx_recursive for a recursive mutex that supports test and return.
19183 <p><!--para 3 -->
19184  If the mtx_init function succeeds, it sets the mutex pointed to by mtx to a value that
19185  uniquely identifies the newly created mutex.
19186 <h6>Returns</h6>
19187 <p><!--para 4 -->
19188  The mtx_init function returns thrd_success on success, or thrd_error if the
19189  request could not be honored.
19190
19191 <h5><a name="7.25.4.3" href="#7.25.4.3">7.25.4.3 The mtx_lock function</a></h5>
19192 <h6>Synopsis</h6>
19193 <p><!--para 1 -->
19194 <pre>
19195         #include <a href="#7.25">&lt;threads.h&gt;</a>
19196         int mtx_lock(mtx_t *mtx);
19197 </pre>
19198 <h6>Description</h6>
19199 <p><!--para 2 -->
19200  The mtx_lock function blocks until it locks the mutex pointed to by mtx. If the mutex
19201  is non-recursive, it shall not be locked by the calling thread. Prior calls to mtx_unlock
19202  on the same mutex shall synchronize with this operation.
19203 <h6>Returns</h6>
19204 <p><!--para 3 -->
19205  The mtx_lock function returns thrd_success on success, or thrd_busy if the
19206  resource requested is already in use, or thrd_error if the request could not be
19207  honored.
19208 <!--page 397 -->
19209
19210 <h5><a name="7.25.4.4" href="#7.25.4.4">7.25.4.4 The mtx_timedlock function</a></h5>
19211 <h6>Synopsis</h6>
19212 <p><!--para 1 -->
19213 <pre>
19214          #include <a href="#7.25">&lt;threads.h&gt;</a>
19215          int mtx_timedlock(mtx_t *mtx, const xtime *xt);
19216 </pre>
19217 <h6>Description</h6>
19218 <p><!--para 2 -->
19219  The mtx_timedlock function endeavors to block until it locks the mutex pointed to by
19220  mtx or until the time specified by the xtime object xt has passed. The specified mutex
19221  shall support timeout. If the operation succeeds, prior calls to mtx_unlock on the same
19222  mutex shall synchronize with this operation.
19223 <h6>Returns</h6>
19224 <p><!--para 3 -->
19225  The mtx_timedlock function returns thrd_success on success, or thrd_busy
19226  if the resource requested is already in use, or thrd_timeout if the time specified was
19227  reached without acquiring the requested resource, or thrd_error if the request could
19228  not be honored.
19229
19230 <h5><a name="7.25.4.5" href="#7.25.4.5">7.25.4.5 The mtx_trylock function</a></h5>
19231 <h6>Synopsis</h6>
19232 <p><!--para 1 -->
19233 <pre>
19234          #include <a href="#7.25">&lt;threads.h&gt;</a>
19235          int mtx_trylock(mtx_t *mtx);
19236 </pre>
19237 <h6>Description</h6>
19238 <p><!--para 2 -->
19239  The mtx_trylock function endeavors to lock the mutex pointed to by mtx. The
19240  specified mutex shall support either test and return or timeout. If the mutex is already
19241  locked, the function returns without blocking. If the operation succeeds, prior calls to
19242  mtx_unlock on the same mutex shall synchronize with this operation.
19243 <h6>Returns</h6>
19244 <p><!--para 3 -->
19245  The mtx_trylock function returns thrd_success on success, or thrd_busy if
19246  the resource requested is already in use, or thrd_error if the request could not be
19247  honored.
19248
19249 <h5><a name="7.25.4.6" href="#7.25.4.6">7.25.4.6 The mtx_unlock function</a></h5>
19250 <h6>Synopsis</h6>
19251 <p><!--para 1 -->
19252 <pre>
19253          #include <a href="#7.25">&lt;threads.h&gt;</a>
19254          int mtx_unlock(mtx_t *mtx);
19255 </pre>
19256 <h6>Description</h6>
19257 <p><!--para 2 -->
19258  The mtx_unlock function unlocks the mutex pointed to by mtx. The mutex pointed to
19259  by mtx shall be locked by the calling thread.
19260 <!--page 398 -->
19261 <h6>Returns</h6>
19262 <p><!--para 3 -->
19263  The mtx_unlock function returns thrd_success on success or thrd_error if
19264  the request could not be honored.
19265
19266 <h4><a name="7.25.5" href="#7.25.5">7.25.5 Thread functions</a></h4>
19267
19268 <h5><a name="7.25.5.1" href="#7.25.5.1">7.25.5.1 The thrd_create function</a></h5>
19269 <h6>Synopsis</h6>
19270 <p><!--para 1 -->
19271 <pre>
19272         #include <a href="#7.25">&lt;threads.h&gt;</a>
19273         int thrd_create(thrd_t *thr, thrd_start_t func,
19274              void *arg);
19275 </pre>
19276 <h6>Description</h6>
19277 <p><!--para 2 -->
19278  The thrd_create function creates a new thread executing func(arg). If the
19279  thrd_create function succeeds, it sets the object pointed to by thr to the identifier of
19280  the newly created thread. (A thread's identifier may be reused for a different thread once
19281  the original thread has exited and either been detached or joined to another thread.) The
19282  completion of the thrd_create function synchronizes with the beginning of the
19283  execution of the new thread.
19284 <h6>Returns</h6>
19285 <p><!--para 3 -->
19286  The thrd_create function returns thrd_success on success, or thrd_nomem if
19287  no memory could be allocated for the thread requested, or thrd_error if the request
19288  could not be honored.
19289
19290 <h5><a name="7.25.5.2" href="#7.25.5.2">7.25.5.2 The thrd_current function</a></h5>
19291 <h6>Synopsis</h6>
19292 <p><!--para 1 -->
19293 <pre>
19294         #include <a href="#7.25">&lt;threads.h&gt;</a>
19295         thrd_t thrd_current(void);
19296 </pre>
19297 <h6>Description</h6>
19298 <p><!--para 2 -->
19299  The thrd_current function identifies the thread that called it.
19300 <h6>Returns</h6>
19301 <p><!--para 3 -->
19302  The thrd_current function returns the identifier of the thread that called it.
19303
19304 <h5><a name="7.25.5.3" href="#7.25.5.3">7.25.5.3 The thrd_detach function</a></h5>
19305 <h6>Synopsis</h6>
19306 <p><!--para 1 -->
19307 <!--page 399 -->
19308 <pre>
19309         #include <a href="#7.25">&lt;threads.h&gt;</a>
19310         int thrd_detach(thrd_t thr);
19311 </pre>
19312 <h6>Description</h6>
19313 <p><!--para 2 -->
19314  The thrd_detach function tells the operating system to dispose of any resources
19315  allocated to the thread identified by thr when that thread terminates. The thread
19316  identified by thr shall not have been previously detached or joined with another thread.
19317 <h6>Returns</h6>
19318 <p><!--para 3 -->
19319  The thrd_detach function returns thrd_success on success or thrd_error if
19320  the request could not be honored.
19321
19322 <h5><a name="7.25.5.4" href="#7.25.5.4">7.25.5.4 The thrd_equal function</a></h5>
19323 <h6>Synopsis</h6>
19324 <p><!--para 1 -->
19325 <pre>
19326          #include <a href="#7.25">&lt;threads.h&gt;</a>
19327          int thrd_equal(thrd_t thr0, thrd_t thr1);
19328 </pre>
19329 <h6>Description</h6>
19330 <p><!--para 2 -->
19331  The thrd_equal function will determine whether the thread identified by thr0 refers
19332  to the thread identified by thr1.
19333 <h6>Returns</h6>
19334 <p><!--para 3 -->
19335  The thrd_equal function returns zero if the thread thr0 and the thread thr1 refer to
19336  different threads. Otherwise the thrd_equal function returns a nonzero value.
19337
19338 <h5><a name="7.25.5.5" href="#7.25.5.5">7.25.5.5 The thrd_exit function</a></h5>
19339 <h6>Synopsis</h6>
19340 <p><!--para 1 -->
19341 <pre>
19342          #include <a href="#7.25">&lt;threads.h&gt;</a>
19343          void thrd_exit(int res);
19344 </pre>
19345 <h6>Description</h6>
19346 <p><!--para 2 -->
19347  The thrd_exit function terminates execution of the calling thread and sets its result
19348  code to res.
19349 <h6>Returns</h6>
19350 <p><!--para 3 -->
19351  The thrd_exit function returns no value.
19352
19353 <h5><a name="7.25.5.6" href="#7.25.5.6">7.25.5.6 The thrd_join function</a></h5>
19354 <h6>Synopsis</h6>
19355 <p><!--para 1 -->
19356 <pre>
19357          #include <a href="#7.25">&lt;threads.h&gt;</a>
19358          int thrd_join(thrd_t thr, int *res);
19359 </pre>
19360 <h6>Description</h6>
19361 <p><!--para 2 -->
19362  The thrd_join function joins the thread identified by thr with the current thread by
19363  blocking until the other thread has terminated. If the parameter res is not a null pointer,
19364 <!--page 400 -->
19365  it stores the thread's result code in the integer pointed to by res. The termination of the
19366  other thread synchronizes with the completion of the thrd_join function. The thread
19367  identified by thr shall not have been previously detached or joined with another thread.
19368 <h6>Returns</h6>
19369 <p><!--para 3 -->
19370  The thrd_join function returns thrd_success on success or thrd_error if the
19371  request could not be honored.
19372
19373 <h5><a name="7.25.5.7" href="#7.25.5.7">7.25.5.7 The thrd_sleep function</a></h5>
19374 <h6>Synopsis</h6>
19375 <p><!--para 1 -->
19376 <pre>
19377         #include <a href="#7.25">&lt;threads.h&gt;</a>
19378         void thrd_sleep(const xtime *xt);
19379 </pre>
19380 <h6>Description</h6>
19381 <p><!--para 2 -->
19382  The thrd_sleep function suspends execution of the calling thread until after the time
19383  specified by the xtime object pointed to by xt.
19384 <h6>Returns</h6>
19385 <p><!--para 3 -->
19386  The thrd_sleep function returns no value.
19387
19388 <h5><a name="7.25.5.8" href="#7.25.5.8">7.25.5.8 The thrd_yield function</a></h5>
19389 <h6>Synopsis</h6>
19390 <p><!--para 1 -->
19391 <pre>
19392         #include <a href="#7.25">&lt;threads.h&gt;</a>
19393         void thrd_yield(void);
19394 </pre>
19395 <h6>Description</h6>
19396 <p><!--para 2 -->
19397  The thrd_yield function endeavors to permit other threads to run, even if the current
19398  thread would ordinarily continue to run.
19399 <h6>Returns</h6>
19400 <p><!--para 3 -->
19401  The thrd_yield function returns no value.
19402
19403 <h4><a name="7.25.6" href="#7.25.6">7.25.6 Thread-specific storage functions</a></h4>
19404
19405 <h5><a name="7.25.6.1" href="#7.25.6.1">7.25.6.1 The tss_create function</a></h5>
19406 <h6>Synopsis</h6>
19407 <p><!--para 1 -->
19408 <pre>
19409         #include <a href="#7.25">&lt;threads.h&gt;</a>
19410         int tss_create(tss_t *key, tss_dtor_t dtor);
19411 </pre>
19412 <h6>Description</h6>
19413 <p><!--para 2 -->
19414  The tss_create function creates a thread-specific storage pointer with destructor
19415  dtor, which may be null.
19416 <!--page 401 -->
19417 <h6>Returns</h6>
19418 <p><!--para 3 -->
19419  If the tss_create function is successful, it sets the thread-specific storage pointed to
19420  by key to a value that uniquely identifies the newly created pointer and returns
19421  thrd_success; otherwise, thrd_error is returned and the thread-specific storage
19422  pointed to by key is set to an undefined value.
19423
19424 <h5><a name="7.25.6.2" href="#7.25.6.2">7.25.6.2 The tss_delete function</a></h5>
19425 <h6>Synopsis</h6>
19426 <p><!--para 1 -->
19427 <pre>
19428          #include <a href="#7.25">&lt;threads.h&gt;</a>
19429          void tss_delete(tss_t key);
19430 </pre>
19431 <h6>Description</h6>
19432 <p><!--para 2 -->
19433  The tss_delete function releases any resources used by the thread-specific storage
19434  identified by key.
19435 <h6>Returns</h6>
19436 <p><!--para 3 -->
19437  The tss_delete function returns no value.
19438
19439 <h5><a name="7.25.6.3" href="#7.25.6.3">7.25.6.3 The tss_get function</a></h5>
19440 <h6>Synopsis</h6>
19441 <p><!--para 1 -->
19442 <pre>
19443          #include <a href="#7.25">&lt;threads.h&gt;</a>
19444          void *tss_get(tss_t key);
19445 </pre>
19446 <h6>Description</h6>
19447 <p><!--para 2 -->
19448  The tss_get function returns the value for the current thread held in the thread-specific
19449  storage identified by key.
19450 <h6>Returns</h6>
19451 <p><!--para 3 -->
19452  The tss_get function returns the value for the current thread if successful, or zero if
19453  unsuccessful.
19454
19455 <h5><a name="7.25.6.4" href="#7.25.6.4">7.25.6.4 The tss_set function</a></h5>
19456 <h6>Synopsis</h6>
19457 <p><!--para 1 -->
19458 <pre>
19459          #include <a href="#7.25">&lt;threads.h&gt;</a>
19460          int tss_set(tss_t key, void *val);
19461 </pre>
19462 <h6>Description</h6>
19463 <p><!--para 2 -->
19464  The tss_set function sets the value for the current thread held in the thread-specific
19465  storage identified by key to val.
19466 <!--page 402 -->
19467 <h6>Returns</h6>
19468 <p><!--para 3 -->
19469  The tss_set function returns thrd_success on success or thrd_error if the
19470  request could not be honored.
19471
19472 <h4><a name="7.25.7" href="#7.25.7">7.25.7 Time functions</a></h4>
19473
19474 <h5><a name="7.25.7.1" href="#7.25.7.1">7.25.7.1 The xtime_get function</a></h5>
19475 <h6>Synopsis</h6>
19476 <p><!--para 1 -->
19477 <pre>
19478          #include <a href="#7.25">&lt;threads.h&gt;</a>
19479          int xtime_get(xtime *xt, int base);
19480 </pre>
19481 <h6>Description</h6>
19482 <p><!--para 2 -->
19483  The xtime_get function sets the xtime object pointed to by xt to hold the current
19484  time based on the time base base.
19485 <h6>Returns</h6>
19486 <p><!--para 3 -->
19487  If the xtime_get function is successful it returns the nonzero value base, which must
19488  be TIME_UTC; otherwise, it returns zero.<sup><a href="#note306"><b>306)</b></a></sup>
19489  
19490  
19491  
19492  
19493 <!--page 403 -->
19494
19495 <h6>footnotes</h6>
19496 <p><small><a name="note306" href="#note306">306)</a> Although an xtime object describes times with nanosecond resolution, the actual resolution in an
19497  xtime object is system dependent.
19498 </small>
19499
19500 <h3><a name="7.26" href="#7.26">7.26 Date and time <time.h></a></h3>
19501
19502 <h4><a name="7.26.1" href="#7.26.1">7.26.1 Components of time</a></h4>
19503 <p><!--para 1 -->
19504  The header <a href="#7.26">&lt;time.h&gt;</a> defines two macros, and declares several types and functions for
19505  manipulating time. Many functions deal with a calendar time that represents the current
19506  date (according to the Gregorian calendar) and time. Some functions deal with local
19507  time, which is the calendar time expressed for some specific time zone, and with Daylight
19508  Saving Time, which is a temporary change in the algorithm for determining local time.
19509  The local time zone and Daylight Saving Time are implementation-defined.
19510 <p><!--para 2 -->
19511  The macros defined are NULL (described in <a href="#7.19">7.19</a>); and
19512 <pre>
19513          CLOCKS_PER_SEC
19514 </pre>
19515  which expands to an expression with type clock_t (described below) that is the
19516  number per second of the value returned by the clock function.
19517 <p><!--para 3 -->
19518  The types declared are size_t (described in <a href="#7.19">7.19</a>);
19519 <pre>
19520          clock_t
19521 </pre>
19522  and
19523 <pre>
19524          time_t
19525 </pre>
19526  which are arithmetic types capable of representing times; and
19527 <pre>
19528          struct tm
19529 </pre>
19530  which holds the components of a calendar time, called the broken-down time.
19531 <p><!--para 4 -->
19532  The range and precision of times representable in clock_t and time_t are
19533  implementation-defined. The tm structure shall contain at least the following members,
19534  in any order. The semantics of the members and their normal ranges are expressed in the
19535  comments.<sup><a href="#note307"><b>307)</b></a></sup>
19536 <pre>
19537          int    tm_sec;           //   seconds after the minute -- [0, 60]
19538          int    tm_min;           //   minutes after the hour -- [0, 59]
19539          int    tm_hour;          //   hours since midnight -- [0, 23]
19540          int    tm_mday;          //   day of the month -- [1, 31]
19541          int    tm_mon;           //   months since January -- [0, 11]
19542          int    tm_year;          //   years since 1900
19543          int    tm_wday;          //   days since Sunday -- [0, 6]
19544          int    tm_yday;          //   days since January 1 -- [0, 365]
19545          int    tm_isdst;         //   Daylight Saving Time flag
19546 </pre>
19547  
19548  
19549  
19550 <!--page 404 -->
19551  The value of tm_isdst is positive if Daylight Saving Time is in effect, zero if Daylight
19552  Saving Time is not in effect, and negative if the information is not available.
19553
19554 <h6>footnotes</h6>
19555 <p><small><a name="note307" href="#note307">307)</a> The range [0, 60] for tm_sec allows for a positive leap second.
19556 </small>
19557
19558 <h4><a name="7.26.2" href="#7.26.2">7.26.2 Time manipulation functions</a></h4>
19559
19560 <h5><a name="7.26.2.1" href="#7.26.2.1">7.26.2.1 The clock function</a></h5>
19561 <h6>Synopsis</h6>
19562 <p><!--para 1 -->
19563 <pre>
19564          #include <a href="#7.26">&lt;time.h&gt;</a>
19565          clock_t clock(void);
19566 </pre>
19567 <h6>Description</h6>
19568 <p><!--para 2 -->
19569  The clock function determines the processor time used.
19570 <h6>Returns</h6>
19571 <p><!--para 3 -->
19572  The clock function returns the implementation's best approximation to the processor
19573  time used by the program since the beginning of an implementation-defined era related
19574  only to the program invocation. To determine the time in seconds, the value returned by
19575  the clock function should be divided by the value of the macro CLOCKS_PER_SEC. If
19576  the processor time used is not available or its value cannot be represented, the function
19577  returns the value (clock_t)(-1).<sup><a href="#note308"><b>308)</b></a></sup>
19578
19579 <h6>footnotes</h6>
19580 <p><small><a name="note308" href="#note308">308)</a> In order to measure the time spent in a program, the clock function should be called at the start of
19581  the program and its return value subtracted from the value returned by subsequent calls.
19582 </small>
19583
19584 <h5><a name="7.26.2.2" href="#7.26.2.2">7.26.2.2 The difftime function</a></h5>
19585 <h6>Synopsis</h6>
19586 <p><!--para 1 -->
19587 <pre>
19588          #include <a href="#7.26">&lt;time.h&gt;</a>
19589          double difftime(time_t time1, time_t time0);
19590 </pre>
19591 <h6>Description</h6>
19592 <p><!--para 2 -->
19593  The difftime function computes the difference between two calendar times: time1 -
19594  time0.
19595 <h6>Returns</h6>
19596 <p><!--para 3 -->
19597  The difftime function returns the difference expressed in seconds as a double.
19598  
19599  
19600  
19601  
19602 <!--page 405 -->
19603
19604 <h5><a name="7.26.2.3" href="#7.26.2.3">7.26.2.3 The mktime function</a></h5>
19605 <h6>Synopsis</h6>
19606 <p><!--para 1 -->
19607 <pre>
19608          #include <a href="#7.26">&lt;time.h&gt;</a>
19609          time_t mktime(struct tm *timeptr);
19610 </pre>
19611 <h6>Description</h6>
19612 <p><!--para 2 -->
19613  The mktime function converts the broken-down time, expressed as local time, in the
19614  structure pointed to by timeptr into a calendar time value with the same encoding as
19615  that of the values returned by the time function. The original values of the tm_wday
19616  and tm_yday components of the structure are ignored, and the original values of the
19617  other components are not restricted to the ranges indicated above.<sup><a href="#note309"><b>309)</b></a></sup> On successful
19618  completion, the values of the tm_wday and tm_yday components of the structure are
19619  set appropriately, and the other components are set to represent the specified calendar
19620  time, but with their values forced to the ranges indicated above; the final value of
19621  tm_mday is not set until tm_mon and tm_year are determined.
19622 <h6>Returns</h6>
19623 <p><!--para 3 -->
19624  The mktime function returns the specified calendar time encoded as a value of type
19625  time_t. If the calendar time cannot be represented, the function returns the value
19626  (time_t)(-1).
19627 <p><!--para 4 -->
19628  EXAMPLE       What day of the week is July 4, 2001?
19629 <pre>
19630          #include <a href="#7.21">&lt;stdio.h&gt;</a>
19631          #include <a href="#7.26">&lt;time.h&gt;</a>
19632          static const char *const wday[] = {
19633                  "Sunday", "Monday", "Tuesday", "Wednesday",
19634                  "Thursday", "Friday", "Saturday", "-unknown-"
19635          };
19636          struct tm time_str;
19637          /* ... */
19638 </pre>
19639  
19640  
19641  
19642  
19643 <!--page 406 -->
19644 <pre>
19645         time_str.tm_year   = 2001 - 1900;
19646         time_str.tm_mon    = 7 - 1;
19647         time_str.tm_mday   = 4;
19648         time_str.tm_hour   = 0;
19649         time_str.tm_min    = 0;
19650         time_str.tm_sec    = 1;
19651         time_str.tm_isdst = -1;
19652         if (mktime(&amp;time_str) == (time_t)(-1))
19653               time_str.tm_wday = 7;
19654         printf("%s\n", wday[time_str.tm_wday]);
19655 </pre>
19656  
19657
19658 <h6>footnotes</h6>
19659 <p><small><a name="note309" href="#note309">309)</a> Thus, a positive or zero value for tm_isdst causes the mktime function to presume initially that
19660  Daylight Saving Time, respectively, is or is not in effect for the specified time. A negative value
19661  causes it to attempt to determine whether Daylight Saving Time is in effect for the specified time.
19662 </small>
19663
19664 <h5><a name="7.26.2.4" href="#7.26.2.4">7.26.2.4 The time function</a></h5>
19665 <h6>Synopsis</h6>
19666 <p><!--para 1 -->
19667 <pre>
19668         #include <a href="#7.26">&lt;time.h&gt;</a>
19669         time_t time(time_t *timer);
19670 </pre>
19671 <h6>Description</h6>
19672 <p><!--para 2 -->
19673  The time function determines the current calendar time. The encoding of the value is
19674  unspecified.
19675 <h6>Returns</h6>
19676 <p><!--para 3 -->
19677  The time function returns the implementation's best approximation to the current
19678  calendar time. The value (time_t)(-1) is returned if the calendar time is not
19679  available. If timer is not a null pointer, the return value is also assigned to the object it
19680  points to.
19681
19682 <h4><a name="7.26.3" href="#7.26.3">7.26.3 Time conversion functions</a></h4>
19683 <p><!--para 1 -->
19684  Except for the strftime function, these functions each return a pointer to one of two
19685  types of static objects: a broken-down time structure or an array of char. Execution of
19686  any of the functions that return a pointer to one of these object types may overwrite the
19687  information in any object of the same type pointed to by the value returned from any
19688  previous call to any of them and the functions are not required to avoid data races. The
19689  implementation shall behave as if no other library functions call these functions.
19690
19691 <h5><a name="7.26.3.1" href="#7.26.3.1">7.26.3.1 The asctime function</a></h5>
19692 <h6>Synopsis</h6>
19693 <p><!--para 1 -->
19694 <pre>
19695         #include <a href="#7.26">&lt;time.h&gt;</a>
19696         char *asctime(const struct tm *timeptr);
19697 </pre>
19698 <h6>Description</h6>
19699 <p><!--para 2 -->
19700  The asctime function converts the broken-down time in the structure pointed to by
19701  timeptr into a string in the form
19702 <!--page 407 -->
19703 <pre>
19704         Sun Sep 16 01:03:52 1973\n\0
19705 </pre>
19706  using the equivalent of the following algorithm.
19707  char *asctime(const struct tm *timeptr)
19708  {
19709 <pre>
19710       static const char wday_name[7][3] = {
19711            "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
19712       };
19713       static const char mon_name[12][3] = {
19714            "Jan", "Feb", "Mar", "Apr", "May", "Jun",
19715            "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
19716       };
19717       static char result[26];
19718          sprintf(result, "%.3s %.3s%3d %.2d:%.2d:%.2d %d\n",
19719               wday_name[timeptr-&gt;tm_wday],
19720               mon_name[timeptr-&gt;tm_mon],
19721               timeptr-&gt;tm_mday, timeptr-&gt;tm_hour,
19722               timeptr-&gt;tm_min, timeptr-&gt;tm_sec,
19723               1900 + timeptr-&gt;tm_year);
19724          return result;
19725 </pre>
19726  }
19727 <p><!--para 3 -->
19728  If any of the fields of the broken-down time contain values that are outside their normal
19729  ranges,<sup><a href="#note310"><b>310)</b></a></sup> the behavior of the asctime function is undefined. Likewise, if the
19730  calculated year exceeds four digits or is less than the year 1000, the behavior is
19731  undefined.
19732 <h6>Returns</h6>
19733 <p><!--para 4 -->
19734  The asctime function returns a pointer to the string.
19735
19736 <h6>footnotes</h6>
19737 <p><small><a name="note310" href="#note310">310)</a> See <a href="#7.26.1">7.26.1</a>.
19738 </small>
19739
19740 <h5><a name="7.26.3.2" href="#7.26.3.2">7.26.3.2 The ctime function</a></h5>
19741 <h6>Synopsis</h6>
19742 <p><!--para 1 -->
19743 <pre>
19744          #include <a href="#7.26">&lt;time.h&gt;</a>
19745          char *ctime(const time_t *timer);
19746 </pre>
19747 <h6>Description</h6>
19748 <p><!--para 2 -->
19749  The ctime function converts the calendar time pointed to by timer to local time in the
19750  form of a string. It is equivalent to
19751 <pre>
19752          asctime(localtime(timer))
19753 </pre>
19754  
19755  
19756  
19757 <!--page 408 -->
19758 <h6>Returns</h6>
19759 <p><!--para 3 -->
19760  The ctime function returns the pointer returned by the asctime function with that
19761  broken-down time as argument.
19762 <p><b> Forward references</b>: the localtime function (<a href="#7.26.3.4">7.26.3.4</a>).
19763
19764 <h5><a name="7.26.3.3" href="#7.26.3.3">7.26.3.3 The gmtime function</a></h5>
19765 <h6>Synopsis</h6>
19766 <p><!--para 1 -->
19767 <pre>
19768         #include <a href="#7.26">&lt;time.h&gt;</a>
19769         struct tm *gmtime(const time_t *timer);
19770 </pre>
19771 <h6>Description</h6>
19772 <p><!--para 2 -->
19773  The gmtime function converts the calendar time pointed to by timer into a broken-
19774  down time, expressed as UTC.
19775 <h6>Returns</h6>
19776 <p><!--para 3 -->
19777  The gmtime function returns a pointer to the broken-down time, or a null pointer if the
19778  specified time cannot be converted to UTC.
19779
19780 <h5><a name="7.26.3.4" href="#7.26.3.4">7.26.3.4 The localtime function</a></h5>
19781 <h6>Synopsis</h6>
19782 <p><!--para 1 -->
19783 <pre>
19784         #include <a href="#7.26">&lt;time.h&gt;</a>
19785         struct tm *localtime(const time_t *timer);
19786 </pre>
19787 <h6>Description</h6>
19788 <p><!--para 2 -->
19789  The localtime function converts the calendar time pointed to by timer into a
19790  broken-down time, expressed as local time.
19791 <h6>Returns</h6>
19792 <p><!--para 3 -->
19793  The localtime function returns a pointer to the broken-down time, or a null pointer if
19794  the specified time cannot be converted to local time.
19795
19796 <h5><a name="7.26.3.5" href="#7.26.3.5">7.26.3.5 The strftime function</a></h5>
19797 <h6>Synopsis</h6>
19798 <p><!--para 1 -->
19799 <!--page 409 -->
19800 <pre>
19801         #include <a href="#7.26">&lt;time.h&gt;</a>
19802         size_t strftime(char * restrict s,
19803              size_t maxsize,
19804              const char * restrict format,
19805              const struct tm * restrict timeptr);
19806 </pre>
19807 <h6>Description</h6>
19808 <p><!--para 2 -->
19809  The strftime function places characters into the array pointed to by s as controlled by
19810  the string pointed to by format. The format shall be a multibyte character sequence,
19811  beginning and ending in its initial shift state. The format string consists of zero or
19812  more conversion specifiers and ordinary multibyte characters. A conversion specifier
19813  consists of a % character, possibly followed by an E or O modifier character (described
19814  below), followed by a character that determines the behavior of the conversion specifier.
19815  All ordinary multibyte characters (including the terminating null character) are copied
19816  unchanged into the array. If copying takes place between objects that overlap, the
19817  behavior is undefined. No more than maxsize characters are placed into the array.
19818 <p><!--para 3 -->
19819  Each conversion specifier is replaced by appropriate characters as described in the
19820  following list. The appropriate characters are determined using the LC_TIME category
19821  of the current locale and by the values of zero or more members of the broken-down time
19822  structure pointed to by timeptr, as specified in brackets in the description. If any of
19823  the specified values is outside the normal range, the characters stored are unspecified.
19824  %a   is replaced by the locale's abbreviated weekday name. [tm_wday]
19825  %A   is replaced by the locale's full weekday name. [tm_wday]
19826  %b   is replaced by the locale's abbreviated month name. [tm_mon]
19827  %B   is replaced by the locale's full month name. [tm_mon]
19828  %c   is replaced by the locale's appropriate date and time representation. [all specified
19829 <pre>
19830       in <a href="#7.26.1">7.26.1</a>]
19831 </pre>
19832  %C   is replaced by the year divided by 100 and truncated to an integer, as a decimal
19833 <pre>
19834       number (00-99). [tm_year]
19835 </pre>
19836  %d   is replaced by the day of the month as a decimal number (01-31). [tm_mday]
19837  %D   is equivalent to ''%m/%d/%y''. [tm_mon, tm_mday, tm_year]
19838  %e   is replaced by the day of the month as a decimal number (1-31); a single digit is
19839 <pre>
19840       preceded by a space. [tm_mday]
19841 </pre>
19842  %F   is equivalent to ''%Y-%m-%d'' (the ISO 8601 date format). [tm_year, tm_mon,
19843 <pre>
19844       tm_mday]
19845 </pre>
19846  %g   is replaced by the last 2 digits of the week-based year (see below) as a decimal
19847 <pre>
19848       number (00-99). [tm_year, tm_wday, tm_yday]
19849 </pre>
19850  %G   is replaced by the week-based year (see below) as a decimal number (e.g., 1997).
19851 <pre>
19852       [tm_year, tm_wday, tm_yday]
19853 </pre>
19854  %h   is equivalent to ''%b''. [tm_mon]
19855  %H   is replaced by the hour (24-hour clock) as a decimal number (00-23). [tm_hour]
19856  %I   is replaced by the hour (12-hour clock) as a decimal number (01-12). [tm_hour]
19857  %j   is replaced by the day of the year as a decimal number (001-366). [tm_yday]
19858  %m   is replaced by the month as a decimal number (01-12). [tm_mon]
19859  %M   is replaced by the minute as a decimal number (00-59). [tm_min]
19860  %n   is replaced by a new-line character.
19861 <!--page 410 -->
19862  %p    is replaced by the locale's equivalent of the AM/PM designations associated with a
19863 <pre>
19864        12-hour clock. [tm_hour]
19865 </pre>
19866  %r    is replaced by the locale's 12-hour clock time. [tm_hour, tm_min, tm_sec]
19867  %R    is equivalent to ''%H:%M''. [tm_hour, tm_min]
19868  %S    is replaced by the second as a decimal number (00-60). [tm_sec]
19869  %t    is replaced by a horizontal-tab character.
19870  %T    is equivalent to ''%H:%M:%S'' (the ISO 8601 time format). [tm_hour, tm_min,
19871 <pre>
19872        tm_sec]
19873 </pre>
19874  %u    is replaced by the ISO 8601 weekday as a decimal number (1-7), where Monday
19875 <pre>
19876        is 1. [tm_wday]
19877 </pre>
19878  %U    is replaced by the week number of the year (the first Sunday as the first day of week
19879 <pre>
19880        1) as a decimal number (00-53). [tm_year, tm_wday, tm_yday]
19881 </pre>
19882  %V    is replaced by the ISO 8601 week number (see below) as a decimal number
19883 <pre>
19884        (01-53). [tm_year, tm_wday, tm_yday]
19885 </pre>
19886  %w    is replaced by the weekday as a decimal number (0-6), where Sunday is 0.
19887 <pre>
19888        [tm_wday]
19889 </pre>
19890  %W    is replaced by the week number of the year (the first Monday as the first day of
19891 <pre>
19892        week 1) as a decimal number (00-53). [tm_year, tm_wday, tm_yday]
19893 </pre>
19894  %x    is replaced by the locale's appropriate date representation. [all specified in <a href="#7.26.1">7.26.1</a>]
19895  %X    is replaced by the locale's appropriate time representation. [all specified in <a href="#7.26.1">7.26.1</a>]
19896  %y    is replaced by the last 2 digits of the year as a decimal number (00-99).
19897 <pre>
19898        [tm_year]
19899 </pre>
19900  %Y    is replaced by the year as a decimal number (e.g., 1997). [tm_year]
19901  %z    is replaced by the offset from UTC in the ISO 8601 format ''-0430'' (meaning 4
19902 <pre>
19903        hours 30 minutes behind UTC, west of Greenwich), or by no characters if no time
19904        zone is determinable. [tm_isdst]
19905 </pre>
19906  %Z    is replaced by the locale's time zone name or abbreviation, or by no characters if no
19907 <pre>
19908        time zone is determinable. [tm_isdst]
19909 </pre>
19910  %%    is replaced by %.
19911 <p><!--para 4 -->
19912  Some conversion specifiers can be modified by the inclusion of an E or O modifier
19913  character to indicate an alternative format or specification. If the alternative format or
19914  specification does not exist for the current locale, the modifier is ignored.
19915  %Ec is replaced by the locale's alternative date and time representation.
19916  %EC is replaced by the name of the base year (period) in the locale's alternative
19917 <pre>
19918      representation.
19919 </pre>
19920  %Ex is replaced by the locale's alternative date representation.
19921  %EX is replaced by the locale's alternative time representation.
19922  %Ey is replaced by the offset from %EC (year only) in the locale's alternative
19923 <pre>
19924      representation.
19925 </pre>
19926  %EY is replaced by the locale's full alternative year representation.
19927 <!--page 411 -->
19928  %Od is replaced by the day of the month, using the locale's alternative numeric symbols
19929 <pre>
19930      (filled as needed with leading zeros, or with leading spaces if there is no alternative
19931      symbol for zero).
19932 </pre>
19933  %Oe is replaced by the day of the month, using the locale's alternative numeric symbols
19934 <pre>
19935      (filled as needed with leading spaces).
19936 </pre>
19937  %OH is replaced by the hour (24-hour clock), using the locale's alternative numeric
19938 <pre>
19939      symbols.
19940 </pre>
19941  %OI is replaced by the hour (12-hour clock), using the locale's alternative numeric
19942 <pre>
19943      symbols.
19944 </pre>
19945  %Om is replaced by the month, using the locale's alternative numeric symbols.
19946  %OM is replaced by the minutes, using the locale's alternative numeric symbols.
19947  %OS is replaced by the seconds, using the locale's alternative numeric symbols.
19948  %Ou is replaced by the ISO 8601 weekday as a number in the locale's alternative
19949 <pre>
19950      representation, where Monday is 1.
19951 </pre>
19952  %OU is replaced by the week number, using the locale's alternative numeric symbols.
19953  %OV is replaced by the ISO 8601 week number, using the locale's alternative numeric
19954 <pre>
19955      symbols.
19956 </pre>
19957  %Ow is replaced by the weekday as a number, using the locale's alternative numeric
19958 <pre>
19959      symbols.
19960 </pre>
19961  %OW is replaced by the week number of the year, using the locale's alternative numeric
19962 <pre>
19963      symbols.
19964 </pre>
19965  %Oy is replaced by the last 2 digits of the year, using the locale's alternative numeric
19966 <pre>
19967      symbols.
19968 </pre>
19969 <p><!--para 5 -->
19970  %g, %G, and %V give values according to the ISO 8601 week-based year. In this system,
19971  weeks begin on a Monday and week 1 of the year is the week that includes January 4th,
19972  which is also the week that includes the first Thursday of the year, and is also the first
19973  week that contains at least four days in the year. If the first Monday of January is the
19974  2nd, 3rd, or 4th, the preceding days are part of the last week of the preceding year; thus,
19975  for Saturday 2nd January 1999, %G is replaced by 1998 and %V is replaced by 53. If
19976  December 29th, 30th, or 31st is a Monday, it and any following days are part of week 1 of
19977  the following year. Thus, for Tuesday 30th December 1997, %G is replaced by 1998 and
19978  %V is replaced by 01.
19979 <p><!--para 6 -->
19980  If a conversion specifier is not one of the above, the behavior is undefined.
19981 <p><!--para 7 -->
19982  In the "C" locale, the E and O modifiers are ignored and the replacement strings for the
19983  following specifiers are:
19984  %a the first three characters of %A.
19985  %A one of ''Sunday'', ''Monday'', ... , ''Saturday''.
19986  %b the first three characters of %B.
19987  %B one of ''January'', ''February'', ... , ''December''.
19988  %c equivalent to ''%a %b %e %T %Y''.
19989 <!--page 412 -->
19990  %p    one of ''AM'' or ''PM''.
19991  %r    equivalent to ''%I:%M:%S %p''.
19992  %x    equivalent to ''%m/%d/%y''.
19993  %X    equivalent to %T.
19994  %Z    implementation-defined.
19995 <h6>Returns</h6>
19996 <p><!--para 8 -->
19997  If the total number of resulting characters including the terminating null character is not
19998  more than maxsize, the strftime function returns the number of characters placed
19999  into the array pointed to by s not including the terminating null character. Otherwise,
20000  zero is returned and the contents of the array are indeterminate.
20001 <!--page 413 -->
20002
20003 <h3><a name="7.27" href="#7.27">7.27 Unicode utilities <uchar.h></a></h3>
20004 <p><!--para 1 -->
20005  The header <a href="#7.27">&lt;uchar.h&gt;</a> declares types and functions for manipulating Unicode
20006  characters.
20007 <p><!--para 2 -->
20008  The types declared are mbstate_t (described in <a href="#7.29.1">7.29.1</a>) and size_t (described in
20009  <a href="#7.19">7.19</a>);
20010 <pre>
20011          char16_t
20012 </pre>
20013  which is an unsigned integer type used for 16-bit characters and is the same type as
20014  uint_least16_t (described in <a href="#7.20.1.2">7.20.1.2</a>); and
20015 <pre>
20016          char32_t
20017 </pre>
20018  which is an unsigned integer type used for 32-bit characters and is the same type as
20019  uint_least32_t (also described in <a href="#7.20.1.2">7.20.1.2</a>).
20020
20021 <h4><a name="7.27.1" href="#7.27.1">7.27.1 Restartable multibyte/wide character conversion functions</a></h4>
20022 <p><!--para 1 -->
20023  These functions have a parameter, ps, of type pointer to mbstate_t that points to an
20024  object that can completely describe the current conversion state of the associated
20025  multibyte character sequence, which the functions alter as necessary. If ps is a null
20026  pointer, each function uses its own internal mbstate_t object instead, which is
20027  initialized at program startup to the initial conversion state; the functions are not required
20028  to avoid data races in this case. The implementation behaves as if no library function
20029  calls these functions with a null pointer for ps.
20030
20031 <h5><a name="7.27.1.1" href="#7.27.1.1">7.27.1.1 The mbrtoc16 function</a></h5>
20032 <h6>Synopsis</h6>
20033 <p><!--para 1 -->
20034 <pre>
20035          #include <a href="#7.27">&lt;uchar.h&gt;</a>
20036          size_t mbrtoc16(char16_t * restrict pc16,
20037               const char * restrict s, size_t n,
20038               mbstate_t * restrict ps);
20039 </pre>
20040 <h6>Description</h6>
20041 <p><!--para 2 -->
20042  If s is a null pointer, the mbrtoc16 function is equivalent to the call:
20043 <pre>
20044                 mbrtoc16(NULL, "", 1, ps)
20045 </pre>
20046  In this case, the values of the parameters pc16 and n are ignored.
20047 <p><!--para 3 -->
20048  If s is not a null pointer, the mbrtoc16 function inspects at most n bytes beginning with
20049  the byte pointed to by s to determine the number of bytes needed to complete the next
20050  multibyte character (including any shift sequences). If the function determines that the
20051  next multibyte character is complete and valid, it determines the values of the
20052  corresponding wide characters and then, if pc16 is not a null pointer, stores the value of
20053  the first (or only) such character in the object pointed to by pc16. Subsequent calls will
20054 <!--page 414 -->
20055  store successive wide characters without consuming any additional input until all the
20056  characters have been stored. If the corresponding wide character is the null wide
20057  character, the resulting state described is the initial conversion state.
20058 <h6>Returns</h6>
20059 <p><!--para 4 -->
20060  The mbrtoc16 function returns the first of the following that applies (given the current
20061  conversion state):
20062  0                     if the next n or fewer bytes complete the multibyte character that
20063 <pre>
20064                        corresponds to the null wide character (which is the value stored).
20065 </pre>
20066  between 1 and n inclusive if the next n or fewer bytes complete a valid multibyte
20067 <pre>
20068                     character (which is the value stored); the value returned is the number
20069                     of bytes that complete the multibyte character.
20070 </pre>
20071  (size_t)(-3) if the next character resulting from a previous call has been stored (no
20072 <pre>
20073               bytes from the input have been consumed by this call).
20074 </pre>
20075  (size_t)(-2) if the next n bytes contribute to an incomplete (but potentially valid)
20076 <pre>
20077               multibyte character, and all n bytes have been processed (no value is
20078               stored).<sup><a href="#note311"><b>311)</b></a></sup>
20079 </pre>
20080  (size_t)(-1) if an encoding error occurs, in which case the next n or fewer bytes
20081 <pre>
20082               do not contribute to a complete and valid multibyte character (no
20083               value is stored); the value of the macro EILSEQ is stored in errno,
20084               and the conversion state is unspecified.
20085 </pre>
20086
20087 <h6>footnotes</h6>
20088 <p><small><a name="note311" href="#note311">311)</a> When n has at least the value of the MB_CUR_MAX macro, this case can only occur if s points at a
20089  sequence of redundant shift sequences (for implementations with state-dependent encodings).
20090 </small>
20091
20092 <h5><a name="7.27.1.2" href="#7.27.1.2">7.27.1.2 The c16rtomb function</a></h5>
20093 <h6>Synopsis</h6>
20094 <p><!--para 1 -->
20095 <pre>
20096          #include <a href="#7.27">&lt;uchar.h&gt;</a>
20097          size_t c16rtomb(char * restrict s, char16_t c16,
20098               mbstate_t * restrict ps);
20099 </pre>
20100 <h6>Description</h6>
20101 <p><!--para 2 -->
20102  If s is a null pointer, the c16rtomb function is equivalent to the call
20103 <pre>
20104                  c16rtomb(buf, L'\0', ps)
20105 </pre>
20106  where buf is an internal buffer.
20107 <p><!--para 3 -->
20108  If s is not a null pointer, the c16rtomb function determines the number of bytes needed
20109  to represent the multibyte character that corresponds to the wide character given by c16
20110  (including any shift sequences), and stores the multibyte character representation in the
20111  
20112  
20113 <!--page 415 -->
20114  array whose first element is pointed to by s. At most MB_CUR_MAX bytes are stored. If
20115  c16 is a null wide character, a null byte is stored, preceded by any shift sequence needed
20116  to restore the initial shift state; the resulting state described is the initial conversion state.
20117 <h6>Returns</h6>
20118 <p><!--para 4 -->
20119  The c16rtomb function returns the number of bytes stored in the array object (including
20120  any shift sequences). When c16 is not a valid wide character, an encoding error occurs:
20121  the function stores the value of the macro EILSEQ in errno and returns
20122  (size_t)(-1); the conversion state is unspecified.
20123
20124 <h5><a name="7.27.1.3" href="#7.27.1.3">7.27.1.3 The mbrtoc32 function</a></h5>
20125 <h6>Synopsis</h6>
20126 <p><!--para 1 -->
20127 <pre>
20128          #include <a href="#7.27">&lt;uchar.h&gt;</a>
20129          size_t mbrtoc32(char32_t * restrict pc32,
20130               const char * restrict s, size_t n,
20131               mbstate_t * restrict ps);
20132 </pre>
20133 <h6>Description</h6>
20134 <p><!--para 2 -->
20135  If s is a null pointer, the mbrtoc32 function is equivalent to the call:
20136 <pre>
20137                  mbrtoc32(NULL, "", 1, ps)
20138 </pre>
20139  In this case, the values of the parameters pc32 and n are ignored.
20140 <p><!--para 3 -->
20141  If s is not a null pointer, the mbrtoc32 function inspects at most n bytes beginning with
20142  the byte pointed to by s to determine the number of bytes needed to complete the next
20143  multibyte character (including any shift sequences). If the function determines that the
20144  next multibyte character is complete and valid, it determines the values of the
20145  corresponding wide characters and then, if pc32 is not a null pointer, stores the value of
20146  the first (or only) such character in the object pointed to by pc32. Subsequent calls will
20147  store successive wide characters without consuming any additional input until all the
20148  characters have been stored. If the corresponding wide character is the null wide
20149  character, the resulting state described is the initial conversion state.
20150 <h6>Returns</h6>
20151 <p><!--para 4 -->
20152  The mbrtoc32 function returns the first of the following that applies (given the current
20153  conversion state):
20154  0                    if the next n or fewer bytes complete the multibyte character that
20155 <pre>
20156                       corresponds to the null wide character (which is the value stored).
20157 </pre>
20158  between 1 and n inclusive if the next n or fewer bytes complete a valid multibyte
20159 <!--page 416 -->
20160 <pre>
20161                     character (which is the value stored); the value returned is the number
20162                     of bytes that complete the multibyte character.
20163 </pre>
20164  (size_t)(-3) if the next character resulting from a previous call has been stored (no
20165 <pre>
20166               bytes from the input have been consumed by this call).
20167 </pre>
20168  (size_t)(-2) if the next n bytes contribute to an incomplete (but potentially valid)
20169 <pre>
20170               multibyte character, and all n bytes have been processed (no value is
20171               stored).<sup><a href="#note312"><b>312)</b></a></sup>
20172 </pre>
20173  (size_t)(-1) if an encoding error occurs, in which case the next n or fewer bytes
20174 <pre>
20175               do not contribute to a complete and valid multibyte character (no
20176               value is stored); the value of the macro EILSEQ is stored in errno,
20177               and the conversion state is unspecified.
20178 </pre>
20179
20180 <h6>footnotes</h6>
20181 <p><small><a name="note312" href="#note312">312)</a> When n has at least the value of the MB_CUR_MAX macro, this case can only occur if s points at a
20182  sequence of redundant shift sequences (for implementations with state-dependent encodings).
20183 </small>
20184
20185 <h5><a name="7.27.1.4" href="#7.27.1.4">7.27.1.4 The c32rtomb function</a></h5>
20186 <h6>Synopsis</h6>
20187 <p><!--para 1 -->
20188 <pre>
20189          #include <a href="#7.27">&lt;uchar.h&gt;</a>
20190          size_t c32rtomb(char * restrict s, char32_t c32,
20191               mbstate_t * restrict ps);
20192 </pre>
20193 <h6>Description</h6>
20194 <p><!--para 2 -->
20195  If s is a null pointer, the c32rtomb function is equivalent to the call
20196 <pre>
20197                  c32rtomb(buf, L'\0', ps)
20198 </pre>
20199  where buf is an internal buffer.
20200 <p><!--para 3 -->
20201  If s is not a null pointer, the c32rtomb function determines the number of bytes needed
20202  to represent the multibyte character that corresponds to the wide character given by c32
20203  (including any shift sequences), and stores the multibyte character representation in the
20204  array whose first element is pointed to by s. At most MB_CUR_MAX bytes are stored. If
20205  c32 is a null wide character, a null byte is stored, preceded by any shift sequence needed
20206  to restore the initial shift state; the resulting state described is the initial conversion state.
20207 <h6>Returns</h6>
20208 <p><!--para 4 -->
20209  The c32rtomb function returns the number of bytes stored in the array object (including
20210  any shift sequences). When c32 is not a valid wide character, an encoding error occurs:
20211  the function stores the value of the macro EILSEQ in errno and returns
20212  (size_t)(-1); the conversion state is unspecified.
20213  
20214  
20215  
20216  
20217 <!--page 417 -->
20218
20219 <h3><a name="7.28" href="#7.28">7.28 Extended multibyte and wide character utilities <wchar.h></a></h3>
20220
20221 <h4><a name="7.28.1" href="#7.28.1">7.28.1 Introduction</a></h4>
20222 <p><!--para 1 -->
20223  The header <a href="#7.28">&lt;wchar.h&gt;</a> defines four macros, and declares four data types, one tag, and
20224  many functions.<sup><a href="#note313"><b>313)</b></a></sup>
20225 <p><!--para 2 -->
20226  The types declared are wchar_t and size_t (both described in <a href="#7.19">7.19</a>);
20227 <pre>
20228            mbstate_t
20229 </pre>
20230  which is a complete object type other than an array type that can hold the conversion state
20231  information necessary to convert between sequences of multibyte characters and wide
20232  characters;
20233 <pre>
20234           wint_t
20235 </pre>
20236  which is an integer type unchanged by default argument promotions that can hold any
20237  value corresponding to members of the extended character set, as well as at least one
20238  value that does not correspond to any member of the extended character set (see WEOF
20239  below);<sup><a href="#note314"><b>314)</b></a></sup> and
20240 <pre>
20241           struct tm
20242 </pre>
20243  which is declared as an incomplete structure type (the contents are described in <a href="#7.26.1">7.26.1</a>).
20244 <p><!--para 3 -->
20245  The macros defined are NULL (described in <a href="#7.19">7.19</a>); WCHAR_MIN and WCHAR_MAX
20246  (described in <a href="#7.20.3">7.20.3</a>); and
20247 <pre>
20248           WEOF
20249 </pre>
20250  which expands to a constant expression of type wint_t whose value does not
20251  correspond to any member of the extended character set.<sup><a href="#note315"><b>315)</b></a></sup> It is accepted (and returned)
20252  by several functions in this subclause to indicate end-of-file, that is, no more input from a
20253  stream. It is also used as a wide character value that does not correspond to any member
20254  of the extended character set.
20255 <p><!--para 4 -->
20256  The functions declared are grouped as follows:
20257 <ul>
20258 <li>  Functions that perform input and output of wide characters, or multibyte characters,
20259  or both;
20260 <li>  Functions that provide wide string numeric conversion;
20261 <li>  Functions that perform general wide string manipulation;
20262  
20263  
20264 <!--page 418 -->
20265 <li>  Functions for wide string date and time conversion; and
20266 <li>  Functions that provide extended capabilities for conversion between multibyte and
20267  wide character sequences.
20268 </ul>
20269 <p><!--para 5 -->
20270  Unless explicitly stated otherwise, if the execution of a function described in this
20271  subclause causes copying to take place between objects that overlap, the behavior is
20272  undefined.
20273
20274 <h6>footnotes</h6>
20275 <p><small><a name="note313" href="#note313">313)</a> See ''future library directions'' (<a href="#7.30.12">7.30.12</a>).
20276 </small>
20277 <p><small><a name="note314" href="#note314">314)</a> wchar_t and wint_t can be the same integer type.
20278 </small>
20279 <p><small><a name="note315" href="#note315">315)</a> The value of the macro WEOF may differ from that of EOF and need not be negative.
20280 </small>
20281
20282 <h4><a name="7.28.2" href="#7.28.2">7.28.2 Formatted wide character input/output functions</a></h4>
20283 <p><!--para 1 -->
20284  The formatted wide character input/output functions shall behave as if there is a sequence
20285  point after the actions associated with each specifier.<sup><a href="#note316"><b>316)</b></a></sup>
20286
20287 <h6>footnotes</h6>
20288 <p><small><a name="note316" href="#note316">316)</a> The fwprintf functions perform writes to memory for the %n specifier.
20289 </small>
20290
20291 <h5><a name="7.28.2.1" href="#7.28.2.1">7.28.2.1 The fwprintf function</a></h5>
20292 <h6>Synopsis</h6>
20293 <p><!--para 1 -->
20294 <pre>
20295          #include <a href="#7.21">&lt;stdio.h&gt;</a>
20296          #include <a href="#7.28">&lt;wchar.h&gt;</a>
20297          int fwprintf(FILE * restrict stream,
20298               const wchar_t * restrict format, ...);
20299 </pre>
20300 <h6>Description</h6>
20301 <p><!--para 2 -->
20302  The fwprintf function writes output to the stream pointed to by stream, under
20303  control of the wide string pointed to by format that specifies how subsequent arguments
20304  are converted for output. If there are insufficient arguments for the format, the behavior
20305  is undefined. If the format is exhausted while arguments remain, the excess arguments
20306  are evaluated (as always) but are otherwise ignored. The fwprintf function returns
20307  when the end of the format string is encountered.
20308 <p><!--para 3 -->
20309  The format is composed of zero or more directives: ordinary wide characters (not %),
20310  which are copied unchanged to the output stream; and conversion specifications, each of
20311  which results in fetching zero or more subsequent arguments, converting them, if
20312  applicable, according to the corresponding conversion specifier, and then writing the
20313  result to the output stream.
20314 <p><!--para 4 -->
20315  Each conversion specification is introduced by the wide character %. After the %, the
20316  following appear in sequence:
20317 <ul>
20318 <li>  Zero or more flags (in any order) that modify the meaning of the conversion
20319  specification.
20320 <li>  An optional minimum field width. If the converted value has fewer wide characters
20321  than the field width, it is padded with spaces (by default) on the left (or right, if the
20322  
20323  
20324 <!--page 419 -->
20325    left adjustment flag, described later, has been given) to the field width. The field
20326    width takes the form of an asterisk * (described later) or a nonnegative decimal
20327    integer.<sup><a href="#note317"><b>317)</b></a></sup>
20328 <li>  An optional precision that gives the minimum number of digits to appear for the d, i,
20329  o, u, x, and X conversions, the number of digits to appear after the decimal-point
20330  wide character for a, A, e, E, f, and F conversions, the maximum number of
20331  significant digits for the g and G conversions, or the maximum number of wide
20332  characters to be written for s conversions. The precision takes the form of a period
20333  (.) followed either by an asterisk * (described later) or by an optional decimal
20334  integer; if only the period is specified, the precision is taken as zero. If a precision
20335  appears with any other conversion specifier, the behavior is undefined.
20336 <li>  An optional length modifier that specifies the size of the argument.
20337 <li>  A conversion specifier wide character that specifies the type of conversion to be
20338  applied.
20339 </ul>
20340 <p><!--para 5 -->
20341  As noted above, a field width, or precision, or both, may be indicated by an asterisk. In
20342  this case, an int argument supplies the field width or precision. The arguments
20343  specifying field width, or precision, or both, shall appear (in that order) before the
20344  argument (if any) to be converted. A negative field width argument is taken as a - flag
20345  followed by a positive field width. A negative precision argument is taken as if the
20346  precision were omitted.
20347 <p><!--para 6 -->
20348  The flag wide characters and their meanings are:
20349  -        The result of the conversion is left-justified within the field. (It is right-justified if
20350 <pre>
20351           this flag is not specified.)
20352 </pre>
20353  +        The result of a signed conversion always begins with a plus or minus sign. (It
20354 <pre>
20355           begins with a sign only when a negative value is converted if this flag is not
20356           specified.)<sup><a href="#note318"><b>318)</b></a></sup>
20357 </pre>
20358  space If the first wide character of a signed conversion is not a sign, or if a signed
20359 <pre>
20360        conversion results in no wide characters, a space is prefixed to the result. If the
20361        space and + flags both appear, the space flag is ignored.
20362 </pre>
20363  #        The result is converted to an ''alternative form''. For o conversion, it increases
20364 <pre>
20365           the precision, if and only if necessary, to force the first digit of the result to be a
20366           zero (if the value and precision are both 0, a single 0 is printed). For x (or X)
20367           conversion, a nonzero result has 0x (or 0X) prefixed to it. For a, A, e, E, f, F, g,
20368 </pre>
20369  
20370  
20371 <!--page 420 -->
20372 <pre>
20373            and G conversions, the result of converting a floating-point number always
20374            contains a decimal-point wide character, even if no digits follow it. (Normally, a
20375            decimal-point wide character appears in the result of these conversions only if a
20376            digit follows it.) For g and G conversions, trailing zeros are not removed from the
20377            result. For other conversions, the behavior is undefined.
20378 </pre>
20379  0         For d, i, o, u, x, X, a, A, e, E, f, F, g, and G conversions, leading zeros
20380 <pre>
20381            (following any indication of sign or base) are used to pad to the field width rather
20382            than performing space padding, except when converting an infinity or NaN. If the
20383            0 and - flags both appear, the 0 flag is ignored. For d, i, o, u, x, and X
20384            conversions, if a precision is specified, the 0 flag is ignored. For other
20385            conversions, the behavior is undefined.
20386 </pre>
20387 <p><!--para 7 -->
20388  The length modifiers and their meanings are:
20389  hh             Specifies that a following d, i, o, u, x, or X conversion specifier applies to a
20390 <pre>
20391                 signed char or unsigned char argument (the argument will have
20392                 been promoted according to the integer promotions, but its value shall be
20393                 converted to signed char or unsigned char before printing); or that
20394                 a following n conversion specifier applies to a pointer to a signed char
20395                 argument.
20396 </pre>
20397  h              Specifies that a following d, i, o, u, x, or X conversion specifier applies to a
20398 <pre>
20399                 short int or unsigned short int argument (the argument will
20400                 have been promoted according to the integer promotions, but its value shall
20401                 be converted to short int or unsigned short int before printing);
20402                 or that a following n conversion specifier applies to a pointer to a short
20403                 int argument.
20404 </pre>
20405  l (ell)        Specifies that a following d, i, o, u, x, or X conversion specifier applies to a
20406 <pre>
20407                 long int or unsigned long int argument; that a following n
20408                 conversion specifier applies to a pointer to a long int argument; that a
20409                 following c conversion specifier applies to a wint_t argument; that a
20410                 following s conversion specifier applies to a pointer to a wchar_t
20411                 argument; or has no effect on a following a, A, e, E, f, F, g, or G conversion
20412                 specifier.
20413 </pre>
20414  ll (ell-ell) Specifies that a following d, i, o, u, x, or X conversion specifier applies to a
20415 <pre>
20416               long long int or unsigned long long int argument; or that a
20417               following n conversion specifier applies to a pointer to a long long int
20418               argument.
20419 </pre>
20420  j              Specifies that a following d, i, o, u, x, or X conversion specifier applies to
20421 <!--page 421 -->
20422 <pre>
20423                 an intmax_t or uintmax_t argument; or that a following n conversion
20424                 specifier applies to a pointer to an intmax_t argument.
20425 </pre>
20426  z            Specifies that a following d, i, o, u, x, or X conversion specifier applies to a
20427 <pre>
20428               size_t or the corresponding signed integer type argument; or that a
20429               following n conversion specifier applies to a pointer to a signed integer type
20430               corresponding to size_t argument.
20431 </pre>
20432  t            Specifies that a following d, i, o, u, x, or X conversion specifier applies to a
20433 <pre>
20434               ptrdiff_t or the corresponding unsigned integer type argument; or that a
20435               following n conversion specifier applies to a pointer to a ptrdiff_t
20436               argument.
20437 </pre>
20438  L            Specifies that a following a, A, e, E, f, F, g, or G conversion specifier
20439 <pre>
20440               applies to a long double argument.
20441 </pre>
20442  If a length modifier appears with any conversion specifier other than as specified above,
20443  the behavior is undefined.
20444 <p><!--para 8 -->
20445  The conversion specifiers and their meanings are:
20446  d,i         The int argument is converted to signed decimal in the style [-]dddd. The
20447 <pre>
20448              precision specifies the minimum number of digits to appear; if the value
20449              being converted can be represented in fewer digits, it is expanded with
20450              leading zeros. The default precision is 1. The result of converting a zero
20451              value with a precision of zero is no wide characters.
20452 </pre>
20453  o,u,x,X The unsigned int argument is converted to unsigned octal (o), unsigned
20454 <pre>
20455          decimal (u), or unsigned hexadecimal notation (x or X) in the style dddd; the
20456          letters abcdef are used for x conversion and the letters ABCDEF for X
20457          conversion. The precision specifies the minimum number of digits to appear;
20458          if the value being converted can be represented in fewer digits, it is expanded
20459          with leading zeros. The default precision is 1. The result of converting a
20460          zero value with a precision of zero is no wide characters.
20461 </pre>
20462  f,F         A double argument representing a floating-point number is converted to
20463 <!--page 422 -->
20464 <pre>
20465              decimal notation in the style [-]ddd.ddd, where the number of digits after
20466              the decimal-point wide character is equal to the precision specification. If the
20467              precision is missing, it is taken as 6; if the precision is zero and the # flag is
20468              not specified, no decimal-point wide character appears. If a decimal-point
20469              wide character appears, at least one digit appears before it. The value is
20470              rounded to the appropriate number of digits.
20471              A double argument representing an infinity is converted in one of the styles
20472              [-]inf or [-]infinity -- which style is implementation-defined. A
20473              double argument representing a NaN is converted in one of the styles
20474              [-]nan or [-]nan(n-wchar-sequence) -- which style, and the meaning of
20475              any n-wchar-sequence, is implementation-defined. The F conversion
20476              specifier produces INF, INFINITY, or NAN instead of inf, infinity, or
20477               nan, respectively.<sup><a href="#note319"><b>319)</b></a></sup>
20478 </pre>
20479  e,E          A double argument representing a floating-point number is converted in the
20480 <pre>
20481               style [-]d.ddd e(+-)dd, where there is one digit (which is nonzero if the
20482               argument is nonzero) before the decimal-point wide character and the number
20483               of digits after it is equal to the precision; if the precision is missing, it is taken
20484               as 6; if the precision is zero and the # flag is not specified, no decimal-point
20485               wide character appears. The value is rounded to the appropriate number of
20486               digits. The E conversion specifier produces a number with E instead of e
20487               introducing the exponent. The exponent always contains at least two digits,
20488               and only as many more digits as necessary to represent the exponent. If the
20489               value is zero, the exponent is zero.
20490               A double argument representing an infinity or NaN is converted in the style
20491               of an f or F conversion specifier.
20492 </pre>
20493  g,G          A double argument representing a floating-point number is converted in
20494 <pre>
20495               style f or e (or in style F or E in the case of a G conversion specifier),
20496               depending on the value converted and the precision. Let P equal the
20497               precision if nonzero, 6 if the precision is omitted, or 1 if the precision is zero.
20498               Then, if a conversion with style E would have an exponent of X:
20499               -- if P &gt; X &gt;= -4, the conversion is with style f (or F) and precision
20500                 P - (X + 1).
20501               -- otherwise, the conversion is with style e (or E) and precision P - 1.
20502               Finally, unless the # flag is used, any trailing zeros are removed from the
20503               fractional portion of the result and the decimal-point wide character is
20504               removed if there is no fractional portion remaining.
20505               A double argument representing an infinity or NaN is converted in the style
20506               of an f or F conversion specifier.
20507 </pre>
20508  a,A          A double argument representing a floating-point number is converted in the
20509 <pre>
20510               style [-]0xh.hhhh p(+-)d, where there is one hexadecimal digit (which is
20511               nonzero if the argument is a normalized floating-point number and is
20512               otherwise unspecified) before the decimal-point wide character<sup><a href="#note320"><b>320)</b></a></sup> and the
20513               number of hexadecimal digits after it is equal to the precision; if the precision
20514               is missing and FLT_RADIX is a power of 2, then the precision is sufficient
20515 </pre>
20516  
20517  
20518 <!--page 423 -->
20519 <pre>
20520               for an exact representation of the value; if the precision is missing and
20521               FLT_RADIX is not a power of 2, then the precision is sufficient to
20522               distinguish<sup><a href="#note321"><b>321)</b></a></sup> values of type double, except that trailing zeros may be
20523               omitted; if the precision is zero and the # flag is not specified, no decimal-
20524               point wide character appears. The letters abcdef are used for a conversion
20525               and the letters ABCDEF for A conversion. The A conversion specifier
20526               produces a number with X and P instead of x and p. The exponent always
20527               contains at least one digit, and only as many more digits as necessary to
20528               represent the decimal exponent of 2. If the value is zero, the exponent is
20529               zero.
20530               A double argument representing an infinity or NaN is converted in the style
20531               of an f or F conversion specifier.
20532 </pre>
20533  c            If no l length modifier is present, the int argument is converted to a wide
20534 <pre>
20535               character as if by calling btowc and the resulting wide character is written.
20536               If an l length modifier is present, the wint_t argument is converted to
20537               wchar_t and written.
20538 </pre>
20539  s            If no l length modifier is present, the argument shall be a pointer to the initial
20540 <pre>
20541               element of a character array containing a multibyte character sequence
20542               beginning in the initial shift state. Characters from the array are converted as
20543               if by repeated calls to the mbrtowc function, with the conversion state
20544               described by an mbstate_t object initialized to zero before the first
20545               multibyte character is converted, and written up to (but not including) the
20546               terminating null wide character. If the precision is specified, no more than
20547               that many wide characters are written. If the precision is not specified or is
20548               greater than the size of the converted array, the converted array shall contain a
20549               null wide character.
20550               If an l length modifier is present, the argument shall be a pointer to the initial
20551               element of an array of wchar_t type. Wide characters from the array are
20552               written up to (but not including) a terminating null wide character. If the
20553               precision is specified, no more than that many wide characters are written. If
20554               the precision is not specified or is greater than the size of the array, the array
20555               shall contain a null wide character.
20556 </pre>
20557  p            The argument shall be a pointer to void. The value of the pointer is
20558 <pre>
20559               converted to a sequence of printing wide characters, in an implementation-
20560 </pre>
20561  
20562 <!--page 424 -->
20563 <pre>
20564                 defined manner.
20565 </pre>
20566  n              The argument shall be a pointer to signed integer into which is written the
20567 <pre>
20568                 number of wide characters written to the output stream so far by this call to
20569                 fwprintf. No argument is converted, but one is consumed. If the
20570                 conversion specification includes any flags, a field width, or a precision, the
20571                 behavior is undefined.
20572 </pre>
20573  %              A % wide character is written. No argument is converted. The complete
20574 <pre>
20575                 conversion specification shall be %%.
20576 </pre>
20577 <p><!--para 9 -->
20578  If a conversion specification is invalid, the behavior is undefined.<sup><a href="#note322"><b>322)</b></a></sup> If any argument is
20579  not the correct type for the corresponding conversion specification, the behavior is
20580  undefined.
20581 <p><!--para 10 -->
20582  In no case does a nonexistent or small field width cause truncation of a field; if the result
20583  of a conversion is wider than the field width, the field is expanded to contain the
20584  conversion result.
20585 <p><!--para 11 -->
20586  For a and A conversions, if FLT_RADIX is a power of 2, the value is correctly rounded
20587  to a hexadecimal floating number with the given precision.
20588 <h6>Recommended practice</h6>
20589 <p><!--para 12 -->
20590  For a and A conversions, if FLT_RADIX is not a power of 2 and the result is not exactly
20591  representable in the given precision, the result should be one of the two adjacent numbers
20592  in hexadecimal floating style with the given precision, with the extra stipulation that the
20593  error should have a correct sign for the current rounding direction.
20594 <p><!--para 13 -->
20595  For e, E, f, F, g, and G conversions, if the number of significant decimal digits is at most
20596  DECIMAL_DIG, then the result should be correctly rounded.<sup><a href="#note323"><b>323)</b></a></sup> If the number of
20597  significant decimal digits is more than DECIMAL_DIG but the source value is exactly
20598  representable with DECIMAL_DIG digits, then the result should be an exact
20599  representation with trailing zeros. Otherwise, the source value is bounded by two
20600  adjacent decimal strings L &lt; U, both having DECIMAL_DIG significant digits; the value
20601  of the resultant decimal string D should satisfy L &lt;= D &lt;= U, with the extra stipulation that
20602  the error should have a correct sign for the current rounding direction.
20603 <h6>Returns</h6>
20604 <p><!--para 14 -->
20605  The fwprintf function returns the number of wide characters transmitted, or a negative
20606  value if an output or encoding error occurred.
20607  
20608 <!--page 425 -->
20609 <h6>Environmental limits</h6>
20610 <p><!--para 15 -->
20611  The number of wide characters that can be produced by any single conversion shall be at
20612  least 4095.
20613 <p><!--para 16 -->
20614  EXAMPLE       To print a date and time in the form ''Sunday, July 3, 10:02'' followed by pi to five decimal
20615  places:
20616 <pre>
20617          #include <a href="#7.12">&lt;math.h&gt;</a>
20618          #include <a href="#7.21">&lt;stdio.h&gt;</a>
20619          #include <a href="#7.28">&lt;wchar.h&gt;</a>
20620          /* ... */
20621          wchar_t *weekday, *month; // pointers to wide strings
20622          int day, hour, min;
20623          fwprintf(stdout, L"%ls, %ls %d, %.2d:%.2d\n",
20624                  weekday, month, day, hour, min);
20625          fwprintf(stdout, L"pi = %.5f\n", 4 * atan(1.0));
20626 </pre>
20627  
20628 <p><b> Forward references</b>:          the btowc function (<a href="#7.28.6.1.1">7.28.6.1.1</a>), the mbrtowc function
20629  (<a href="#7.28.6.3.2">7.28.6.3.2</a>).
20630
20631 <h6>footnotes</h6>
20632 <p><small><a name="note317" href="#note317">317)</a> Note that 0 is taken as a flag, not as the beginning of a field width.
20633 </small>
20634 <p><small><a name="note318" href="#note318">318)</a> The results of all floating conversions of a negative zero, and of negative values that round to zero,
20635  include a minus sign.
20636 </small>
20637 <p><small><a name="note319" href="#note319">319)</a> When applied to infinite and NaN values, the -, +, and space flag wide characters have their usual
20638  meaning; the # and 0 flag wide characters have no effect.
20639 </small>
20640 <p><small><a name="note320" href="#note320">320)</a> Binary implementations can choose the hexadecimal digit to the left of the decimal-point wide
20641  character so that subsequent digits align to nibble (4-bit) boundaries.
20642 </small>
20643 <p><small><a name="note321" href="#note321">321)</a> The precision p is sufficient to distinguish values of the source type if 16 p-1 &gt; b n where b is
20644  FLT_RADIX and n is the number of base-b digits in the significand of the source type. A smaller p
20645  might suffice depending on the implementation's scheme for determining the digit to the left of the
20646  decimal-point wide character.
20647 </small>
20648 <p><small><a name="note322" href="#note322">322)</a> See ''future library directions'' (<a href="#7.30.12">7.30.12</a>).
20649 </small>
20650 <p><small><a name="note323" href="#note323">323)</a> For binary-to-decimal conversion, the result format's values are the numbers representable with the
20651  given format specifier. The number of significant digits is determined by the format specifier, and in
20652  the case of fixed-point conversion by the source value as well.
20653 </small>
20654
20655 <h5><a name="7.28.2.2" href="#7.28.2.2">7.28.2.2 The fwscanf function</a></h5>
20656 <h6>Synopsis</h6>
20657 <p><!--para 1 -->
20658 <pre>
20659          #include <a href="#7.21">&lt;stdio.h&gt;</a>
20660          #include <a href="#7.28">&lt;wchar.h&gt;</a>
20661          int fwscanf(FILE * restrict stream,
20662               const wchar_t * restrict format, ...);
20663 </pre>
20664 <h6>Description</h6>
20665 <p><!--para 2 -->
20666  The fwscanf function reads input from the stream pointed to by stream, under
20667  control of the wide string pointed to by format that specifies the admissible input
20668  sequences and how they are to be converted for assignment, using subsequent arguments
20669  as pointers to the objects to receive the converted input. If there are insufficient
20670  arguments for the format, the behavior is undefined. If the format is exhausted while
20671  arguments remain, the excess arguments are evaluated (as always) but are otherwise
20672  ignored.
20673 <p><!--para 3 -->
20674  The format is composed of zero or more directives: one or more white-space wide
20675  characters, an ordinary wide character (neither % nor a white-space wide character), or a
20676  conversion specification. Each conversion specification is introduced by the wide
20677  character %. After the %, the following appear in sequence:
20678 <ul>
20679 <li>  An optional assignment-suppressing wide character *.
20680 <li>  An optional decimal integer greater than zero that specifies the maximum field width
20681  (in wide characters).
20682 <!--page 426 -->
20683 <li>  An optional length modifier that specifies the size of the receiving object.
20684 <li>  A conversion specifier wide character that specifies the type of conversion to be
20685  applied.
20686 </ul>
20687 <p><!--para 4 -->
20688  The fwscanf function executes each directive of the format in turn. When all directives
20689  have been executed, or if a directive fails (as detailed below), the function returns.
20690  Failures are described as input failures (due to the occurrence of an encoding error or the
20691  unavailability of input characters), or matching failures (due to inappropriate input).
20692 <p><!--para 5 -->
20693  A directive composed of white-space wide character(s) is executed by reading input up to
20694  the first non-white-space wide character (which remains unread), or until no more wide
20695  characters can be read.
20696 <p><!--para 6 -->
20697  A directive that is an ordinary wide character is executed by reading the next wide
20698  character of the stream. If that wide character differs from the directive, the directive
20699  fails and the differing and subsequent wide characters remain unread. Similarly, if end-
20700  of-file, an encoding error, or a read error prevents a wide character from being read, the
20701  directive fails.
20702 <p><!--para 7 -->
20703  A directive that is a conversion specification defines a set of matching input sequences, as
20704  described below for each specifier. A conversion specification is executed in the
20705  following steps:
20706 <p><!--para 8 -->
20707  Input white-space wide characters (as specified by the iswspace function) are skipped,
20708  unless the specification includes a [, c, or n specifier.<sup><a href="#note324"><b>324)</b></a></sup>
20709 <p><!--para 9 -->
20710  An input item is read from the stream, unless the specification includes an n specifier. An
20711  input item is defined as the longest sequence of input wide characters which does not
20712  exceed any specified field width and which is, or is a prefix of, a matching input
20713  sequence.<sup><a href="#note325"><b>325)</b></a></sup> The first wide character, if any, after the input item remains unread. If the
20714  length of the input item is zero, the execution of the directive fails; this condition is a
20715  matching failure unless end-of-file, an encoding error, or a read error prevented input
20716  from the stream, in which case it is an input failure.
20717 <p><!--para 10 -->
20718  Except in the case of a % specifier, the input item (or, in the case of a %n directive, the
20719  count of input wide characters) is converted to a type appropriate to the conversion
20720  specifier. If the input item is not a matching sequence, the execution of the directive fails:
20721  this condition is a matching failure. Unless assignment suppression was indicated by a *,
20722  the result of the conversion is placed in the object pointed to by the first argument
20723  following the format argument that has not already received a conversion result. If this
20724  
20725  
20726 <!--page 427 -->
20727  object does not have an appropriate type, or if the result of the conversion cannot be
20728  represented in the object, the behavior is undefined.
20729 <p><!--para 11 -->
20730  The length modifiers and their meanings are:
20731  hh           Specifies that a following d, i, o, u, x, X, or n conversion specifier applies
20732 <pre>
20733               to an argument with type pointer to signed char or unsigned char.
20734 </pre>
20735  h            Specifies that a following d, i, o, u, x, X, or n conversion specifier applies
20736 <pre>
20737               to an argument with type pointer to short int or unsigned short
20738               int.
20739 </pre>
20740  l (ell)      Specifies that a following d, i, o, u, x, X, or n conversion specifier applies
20741 <pre>
20742               to an argument with type pointer to long int or unsigned long
20743               int; that a following a, A, e, E, f, F, g, or G conversion specifier applies to
20744               an argument with type pointer to double; or that a following c, s, or [
20745               conversion specifier applies to an argument with type pointer to wchar_t.
20746 </pre>
20747  ll (ell-ell) Specifies that a following d, i, o, u, x, X, or n conversion specifier applies
20748 <pre>
20749               to an argument with type pointer to long long int or unsigned
20750               long long int.
20751 </pre>
20752  j            Specifies that a following d, i, o, u, x, X, or n conversion specifier applies
20753 <pre>
20754               to an argument with type pointer to intmax_t or uintmax_t.
20755 </pre>
20756  z            Specifies that a following d, i, o, u, x, X, or n conversion specifier applies
20757 <pre>
20758               to an argument with type pointer to size_t or the corresponding signed
20759               integer type.
20760 </pre>
20761  t            Specifies that a following d, i, o, u, x, X, or n conversion specifier applies
20762 <pre>
20763               to an argument with type pointer to ptrdiff_t or the corresponding
20764               unsigned integer type.
20765 </pre>
20766  L            Specifies that a following a, A, e, E, f, F, g, or G conversion specifier
20767 <pre>
20768               applies to an argument with type pointer to long double.
20769 </pre>
20770  If a length modifier appears with any conversion specifier other than as specified above,
20771  the behavior is undefined.
20772 <p><!--para 12 -->
20773  The conversion specifiers and their meanings are:
20774  d           Matches an optionally signed decimal integer, whose format is the same as
20775 <pre>
20776              expected for the subject sequence of the wcstol function with the value 10
20777              for the base argument. The corresponding argument shall be a pointer to
20778              signed integer.
20779 </pre>
20780  i           Matches an optionally signed integer, whose format is the same as expected
20781 <!--page 428 -->
20782 <pre>
20783              for the subject sequence of the wcstol function with the value 0 for the
20784              base argument. The corresponding argument shall be a pointer to signed
20785            integer.
20786 </pre>
20787  o         Matches an optionally signed octal integer, whose format is the same as
20788 <pre>
20789            expected for the subject sequence of the wcstoul function with the value 8
20790            for the base argument. The corresponding argument shall be a pointer to
20791            unsigned integer.
20792 </pre>
20793  u         Matches an optionally signed decimal integer, whose format is the same as
20794 <pre>
20795            expected for the subject sequence of the wcstoul function with the value 10
20796            for the base argument. The corresponding argument shall be a pointer to
20797            unsigned integer.
20798 </pre>
20799  x         Matches an optionally signed hexadecimal integer, whose format is the same
20800 <pre>
20801            as expected for the subject sequence of the wcstoul function with the value
20802            16 for the base argument. The corresponding argument shall be a pointer to
20803            unsigned integer.
20804 </pre>
20805  a,e,f,g Matches an optionally signed floating-point number, infinity, or NaN, whose
20806 <pre>
20807          format is the same as expected for the subject sequence of the wcstod
20808          function. The corresponding argument shall be a pointer to floating.
20809 </pre>
20810  c         Matches a sequence of wide characters of exactly the number specified by the
20811 <pre>
20812            field width (1 if no field width is present in the directive).
20813            If no l length modifier is present, characters from the input field are
20814            converted as if by repeated calls to the wcrtomb function, with the
20815            conversion state described by an mbstate_t object initialized to zero
20816            before the first wide character is converted. The corresponding argument
20817            shall be a pointer to the initial element of a character array large enough to
20818            accept the sequence. No null character is added.
20819            If an l length modifier is present, the corresponding argument shall be a
20820            pointer to the initial element of an array of wchar_t large enough to accept
20821            the sequence. No null wide character is added.
20822 </pre>
20823  s         Matches a sequence of non-white-space wide characters.
20824 <!--page 429 -->
20825 <pre>
20826            If no l length modifier is present, characters from the input field are
20827            converted as if by repeated calls to the wcrtomb function, with the
20828            conversion state described by an mbstate_t object initialized to zero
20829            before the first wide character is converted. The corresponding argument
20830            shall be a pointer to the initial element of a character array large enough to
20831            accept the sequence and a terminating null character, which will be added
20832            automatically.
20833            If an l length modifier is present, the corresponding argument shall be a
20834            pointer to the initial element of an array of wchar_t large enough to accept
20835              the sequence and the terminating null wide character, which will be added
20836              automatically.
20837 </pre>
20838  [           Matches a nonempty sequence of wide characters from a set of expected
20839 <pre>
20840              characters (the scanset).
20841              If no l length modifier is present, characters from the input field are
20842              converted as if by repeated calls to the wcrtomb function, with the
20843              conversion state described by an mbstate_t object initialized to zero
20844              before the first wide character is converted. The corresponding argument
20845              shall be a pointer to the initial element of a character array large enough to
20846              accept the sequence and a terminating null character, which will be added
20847              automatically.
20848              If an l length modifier is present, the corresponding argument shall be a
20849              pointer to the initial element of an array of wchar_t large enough to accept
20850              the sequence and the terminating null wide character, which will be added
20851              automatically.
20852              The conversion specifier includes all subsequent wide characters in the
20853              format string, up to and including the matching right bracket (]). The wide
20854              characters between the brackets (the scanlist) compose the scanset, unless the
20855              wide character after the left bracket is a circumflex (^), in which case the
20856              scanset contains all wide characters that do not appear in the scanlist between
20857              the circumflex and the right bracket. If the conversion specifier begins with
20858              [] or [^], the right bracket wide character is in the scanlist and the next
20859              following right bracket wide character is the matching right bracket that ends
20860              the specification; otherwise the first following right bracket wide character is
20861              the one that ends the specification. If a - wide character is in the scanlist and
20862              is not the first, nor the second where the first wide character is a ^, nor the
20863              last character, the behavior is implementation-defined.
20864 </pre>
20865  p           Matches an implementation-defined set of sequences, which should be the
20866 <pre>
20867              same as the set of sequences that may be produced by the %p conversion of
20868              the fwprintf function. The corresponding argument shall be a pointer to a
20869              pointer to void. The input item is converted to a pointer value in an
20870              implementation-defined manner. If the input item is a value converted earlier
20871              during the same program execution, the pointer that results shall compare
20872              equal to that value; otherwise the behavior of the %p conversion is undefined.
20873 </pre>
20874  n           No input is consumed. The corresponding argument shall be a pointer to
20875 <!--page 430 -->
20876 <pre>
20877              signed integer into which is to be written the number of wide characters read
20878              from the input stream so far by this call to the fwscanf function. Execution
20879              of a %n directive does not increment the assignment count returned at the
20880              completion of execution of the fwscanf function. No argument is
20881                 converted, but one is consumed. If the conversion specification includes an
20882                 assignment-suppressing wide character or a field width, the behavior is
20883                 undefined.
20884 </pre>
20885  %              Matches a single % wide character; no conversion or assignment occurs. The
20886 <pre>
20887                 complete conversion specification shall be %%.
20888 </pre>
20889 <p><!--para 13 -->
20890  If a conversion specification is invalid, the behavior is undefined.<sup><a href="#note326"><b>326)</b></a></sup>
20891 <p><!--para 14 -->
20892  The conversion specifiers A, E, F, G, and X are also valid and behave the same as,
20893  respectively, a, e, f, g, and x.
20894 <p><!--para 15 -->
20895  Trailing white space (including new-line wide characters) is left unread unless matched
20896  by a directive. The success of literal matches and suppressed assignments is not directly
20897  determinable other than via the %n directive.
20898 <h6>Returns</h6>
20899 <p><!--para 16 -->
20900  The fwscanf function returns the value of the macro EOF if an input failure occurs
20901  before the first conversion (if any) has completed. Otherwise, the function returns the
20902  number of input items assigned, which can be fewer than provided for, or even zero, in
20903  the event of an early matching failure.
20904 <p><!--para 17 -->
20905  EXAMPLE 1        The call:
20906 <pre>
20907           #include <a href="#7.21">&lt;stdio.h&gt;</a>
20908           #include <a href="#7.28">&lt;wchar.h&gt;</a>
20909           /* ... */
20910           int n, i; float x; wchar_t name[50];
20911           n = fwscanf(stdin, L"%d%f%ls", &amp;i, &amp;x, name);
20912 </pre>
20913  with the input line:
20914 <pre>
20915           25 54.32E-1 thompson
20916 </pre>
20917  will assign to n the value 3, to i the value 25, to x the value 5.432, and to name the sequence
20918  thompson\0.
20919  
20920 <p><!--para 18 -->
20921  EXAMPLE 2        The call:
20922 <pre>
20923           #include <a href="#7.21">&lt;stdio.h&gt;</a>
20924           #include <a href="#7.28">&lt;wchar.h&gt;</a>
20925           /* ... */
20926           int i; float x; double y;
20927           fwscanf(stdin, L"%2d%f%*d %lf", &amp;i, &amp;x, &amp;y);
20928 </pre>
20929  with input:
20930 <pre>
20931           56789 0123 56a72
20932 </pre>
20933  will assign to i the value 56 and to x the value 789.0, will skip past 0123, and will assign to y the value
20934  56.0. The next wide character read from the input stream will be a.
20935  
20936  
20937 <!--page 431 -->
20938 <p><b> Forward references</b>: the wcstod, wcstof, and wcstold functions (<a href="#7.28.4.1.1">7.28.4.1.1</a>), the
20939  wcstol, wcstoll, wcstoul, and wcstoull functions (<a href="#7.28.4.1.2">7.28.4.1.2</a>), the wcrtomb
20940  function (<a href="#7.28.6.3.3">7.28.6.3.3</a>).
20941
20942 <h6>footnotes</h6>
20943 <p><small><a name="note324" href="#note324">324)</a> These white-space wide characters are not counted against a specified field width.
20944 </small>
20945 <p><small><a name="note325" href="#note325">325)</a> fwscanf pushes back at most one input wide character onto the input stream. Therefore, some
20946  sequences that are acceptable to wcstod, wcstol, etc., are unacceptable to fwscanf.
20947 </small>
20948 <p><small><a name="note326" href="#note326">326)</a> See ''future library directions'' (<a href="#7.30.12">7.30.12</a>).
20949 </small>
20950
20951 <h5><a name="7.28.2.3" href="#7.28.2.3">7.28.2.3 The swprintf function</a></h5>
20952 <h6>Synopsis</h6>
20953 <p><!--para 1 -->
20954 <pre>
20955          #include <a href="#7.28">&lt;wchar.h&gt;</a>
20956          int swprintf(wchar_t * restrict s,
20957               size_t n,
20958               const wchar_t * restrict format, ...);
20959 </pre>
20960 <h6>Description</h6>
20961 <p><!--para 2 -->
20962  The swprintf function is equivalent to fwprintf, except that the argument s
20963  specifies an array of wide characters into which the generated output is to be written,
20964  rather than written to a stream. No more than n wide characters are written, including a
20965  terminating null wide character, which is always added (unless n is zero).
20966 <h6>Returns</h6>
20967 <p><!--para 3 -->
20968  The swprintf function returns the number of wide characters written in the array, not
20969  counting the terminating null wide character, or a negative value if an encoding error
20970  occurred or if n or more wide characters were requested to be written.
20971
20972 <h5><a name="7.28.2.4" href="#7.28.2.4">7.28.2.4 The swscanf function</a></h5>
20973 <h6>Synopsis</h6>
20974 <p><!--para 1 -->
20975 <pre>
20976          #include <a href="#7.28">&lt;wchar.h&gt;</a>
20977          int swscanf(const wchar_t * restrict s,
20978               const wchar_t * restrict format, ...);
20979 </pre>
20980 <h6>Description</h6>
20981 <p><!--para 2 -->
20982  The swscanf function is equivalent to fwscanf, except that the argument s specifies a
20983  wide string from which the input is to be obtained, rather than from a stream. Reaching
20984  the end of the wide string is equivalent to encountering end-of-file for the fwscanf
20985  function.
20986 <h6>Returns</h6>
20987 <p><!--para 3 -->
20988  The swscanf function returns the value of the macro EOF if an input failure occurs
20989  before the first conversion (if any) has completed. Otherwise, the swscanf function
20990  returns the number of input items assigned, which can be fewer than provided for, or even
20991  zero, in the event of an early matching failure.
20992 <!--page 432 -->
20993
20994 <h5><a name="7.28.2.5" href="#7.28.2.5">7.28.2.5 The vfwprintf function</a></h5>
20995 <h6>Synopsis</h6>
20996 <p><!--para 1 -->
20997 <pre>
20998         #include <a href="#7.16">&lt;stdarg.h&gt;</a>
20999         #include <a href="#7.21">&lt;stdio.h&gt;</a>
21000         #include <a href="#7.28">&lt;wchar.h&gt;</a>
21001         int vfwprintf(FILE * restrict stream,
21002              const wchar_t * restrict format,
21003              va_list arg);
21004 </pre>
21005 <h6>Description</h6>
21006 <p><!--para 2 -->
21007  The vfwprintf function is equivalent to fwprintf, with the variable argument list
21008  replaced by arg, which shall have been initialized by the va_start macro (and
21009  possibly subsequent va_arg calls). The vfwprintf function does not invoke the
21010  va_end macro.<sup><a href="#note327"><b>327)</b></a></sup>
21011 <h6>Returns</h6>
21012 <p><!--para 3 -->
21013  The vfwprintf function returns the number of wide characters transmitted, or a
21014  negative value if an output or encoding error occurred.
21015 <p><!--para 4 -->
21016  EXAMPLE       The following shows the use of the vfwprintf function in a general error-reporting
21017  routine.
21018 <pre>
21019         #include <a href="#7.16">&lt;stdarg.h&gt;</a>
21020         #include <a href="#7.21">&lt;stdio.h&gt;</a>
21021         #include <a href="#7.28">&lt;wchar.h&gt;</a>
21022         void error(char *function_name, wchar_t *format, ...)
21023         {
21024               va_list args;
21025                  va_start(args, format);
21026                  // print out name of function causing error
21027                  fwprintf(stderr, L"ERROR in %s: ", function_name);
21028                  // print out remainder of message
21029                  vfwprintf(stderr, format, args);
21030                  va_end(args);
21031         }
21032 </pre>
21033  
21034  
21035  
21036  
21037 <!--page 433 -->
21038
21039 <h6>footnotes</h6>
21040 <p><small><a name="note327" href="#note327">327)</a> As the functions vfwprintf, vswprintf, vfwscanf, vwprintf, vwscanf, and vswscanf
21041  invoke the va_arg macro, the value of arg after the return is indeterminate.
21042 </small>
21043
21044 <h5><a name="7.28.2.6" href="#7.28.2.6">7.28.2.6 The vfwscanf function</a></h5>
21045 <h6>Synopsis</h6>
21046 <p><!--para 1 -->
21047 <pre>
21048          #include <a href="#7.16">&lt;stdarg.h&gt;</a>
21049          #include <a href="#7.21">&lt;stdio.h&gt;</a>
21050          #include <a href="#7.28">&lt;wchar.h&gt;</a>
21051          int vfwscanf(FILE * restrict stream,
21052               const wchar_t * restrict format,
21053               va_list arg);
21054 </pre>
21055 <h6>Description</h6>
21056 <p><!--para 2 -->
21057  The vfwscanf function is equivalent to fwscanf, with the variable argument list
21058  replaced by arg, which shall have been initialized by the va_start macro (and
21059  possibly subsequent va_arg calls). The vfwscanf function does not invoke the
21060  va_end macro.<sup><a href="#note327"><b>327)</b></a></sup>
21061 <h6>Returns</h6>
21062 <p><!--para 3 -->
21063  The vfwscanf function returns the value of the macro EOF if an input failure occurs
21064  before the first conversion (if any) has completed. Otherwise, the vfwscanf function
21065  returns the number of input items assigned, which can be fewer than provided for, or even
21066  zero, in the event of an early matching failure.
21067
21068 <h5><a name="7.28.2.7" href="#7.28.2.7">7.28.2.7 The vswprintf function</a></h5>
21069 <h6>Synopsis</h6>
21070 <p><!--para 1 -->
21071 <pre>
21072          #include <a href="#7.16">&lt;stdarg.h&gt;</a>
21073          #include <a href="#7.28">&lt;wchar.h&gt;</a>
21074          int vswprintf(wchar_t * restrict s,
21075               size_t n,
21076               const wchar_t * restrict format,
21077               va_list arg);
21078 </pre>
21079 <h6>Description</h6>
21080 <p><!--para 2 -->
21081  The vswprintf function is equivalent to swprintf, with the variable argument list
21082  replaced by arg, which shall have been initialized by the va_start macro (and
21083  possibly subsequent va_arg calls). The vswprintf function does not invoke the
21084  va_end macro.<sup><a href="#note327"><b>327)</b></a></sup>
21085 <h6>Returns</h6>
21086 <p><!--para 3 -->
21087  The vswprintf function returns the number of wide characters written in the array, not
21088  counting the terminating null wide character, or a negative value if an encoding error
21089  occurred or if n or more wide characters were requested to be generated.
21090 <!--page 434 -->
21091
21092 <h5><a name="7.28.2.8" href="#7.28.2.8">7.28.2.8 The vswscanf function</a></h5>
21093 <h6>Synopsis</h6>
21094 <p><!--para 1 -->
21095 <pre>
21096         #include <a href="#7.16">&lt;stdarg.h&gt;</a>
21097         #include <a href="#7.28">&lt;wchar.h&gt;</a>
21098         int vswscanf(const wchar_t * restrict s,
21099              const wchar_t * restrict format,
21100              va_list arg);
21101 </pre>
21102 <h6>Description</h6>
21103 <p><!--para 2 -->
21104  The vswscanf function is equivalent to swscanf, with the variable argument list
21105  replaced by arg, which shall have been initialized by the va_start macro (and
21106  possibly subsequent va_arg calls). The vswscanf function does not invoke the
21107  va_end macro.<sup><a href="#note327"><b>327)</b></a></sup>
21108 <h6>Returns</h6>
21109 <p><!--para 3 -->
21110  The vswscanf function returns the value of the macro EOF if an input failure occurs
21111  before the first conversion (if any) has completed. Otherwise, the vswscanf function
21112  returns the number of input items assigned, which can be fewer than provided for, or even
21113  zero, in the event of an early matching failure.
21114
21115 <h5><a name="7.28.2.9" href="#7.28.2.9">7.28.2.9 The vwprintf function</a></h5>
21116 <h6>Synopsis</h6>
21117 <p><!--para 1 -->
21118 <pre>
21119         #include <a href="#7.16">&lt;stdarg.h&gt;</a>
21120         #include <a href="#7.28">&lt;wchar.h&gt;</a>
21121         int vwprintf(const wchar_t * restrict format,
21122              va_list arg);
21123 </pre>
21124 <h6>Description</h6>
21125 <p><!--para 2 -->
21126  The vwprintf function is equivalent to wprintf, with the variable argument list
21127  replaced by arg, which shall have been initialized by the va_start macro (and
21128  possibly subsequent va_arg calls). The vwprintf function does not invoke the
21129  va_end macro.<sup><a href="#note327"><b>327)</b></a></sup>
21130 <h6>Returns</h6>
21131 <p><!--para 3 -->
21132  The vwprintf function returns the number of wide characters transmitted, or a negative
21133  value if an output or encoding error occurred.
21134 <!--page 435 -->
21135
21136 <h5><a name="7.28.2.10" href="#7.28.2.10">7.28.2.10 The vwscanf function</a></h5>
21137 <h6>Synopsis</h6>
21138 <p><!--para 1 -->
21139 <pre>
21140          #include <a href="#7.16">&lt;stdarg.h&gt;</a>
21141          #include <a href="#7.28">&lt;wchar.h&gt;</a>
21142          int vwscanf(const wchar_t * restrict format,
21143               va_list arg);
21144 </pre>
21145 <h6>Description</h6>
21146 <p><!--para 2 -->
21147  The vwscanf function is equivalent to wscanf, with the variable argument list
21148  replaced by arg, which shall have been initialized by the va_start macro (and
21149  possibly subsequent va_arg calls). The vwscanf function does not invoke the
21150  va_end macro.<sup><a href="#note327"><b>327)</b></a></sup>
21151 <h6>Returns</h6>
21152 <p><!--para 3 -->
21153  The vwscanf function returns the value of the macro EOF if an input failure occurs
21154  before the first conversion (if any) has completed. Otherwise, the vwscanf function
21155  returns the number of input items assigned, which can be fewer than provided for, or even
21156  zero, in the event of an early matching failure.
21157
21158 <h5><a name="7.28.2.11" href="#7.28.2.11">7.28.2.11 The wprintf function</a></h5>
21159 <h6>Synopsis</h6>
21160 <p><!--para 1 -->
21161 <pre>
21162          #include <a href="#7.28">&lt;wchar.h&gt;</a>
21163          int wprintf(const wchar_t * restrict format, ...);
21164 </pre>
21165 <h6>Description</h6>
21166 <p><!--para 2 -->
21167  The wprintf function is equivalent to fwprintf with the argument stdout
21168  interposed before the arguments to wprintf.
21169 <h6>Returns</h6>
21170 <p><!--para 3 -->
21171  The wprintf function returns the number of wide characters transmitted, or a negative
21172  value if an output or encoding error occurred.
21173
21174 <h5><a name="7.28.2.12" href="#7.28.2.12">7.28.2.12 The wscanf function</a></h5>
21175 <h6>Synopsis</h6>
21176 <p><!--para 1 -->
21177 <pre>
21178          #include <a href="#7.28">&lt;wchar.h&gt;</a>
21179          int wscanf(const wchar_t * restrict format, ...);
21180 </pre>
21181 <h6>Description</h6>
21182 <p><!--para 2 -->
21183  The wscanf function is equivalent to fwscanf with the argument stdin interposed
21184  before the arguments to wscanf.
21185 <!--page 436 -->
21186 <h6>Returns</h6>
21187 <p><!--para 3 -->
21188  The wscanf function returns the value of the macro EOF if an input failure occurs
21189  before the first conversion (if any) has completed. Otherwise, the wscanf function
21190  returns the number of input items assigned, which can be fewer than provided for, or even
21191  zero, in the event of an early matching failure.
21192
21193 <h4><a name="7.28.3" href="#7.28.3">7.28.3 Wide character input/output functions</a></h4>
21194
21195 <h5><a name="7.28.3.1" href="#7.28.3.1">7.28.3.1 The fgetwc function</a></h5>
21196 <h6>Synopsis</h6>
21197 <p><!--para 1 -->
21198 <pre>
21199          #include <a href="#7.21">&lt;stdio.h&gt;</a>
21200          #include <a href="#7.28">&lt;wchar.h&gt;</a>
21201          wint_t fgetwc(FILE *stream);
21202 </pre>
21203 <h6>Description</h6>
21204 <p><!--para 2 -->
21205  If the end-of-file indicator for the input stream pointed to by stream is not set and a
21206  next wide character is present, the fgetwc function obtains that wide character as a
21207  wchar_t converted to a wint_t and advances the associated file position indicator for
21208  the stream (if defined).
21209 <h6>Returns</h6>
21210 <p><!--para 3 -->
21211  If the end-of-file indicator for the stream is set, or if the stream is at end-of-file, the end-
21212  of-file indicator for the stream is set and the fgetwc function returns WEOF. Otherwise,
21213  the fgetwc function returns the next wide character from the input stream pointed to by
21214  stream. If a read error occurs, the error indicator for the stream is set and the fgetwc
21215  function returns WEOF. If an encoding error occurs (including too few bytes), the value of
21216  the macro EILSEQ is stored in errno and the fgetwc function returns WEOF.<sup><a href="#note328"><b>328)</b></a></sup>
21217
21218 <h6>footnotes</h6>
21219 <p><small><a name="note328" href="#note328">328)</a> An end-of-file and a read error can be distinguished by use of the feof and ferror functions.
21220  Also, errno will be set to EILSEQ by input/output functions only if an encoding error occurs.
21221 </small>
21222
21223 <h5><a name="7.28.3.2" href="#7.28.3.2">7.28.3.2 The fgetws function</a></h5>
21224 <h6>Synopsis</h6>
21225 <p><!--para 1 -->
21226 <pre>
21227          #include <a href="#7.21">&lt;stdio.h&gt;</a>
21228          #include <a href="#7.28">&lt;wchar.h&gt;</a>
21229          wchar_t *fgetws(wchar_t * restrict s,
21230               int n, FILE * restrict stream);
21231 </pre>
21232 <h6>Description</h6>
21233 <p><!--para 2 -->
21234  The fgetws function reads at most one less than the number of wide characters
21235  specified by n from the stream pointed to by stream into the array pointed to by s. No
21236  
21237  
21238 <!--page 437 -->
21239  additional wide characters are read after a new-line wide character (which is retained) or
21240  after end-of-file. A null wide character is written immediately after the last wide
21241  character read into the array.
21242 <h6>Returns</h6>
21243 <p><!--para 3 -->
21244  The fgetws function returns s if successful. If end-of-file is encountered and no
21245  characters have been read into the array, the contents of the array remain unchanged and a
21246  null pointer is returned. If a read or encoding error occurs during the operation, the array
21247  contents are indeterminate and a null pointer is returned.
21248
21249 <h5><a name="7.28.3.3" href="#7.28.3.3">7.28.3.3 The fputwc function</a></h5>
21250 <h6>Synopsis</h6>
21251 <p><!--para 1 -->
21252 <pre>
21253          #include <a href="#7.21">&lt;stdio.h&gt;</a>
21254          #include <a href="#7.28">&lt;wchar.h&gt;</a>
21255          wint_t fputwc(wchar_t c, FILE *stream);
21256 </pre>
21257 <h6>Description</h6>
21258 <p><!--para 2 -->
21259  The fputwc function writes the wide character specified by c to the output stream
21260  pointed to by stream, at the position indicated by the associated file position indicator
21261  for the stream (if defined), and advances the indicator appropriately. If the file cannot
21262  support positioning requests, or if the stream was opened with append mode, the
21263  character is appended to the output stream.
21264 <h6>Returns</h6>
21265 <p><!--para 3 -->
21266  The fputwc function returns the wide character written. If a write error occurs, the
21267  error indicator for the stream is set and fputwc returns WEOF. If an encoding error
21268  occurs, the value of the macro EILSEQ is stored in errno and fputwc returns WEOF.
21269
21270 <h5><a name="7.28.3.4" href="#7.28.3.4">7.28.3.4 The fputws function</a></h5>
21271 <h6>Synopsis</h6>
21272 <p><!--para 1 -->
21273 <pre>
21274          #include <a href="#7.21">&lt;stdio.h&gt;</a>
21275          #include <a href="#7.28">&lt;wchar.h&gt;</a>
21276          int fputws(const wchar_t * restrict s,
21277               FILE * restrict stream);
21278 </pre>
21279 <h6>Description</h6>
21280 <p><!--para 2 -->
21281  The fputws function writes the wide string pointed to by s to the stream pointed to by
21282  stream. The terminating null wide character is not written.
21283 <h6>Returns</h6>
21284 <p><!--para 3 -->
21285  The fputws function returns EOF if a write or encoding error occurs; otherwise, it
21286  returns a nonnegative value.
21287 <!--page 438 -->
21288
21289 <h5><a name="7.28.3.5" href="#7.28.3.5">7.28.3.5 The fwide function</a></h5>
21290 <h6>Synopsis</h6>
21291 <p><!--para 1 -->
21292 <pre>
21293          #include <a href="#7.21">&lt;stdio.h&gt;</a>
21294          #include <a href="#7.28">&lt;wchar.h&gt;</a>
21295          int fwide(FILE *stream, int mode);
21296 </pre>
21297 <h6>Description</h6>
21298 <p><!--para 2 -->
21299  The fwide function determines the orientation of the stream pointed to by stream. If
21300  mode is greater than zero, the function first attempts to make the stream wide oriented. If
21301  mode is less than zero, the function first attempts to make the stream byte oriented.<sup><a href="#note329"><b>329)</b></a></sup>
21302  Otherwise, mode is zero and the function does not alter the orientation of the stream.
21303 <h6>Returns</h6>
21304 <p><!--para 3 -->
21305  The fwide function returns a value greater than zero if, after the call, the stream has
21306  wide orientation, a value less than zero if the stream has byte orientation, or zero if the
21307  stream has no orientation.
21308
21309 <h6>footnotes</h6>
21310 <p><small><a name="note329" href="#note329">329)</a> If the orientation of the stream has already been determined, fwide does not change it.
21311 </small>
21312
21313 <h5><a name="7.28.3.6" href="#7.28.3.6">7.28.3.6 The getwc function</a></h5>
21314 <h6>Synopsis</h6>
21315 <p><!--para 1 -->
21316 <pre>
21317          #include <a href="#7.21">&lt;stdio.h&gt;</a>
21318          #include <a href="#7.28">&lt;wchar.h&gt;</a>
21319          wint_t getwc(FILE *stream);
21320 </pre>
21321 <h6>Description</h6>
21322 <p><!--para 2 -->
21323  The getwc function is equivalent to fgetwc, except that if it is implemented as a
21324  macro, it may evaluate stream more than once, so the argument should never be an
21325  expression with side effects.
21326 <h6>Returns</h6>
21327 <p><!--para 3 -->
21328  The getwc function returns the next wide character from the input stream pointed to by
21329  stream, or WEOF.
21330
21331 <h5><a name="7.28.3.7" href="#7.28.3.7">7.28.3.7 The getwchar function</a></h5>
21332 <h6>Synopsis</h6>
21333 <p><!--para 1 -->
21334 <pre>
21335          #include <a href="#7.28">&lt;wchar.h&gt;</a>
21336          wint_t getwchar(void);
21337 </pre>
21338  
21339  
21340  
21341  
21342 <!--page 439 -->
21343 <h6>Description</h6>
21344 <p><!--para 2 -->
21345  The getwchar function is equivalent to getwc with the argument stdin.
21346 <h6>Returns</h6>
21347 <p><!--para 3 -->
21348  The getwchar function returns the next wide character from the input stream pointed to
21349  by stdin, or WEOF.
21350
21351 <h5><a name="7.28.3.8" href="#7.28.3.8">7.28.3.8 The putwc function</a></h5>
21352 <h6>Synopsis</h6>
21353 <p><!--para 1 -->
21354 <pre>
21355          #include <a href="#7.21">&lt;stdio.h&gt;</a>
21356          #include <a href="#7.28">&lt;wchar.h&gt;</a>
21357          wint_t putwc(wchar_t c, FILE *stream);
21358 </pre>
21359 <h6>Description</h6>
21360 <p><!--para 2 -->
21361  The putwc function is equivalent to fputwc, except that if it is implemented as a
21362  macro, it may evaluate stream more than once, so that argument should never be an
21363  expression with side effects.
21364 <h6>Returns</h6>
21365 <p><!--para 3 -->
21366  The putwc function returns the wide character written, or WEOF.
21367
21368 <h5><a name="7.28.3.9" href="#7.28.3.9">7.28.3.9 The putwchar function</a></h5>
21369 <h6>Synopsis</h6>
21370 <p><!--para 1 -->
21371 <pre>
21372          #include <a href="#7.28">&lt;wchar.h&gt;</a>
21373          wint_t putwchar(wchar_t c);
21374 </pre>
21375 <h6>Description</h6>
21376 <p><!--para 2 -->
21377  The putwchar function is equivalent to putwc with the second argument stdout.
21378 <h6>Returns</h6>
21379 <p><!--para 3 -->
21380  The putwchar function returns the character written, or WEOF.
21381
21382 <h5><a name="7.28.3.10" href="#7.28.3.10">7.28.3.10 The ungetwc function</a></h5>
21383 <h6>Synopsis</h6>
21384 <p><!--para 1 -->
21385 <pre>
21386          #include <a href="#7.21">&lt;stdio.h&gt;</a>
21387          #include <a href="#7.28">&lt;wchar.h&gt;</a>
21388          wint_t ungetwc(wint_t c, FILE *stream);
21389 </pre>
21390 <h6>Description</h6>
21391 <p><!--para 2 -->
21392  The ungetwc function pushes the wide character specified by c back onto the input
21393  stream pointed to by stream. Pushed-back wide characters will be returned by
21394  subsequent reads on that stream in the reverse order of their pushing. A successful
21395 <!--page 440 -->
21396  intervening call (with the stream pointed to by stream) to a file positioning function
21397  (fseek, fsetpos, or rewind) discards any pushed-back wide characters for the
21398  stream. The external storage corresponding to the stream is unchanged.
21399 <p><!--para 3 -->
21400  One wide character of pushback is guaranteed, even if the call to the ungetwc function
21401  follows just after a call to a formatted wide character input function fwscanf,
21402  vfwscanf, vwscanf, or wscanf. If the ungetwc function is called too many times
21403  on the same stream without an intervening read or file positioning operation on that
21404  stream, the operation may fail.
21405 <p><!--para 4 -->
21406  If the value of c equals that of the macro WEOF, the operation fails and the input stream is
21407  unchanged.
21408 <p><!--para 5 -->
21409  A successful call to the ungetwc function clears the end-of-file indicator for the stream.
21410  The value of the file position indicator for the stream after reading or discarding all
21411  pushed-back wide characters is the same as it was before the wide characters were pushed
21412  back. For a text or binary stream, the value of its file position indicator after a successful
21413  call to the ungetwc function is unspecified until all pushed-back wide characters are
21414  read or discarded.
21415 <h6>Returns</h6>
21416 <p><!--para 6 -->
21417  The ungetwc function returns the wide character pushed back, or WEOF if the operation
21418  fails.
21419
21420 <h4><a name="7.28.4" href="#7.28.4">7.28.4 General wide string utilities</a></h4>
21421 <p><!--para 1 -->
21422  The header <a href="#7.28">&lt;wchar.h&gt;</a> declares a number of functions useful for wide string
21423  manipulation. Various methods are used for determining the lengths of the arrays, but in
21424  all cases a wchar_t * argument points to the initial (lowest addressed) element of the
21425  array. If an array is accessed beyond the end of an object, the behavior is undefined.
21426 <p><!--para 2 -->
21427  Where an argument declared as size_t n determines the length of the array for a
21428  function, n can have the value zero on a call to that function. Unless explicitly stated
21429  otherwise in the description of a particular function in this subclause, pointer arguments
21430  on such a call shall still have valid values, as described in <a href="#7.1.4">7.1.4</a>. On such a call, a
21431  function that locates a wide character finds no occurrence, a function that compares two
21432  wide character sequences returns zero, and a function that copies wide characters copies
21433  zero wide characters.
21434 <!--page 441 -->
21435
21436 <h5><a name="7.28.4.1" href="#7.28.4.1">7.28.4.1 Wide string numeric conversion functions</a></h5>
21437
21438 <h5><a name="7.28.4.1.1" href="#7.28.4.1.1">7.28.4.1.1 The wcstod, wcstof, and wcstold functions</a></h5>
21439 <h6>Synopsis</h6>
21440 <p><!--para 1 -->
21441 <pre>
21442          #include <a href="#7.28">&lt;wchar.h&gt;</a>
21443          double wcstod(const wchar_t * restrict nptr,
21444               wchar_t ** restrict endptr);
21445          float wcstof(const wchar_t * restrict nptr,
21446               wchar_t ** restrict endptr);
21447          long double wcstold(const wchar_t * restrict nptr,
21448               wchar_t ** restrict endptr);
21449 </pre>
21450 <h6>Description</h6>
21451 <p><!--para 2 -->
21452  The wcstod, wcstof, and wcstold functions convert the initial portion of the wide
21453  string pointed to by nptr to double, float, and long double representation,
21454  respectively. First, they decompose the input string into three parts: an initial, possibly
21455  empty, sequence of white-space wide characters (as specified by the iswspace
21456  function), a subject sequence resembling a floating-point constant or representing an
21457  infinity or NaN; and a final wide string of one or more unrecognized wide characters,
21458  including the terminating null wide character of the input wide string. Then, they attempt
21459  to convert the subject sequence to a floating-point number, and return the result.
21460 <p><!--para 3 -->
21461  The expected form of the subject sequence is an optional plus or minus sign, then one of
21462  the following:
21463 <ul>
21464 <li>  a nonempty sequence of decimal digits optionally containing a decimal-point wide
21465  character, then an optional exponent part as defined for the corresponding single-byte
21466  characters in <a href="#6.4.4.2">6.4.4.2</a>;
21467 <li>  a 0x or 0X, then a nonempty sequence of hexadecimal digits optionally containing a
21468  decimal-point wide character, then an optional binary exponent part as defined in
21469  <a href="#6.4.4.2">6.4.4.2</a>;
21470 <li>  INF or INFINITY, or any other wide string equivalent except for case
21471 <li>  NAN or NAN(n-wchar-sequence<sub>opt</sub>), or any other wide string equivalent except for
21472  case in the NAN part, where:
21473 <pre>
21474           n-wchar-sequence:
21475                 digit
21476                 nondigit
21477                 n-wchar-sequence digit
21478                 n-wchar-sequence nondigit
21479 </pre>
21480 </ul>
21481  The subject sequence is defined as the longest initial subsequence of the input wide
21482  string, starting with the first non-white-space wide character, that is of the expected form.
21483 <!--page 442 -->
21484  The subject sequence contains no wide characters if the input wide string is not of the
21485  expected form.
21486 <p><!--para 4 -->
21487  If the subject sequence has the expected form for a floating-point number, the sequence of
21488  wide characters starting with the first digit or the decimal-point wide character
21489  (whichever occurs first) is interpreted as a floating constant according to the rules of
21490  <a href="#6.4.4.2">6.4.4.2</a>, except that the decimal-point wide character is used in place of a period, and that
21491  if neither an exponent part nor a decimal-point wide character appears in a decimal
21492  floating point number, or if a binary exponent part does not appear in a hexadecimal
21493  floating point number, an exponent part of the appropriate type with value zero is
21494  assumed to follow the last digit in the string. If the subject sequence begins with a minus
21495  sign, the sequence is interpreted as negated.<sup><a href="#note330"><b>330)</b></a></sup> A wide character sequence INF or
21496  INFINITY is interpreted as an infinity, if representable in the return type, else like a
21497  floating constant that is too large for the range of the return type. A wide character
21498  sequence NAN or NAN(n-wchar-sequence<sub>opt</sub>) is interpreted as a quiet NaN, if supported
21499  in the return type, else like a subject sequence part that does not have the expected form;
21500  the meaning of the n-wchar sequences is implementation-defined.<sup><a href="#note331"><b>331)</b></a></sup> A pointer to the
21501  final wide string is stored in the object pointed to by endptr, provided that endptr is
21502  not a null pointer.
21503 <p><!--para 5 -->
21504  If the subject sequence has the hexadecimal form and FLT_RADIX is a power of 2, the
21505  value resulting from the conversion is correctly rounded.
21506 <p><!--para 6 -->
21507  In other than the "C" locale, additional locale-specific subject sequence forms may be
21508  accepted.
21509 <p><!--para 7 -->
21510  If the subject sequence is empty or does not have the expected form, no conversion is
21511  performed; the value of nptr is stored in the object pointed to by endptr, provided
21512  that endptr is not a null pointer.
21513 <h6>Recommended practice</h6>
21514 <p><!--para 8 -->
21515  If the subject sequence has the hexadecimal form, FLT_RADIX is not a power of 2, and
21516  the result is not exactly representable, the result should be one of the two numbers in the
21517  appropriate internal format that are adjacent to the hexadecimal floating source value,
21518  with the extra stipulation that the error should have a correct sign for the current rounding
21519  direction.
21520  
21521  
21522  
21523 <!--page 443 -->
21524 <p><!--para 9 -->
21525  If the subject sequence has the decimal form and at most DECIMAL_DIG (defined in
21526  <a href="#7.7">&lt;float.h&gt;</a>) significant digits, the result should be correctly rounded. If the subject
21527  sequence D has the decimal form and more than DECIMAL_DIG significant digits,
21528  consider the two bounding, adjacent decimal strings L and U, both having
21529  DECIMAL_DIG significant digits, such that the values of L, D, and U satisfy L &lt;= D &lt;= U.
21530  The result should be one of the (equal or adjacent) values that would be obtained by
21531  correctly rounding L and U according to the current rounding direction, with the extra
21532  stipulation that the error with respect to D should have a correct sign for the current
21533  rounding direction.<sup><a href="#note332"><b>332)</b></a></sup>
21534 <h6>Returns</h6>
21535 <p><!--para 10 -->
21536  The functions return the converted value, if any. If no conversion could be performed,
21537  zero is returned. If the correct value overflows and default rounding is in effect (<a href="#7.12.1">7.12.1</a>),
21538  plus or minus HUGE_VAL, HUGE_VALF, or HUGE_VALL is returned (according to the
21539  return type and sign of the value), and the value of the macro ERANGE is stored in
21540  errno. If the result underflows (<a href="#7.12.1">7.12.1</a>), the functions return a value whose magnitude is
21541  no greater than the smallest normalized positive number in the return type; whether
21542  errno acquires the value ERANGE is implementation-defined.
21543  
21544  
21545  
21546  
21547 <!--page 444 -->
21548
21549 <h6>footnotes</h6>
21550 <p><small><a name="note330" href="#note330">330)</a> It is unspecified whether a minus-signed sequence is converted to a negative number directly or by
21551  negating the value resulting from converting the corresponding unsigned sequence (see <a href="#F.5">F.5</a>); the two
21552  methods may yield different results if rounding is toward positive or negative infinity. In either case,
21553  the functions honor the sign of zero if floating-point arithmetic supports signed zeros.
21554 </small>
21555 <p><small><a name="note331" href="#note331">331)</a> An implementation may use the n-wchar sequence to determine extra information to be represented in
21556  the NaN's significand.
21557 </small>
21558 <p><small><a name="note332" href="#note332">332)</a> DECIMAL_DIG, defined in <a href="#7.7">&lt;float.h&gt;</a>, should be sufficiently large that L and U will usually round
21559  to the same internal floating value, but if not will round to adjacent values.
21560 </small>
21561
21562 <h5><a name="7.28.4.1.2" href="#7.28.4.1.2">7.28.4.1.2 The wcstol, wcstoll, wcstoul, and wcstoull functions</a></h5>
21563 <h6>Synopsis</h6>
21564 <p><!--para 1 -->
21565 <pre>
21566         #include <a href="#7.28">&lt;wchar.h&gt;</a>
21567         long int wcstol(
21568              const wchar_t * restrict nptr,
21569              wchar_t ** restrict endptr,
21570              int base);
21571         long long int wcstoll(
21572              const wchar_t * restrict nptr,
21573              wchar_t ** restrict endptr,
21574              int base);
21575         unsigned long int wcstoul(
21576              const wchar_t * restrict nptr,
21577              wchar_t ** restrict endptr,
21578              int base);
21579         unsigned long long int wcstoull(
21580              const wchar_t * restrict nptr,
21581              wchar_t ** restrict endptr,
21582              int base);
21583 </pre>
21584 <h6>Description</h6>
21585 <p><!--para 2 -->
21586  The wcstol, wcstoll, wcstoul, and wcstoull functions convert the initial
21587  portion of the wide string pointed to by nptr to long int, long long int,
21588  unsigned long int, and unsigned long long int representation,
21589  respectively. First, they decompose the input string into three parts: an initial, possibly
21590  empty, sequence of white-space wide characters (as specified by the iswspace
21591  function), a subject sequence resembling an integer represented in some radix determined
21592  by the value of base, and a final wide string of one or more unrecognized wide
21593  characters, including the terminating null wide character of the input wide string. Then,
21594  they attempt to convert the subject sequence to an integer, and return the result.
21595 <p><!--para 3 -->
21596  If the value of base is zero, the expected form of the subject sequence is that of an
21597  integer constant as described for the corresponding single-byte characters in <a href="#6.4.4.1">6.4.4.1</a>,
21598  optionally preceded by a plus or minus sign, but not including an integer suffix. If the
21599  value of base is between 2 and 36 (inclusive), the expected form of the subject sequence
21600  is a sequence of letters and digits representing an integer with the radix specified by
21601  base, optionally preceded by a plus or minus sign, but not including an integer suffix.
21602  The letters from a (or A) through z (or Z) are ascribed the values 10 through 35; only
21603  letters and digits whose ascribed values are less than that of base are permitted. If the
21604  value of base is 16, the wide characters 0x or 0X may optionally precede the sequence
21605  of letters and digits, following the sign if present.
21606 <!--page 445 -->
21607 <p><!--para 4 -->
21608  The subject sequence is defined as the longest initial subsequence of the input wide
21609  string, starting with the first non-white-space wide character, that is of the expected form.
21610  The subject sequence contains no wide characters if the input wide string is empty or
21611  consists entirely of white space, or if the first non-white-space wide character is other
21612  than a sign or a permissible letter or digit.
21613 <p><!--para 5 -->
21614  If the subject sequence has the expected form and the value of base is zero, the sequence
21615  of wide characters starting with the first digit is interpreted as an integer constant
21616  according to the rules of <a href="#6.4.4.1">6.4.4.1</a>. If the subject sequence has the expected form and the
21617  value of base is between 2 and 36, it is used as the base for conversion, ascribing to each
21618  letter its value as given above. If the subject sequence begins with a minus sign, the value
21619  resulting from the conversion is negated (in the return type). A pointer to the final wide
21620  string is stored in the object pointed to by endptr, provided that endptr is not a null
21621  pointer.
21622 <p><!--para 6 -->
21623  In other than the "C" locale, additional locale-specific subject sequence forms may be
21624  accepted.
21625 <p><!--para 7 -->
21626  If the subject sequence is empty or does not have the expected form, no conversion is
21627  performed; the value of nptr is stored in the object pointed to by endptr, provided
21628  that endptr is not a null pointer.
21629 <h6>Returns</h6>
21630 <p><!--para 8 -->
21631  The wcstol, wcstoll, wcstoul, and wcstoull functions return the converted
21632  value, if any. If no conversion could be performed, zero is returned. If the correct value
21633  is outside the range of representable values, LONG_MIN, LONG_MAX, LLONG_MIN,
21634  LLONG_MAX, ULONG_MAX, or ULLONG_MAX is returned (according to the return type
21635  sign of the value, if any), and the value of the macro ERANGE is stored in errno.
21636
21637 <h5><a name="7.28.4.2" href="#7.28.4.2">7.28.4.2 Wide string copying functions</a></h5>
21638
21639 <h5><a name="7.28.4.2.1" href="#7.28.4.2.1">7.28.4.2.1 The wcscpy function</a></h5>
21640 <h6>Synopsis</h6>
21641 <p><!--para 1 -->
21642 <pre>
21643          #include <a href="#7.28">&lt;wchar.h&gt;</a>
21644          wchar_t *wcscpy(wchar_t * restrict s1,
21645               const wchar_t * restrict s2);
21646 </pre>
21647 <h6>Description</h6>
21648 <p><!--para 2 -->
21649  The wcscpy function copies the wide string pointed to by s2 (including the terminating
21650  null wide character) into the array pointed to by s1.
21651 <h6>Returns</h6>
21652 <p><!--para 3 -->
21653  The wcscpy function returns the value of s1.
21654 <!--page 446 -->
21655
21656 <h5><a name="7.28.4.2.2" href="#7.28.4.2.2">7.28.4.2.2 The wcsncpy function</a></h5>
21657 <h6>Synopsis</h6>
21658 <p><!--para 1 -->
21659 <pre>
21660           #include <a href="#7.28">&lt;wchar.h&gt;</a>
21661           wchar_t *wcsncpy(wchar_t * restrict s1,
21662                const wchar_t * restrict s2,
21663                size_t n);
21664 </pre>
21665 <h6>Description</h6>
21666 <p><!--para 2 -->
21667  The wcsncpy function copies not more than n wide characters (those that follow a null
21668  wide character are not copied) from the array pointed to by s2 to the array pointed to by
21669  s1.<sup><a href="#note333"><b>333)</b></a></sup>
21670 <p><!--para 3 -->
21671  If the array pointed to by s2 is a wide string that is shorter than n wide characters, null
21672  wide characters are appended to the copy in the array pointed to by s1, until n wide
21673  characters in all have been written.
21674 <h6>Returns</h6>
21675 <p><!--para 4 -->
21676  The wcsncpy function returns the value of s1.
21677
21678 <h6>footnotes</h6>
21679 <p><small><a name="note333" href="#note333">333)</a> Thus, if there is no null wide character in the first n wide characters of the array pointed to by s2, the
21680  result will not be null-terminated.
21681 </small>
21682
21683 <h5><a name="7.28.4.2.3" href="#7.28.4.2.3">7.28.4.2.3 The wmemcpy function</a></h5>
21684 <h6>Synopsis</h6>
21685 <p><!--para 1 -->
21686 <pre>
21687           #include <a href="#7.28">&lt;wchar.h&gt;</a>
21688           wchar_t *wmemcpy(wchar_t * restrict s1,
21689                const wchar_t * restrict s2,
21690                size_t n);
21691 </pre>
21692 <h6>Description</h6>
21693 <p><!--para 2 -->
21694  The wmemcpy function copies n wide characters from the object pointed to by s2 to the
21695  object pointed to by s1.
21696 <h6>Returns</h6>
21697 <p><!--para 3 -->
21698  The wmemcpy function returns the value of s1.
21699  
21700  
21701  
21702  
21703 <!--page 447 -->
21704
21705 <h5><a name="7.28.4.2.4" href="#7.28.4.2.4">7.28.4.2.4 The wmemmove function</a></h5>
21706 <h6>Synopsis</h6>
21707 <p><!--para 1 -->
21708 <pre>
21709          #include <a href="#7.28">&lt;wchar.h&gt;</a>
21710          wchar_t *wmemmove(wchar_t *s1, const wchar_t *s2,
21711               size_t n);
21712 </pre>
21713 <h6>Description</h6>
21714 <p><!--para 2 -->
21715  The wmemmove function copies n wide characters from the object pointed to by s2 to
21716  the object pointed to by s1. Copying takes place as if the n wide characters from the
21717  object pointed to by s2 are first copied into a temporary array of n wide characters that
21718  does not overlap the objects pointed to by s1 or s2, and then the n wide characters from
21719  the temporary array are copied into the object pointed to by s1.
21720 <h6>Returns</h6>
21721 <p><!--para 3 -->
21722  The wmemmove function returns the value of s1.
21723
21724 <h5><a name="7.28.4.3" href="#7.28.4.3">7.28.4.3 Wide string concatenation functions</a></h5>
21725
21726 <h5><a name="7.28.4.3.1" href="#7.28.4.3.1">7.28.4.3.1 The wcscat function</a></h5>
21727 <h6>Synopsis</h6>
21728 <p><!--para 1 -->
21729 <pre>
21730          #include <a href="#7.28">&lt;wchar.h&gt;</a>
21731          wchar_t *wcscat(wchar_t * restrict s1,
21732               const wchar_t * restrict s2);
21733 </pre>
21734 <h6>Description</h6>
21735 <p><!--para 2 -->
21736  The wcscat function appends a copy of the wide string pointed to by s2 (including the
21737  terminating null wide character) to the end of the wide string pointed to by s1. The initial
21738  wide character of s2 overwrites the null wide character at the end of s1.
21739 <h6>Returns</h6>
21740 <p><!--para 3 -->
21741  The wcscat function returns the value of s1.
21742
21743 <h5><a name="7.28.4.3.2" href="#7.28.4.3.2">7.28.4.3.2 The wcsncat function</a></h5>
21744 <h6>Synopsis</h6>
21745 <p><!--para 1 -->
21746 <pre>
21747          #include <a href="#7.28">&lt;wchar.h&gt;</a>
21748          wchar_t *wcsncat(wchar_t * restrict s1,
21749               const wchar_t * restrict s2,
21750               size_t n);
21751 </pre>
21752 <h6>Description</h6>
21753 <p><!--para 2 -->
21754  The wcsncat function appends not more than n wide characters (a null wide character
21755  and those that follow it are not appended) from the array pointed to by s2 to the end of
21756 <!--page 448 -->
21757  the wide string pointed to by s1. The initial wide character of s2 overwrites the null
21758  wide character at the end of s1. A terminating null wide character is always appended to
21759  the result.<sup><a href="#note334"><b>334)</b></a></sup>
21760 <h6>Returns</h6>
21761 <p><!--para 3 -->
21762  The wcsncat function returns the value of s1.
21763
21764 <h6>footnotes</h6>
21765 <p><small><a name="note334" href="#note334">334)</a> Thus, the maximum number of wide characters that can end up in the array pointed to by s1 is
21766  wcslen(s1)+n+1.
21767 </small>
21768
21769 <h5><a name="7.28.4.4" href="#7.28.4.4">7.28.4.4 Wide string comparison functions</a></h5>
21770 <p><!--para 1 -->
21771  Unless explicitly stated otherwise, the functions described in this subclause order two
21772  wide characters the same way as two integers of the underlying integer type designated
21773  by wchar_t.
21774
21775 <h5><a name="7.28.4.4.1" href="#7.28.4.4.1">7.28.4.4.1 The wcscmp function</a></h5>
21776 <h6>Synopsis</h6>
21777 <p><!--para 1 -->
21778 <pre>
21779          #include <a href="#7.28">&lt;wchar.h&gt;</a>
21780          int wcscmp(const wchar_t *s1, const wchar_t *s2);
21781 </pre>
21782 <h6>Description</h6>
21783 <p><!--para 2 -->
21784  The wcscmp function compares the wide string pointed to by s1 to the wide string
21785  pointed to by s2.
21786 <h6>Returns</h6>
21787 <p><!--para 3 -->
21788  The wcscmp function returns an integer greater than, equal to, or less than zero,
21789  accordingly as the wide string pointed to by s1 is greater than, equal to, or less than the
21790  wide string pointed to by s2.
21791
21792 <h5><a name="7.28.4.4.2" href="#7.28.4.4.2">7.28.4.4.2 The wcscoll function</a></h5>
21793 <h6>Synopsis</h6>
21794 <p><!--para 1 -->
21795 <pre>
21796          #include <a href="#7.28">&lt;wchar.h&gt;</a>
21797          int wcscoll(const wchar_t *s1, const wchar_t *s2);
21798 </pre>
21799 <h6>Description</h6>
21800 <p><!--para 2 -->
21801  The wcscoll function compares the wide string pointed to by s1 to the wide string
21802  pointed to by s2, both interpreted as appropriate to the LC_COLLATE category of the
21803  current locale.
21804 <h6>Returns</h6>
21805 <p><!--para 3 -->
21806  The wcscoll function returns an integer greater than, equal to, or less than zero,
21807  accordingly as the wide string pointed to by s1 is greater than, equal to, or less than the
21808  
21809  
21810 <!--page 449 -->
21811  wide string pointed to by s2 when both are interpreted as appropriate to the current
21812  locale.
21813
21814 <h5><a name="7.28.4.4.3" href="#7.28.4.4.3">7.28.4.4.3 The wcsncmp function</a></h5>
21815 <h6>Synopsis</h6>
21816 <p><!--para 1 -->
21817 <pre>
21818          #include <a href="#7.28">&lt;wchar.h&gt;</a>
21819          int wcsncmp(const wchar_t *s1, const wchar_t *s2,
21820               size_t n);
21821 </pre>
21822 <h6>Description</h6>
21823 <p><!--para 2 -->
21824  The wcsncmp function compares not more than n wide characters (those that follow a
21825  null wide character are not compared) from the array pointed to by s1 to the array
21826  pointed to by s2.
21827 <h6>Returns</h6>
21828 <p><!--para 3 -->
21829  The wcsncmp function returns an integer greater than, equal to, or less than zero,
21830  accordingly as the possibly null-terminated array pointed to by s1 is greater than, equal
21831  to, or less than the possibly null-terminated array pointed to by s2.
21832
21833 <h5><a name="7.28.4.4.4" href="#7.28.4.4.4">7.28.4.4.4 The wcsxfrm function</a></h5>
21834 <h6>Synopsis</h6>
21835 <p><!--para 1 -->
21836 <pre>
21837          #include <a href="#7.28">&lt;wchar.h&gt;</a>
21838          size_t wcsxfrm(wchar_t * restrict s1,
21839               const wchar_t * restrict s2,
21840               size_t n);
21841 </pre>
21842 <h6>Description</h6>
21843 <p><!--para 2 -->
21844  The wcsxfrm function transforms the wide string pointed to by s2 and places the
21845  resulting wide string into the array pointed to by s1. The transformation is such that if
21846  the wcscmp function is applied to two transformed wide strings, it returns a value greater
21847  than, equal to, or less than zero, corresponding to the result of the wcscoll function
21848  applied to the same two original wide strings. No more than n wide characters are placed
21849  into the resulting array pointed to by s1, including the terminating null wide character. If
21850  n is zero, s1 is permitted to be a null pointer.
21851 <h6>Returns</h6>
21852 <p><!--para 3 -->
21853  The wcsxfrm function returns the length of the transformed wide string (not including
21854  the terminating null wide character). If the value returned is n or greater, the contents of
21855  the array pointed to by s1 are indeterminate.
21856 <p><!--para 4 -->
21857  EXAMPLE The value of the following expression is the length of the array needed to hold the
21858  transformation of the wide string pointed to by s:
21859 <!--page 450 -->
21860 <pre>
21861         1 + wcsxfrm(NULL, s, 0)
21862 </pre>
21863  
21864
21865 <h5><a name="7.28.4.4.5" href="#7.28.4.4.5">7.28.4.4.5 The wmemcmp function</a></h5>
21866 <h6>Synopsis</h6>
21867 <p><!--para 1 -->
21868 <pre>
21869         #include <a href="#7.28">&lt;wchar.h&gt;</a>
21870         int wmemcmp(const wchar_t *s1, const wchar_t *s2,
21871              size_t n);
21872 </pre>
21873 <h6>Description</h6>
21874 <p><!--para 2 -->
21875  The wmemcmp function compares the first n wide characters of the object pointed to by
21876  s1 to the first n wide characters of the object pointed to by s2.
21877 <h6>Returns</h6>
21878 <p><!--para 3 -->
21879  The wmemcmp function returns an integer greater than, equal to, or less than zero,
21880  accordingly as the object pointed to by s1 is greater than, equal to, or less than the object
21881  pointed to by s2.
21882
21883 <h5><a name="7.28.4.5" href="#7.28.4.5">7.28.4.5 Wide string search functions</a></h5>
21884
21885 <h5><a name="7.28.4.5.1" href="#7.28.4.5.1">7.28.4.5.1 The wcschr function</a></h5>
21886 <h6>Synopsis</h6>
21887 <p><!--para 1 -->
21888 <pre>
21889         #include <a href="#7.28">&lt;wchar.h&gt;</a>
21890         wchar_t *wcschr(const wchar_t *s, wchar_t c);
21891 </pre>
21892 <h6>Description</h6>
21893 <p><!--para 2 -->
21894  The wcschr function locates the first occurrence of c in the wide string pointed to by s.
21895  The terminating null wide character is considered to be part of the wide string.
21896 <h6>Returns</h6>
21897 <p><!--para 3 -->
21898  The wcschr function returns a pointer to the located wide character, or a null pointer if
21899  the wide character does not occur in the wide string.
21900
21901 <h5><a name="7.28.4.5.2" href="#7.28.4.5.2">7.28.4.5.2 The wcscspn function</a></h5>
21902 <h6>Synopsis</h6>
21903 <p><!--para 1 -->
21904 <pre>
21905         #include <a href="#7.28">&lt;wchar.h&gt;</a>
21906         size_t wcscspn(const wchar_t *s1, const wchar_t *s2);
21907 </pre>
21908 <h6>Description</h6>
21909 <p><!--para 2 -->
21910  The wcscspn function computes the length of the maximum initial segment of the wide
21911  string pointed to by s1 which consists entirely of wide characters not from the wide
21912  string pointed to by s2.
21913 <!--page 451 -->
21914 <h6>Returns</h6>
21915 <p><!--para 3 -->
21916  The wcscspn function returns the length of the segment.
21917
21918 <h5><a name="7.28.4.5.3" href="#7.28.4.5.3">7.28.4.5.3 The wcspbrk function</a></h5>
21919 <h6>Synopsis</h6>
21920 <p><!--para 1 -->
21921 <pre>
21922          #include <a href="#7.28">&lt;wchar.h&gt;</a>
21923          wchar_t *wcspbrk(const wchar_t *s1, const wchar_t *s2);
21924 </pre>
21925 <h6>Description</h6>
21926 <p><!--para 2 -->
21927  The wcspbrk function locates the first occurrence in the wide string pointed to by s1 of
21928  any wide character from the wide string pointed to by s2.
21929 <h6>Returns</h6>
21930 <p><!--para 3 -->
21931  The wcspbrk function returns a pointer to the wide character in s1, or a null pointer if
21932  no wide character from s2 occurs in s1.
21933
21934 <h5><a name="7.28.4.5.4" href="#7.28.4.5.4">7.28.4.5.4 The wcsrchr function</a></h5>
21935 <h6>Synopsis</h6>
21936 <p><!--para 1 -->
21937 <pre>
21938          #include <a href="#7.28">&lt;wchar.h&gt;</a>
21939          wchar_t *wcsrchr(const wchar_t *s, wchar_t c);
21940 </pre>
21941 <h6>Description</h6>
21942 <p><!--para 2 -->
21943  The wcsrchr function locates the last occurrence of c in the wide string pointed to by
21944  s. The terminating null wide character is considered to be part of the wide string.
21945 <h6>Returns</h6>
21946 <p><!--para 3 -->
21947  The wcsrchr function returns a pointer to the wide character, or a null pointer if c does
21948  not occur in the wide string.
21949
21950 <h5><a name="7.28.4.5.5" href="#7.28.4.5.5">7.28.4.5.5 The wcsspn function</a></h5>
21951 <h6>Synopsis</h6>
21952 <p><!--para 1 -->
21953 <pre>
21954          #include <a href="#7.28">&lt;wchar.h&gt;</a>
21955          size_t wcsspn(const wchar_t *s1, const wchar_t *s2);
21956 </pre>
21957 <h6>Description</h6>
21958 <p><!--para 2 -->
21959  The wcsspn function computes the length of the maximum initial segment of the wide
21960  string pointed to by s1 which consists entirely of wide characters from the wide string
21961  pointed to by s2.
21962 <h6>Returns</h6>
21963 <p><!--para 3 -->
21964  The wcsspn function returns the length of the segment.
21965 <!--page 452 -->
21966
21967 <h5><a name="7.28.4.5.6" href="#7.28.4.5.6">7.28.4.5.6 The wcsstr function</a></h5>
21968 <h6>Synopsis</h6>
21969 <p><!--para 1 -->
21970 <pre>
21971         #include <a href="#7.28">&lt;wchar.h&gt;</a>
21972         wchar_t *wcsstr(const wchar_t *s1, const wchar_t *s2);
21973 </pre>
21974 <h6>Description</h6>
21975 <p><!--para 2 -->
21976  The wcsstr function locates the first occurrence in the wide string pointed to by s1 of
21977  the sequence of wide characters (excluding the terminating null wide character) in the
21978  wide string pointed to by s2.
21979 <h6>Returns</h6>
21980 <p><!--para 3 -->
21981  The wcsstr function returns a pointer to the located wide string, or a null pointer if the
21982  wide string is not found. If s2 points to a wide string with zero length, the function
21983  returns s1.
21984
21985 <h5><a name="7.28.4.5.7" href="#7.28.4.5.7">7.28.4.5.7 The wcstok function</a></h5>
21986 <h6>Synopsis</h6>
21987 <p><!--para 1 -->
21988 <pre>
21989         #include <a href="#7.28">&lt;wchar.h&gt;</a>
21990         wchar_t *wcstok(wchar_t * restrict s1,
21991              const wchar_t * restrict s2,
21992              wchar_t ** restrict ptr);
21993 </pre>
21994 <h6>Description</h6>
21995 <p><!--para 2 -->
21996  A sequence of calls to the wcstok function breaks the wide string pointed to by s1 into
21997  a sequence of tokens, each of which is delimited by a wide character from the wide string
21998  pointed to by s2. The third argument points to a caller-provided wchar_t pointer into
21999  which the wcstok function stores information necessary for it to continue scanning the
22000  same wide string.
22001 <p><!--para 3 -->
22002  The first call in a sequence has a non-null first argument and stores an initial value in the
22003  object pointed to by ptr. Subsequent calls in the sequence have a null first argument and
22004  the object pointed to by ptr is required to have the value stored by the previous call in
22005  the sequence, which is then updated. The separator wide string pointed to by s2 may be
22006  different from call to call.
22007 <p><!--para 4 -->
22008  The first call in the sequence searches the wide string pointed to by s1 for the first wide
22009  character that is not contained in the current separator wide string pointed to by s2. If no
22010  such wide character is found, then there are no tokens in the wide string pointed to by s1
22011  and the wcstok function returns a null pointer. If such a wide character is found, it is
22012  the start of the first token.
22013 <p><!--para 5 -->
22014  The wcstok function then searches from there for a wide character that is contained in
22015  the current separator wide string. If no such wide character is found, the current token
22016 <!--page 453 -->
22017  extends to the end of the wide string pointed to by s1, and subsequent searches in the
22018  same wide string for a token return a null pointer. If such a wide character is found, it is
22019  overwritten by a null wide character, which terminates the current token.
22020 <p><!--para 6 -->
22021  In all cases, the wcstok function stores sufficient information in the pointer pointed to
22022  by ptr so that subsequent calls, with a null pointer for s1 and the unmodified pointer
22023  value for ptr, shall start searching just past the element overwritten by a null wide
22024  character (if any).
22025 <h6>Returns</h6>
22026 <p><!--para 7 -->
22027  The wcstok function returns a pointer to the first wide character of a token, or a null
22028  pointer if there is no token.
22029 <p><!--para 8 -->
22030  EXAMPLE
22031 <pre>
22032          #include <a href="#7.28">&lt;wchar.h&gt;</a>
22033          static wchar_t str1[] = L"?a???b,,,#c";
22034          static wchar_t str2[] = L"\t \t";
22035          wchar_t *t, *ptr1, *ptr2;
22036          t   =   wcstok(str1,   L"?", &amp;ptr1);         //   t   points to the token L"a"
22037          t   =   wcstok(NULL,   L",", &amp;ptr1);         //   t   points to the token L"??b"
22038          t   =   wcstok(str2,   L" \t", &amp;ptr2);       //   t   is a null pointer
22039          t   =   wcstok(NULL,   L"#,", &amp;ptr1);        //   t   points to the token L"c"
22040          t   =   wcstok(NULL,   L"?", &amp;ptr1);         //   t   is a null pointer
22041 </pre>
22042  
22043
22044 <h5><a name="7.28.4.5.8" href="#7.28.4.5.8">7.28.4.5.8 The wmemchr function</a></h5>
22045 <h6>Synopsis</h6>
22046 <p><!--para 1 -->
22047 <pre>
22048          #include <a href="#7.28">&lt;wchar.h&gt;</a>
22049          wchar_t *wmemchr(const wchar_t *s, wchar_t c,
22050               size_t n);
22051 </pre>
22052 <h6>Description</h6>
22053 <p><!--para 2 -->
22054  The wmemchr function locates the first occurrence of c in the initial n wide characters of
22055  the object pointed to by s.
22056 <h6>Returns</h6>
22057 <p><!--para 3 -->
22058  The wmemchr function returns a pointer to the located wide character, or a null pointer if
22059  the wide character does not occur in the object.
22060 <!--page 454 -->
22061
22062 <h5><a name="7.28.4.6" href="#7.28.4.6">7.28.4.6 Miscellaneous functions</a></h5>
22063
22064 <h5><a name="7.28.4.6.1" href="#7.28.4.6.1">7.28.4.6.1 The wcslen function</a></h5>
22065 <h6>Synopsis</h6>
22066 <p><!--para 1 -->
22067 <pre>
22068         #include <a href="#7.28">&lt;wchar.h&gt;</a>
22069         size_t wcslen(const wchar_t *s);
22070 </pre>
22071 <h6>Description</h6>
22072 <p><!--para 2 -->
22073  The wcslen function computes the length of the wide string pointed to by s.
22074 <h6>Returns</h6>
22075 <p><!--para 3 -->
22076  The wcslen function returns the number of wide characters that precede the terminating
22077  null wide character.
22078
22079 <h5><a name="7.28.4.6.2" href="#7.28.4.6.2">7.28.4.6.2 The wmemset function</a></h5>
22080 <h6>Synopsis</h6>
22081 <p><!--para 1 -->
22082 <pre>
22083         #include <a href="#7.28">&lt;wchar.h&gt;</a>
22084         wchar_t *wmemset(wchar_t *s, wchar_t c, size_t n);
22085 </pre>
22086 <h6>Description</h6>
22087 <p><!--para 2 -->
22088  The wmemset function copies the value of c into each of the first n wide characters of
22089  the object pointed to by s.
22090 <h6>Returns</h6>
22091 <p><!--para 3 -->
22092  The wmemset function returns the value of s.
22093
22094 <h4><a name="7.28.5" href="#7.28.5">7.28.5 Wide character time conversion functions</a></h4>
22095
22096 <h5><a name="7.28.5.1" href="#7.28.5.1">7.28.5.1 The wcsftime function</a></h5>
22097 <h6>Synopsis</h6>
22098 <p><!--para 1 -->
22099 <pre>
22100         #include <a href="#7.26">&lt;time.h&gt;</a>
22101         #include <a href="#7.28">&lt;wchar.h&gt;</a>
22102         size_t wcsftime(wchar_t * restrict s,
22103              size_t maxsize,
22104              const wchar_t * restrict format,
22105              const struct tm * restrict timeptr);
22106 </pre>
22107 <h6>Description</h6>
22108 <p><!--para 2 -->
22109  The wcsftime function is equivalent to the strftime function, except that:
22110 <ul>
22111 <li>  The argument s points to the initial element of an array of wide characters into which
22112  the generated output is to be placed.
22113 <!--page 455 -->
22114 <li>  The argument maxsize indicates the limiting number of wide characters.
22115 <li>  The argument format is a wide string and the conversion specifiers are replaced by
22116  corresponding sequences of wide characters.
22117 <li>  The return value indicates the number of wide characters.
22118 </ul>
22119 <h6>Returns</h6>
22120 <p><!--para 3 -->
22121  If the total number of resulting wide characters including the terminating null wide
22122  character is not more than maxsize, the wcsftime function returns the number of
22123  wide characters placed into the array pointed to by s not including the terminating null
22124  wide character. Otherwise, zero is returned and the contents of the array are
22125  indeterminate.
22126
22127 <h4><a name="7.28.6" href="#7.28.6">7.28.6 Extended multibyte/wide character conversion utilities</a></h4>
22128 <p><!--para 1 -->
22129  The header <a href="#7.28">&lt;wchar.h&gt;</a> declares an extended set of functions useful for conversion
22130  between multibyte characters and wide characters.
22131 <p><!--para 2 -->
22132  Most of the following functions -- those that are listed as ''restartable'', <a href="#7.28.6.3">7.28.6.3</a> and
22133  <a href="#7.28.6.4">7.28.6.4</a> -- take as a last argument a pointer to an object of type mbstate_t that is used
22134  to describe the current conversion state from a particular multibyte character sequence to
22135  a wide character sequence (or the reverse) under the rules of a particular setting for the
22136  LC_CTYPE category of the current locale.
22137 <p><!--para 3 -->
22138  The initial conversion state corresponds, for a conversion in either direction, to the
22139  beginning of a new multibyte character in the initial shift state. A zero-valued
22140  mbstate_t object is (at least) one way to describe an initial conversion state. A zero-
22141  valued mbstate_t object can be used to initiate conversion involving any multibyte
22142  character sequence, in any LC_CTYPE category setting. If an mbstate_t object has
22143  been altered by any of the functions described in this subclause, and is then used with a
22144  different multibyte character sequence, or in the other conversion direction, or with a
22145  different LC_CTYPE category setting than on earlier function calls, the behavior is
22146  undefined.<sup><a href="#note335"><b>335)</b></a></sup>
22147 <p><!--para 4 -->
22148  On entry, each function takes the described conversion state (either internal or pointed to
22149  by an argument) as current. The conversion state described by the referenced object is
22150  altered as needed to track the shift state, and the position within a multibyte character, for
22151  the associated multibyte character sequence.
22152  
22153  
22154  
22155  
22156 <!--page 456 -->
22157
22158 <h6>footnotes</h6>
22159 <p><small><a name="note335" href="#note335">335)</a> Thus, a particular mbstate_t object can be used, for example, with both the mbrtowc and
22160  mbsrtowcs functions as long as they are used to step sequentially through the same multibyte
22161  character string.
22162 </small>
22163
22164 <h5><a name="7.28.6.1" href="#7.28.6.1">7.28.6.1 Single-byte/wide character conversion functions</a></h5>
22165
22166 <h5><a name="7.28.6.1.1" href="#7.28.6.1.1">7.28.6.1.1 The btowc function</a></h5>
22167 <h6>Synopsis</h6>
22168 <p><!--para 1 -->
22169 <pre>
22170         #include <a href="#7.28">&lt;wchar.h&gt;</a>                                                                        *
22171         wint_t btowc(int c);
22172 </pre>
22173 <h6>Description</h6>
22174 <p><!--para 2 -->
22175  The btowc function determines whether c constitutes a valid single-byte character in the
22176  initial shift state.
22177 <h6>Returns</h6>
22178 <p><!--para 3 -->
22179  The btowc function returns WEOF if c has the value EOF or if (unsigned char)c
22180  does not constitute a valid single-byte character in the initial shift state. Otherwise, it
22181  returns the wide character representation of that character.
22182
22183 <h5><a name="7.28.6.1.2" href="#7.28.6.1.2">7.28.6.1.2 The wctob function</a></h5>
22184 <h6>Synopsis</h6>
22185 <p><!--para 1 -->
22186 <pre>
22187         #include <a href="#7.28">&lt;wchar.h&gt;</a>                                                                        *
22188         int wctob(wint_t c);
22189 </pre>
22190 <h6>Description</h6>
22191 <p><!--para 2 -->
22192  The wctob function determines whether c corresponds to a member of the extended
22193  character set whose multibyte character representation is a single byte when in the initial
22194  shift state.
22195 <h6>Returns</h6>
22196 <p><!--para 3 -->
22197  The wctob function returns EOF if c does not correspond to a multibyte character with
22198  length one in the initial shift state. Otherwise, it returns the single-byte representation of
22199  that character as an unsigned char converted to an int.
22200
22201 <h5><a name="7.28.6.2" href="#7.28.6.2">7.28.6.2 Conversion state functions</a></h5>
22202
22203 <h5><a name="7.28.6.2.1" href="#7.28.6.2.1">7.28.6.2.1 The mbsinit function</a></h5>
22204 <h6>Synopsis</h6>
22205 <p><!--para 1 -->
22206 <pre>
22207         #include <a href="#7.28">&lt;wchar.h&gt;</a>
22208         int mbsinit(const mbstate_t *ps);
22209 </pre>
22210 <h6>Description</h6>
22211 <p><!--para 2 -->
22212  If ps is not a null pointer, the mbsinit function determines whether the referenced
22213  mbstate_t object describes an initial conversion state.
22214 <!--page 457 -->
22215 <h6>Returns</h6>
22216 <p><!--para 3 -->
22217  The mbsinit function returns nonzero if ps is a null pointer or if the referenced object
22218  describes an initial conversion state; otherwise, it returns zero.
22219
22220 <h5><a name="7.28.6.3" href="#7.28.6.3">7.28.6.3 Restartable multibyte/wide character conversion functions</a></h5>
22221 <p><!--para 1 -->
22222  These functions differ from the corresponding multibyte character functions of <a href="#7.22.7">7.22.7</a>
22223  (mblen, mbtowc, and wctomb) in that they have an extra parameter, ps, of type
22224  pointer to mbstate_t that points to an object that can completely describe the current
22225  conversion state of the associated multibyte character sequence. If ps is a null pointer,
22226  each function uses its own internal mbstate_t object instead, which is initialized at
22227  program startup to the initial conversion state; the functions are not required to avoid data
22228  races in this case. The implementation behaves as if no library function calls these
22229  functions with a null pointer for ps.
22230 <p><!--para 2 -->
22231  Also unlike their corresponding functions, the return value does not represent whether the
22232  encoding is state-dependent.
22233
22234 <h5><a name="7.28.6.3.1" href="#7.28.6.3.1">7.28.6.3.1 The mbrlen function</a></h5>
22235 <h6>Synopsis</h6>
22236 <p><!--para 1 -->
22237 <pre>
22238          #include <a href="#7.28">&lt;wchar.h&gt;</a>
22239          size_t mbrlen(const char * restrict s,
22240               size_t n,
22241               mbstate_t * restrict ps);
22242 </pre>
22243 <h6>Description</h6>
22244 <p><!--para 2 -->
22245  The mbrlen function is equivalent to the call:
22246 <pre>
22247          mbrtowc(NULL, s, n, ps != NULL ? ps : &amp;internal)
22248 </pre>
22249  where internal is the mbstate_t object for the mbrlen function, except that the
22250  expression designated by ps is evaluated only once.
22251 <h6>Returns</h6>
22252 <p><!--para 3 -->
22253  The mbrlen function returns a value between zero and n, inclusive, (size_t)(-2),
22254  or (size_t)(-1).
22255 <p><b> Forward references</b>: the mbrtowc function (<a href="#7.28.6.3.2">7.28.6.3.2</a>).
22256 <!--page 458 -->
22257
22258 <h5><a name="7.28.6.3.2" href="#7.28.6.3.2">7.28.6.3.2 The mbrtowc function</a></h5>
22259 <h6>Synopsis</h6>
22260 <p><!--para 1 -->
22261 <pre>
22262          #include <a href="#7.28">&lt;wchar.h&gt;</a>
22263          size_t mbrtowc(wchar_t * restrict pwc,
22264               const char * restrict s,
22265               size_t n,
22266               mbstate_t * restrict ps);
22267 </pre>
22268 <h6>Description</h6>
22269 <p><!--para 2 -->
22270  If s is a null pointer, the mbrtowc function is equivalent to the call:
22271 <pre>
22272                  mbrtowc(NULL, "", 1, ps)
22273 </pre>
22274  In this case, the values of the parameters pwc and n are ignored.
22275 <p><!--para 3 -->
22276  If s is not a null pointer, the mbrtowc function inspects at most n bytes beginning with
22277  the byte pointed to by s to determine the number of bytes needed to complete the next
22278  multibyte character (including any shift sequences). If the function determines that the
22279  next multibyte character is complete and valid, it determines the value of the
22280  corresponding wide character and then, if pwc is not a null pointer, stores that value in
22281  the object pointed to by pwc. If the corresponding wide character is the null wide
22282  character, the resulting state described is the initial conversion state.
22283 <h6>Returns</h6>
22284 <p><!--para 4 -->
22285  The mbrtowc function returns the first of the following that applies (given the current
22286  conversion state):
22287  0                     if the next n or fewer bytes complete the multibyte character that
22288 <pre>
22289                        corresponds to the null wide character (which is the value stored).
22290 </pre>
22291  between 1 and n inclusive if the next n or fewer bytes complete a valid multibyte
22292 <pre>
22293                     character (which is the value stored); the value returned is the number
22294                     of bytes that complete the multibyte character.
22295 </pre>
22296  (size_t)(-2) if the next n bytes contribute to an incomplete (but potentially valid)
22297 <pre>
22298               multibyte character, and all n bytes have been processed (no value is
22299               stored).<sup><a href="#note336"><b>336)</b></a></sup>
22300 </pre>
22301  (size_t)(-1) if an encoding error occurs, in which case the next n or fewer bytes
22302 <pre>
22303               do not contribute to a complete and valid multibyte character (no
22304               value is stored); the value of the macro EILSEQ is stored in errno,
22305               and the conversion state is unspecified.
22306 </pre>
22307  
22308 <!--page 459 -->
22309
22310 <h6>footnotes</h6>
22311 <p><small><a name="note336" href="#note336">336)</a> When n has at least the value of the MB_CUR_MAX macro, this case can only occur if s points at a
22312  sequence of redundant shift sequences (for implementations with state-dependent encodings).
22313 </small>
22314
22315 <h5><a name="7.28.6.3.3" href="#7.28.6.3.3">7.28.6.3.3 The wcrtomb function</a></h5>
22316 <h6>Synopsis</h6>
22317 <p><!--para 1 -->
22318 <pre>
22319          #include <a href="#7.28">&lt;wchar.h&gt;</a>
22320          size_t wcrtomb(char * restrict s,
22321               wchar_t wc,
22322               mbstate_t * restrict ps);
22323 </pre>
22324 <h6>Description</h6>
22325 <p><!--para 2 -->
22326  If s is a null pointer, the wcrtomb function is equivalent to the call
22327 <pre>
22328                  wcrtomb(buf, L'\0', ps)
22329 </pre>
22330  where buf is an internal buffer.
22331 <p><!--para 3 -->
22332  If s is not a null pointer, the wcrtomb function determines the number of bytes needed
22333  to represent the multibyte character that corresponds to the wide character given by wc
22334  (including any shift sequences), and stores the multibyte character representation in the
22335  array whose first element is pointed to by s. At most MB_CUR_MAX bytes are stored. If
22336  wc is a null wide character, a null byte is stored, preceded by any shift sequence needed
22337  to restore the initial shift state; the resulting state described is the initial conversion state.
22338 <h6>Returns</h6>
22339 <p><!--para 4 -->
22340  The wcrtomb function returns the number of bytes stored in the array object (including
22341  any shift sequences). When wc is not a valid wide character, an encoding error occurs:
22342  the function stores the value of the macro EILSEQ in errno and returns
22343  (size_t)(-1); the conversion state is unspecified.
22344
22345 <h5><a name="7.28.6.4" href="#7.28.6.4">7.28.6.4 Restartable multibyte/wide string conversion functions</a></h5>
22346 <p><!--para 1 -->
22347  These functions differ from the corresponding multibyte string functions of <a href="#7.22.8">7.22.8</a>
22348  (mbstowcs and wcstombs) in that they have an extra parameter, ps, of type pointer to
22349  mbstate_t that points to an object that can completely describe the current conversion
22350  state of the associated multibyte character sequence. If ps is a null pointer, each function
22351  uses its own internal mbstate_t object instead, which is initialized at program startup
22352  to the initial conversion state; the functions are not required to avoid data races in this
22353  case. The implementation behaves as if no library function calls these functions with a
22354  null pointer for ps.
22355 <p><!--para 2 -->
22356  Also unlike their corresponding functions, the conversion source parameter, src, has a
22357  pointer-to-pointer type. When the function is storing the results of conversions (that is,
22358  when dst is not a null pointer), the pointer object pointed to by this parameter is updated
22359  to reflect the amount of the source processed by that invocation.
22360 <!--page 460 -->
22361
22362 <h5><a name="7.28.6.4.1" href="#7.28.6.4.1">7.28.6.4.1 The mbsrtowcs function</a></h5>
22363 <h6>Synopsis</h6>
22364 <p><!--para 1 -->
22365 <pre>
22366           #include <a href="#7.28">&lt;wchar.h&gt;</a>
22367           size_t mbsrtowcs(wchar_t * restrict dst,
22368                const char ** restrict src,
22369                size_t len,
22370                mbstate_t * restrict ps);
22371 </pre>
22372 <h6>Description</h6>
22373 <p><!--para 2 -->
22374  The mbsrtowcs function converts a sequence of multibyte characters that begins in the
22375  conversion state described by the object pointed to by ps, from the array indirectly
22376  pointed to by src into a sequence of corresponding wide characters. If dst is not a null
22377  pointer, the converted characters are stored into the array pointed to by dst. Conversion
22378  continues up to and including a terminating null character, which is also stored.
22379  Conversion stops earlier in two cases: when a sequence of bytes is encountered that does
22380  not form a valid multibyte character, or (if dst is not a null pointer) when len wide
22381  characters have been stored into the array pointed to by dst.<sup><a href="#note337"><b>337)</b></a></sup> Each conversion takes
22382  place as if by a call to the mbrtowc function.
22383 <p><!--para 3 -->
22384  If dst is not a null pointer, the pointer object pointed to by src is assigned either a null
22385  pointer (if conversion stopped due to reaching a terminating null character) or the address
22386  just past the last multibyte character converted (if any). If conversion stopped due to
22387  reaching a terminating null character and if dst is not a null pointer, the resulting state
22388  described is the initial conversion state.
22389 <h6>Returns</h6>
22390 <p><!--para 4 -->
22391  If the input conversion encounters a sequence of bytes that do not form a valid multibyte
22392  character, an encoding error occurs: the mbsrtowcs function stores the value of the
22393  macro EILSEQ in errno and returns (size_t)(-1); the conversion state is
22394  unspecified. Otherwise, it returns the number of multibyte characters successfully
22395  converted, not including the terminating null character (if any).
22396  
22397  
22398  
22399  
22400 <!--page 461 -->
22401
22402 <h6>footnotes</h6>
22403 <p><small><a name="note337" href="#note337">337)</a> Thus, the value of len is ignored if dst is a null pointer.
22404 </small>
22405
22406 <h5><a name="7.28.6.4.2" href="#7.28.6.4.2">7.28.6.4.2 The wcsrtombs function</a></h5>
22407 <h6>Synopsis</h6>
22408 <p><!--para 1 -->
22409 <pre>
22410          #include <a href="#7.28">&lt;wchar.h&gt;</a>
22411          size_t wcsrtombs(char * restrict dst,
22412               const wchar_t ** restrict src,
22413               size_t len,
22414               mbstate_t * restrict ps);
22415 </pre>
22416 <h6>Description</h6>
22417 <p><!--para 2 -->
22418  The wcsrtombs function converts a sequence of wide characters from the array
22419  indirectly pointed to by src into a sequence of corresponding multibyte characters that
22420  begins in the conversion state described by the object pointed to by ps. If dst is not a
22421  null pointer, the converted characters are then stored into the array pointed to by dst.
22422  Conversion continues up to and including a terminating null wide character, which is also
22423  stored. Conversion stops earlier in two cases: when a wide character is reached that does
22424  not correspond to a valid multibyte character, or (if dst is not a null pointer) when the
22425  next multibyte character would exceed the limit of len total bytes to be stored into the
22426  array pointed to by dst. Each conversion takes place as if by a call to the wcrtomb
22427  function.<sup><a href="#note338"><b>338)</b></a></sup>
22428 <p><!--para 3 -->
22429  If dst is not a null pointer, the pointer object pointed to by src is assigned either a null
22430  pointer (if conversion stopped due to reaching a terminating null wide character) or the
22431  address just past the last wide character converted (if any). If conversion stopped due to
22432  reaching a terminating null wide character, the resulting state described is the initial
22433  conversion state.
22434 <h6>Returns</h6>
22435 <p><!--para 4 -->
22436  If conversion stops because a wide character is reached that does not correspond to a
22437  valid multibyte character, an encoding error occurs: the wcsrtombs function stores the
22438  value of the macro EILSEQ in errno and returns (size_t)(-1); the conversion
22439  state is unspecified. Otherwise, it returns the number of bytes in the resulting multibyte
22440  character sequence, not including the terminating null character (if any).
22441  
22442  
22443  
22444  
22445 <!--page 462 -->
22446
22447 <h6>footnotes</h6>
22448 <p><small><a name="note338" href="#note338">338)</a> If conversion stops because a terminating null wide character has been reached, the bytes stored
22449  include those necessary to reach the initial shift state immediately before the null byte.
22450 </small>
22451
22452 <h3><a name="7.29" href="#7.29">7.29 Wide character classification and mapping utilities <wctype.h></a></h3>
22453
22454 <h4><a name="7.29.1" href="#7.29.1">7.29.1 Introduction</a></h4>
22455 <p><!--para 1 -->
22456  The header <a href="#7.29">&lt;wctype.h&gt;</a> defines one macro, and declares three data types and many
22457  functions.<sup><a href="#note339"><b>339)</b></a></sup>
22458 <p><!--para 2 -->
22459  The types declared are
22460 <pre>
22461           wint_t
22462 </pre>
22463  described in <a href="#7.28.1">7.28.1</a>;
22464 <pre>
22465           wctrans_t
22466 </pre>
22467  which is a scalar type that can hold values which represent locale-specific character
22468  mappings; and
22469 <pre>
22470           wctype_t
22471 </pre>
22472  which is a scalar type that can hold values which represent locale-specific character
22473  classifications.
22474 <p><!--para 3 -->
22475  The macro defined is WEOF (described in <a href="#7.28.1">7.28.1</a>).
22476 <p><!--para 4 -->
22477  The functions declared are grouped as follows:
22478 <ul>
22479 <li>  Functions that provide wide character classification;
22480 <li>  Extensible functions that provide wide character classification;
22481 <li>  Functions that provide wide character case mapping;
22482 <li>  Extensible functions that provide wide character mapping.
22483 </ul>
22484 <p><!--para 5 -->
22485  For all functions described in this subclause that accept an argument of type wint_t, the
22486  value shall be representable as a wchar_t or shall equal the value of the macro WEOF. If
22487  this argument has any other value, the behavior is undefined.
22488 <p><!--para 6 -->
22489  The behavior of these functions is affected by the LC_CTYPE category of the current
22490  locale.
22491  
22492  
22493  
22494  
22495 <!--page 463 -->
22496
22497 <h6>footnotes</h6>
22498 <p><small><a name="note339" href="#note339">339)</a> See ''future library directions'' (<a href="#7.30.13">7.30.13</a>).
22499 </small>
22500
22501 <h4><a name="7.29.2" href="#7.29.2">7.29.2 Wide character classification utilities</a></h4>
22502 <p><!--para 1 -->
22503  The header <a href="#7.29">&lt;wctype.h&gt;</a> declares several functions useful for classifying wide
22504  characters.
22505 <p><!--para 2 -->
22506  The term printing wide character refers to a member of a locale-specific set of wide
22507  characters, each of which occupies at least one printing position on a display device. The
22508  term control wide character refers to a member of a locale-specific set of wide characters
22509  that are not printing wide characters.
22510
22511 <h5><a name="7.29.2.1" href="#7.29.2.1">7.29.2.1 Wide character classification functions</a></h5>
22512 <p><!--para 1 -->
22513  The functions in this subclause return nonzero (true) if and only if the value of the
22514  argument wc conforms to that in the description of the function.
22515 <p><!--para 2 -->
22516  Each of the following functions returns true for each wide character that corresponds (as
22517  if by a call to the wctob function) to a single-byte character for which the corresponding
22518  character classification function from <a href="#7.4.1">7.4.1</a> returns true, except that the iswgraph and
22519  iswpunct functions may differ with respect to wide characters other than L' ' that are
22520  both printing and white-space wide characters.<sup><a href="#note340"><b>340)</b></a></sup>
22521 <p><b> Forward references</b>: the wctob function (<a href="#7.28.6.1.2">7.28.6.1.2</a>).
22522
22523 <h6>footnotes</h6>
22524 <p><small><a name="note340" href="#note340">340)</a> For example, if the expression isalpha(wctob(wc)) evaluates to true, then the call
22525  iswalpha(wc) also returns true. But, if the expression isgraph(wctob(wc)) evaluates to true
22526  (which cannot occur for wc == L' ' of course), then either iswgraph(wc) or iswprint(wc)
22527  &amp;&amp; iswspace(wc) is true, but not both.
22528 </small>
22529
22530 <h5><a name="7.29.2.1.1" href="#7.29.2.1.1">7.29.2.1.1 The iswalnum function</a></h5>
22531 <h6>Synopsis</h6>
22532 <p><!--para 1 -->
22533 <pre>
22534          #include <a href="#7.29">&lt;wctype.h&gt;</a>
22535          int iswalnum(wint_t wc);
22536 </pre>
22537 <h6>Description</h6>
22538 <p><!--para 2 -->
22539  The iswalnum function tests for any wide character for which iswalpha or
22540  iswdigit is true.
22541
22542 <h5><a name="7.29.2.1.2" href="#7.29.2.1.2">7.29.2.1.2 The iswalpha function</a></h5>
22543 <h6>Synopsis</h6>
22544 <p><!--para 1 -->
22545 <pre>
22546          #include <a href="#7.29">&lt;wctype.h&gt;</a>
22547          int iswalpha(wint_t wc);
22548 </pre>
22549 <h6>Description</h6>
22550 <p><!--para 2 -->
22551  The iswalpha function tests for any wide character for which iswupper or
22552  iswlower is true, or any wide character that is one of a locale-specific set of alphabetic
22553  
22554 <!--page 464 -->
22555  wide characters for which none of iswcntrl, iswdigit, iswpunct, or iswspace
22556  is true.<sup><a href="#note341"><b>341)</b></a></sup>
22557
22558 <h6>footnotes</h6>
22559 <p><small><a name="note341" href="#note341">341)</a> The functions iswlower and iswupper test true or false separately for each of these additional
22560  wide characters; all four combinations are possible.
22561 </small>
22562
22563 <h5><a name="7.29.2.1.3" href="#7.29.2.1.3">7.29.2.1.3 The iswblank function</a></h5>
22564 <h6>Synopsis</h6>
22565 <p><!--para 1 -->
22566 <pre>
22567          #include <a href="#7.29">&lt;wctype.h&gt;</a>
22568          int iswblank(wint_t wc);
22569 </pre>
22570 <h6>Description</h6>
22571 <p><!--para 2 -->
22572  The iswblank function tests for any wide character that is a standard blank wide
22573  character or is one of a locale-specific set of wide characters for which iswspace is true
22574  and that is used to separate words within a line of text. The standard blank wide
22575  characters are the following: space (L' '), and horizontal tab (L'\t'). In the "C"
22576  locale, iswblank returns true only for the standard blank characters.
22577
22578 <h5><a name="7.29.2.1.4" href="#7.29.2.1.4">7.29.2.1.4 The iswcntrl function</a></h5>
22579 <h6>Synopsis</h6>
22580 <p><!--para 1 -->
22581 <pre>
22582          #include <a href="#7.29">&lt;wctype.h&gt;</a>
22583          int iswcntrl(wint_t wc);
22584 </pre>
22585 <h6>Description</h6>
22586 <p><!--para 2 -->
22587  The iswcntrl function tests for any control wide character.
22588
22589 <h5><a name="7.29.2.1.5" href="#7.29.2.1.5">7.29.2.1.5 The iswdigit function</a></h5>
22590 <h6>Synopsis</h6>
22591 <p><!--para 1 -->
22592 <pre>
22593          #include <a href="#7.29">&lt;wctype.h&gt;</a>
22594          int iswdigit(wint_t wc);
22595 </pre>
22596 <h6>Description</h6>
22597 <p><!--para 2 -->
22598  The iswdigit function tests for any wide character that corresponds to a decimal-digit
22599  character (as defined in <a href="#5.2.1">5.2.1</a>).
22600
22601 <h5><a name="7.29.2.1.6" href="#7.29.2.1.6">7.29.2.1.6 The iswgraph function</a></h5>
22602 <h6>Synopsis</h6>
22603 <p><!--para 1 -->
22604 <pre>
22605          #include <a href="#7.29">&lt;wctype.h&gt;</a>
22606          int iswgraph(wint_t wc);
22607 </pre>
22608  
22609  
22610  
22611  
22612 <!--page 465 -->
22613 <h6>Description</h6>
22614 <p><!--para 2 -->
22615  The iswgraph function tests for any wide character for which iswprint is true and
22616  iswspace is false.<sup><a href="#note342"><b>342)</b></a></sup>
22617
22618 <h6>footnotes</h6>
22619 <p><small><a name="note342" href="#note342">342)</a> Note that the behavior of the iswgraph and iswpunct functions may differ from their
22620  corresponding functions in <a href="#7.4.1">7.4.1</a> with respect to printing, white-space, single-byte execution
22621  characters other than ' '.
22622 </small>
22623
22624 <h5><a name="7.29.2.1.7" href="#7.29.2.1.7">7.29.2.1.7 The iswlower function</a></h5>
22625 <h6>Synopsis</h6>
22626 <p><!--para 1 -->
22627 <pre>
22628          #include <a href="#7.29">&lt;wctype.h&gt;</a>
22629          int iswlower(wint_t wc);
22630 </pre>
22631 <h6>Description</h6>
22632 <p><!--para 2 -->
22633  The iswlower function tests for any wide character that corresponds to a lowercase
22634  letter or is one of a locale-specific set of wide characters for which none of iswcntrl,
22635  iswdigit, iswpunct, or iswspace is true.
22636
22637 <h5><a name="7.29.2.1.8" href="#7.29.2.1.8">7.29.2.1.8 The iswprint function</a></h5>
22638 <h6>Synopsis</h6>
22639 <p><!--para 1 -->
22640 <pre>
22641          #include <a href="#7.29">&lt;wctype.h&gt;</a>
22642          int iswprint(wint_t wc);
22643 </pre>
22644 <h6>Description</h6>
22645 <p><!--para 2 -->
22646  The iswprint function tests for any printing wide character.
22647
22648 <h5><a name="7.29.2.1.9" href="#7.29.2.1.9">7.29.2.1.9 The iswpunct function</a></h5>
22649 <h6>Synopsis</h6>
22650 <p><!--para 1 -->
22651 <pre>
22652          #include <a href="#7.29">&lt;wctype.h&gt;</a>
22653          int iswpunct(wint_t wc);
22654 </pre>
22655 <h6>Description</h6>
22656 <p><!--para 2 -->
22657  The iswpunct function tests for any printing wide character that is one of a locale-
22658  specific set of punctuation wide characters for which neither iswspace nor iswalnum
22659  is true.<sup><a href="#note342"><b>342)</b></a></sup>
22660
22661 <h5><a name="7.29.2.1.10" href="#7.29.2.1.10">7.29.2.1.10 The iswspace function</a></h5>
22662 <h6>Synopsis</h6>
22663 <p><!--para 1 -->
22664 <pre>
22665          #include <a href="#7.29">&lt;wctype.h&gt;</a>
22666          int iswspace(wint_t wc);
22667 </pre>
22668  
22669  
22670  
22671 <!--page 466 -->
22672 <h6>Description</h6>
22673 <p><!--para 2 -->
22674  The iswspace function tests for any wide character that corresponds to a locale-specific
22675  set of white-space wide characters for which none of iswalnum, iswgraph, or
22676  iswpunct is true.
22677
22678 <h5><a name="7.29.2.1.11" href="#7.29.2.1.11">7.29.2.1.11 The iswupper function</a></h5>
22679 <h6>Synopsis</h6>
22680 <p><!--para 1 -->
22681 <pre>
22682         #include <a href="#7.29">&lt;wctype.h&gt;</a>
22683         int iswupper(wint_t wc);
22684 </pre>
22685 <h6>Description</h6>
22686 <p><!--para 2 -->
22687  The iswupper function tests for any wide character that corresponds to an uppercase
22688  letter or is one of a locale-specific set of wide characters for which none of iswcntrl,
22689  iswdigit, iswpunct, or iswspace is true.
22690
22691 <h5><a name="7.29.2.1.12" href="#7.29.2.1.12">7.29.2.1.12 The iswxdigit function</a></h5>
22692 <h6>Synopsis</h6>
22693 <p><!--para 1 -->
22694 <pre>
22695         #include <a href="#7.29">&lt;wctype.h&gt;</a>
22696         int iswxdigit(wint_t wc);
22697 </pre>
22698 <h6>Description</h6>
22699 <p><!--para 2 -->
22700  The iswxdigit function tests for any wide character that corresponds to a
22701  hexadecimal-digit character (as defined in <a href="#6.4.4.1">6.4.4.1</a>).
22702
22703 <h5><a name="7.29.2.2" href="#7.29.2.2">7.29.2.2 Extensible wide character classification functions</a></h5>
22704 <p><!--para 1 -->
22705  The functions wctype and iswctype provide extensible wide character classification
22706  as well as testing equivalent to that performed by the functions described in the previous
22707  subclause (<a href="#7.29.2.1">7.29.2.1</a>).
22708
22709 <h5><a name="7.29.2.2.1" href="#7.29.2.2.1">7.29.2.2.1 The iswctype function</a></h5>
22710 <h6>Synopsis</h6>
22711 <p><!--para 1 -->
22712 <pre>
22713         #include <a href="#7.29">&lt;wctype.h&gt;</a>
22714         int iswctype(wint_t wc, wctype_t desc);
22715 </pre>
22716 <h6>Description</h6>
22717 <p><!--para 2 -->
22718  The iswctype function determines whether the wide character wc has the property
22719  described by desc. The current setting of the LC_CTYPE category shall be the same as
22720  during the call to wctype that returned the value desc.
22721 <p><!--para 3 -->
22722  Each of the following expressions has a truth-value equivalent to the call to the wide
22723  character classification function (<a href="#7.29.2.1">7.29.2.1</a>) in the comment that follows the expression:
22724 <!--page 467 -->
22725 <pre>
22726          iswctype(wc,      wctype("alnum"))              //   iswalnum(wc)
22727          iswctype(wc,      wctype("alpha"))              //   iswalpha(wc)
22728          iswctype(wc,      wctype("blank"))              //   iswblank(wc)
22729          iswctype(wc,      wctype("cntrl"))              //   iswcntrl(wc)
22730          iswctype(wc,      wctype("digit"))              //   iswdigit(wc)
22731          iswctype(wc,      wctype("graph"))              //   iswgraph(wc)
22732          iswctype(wc,      wctype("lower"))              //   iswlower(wc)
22733          iswctype(wc,      wctype("print"))              //   iswprint(wc)
22734          iswctype(wc,      wctype("punct"))              //   iswpunct(wc)
22735          iswctype(wc,      wctype("space"))              //   iswspace(wc)
22736          iswctype(wc,      wctype("upper"))              //   iswupper(wc)
22737          iswctype(wc,      wctype("xdigit"))             //   iswxdigit(wc)
22738 </pre>
22739 <h6>Returns</h6>
22740 <p><!--para 4 -->
22741  The iswctype function returns nonzero (true) if and only if the value of the wide
22742  character wc has the property described by desc. If desc is zero, the iswctype
22743  function returns zero (false).
22744 <p><b> Forward references</b>: the wctype function (<a href="#7.29.2.2.2">7.29.2.2.2</a>).
22745
22746 <h5><a name="7.29.2.2.2" href="#7.29.2.2.2">7.29.2.2.2 The wctype function</a></h5>
22747 <h6>Synopsis</h6>
22748 <p><!--para 1 -->
22749 <pre>
22750          #include <a href="#7.29">&lt;wctype.h&gt;</a>
22751          wctype_t wctype(const char *property);
22752 </pre>
22753 <h6>Description</h6>
22754 <p><!--para 2 -->
22755  The wctype function constructs a value with type wctype_t that describes a class of
22756  wide characters identified by the string argument property.
22757 <p><!--para 3 -->
22758  The strings listed in the description of the iswctype function shall be valid in all
22759  locales as property arguments to the wctype function.
22760 <h6>Returns</h6>
22761 <p><!--para 4 -->
22762  If property identifies a valid class of wide characters according to the LC_CTYPE
22763  category of the current locale, the wctype function returns a nonzero value that is valid
22764  as the second argument to the iswctype function; otherwise, it returns zero.
22765 <!--page 468 -->
22766
22767 <h4><a name="7.29.3" href="#7.29.3">7.29.3 Wide character case mapping utilities</a></h4>
22768 <p><!--para 1 -->
22769  The header <a href="#7.29">&lt;wctype.h&gt;</a> declares several functions useful for mapping wide characters.
22770
22771 <h5><a name="7.29.3.1" href="#7.29.3.1">7.29.3.1 Wide character case mapping functions</a></h5>
22772
22773 <h5><a name="7.29.3.1.1" href="#7.29.3.1.1">7.29.3.1.1 The towlower function</a></h5>
22774 <h6>Synopsis</h6>
22775 <p><!--para 1 -->
22776 <pre>
22777         #include <a href="#7.29">&lt;wctype.h&gt;</a>
22778         wint_t towlower(wint_t wc);
22779 </pre>
22780 <h6>Description</h6>
22781 <p><!--para 2 -->
22782  The towlower function converts an uppercase letter to a corresponding lowercase letter.
22783 <h6>Returns</h6>
22784 <p><!--para 3 -->
22785  If the argument is a wide character for which iswupper is true and there are one or
22786  more corresponding wide characters, as specified by the current locale, for which
22787  iswlower is true, the towlower function returns one of the corresponding wide
22788  characters (always the same one for any given locale); otherwise, the argument is
22789  returned unchanged.
22790
22791 <h5><a name="7.29.3.1.2" href="#7.29.3.1.2">7.29.3.1.2 The towupper function</a></h5>
22792 <h6>Synopsis</h6>
22793 <p><!--para 1 -->
22794 <pre>
22795         #include <a href="#7.29">&lt;wctype.h&gt;</a>
22796         wint_t towupper(wint_t wc);
22797 </pre>
22798 <h6>Description</h6>
22799 <p><!--para 2 -->
22800  The towupper function converts a lowercase letter to a corresponding uppercase letter.
22801 <h6>Returns</h6>
22802 <p><!--para 3 -->
22803  If the argument is a wide character for which iswlower is true and there are one or
22804  more corresponding wide characters, as specified by the current locale, for which
22805  iswupper is true, the towupper function returns one of the corresponding wide
22806  characters (always the same one for any given locale); otherwise, the argument is
22807  returned unchanged.
22808
22809 <h5><a name="7.29.3.2" href="#7.29.3.2">7.29.3.2 Extensible wide character case mapping functions</a></h5>
22810 <p><!--para 1 -->
22811  The functions wctrans and towctrans provide extensible wide character mapping as
22812  well as case mapping equivalent to that performed by the functions described in the
22813  previous subclause (<a href="#7.29.3.1">7.29.3.1</a>).
22814 <!--page 469 -->
22815
22816 <h5><a name="7.29.3.2.1" href="#7.29.3.2.1">7.29.3.2.1 The towctrans function</a></h5>
22817 <h6>Synopsis</h6>
22818 <p><!--para 1 -->
22819 <pre>
22820          #include <a href="#7.29">&lt;wctype.h&gt;</a>
22821          wint_t towctrans(wint_t wc, wctrans_t desc);
22822 </pre>
22823 <h6>Description</h6>
22824 <p><!--para 2 -->
22825  The towctrans function maps the wide character wc using the mapping described by
22826  desc. The current setting of the LC_CTYPE category shall be the same as during the call
22827  to wctrans that returned the value desc.
22828 <p><!--para 3 -->
22829  Each of the following expressions behaves the same as the call to the wide character case
22830  mapping function (<a href="#7.29.3.1">7.29.3.1</a>) in the comment that follows the expression:
22831 <pre>
22832          towctrans(wc, wctrans("tolower"))                     // towlower(wc)
22833          towctrans(wc, wctrans("toupper"))                     // towupper(wc)
22834 </pre>
22835 <h6>Returns</h6>
22836 <p><!--para 4 -->
22837  The towctrans function returns the mapped value of wc using the mapping described
22838  by desc. If desc is zero, the towctrans function returns the value of wc.
22839
22840 <h5><a name="7.29.3.2.2" href="#7.29.3.2.2">7.29.3.2.2 The wctrans function</a></h5>
22841 <h6>Synopsis</h6>
22842 <p><!--para 1 -->
22843 <pre>
22844          #include <a href="#7.29">&lt;wctype.h&gt;</a>
22845          wctrans_t wctrans(const char *property);
22846 </pre>
22847 <h6>Description</h6>
22848 <p><!--para 2 -->
22849  The wctrans function constructs a value with type wctrans_t that describes a
22850  mapping between wide characters identified by the string argument property.
22851 <p><!--para 3 -->
22852  The strings listed in the description of the towctrans function shall be valid in all
22853  locales as property arguments to the wctrans function.
22854 <h6>Returns</h6>
22855 <p><!--para 4 -->
22856  If property identifies a valid mapping of wide characters according to the LC_CTYPE
22857  category of the current locale, the wctrans function returns a nonzero value that is valid
22858  as the second argument to the towctrans function; otherwise, it returns zero.
22859 <!--page 470 -->
22860
22861 <h3><a name="7.30" href="#7.30">7.30 Future library directions</a></h3>
22862 <p><!--para 1 -->
22863  The following names are grouped under individual headers for convenience. All external
22864  names described below are reserved no matter what headers are included by the program.
22865
22866 <h4><a name="7.30.1" href="#7.30.1">7.30.1 Complex arithmetic <complex.h></a></h4>
22867 <p><!--para 1 -->
22868  The function names
22869 <pre>
22870        cerf               cexpm1              clog2
22871        cerfc              clog10              clgamma
22872        cexp2              clog1p              ctgamma
22873 </pre>
22874  and the same names suffixed with f or l may be added to the declarations in the
22875  <a href="#7.3">&lt;complex.h&gt;</a> header.
22876
22877 <h4><a name="7.30.2" href="#7.30.2">7.30.2 Character handling <ctype.h></a></h4>
22878 <p><!--para 1 -->
22879  Function names that begin with either is or to, and a lowercase letter may be added to
22880  the declarations in the <a href="#7.4">&lt;ctype.h&gt;</a> header.
22881
22882 <h4><a name="7.30.3" href="#7.30.3">7.30.3 Errors <errno.h></a></h4>
22883 <p><!--para 1 -->
22884  Macros that begin with E and a digit or E and an uppercase letter may be added to the
22885  declarations in the <a href="#7.5">&lt;errno.h&gt;</a> header.
22886
22887 <h4><a name="7.30.4" href="#7.30.4">7.30.4 Format conversion of integer types <inttypes.h></a></h4>
22888 <p><!--para 1 -->
22889  Macro names beginning with PRI or SCN followed by any lowercase letter or X may be
22890  added to the macros defined in the <a href="#7.8">&lt;inttypes.h&gt;</a> header.
22891
22892 <h4><a name="7.30.5" href="#7.30.5">7.30.5 Localization <locale.h></a></h4>
22893 <p><!--para 1 -->
22894  Macros that begin with LC_ and an uppercase letter may be added to the definitions in
22895  the <a href="#7.11">&lt;locale.h&gt;</a> header.
22896
22897 <h4><a name="7.30.6" href="#7.30.6">7.30.6 Signal handling <signal.h></a></h4>
22898 <p><!--para 1 -->
22899  Macros that begin with either SIG and an uppercase letter or SIG_ and an uppercase
22900  letter may be added to the definitions in the <a href="#7.14">&lt;signal.h&gt;</a> header.
22901
22902 <h4><a name="7.30.7" href="#7.30.7">7.30.7 Boolean type and values <stdbool.h></a></h4>
22903 <p><!--para 1 -->
22904  The ability to undefine and perhaps then redefine the macros bool, true, and false is
22905  an obsolescent feature.
22906
22907 <h4><a name="7.30.8" href="#7.30.8">7.30.8 Integer types <stdint.h></a></h4>
22908 <p><!--para 1 -->
22909  Typedef names beginning with int or uint and ending with _t may be added to the
22910  types defined in the <a href="#7.20">&lt;stdint.h&gt;</a> header. Macro names beginning with INT or UINT
22911  and ending with _MAX, _MIN, or _C may be added to the macros defined in the
22912  <a href="#7.20">&lt;stdint.h&gt;</a> header.
22913 <!--page 471 -->
22914
22915 <h4><a name="7.30.9" href="#7.30.9">7.30.9 Input/output <stdio.h></a></h4>
22916 <p><!--para 1 -->
22917  Lowercase letters may be added to the conversion specifiers and length modifiers in
22918  fprintf and fscanf. Other characters may be used in extensions.
22919 <p><!--para 2 -->
22920  The use of ungetc on a binary stream where the file position indicator is zero prior to *
22921  the call is an obsolescent feature.
22922
22923 <h4><a name="7.30.10" href="#7.30.10">7.30.10 General utilities <stdlib.h></a></h4>
22924 <p><!--para 1 -->
22925  Function names that begin with str and a lowercase letter may be added to the
22926  declarations in the <a href="#7.22">&lt;stdlib.h&gt;</a> header.
22927
22928 <h4><a name="7.30.11" href="#7.30.11">7.30.11 String handling <string.h></a></h4>
22929 <p><!--para 1 -->
22930  Function names that begin with str, mem, or wcs and a lowercase letter may be added
22931  to the declarations in the <a href="#7.23">&lt;string.h&gt;</a> header.
22932
22933 <h4><a name="7.30.12" href="#7.30.12">7.30.12 Extended multibyte and wide character utilities <wchar.h></a></h4>
22934 <p><!--para 1 -->
22935  Function names that begin with wcs and a lowercase letter may be added to the
22936  declarations in the <a href="#7.28">&lt;wchar.h&gt;</a> header.
22937 <p><!--para 2 -->
22938  Lowercase letters may be added to the conversion specifiers and length modifiers in
22939  fwprintf and fwscanf. Other characters may be used in extensions.
22940
22941 <h4><a name="7.30.13" href="#7.30.13">7.30.13 Wide character classification and mapping utilities</a></h4>
22942  <a href="#7.29">&lt;wctype.h&gt;</a>
22943 <p><!--para 1 -->
22944  Function names that begin with is or to and a lowercase letter may be added to the
22945  declarations in the <a href="#7.29">&lt;wctype.h&gt;</a> header.
22946 <!--page 472 -->
22947
22948 <h2><a name="A" href="#A">Annex A</a></h2>
22949 <pre>
22950                                             (informative)
22951                              Language syntax summary
22952 </pre>
22953 <p><!--para 1 -->
22954  NOTE   The notation is described in <a href="#6.1">6.1</a>.
22955  
22956
22957 <h3><a name="A.1" href="#A.1">A.1 Lexical grammar</a></h3>
22958
22959 <h4><a name="A.1.1" href="#A.1.1">A.1.1 Lexical elements</a></h4>
22960  (<a href="#6.4">6.4</a>) token:
22961 <pre>
22962                 keyword
22963                 identifier
22964                 constant
22965                 string-literal
22966                 punctuator
22967 </pre>
22968  (<a href="#6.4">6.4</a>) preprocessing-token:
22969 <!--page 473 -->
22970 <pre>
22971                header-name
22972                identifier
22973                pp-number
22974                character-constant
22975                string-literal
22976                punctuator
22977                each non-white-space character that cannot be one of the above
22978 </pre>
22979
22980 <h4><a name="A.1.2" href="#A.1.2">A.1.2 Keywords</a></h4>
22981  (<a href="#6.4.1">6.4.1</a>) keyword: one of
22982 <pre>
22983                alignof                     goto                  union
22984                auto                        if                    unsigned
22985                break                       inline                void
22986                case                        int                   volatile
22987                char                        long                  while
22988                const                       register              _Alignas
22989                continue                    restrict              _Atomic
22990                default                     return                _Bool
22991                do                          short                 _Complex
22992                double                      signed                _Generic
22993                else                        sizeof                _Imaginary
22994                enum                        static                _Noreturn
22995                extern                      struct                _Static_assert
22996                float                       switch                _Thread_local
22997                for                         typedef
22998 </pre>
22999
23000 <h4><a name="A.1.3" href="#A.1.3">A.1.3 Identifiers</a></h4>
23001  (<a href="#6.4.2.1">6.4.2.1</a>) identifier:
23002 <pre>
23003                 identifier-nondigit
23004                 identifier identifier-nondigit
23005                 identifier digit
23006 </pre>
23007  (<a href="#6.4.2.1">6.4.2.1</a>) identifier-nondigit:
23008 <pre>
23009                 nondigit
23010                 universal-character-name
23011                 other implementation-defined characters
23012 </pre>
23013  (<a href="#6.4.2.1">6.4.2.1</a>) nondigit: one of
23014 <pre>
23015                _ a b          c    d   e    f   g   h    i   j   k   l   m
23016                     n o       p    q   r    s   t   u    v   w   x   y   z
23017                     A B       C    D   E    F   G   H    I   J   K   L   M
23018                     N O       P    Q   R    S   T   U    V   W   X   Y   Z
23019 </pre>
23020  (<a href="#6.4.2.1">6.4.2.1</a>) digit: one of
23021 <!--page 474 -->
23022 <pre>
23023                 0 1 2         3    4   5    6   7   8    9
23024 </pre>
23025
23026 <h4><a name="A.1.4" href="#A.1.4">A.1.4 Universal character names</a></h4>
23027  (<a href="#6.4.3">6.4.3</a>) universal-character-name:
23028 <pre>
23029                \u hex-quad
23030                \U hex-quad hex-quad
23031 </pre>
23032  (<a href="#6.4.3">6.4.3</a>) hex-quad:
23033 <pre>
23034                hexadecimal-digit hexadecimal-digit
23035                             hexadecimal-digit hexadecimal-digit
23036 </pre>
23037
23038 <h4><a name="A.1.5" href="#A.1.5">A.1.5 Constants</a></h4>
23039  (<a href="#6.4.4">6.4.4</a>) constant:
23040 <pre>
23041                integer-constant
23042                floating-constant
23043                enumeration-constant
23044                character-constant
23045 </pre>
23046  (<a href="#6.4.4.1">6.4.4.1</a>) integer-constant:
23047 <pre>
23048                 decimal-constant integer-suffix<sub>opt</sub>
23049                 octal-constant integer-suffix<sub>opt</sub>
23050                 hexadecimal-constant integer-suffix<sub>opt</sub>
23051 </pre>
23052  (<a href="#6.4.4.1">6.4.4.1</a>) decimal-constant:
23053 <pre>
23054                nonzero-digit
23055                decimal-constant digit
23056 </pre>
23057  (<a href="#6.4.4.1">6.4.4.1</a>) octal-constant:
23058 <pre>
23059                 0
23060                 octal-constant octal-digit
23061 </pre>
23062  (<a href="#6.4.4.1">6.4.4.1</a>) hexadecimal-constant:
23063 <pre>
23064                hexadecimal-prefix hexadecimal-digit
23065                hexadecimal-constant hexadecimal-digit
23066 </pre>
23067  (<a href="#6.4.4.1">6.4.4.1</a>) hexadecimal-prefix: one of
23068 <pre>
23069                0x 0X
23070 </pre>
23071  (<a href="#6.4.4.1">6.4.4.1</a>) nonzero-digit: one of
23072 <pre>
23073                1 2 3 4 5              6      7   8   9
23074 </pre>
23075  (<a href="#6.4.4.1">6.4.4.1</a>) octal-digit: one of
23076 <!--page 475 -->
23077 <pre>
23078                 0 1 2 3           4   5      6   7
23079 </pre>
23080  (<a href="#6.4.4.1">6.4.4.1</a>) hexadecimal-digit: one of
23081 <pre>
23082                0 1 2 3 4 5                6    7    8   9
23083                a b c d e f
23084                A B C D E F
23085 </pre>
23086  (<a href="#6.4.4.1">6.4.4.1</a>) integer-suffix:
23087 <pre>
23088                 unsigned-suffix long-suffix<sub>opt</sub>
23089                 unsigned-suffix long-long-suffix
23090                 long-suffix unsigned-suffix<sub>opt</sub>
23091                 long-long-suffix unsigned-suffix<sub>opt</sub>
23092 </pre>
23093  (<a href="#6.4.4.1">6.4.4.1</a>) unsigned-suffix: one of
23094 <pre>
23095                 u U
23096 </pre>
23097  (<a href="#6.4.4.1">6.4.4.1</a>) long-suffix: one of
23098 <pre>
23099                 l L
23100 </pre>
23101  (<a href="#6.4.4.1">6.4.4.1</a>) long-long-suffix: one of
23102 <pre>
23103                 ll LL
23104 </pre>
23105  (<a href="#6.4.4.2">6.4.4.2</a>) floating-constant:
23106 <pre>
23107                 decimal-floating-constant
23108                 hexadecimal-floating-constant
23109 </pre>
23110  (<a href="#6.4.4.2">6.4.4.2</a>) decimal-floating-constant:
23111 <pre>
23112                fractional-constant exponent-part<sub>opt</sub> floating-suffix<sub>opt</sub>
23113                digit-sequence exponent-part floating-suffix<sub>opt</sub>
23114 </pre>
23115  (<a href="#6.4.4.2">6.4.4.2</a>) hexadecimal-floating-constant:
23116 <pre>
23117                hexadecimal-prefix hexadecimal-fractional-constant
23118                              binary-exponent-part floating-suffix<sub>opt</sub>
23119                hexadecimal-prefix hexadecimal-digit-sequence
23120                              binary-exponent-part floating-suffix<sub>opt</sub>
23121 </pre>
23122  (<a href="#6.4.4.2">6.4.4.2</a>) fractional-constant:
23123 <pre>
23124                 digit-sequence<sub>opt</sub> . digit-sequence
23125                 digit-sequence .
23126 </pre>
23127  (<a href="#6.4.4.2">6.4.4.2</a>) exponent-part:
23128 <pre>
23129                e sign<sub>opt</sub> digit-sequence
23130                E sign<sub>opt</sub> digit-sequence
23131 </pre>
23132  (<a href="#6.4.4.2">6.4.4.2</a>) sign: one of
23133 <!--page 476 -->
23134 <pre>
23135                 + -
23136 </pre>
23137  (<a href="#6.4.4.2">6.4.4.2</a>) digit-sequence:
23138 <pre>
23139                 digit
23140                 digit-sequence digit
23141 </pre>
23142  (<a href="#6.4.4.2">6.4.4.2</a>) hexadecimal-fractional-constant:
23143 <pre>
23144                hexadecimal-digit-sequence<sub>opt</sub> .
23145                               hexadecimal-digit-sequence
23146                hexadecimal-digit-sequence .
23147 </pre>
23148  (<a href="#6.4.4.2">6.4.4.2</a>) binary-exponent-part:
23149 <pre>
23150                 p sign<sub>opt</sub> digit-sequence
23151                 P sign<sub>opt</sub> digit-sequence
23152 </pre>
23153  (<a href="#6.4.4.2">6.4.4.2</a>) hexadecimal-digit-sequence:
23154 <pre>
23155                hexadecimal-digit
23156                hexadecimal-digit-sequence hexadecimal-digit
23157 </pre>
23158  (<a href="#6.4.4.2">6.4.4.2</a>) floating-suffix: one of
23159 <pre>
23160                 f l F L
23161 </pre>
23162  (<a href="#6.4.4.3">6.4.4.3</a>) enumeration-constant:
23163 <pre>
23164                identifier
23165 </pre>
23166  (<a href="#6.4.4.4">6.4.4.4</a>) character-constant:
23167 <pre>
23168                ' c-char-sequence '
23169                L' c-char-sequence '
23170                u' c-char-sequence '
23171                U' c-char-sequence '
23172 </pre>
23173  (<a href="#6.4.4.4">6.4.4.4</a>) c-char-sequence:
23174 <pre>
23175                 c-char
23176                 c-char-sequence c-char
23177 </pre>
23178  (<a href="#6.4.4.4">6.4.4.4</a>) c-char:
23179 <pre>
23180                 any member of the source character set except
23181                              the single-quote ', backslash \, or new-line character
23182                 escape-sequence
23183 </pre>
23184  (<a href="#6.4.4.4">6.4.4.4</a>) escape-sequence:
23185 <!--page 477 -->
23186 <pre>
23187                simple-escape-sequence
23188                octal-escape-sequence
23189                hexadecimal-escape-sequence
23190                universal-character-name
23191 </pre>
23192  (<a href="#6.4.4.4">6.4.4.4</a>) simple-escape-sequence: one of
23193 <pre>
23194                \' \" \? \\
23195                \a \b \f \n \r \t                   \v
23196 </pre>
23197  (<a href="#6.4.4.4">6.4.4.4</a>) octal-escape-sequence:
23198 <pre>
23199                 \ octal-digit
23200                 \ octal-digit octal-digit
23201                 \ octal-digit octal-digit octal-digit
23202 </pre>
23203  (<a href="#6.4.4.4">6.4.4.4</a>) hexadecimal-escape-sequence:
23204 <pre>
23205                \x hexadecimal-digit
23206                hexadecimal-escape-sequence hexadecimal-digit
23207 </pre>
23208
23209 <h4><a name="A.1.6" href="#A.1.6">A.1.6 String literals</a></h4>
23210  (<a href="#6.4.5">6.4.5</a>) string-literal:
23211 <pre>
23212                 encoding-prefix<sub>opt</sub> " s-char-sequence<sub>opt</sub> "
23213 </pre>
23214  (<a href="#6.4.5">6.4.5</a>) encoding-prefix:
23215 <pre>
23216                u8
23217                u
23218                U
23219                L
23220 </pre>
23221  (<a href="#6.4.5">6.4.5</a>) s-char-sequence:
23222 <pre>
23223                 s-char
23224                 s-char-sequence s-char
23225 </pre>
23226  (<a href="#6.4.5">6.4.5</a>) s-char:
23227 <pre>
23228                 any member of the source character set except
23229                              the double-quote ", backslash \, or new-line character
23230                 escape-sequence
23231 </pre>
23232
23233 <h4><a name="A.1.7" href="#A.1.7">A.1.7 Punctuators</a></h4>
23234  (<a href="#6.4.6">6.4.6</a>) punctuator: one of
23235 <!--page 478 -->
23236 <pre>
23237                [ ] ( ) { } . -&gt;
23238                ++ -- &amp; * + - ~ !
23239                / % &lt;&lt; &gt;&gt; &lt; &gt; &lt;= &gt;=                      ==    !=    ^    |   &amp;&amp;   ||
23240                ? : ; ...
23241                = *= /= %= += -= &lt;&lt;=                     &gt;&gt;=    &amp;=       ^=   |=
23242                , # ##
23243                &lt;: :&gt; &lt;% %&gt; %: %:%:
23244 </pre>
23245
23246 <h4><a name="A.1.8" href="#A.1.8">A.1.8 Header names</a></h4>
23247  (<a href="#6.4.7">6.4.7</a>) header-name:
23248 <pre>
23249                &lt; h-char-sequence &gt;
23250                " q-char-sequence "
23251 </pre>
23252  (<a href="#6.4.7">6.4.7</a>) h-char-sequence:
23253 <pre>
23254                h-char
23255                h-char-sequence h-char
23256 </pre>
23257  (<a href="#6.4.7">6.4.7</a>) h-char:
23258 <pre>
23259                any member of the source character set except
23260                             the new-line character and &gt;
23261 </pre>
23262  (<a href="#6.4.7">6.4.7</a>) q-char-sequence:
23263 <pre>
23264                q-char
23265                q-char-sequence q-char
23266 </pre>
23267  (<a href="#6.4.7">6.4.7</a>) q-char:
23268 <pre>
23269                any member of the source character set except
23270                             the new-line character and "
23271 </pre>
23272
23273 <h4><a name="A.1.9" href="#A.1.9">A.1.9 Preprocessing numbers</a></h4>
23274  (<a href="#6.4.8">6.4.8</a>) pp-number:
23275 <!--page 479 -->
23276 <pre>
23277                digit
23278                . digit
23279                pp-number   digit
23280                pp-number   identifier-nondigit
23281                pp-number   e sign
23282                pp-number   E sign
23283                pp-number   p sign
23284                pp-number   P sign
23285                pp-number   .
23286 </pre>
23287
23288 <h3><a name="A.2" href="#A.2">A.2 Phrase structure grammar</a></h3>
23289
23290 <h4><a name="A.2.1" href="#A.2.1">A.2.1 Expressions</a></h4>
23291  (<a href="#6.5.1">6.5.1</a>) primary-expression:
23292 <pre>
23293                identifier
23294                constant
23295                string-literal
23296                ( expression )
23297                generic-selection
23298 </pre>
23299  (<a href="#6.5.1.1">6.5.1.1</a>) generic-selection:
23300 <pre>
23301                _Generic ( assignment-expression , generic-assoc-list )
23302 </pre>
23303  (<a href="#6.5.1.1">6.5.1.1</a>) generic-assoc-list:
23304 <pre>
23305                generic-association
23306                generic-assoc-list , generic-association
23307 </pre>
23308  (<a href="#6.5.1.1">6.5.1.1</a>) generic-association:
23309 <pre>
23310                type-name : assignment-expression
23311                default : assignment-expression
23312 </pre>
23313  (<a href="#6.5.2">6.5.2</a>) postfix-expression:
23314 <pre>
23315                primary-expression
23316                postfix-expression [ expression ]
23317                postfix-expression ( argument-expression-list<sub>opt</sub> )
23318                postfix-expression . identifier
23319                postfix-expression -&gt; identifier
23320                postfix-expression ++
23321                postfix-expression --
23322                ( type-name ) { initializer-list }
23323                ( type-name ) { initializer-list , }
23324 </pre>
23325  (<a href="#6.5.2">6.5.2</a>) argument-expression-list:
23326 <pre>
23327               assignment-expression
23328               argument-expression-list , assignment-expression
23329 </pre>
23330  (<a href="#6.5.3">6.5.3</a>) unary-expression:
23331 <!--page 480 -->
23332 <pre>
23333                postfix-expression
23334                ++ unary-expression
23335                -- unary-expression
23336                unary-operator cast-expression
23337                sizeof unary-expression
23338                sizeof ( type-name )
23339                alignof ( type-name )
23340 </pre>
23341  (<a href="#6.5.3">6.5.3</a>) unary-operator: one of
23342 <pre>
23343                &amp; * + - ~                !
23344 </pre>
23345  (<a href="#6.5.4">6.5.4</a>) cast-expression:
23346 <pre>
23347                 unary-expression
23348                 ( type-name ) cast-expression
23349 </pre>
23350  (<a href="#6.5.5">6.5.5</a>) multiplicative-expression:
23351 <pre>
23352                 cast-expression
23353                 multiplicative-expression * cast-expression
23354                 multiplicative-expression / cast-expression
23355                 multiplicative-expression % cast-expression
23356 </pre>
23357  (<a href="#6.5.6">6.5.6</a>) additive-expression:
23358 <pre>
23359                 multiplicative-expression
23360                 additive-expression + multiplicative-expression
23361                 additive-expression - multiplicative-expression
23362 </pre>
23363  (<a href="#6.5.7">6.5.7</a>) shift-expression:
23364 <pre>
23365                  additive-expression
23366                  shift-expression &lt;&lt; additive-expression
23367                  shift-expression &gt;&gt; additive-expression
23368 </pre>
23369  (<a href="#6.5.8">6.5.8</a>) relational-expression:
23370 <pre>
23371                 shift-expression
23372                 relational-expression   &lt;    shift-expression
23373                 relational-expression   &gt;    shift-expression
23374                 relational-expression   &lt;=   shift-expression
23375                 relational-expression   &gt;=   shift-expression
23376 </pre>
23377  (<a href="#6.5.9">6.5.9</a>) equality-expression:
23378 <pre>
23379                 relational-expression
23380                 equality-expression == relational-expression
23381                 equality-expression != relational-expression
23382 </pre>
23383  (<a href="#6.5.10">6.5.10</a>) AND-expression:
23384 <pre>
23385               equality-expression
23386               AND-expression &amp; equality-expression
23387 </pre>
23388  (<a href="#6.5.11">6.5.11</a>) exclusive-OR-expression:
23389 <!--page 481 -->
23390 <pre>
23391                AND-expression
23392                exclusive-OR-expression ^ AND-expression
23393 </pre>
23394  (<a href="#6.5.12">6.5.12</a>) inclusive-OR-expression:
23395 <pre>
23396                 exclusive-OR-expression
23397                 inclusive-OR-expression | exclusive-OR-expression
23398 </pre>
23399  (<a href="#6.5.13">6.5.13</a>) logical-AND-expression:
23400 <pre>
23401                inclusive-OR-expression
23402                logical-AND-expression &amp;&amp; inclusive-OR-expression
23403 </pre>
23404  (<a href="#6.5.14">6.5.14</a>) logical-OR-expression:
23405 <pre>
23406                logical-AND-expression
23407                logical-OR-expression || logical-AND-expression
23408 </pre>
23409  (<a href="#6.5.15">6.5.15</a>) conditional-expression:
23410 <pre>
23411                logical-OR-expression
23412                logical-OR-expression ? expression : conditional-expression
23413 </pre>
23414  (<a href="#6.5.16">6.5.16</a>) assignment-expression:
23415 <pre>
23416                conditional-expression
23417                unary-expression assignment-operator assignment-expression
23418 </pre>
23419  (<a href="#6.5.16">6.5.16</a>) assignment-operator: one of
23420 <pre>
23421                = *= /= %= +=                -=    &lt;&lt;=    &gt;&gt;=      &amp;=    ^=   |=
23422 </pre>
23423  (<a href="#6.5.17">6.5.17</a>) expression:
23424 <pre>
23425                assignment-expression
23426                expression , assignment-expression
23427 </pre>
23428  (<a href="#6.6">6.6</a>) constant-expression:
23429 <pre>
23430                conditional-expression
23431 </pre>
23432
23433 <h4><a name="A.2.2" href="#A.2.2">A.2.2 Declarations</a></h4>
23434  (<a href="#6.7">6.7</a>) declaration:
23435 <pre>
23436                 declaration-specifiers init-declarator-list<sub>opt</sub> ;
23437                 static_assert-declaration
23438 </pre>
23439  (<a href="#6.7">6.7</a>) declaration-specifiers:
23440 <pre>
23441                 storage-class-specifier declaration-specifiers<sub>opt</sub>
23442                 type-specifier declaration-specifiers<sub>opt</sub>
23443                 type-qualifier declaration-specifiers<sub>opt</sub>
23444                 function-specifier declaration-specifiers<sub>opt</sub>
23445                 alignment-specifier declaration-specifiers<sub>opt</sub>
23446 </pre>
23447  (<a href="#6.7">6.7</a>) init-declarator-list:
23448 <!--page 482 -->
23449 <pre>
23450                 init-declarator
23451                 init-declarator-list , init-declarator
23452 </pre>
23453  (<a href="#6.7">6.7</a>) init-declarator:
23454 <pre>
23455                 declarator
23456                 declarator = initializer
23457 </pre>
23458  (<a href="#6.7.1">6.7.1</a>) storage-class-specifier:
23459 <pre>
23460                typedef
23461                extern
23462                static
23463                _Thread_local
23464                auto
23465                register
23466 </pre>
23467  (<a href="#6.7.2">6.7.2</a>) type-specifier:
23468 <pre>
23469                 void
23470                 char
23471                 short
23472                 int
23473                 long
23474                 float
23475                 double
23476                 signed
23477                 unsigned
23478                 _Bool
23479                 _Complex
23480                 atomic-type-specifier
23481                 struct-or-union-specifier
23482                 enum-specifier
23483                 typedef-name
23484 </pre>
23485  (<a href="#6.7.2.1">6.7.2.1</a>) struct-or-union-specifier:
23486 <pre>
23487                 struct-or-union identifier<sub>opt</sub> { struct-declaration-list }
23488                 struct-or-union identifier
23489 </pre>
23490  (<a href="#6.7.2.1">6.7.2.1</a>) struct-or-union:
23491 <pre>
23492                 struct
23493                 union
23494 </pre>
23495  (<a href="#6.7.2.1">6.7.2.1</a>) struct-declaration-list:
23496 <pre>
23497                 struct-declaration
23498                 struct-declaration-list struct-declaration
23499 </pre>
23500  (<a href="#6.7.2.1">6.7.2.1</a>) struct-declaration:
23501 <!--page 483 -->
23502 <pre>
23503                 specifier-qualifier-list struct-declarator-list<sub>opt</sub> ;
23504                 static_assert-declaration
23505 </pre>
23506  (<a href="#6.7.2.1">6.7.2.1</a>) specifier-qualifier-list:
23507 <pre>
23508                 type-specifier specifier-qualifier-list<sub>opt</sub>
23509                 type-qualifier specifier-qualifier-list<sub>opt</sub>
23510 </pre>
23511  (<a href="#6.7.2.1">6.7.2.1</a>) struct-declarator-list:
23512 <pre>
23513                 struct-declarator
23514                 struct-declarator-list , struct-declarator
23515 </pre>
23516  (<a href="#6.7.2.1">6.7.2.1</a>) struct-declarator:
23517 <pre>
23518                 declarator
23519                 declarator<sub>opt</sub> : constant-expression
23520 </pre>
23521  (<a href="#6.7.2.2">6.7.2.2</a>) enum-specifier:
23522 <pre>
23523                enum identifier<sub>opt</sub> { enumerator-list }
23524                enum identifier<sub>opt</sub> { enumerator-list , }
23525                enum identifier
23526 </pre>
23527  (<a href="#6.7.2.2">6.7.2.2</a>) enumerator-list:
23528 <pre>
23529                enumerator
23530                enumerator-list , enumerator
23531 </pre>
23532  (<a href="#6.7.2.2">6.7.2.2</a>) enumerator:
23533 <pre>
23534                enumeration-constant
23535                enumeration-constant = constant-expression
23536 </pre>
23537  (<a href="#6.7.2.4">6.7.2.4</a>) atomic-type-specifier:
23538 <pre>
23539                _Atomic ( type-name )
23540 </pre>
23541  (<a href="#6.7.3">6.7.3</a>) type-qualifier:
23542 <pre>
23543                const
23544                restrict
23545                volatile
23546                _Atomic
23547 </pre>
23548  (<a href="#6.7.4">6.7.4</a>) function-specifier:
23549 <pre>
23550                 inline
23551                 _Noreturn
23552 </pre>
23553  (<a href="#6.7.5">6.7.5</a>) alignment-specifier:
23554 <pre>
23555                _Alignas ( type-name )
23556                _Alignas ( constant-expression )
23557 </pre>
23558  (<a href="#6.7.6">6.7.6</a>) declarator:
23559 <!--page 484 -->
23560 <pre>
23561                pointer<sub>opt</sub> direct-declarator
23562 </pre>
23563  (<a href="#6.7.6">6.7.6</a>) direct-declarator:
23564 <pre>
23565                 identifier
23566                 ( declarator )
23567                 direct-declarator [ type-qualifier-list<sub>opt</sub> assignment-expression<sub>opt</sub> ]
23568                 direct-declarator [ static type-qualifier-list<sub>opt</sub> assignment-expression ]
23569                 direct-declarator [ type-qualifier-list static assignment-expression ]
23570                 direct-declarator [ type-qualifier-list<sub>opt</sub> * ]
23571                 direct-declarator ( parameter-type-list )
23572                 direct-declarator ( identifier-list<sub>opt</sub> )
23573 </pre>
23574  (<a href="#6.7.6">6.7.6</a>) pointer:
23575 <pre>
23576                 * type-qualifier-list<sub>opt</sub>
23577                 * type-qualifier-list<sub>opt</sub> pointer
23578 </pre>
23579  (<a href="#6.7.6">6.7.6</a>) type-qualifier-list:
23580 <pre>
23581                type-qualifier
23582                type-qualifier-list type-qualifier
23583 </pre>
23584  (<a href="#6.7.6">6.7.6</a>) parameter-type-list:
23585 <pre>
23586               parameter-list
23587               parameter-list , ...
23588 </pre>
23589  (<a href="#6.7.6">6.7.6</a>) parameter-list:
23590 <pre>
23591               parameter-declaration
23592               parameter-list , parameter-declaration
23593 </pre>
23594  (<a href="#6.7.6">6.7.6</a>) parameter-declaration:
23595 <pre>
23596               declaration-specifiers declarator
23597               declaration-specifiers abstract-declarator<sub>opt</sub>
23598 </pre>
23599  (<a href="#6.7.6">6.7.6</a>) identifier-list:
23600 <pre>
23601                 identifier
23602                 identifier-list , identifier
23603 </pre>
23604  (<a href="#6.7.7">6.7.7</a>) type-name:
23605 <pre>
23606                specifier-qualifier-list abstract-declarator<sub>opt</sub>
23607 </pre>
23608  (<a href="#6.7.7">6.7.7</a>) abstract-declarator:
23609 <!--page 485 -->
23610 <pre>
23611                pointer
23612                pointer<sub>opt</sub> direct-abstract-declarator
23613 </pre>
23614  (<a href="#6.7.7">6.7.7</a>) direct-abstract-declarator:
23615 <pre>
23616                 ( abstract-declarator )
23617                 direct-abstract-declarator<sub>opt</sub> [ type-qualifier-list<sub>opt</sub>
23618                                assignment-expression<sub>opt</sub> ]
23619                 direct-abstract-declarator<sub>opt</sub> [ static type-qualifier-list<sub>opt</sub>
23620                                assignment-expression ]
23621                 direct-abstract-declarator<sub>opt</sub> [ type-qualifier-list static
23622                                assignment-expression ]
23623                 direct-abstract-declarator<sub>opt</sub> [ * ]
23624                 direct-abstract-declarator<sub>opt</sub> ( parameter-type-list<sub>opt</sub> )
23625 </pre>
23626  (<a href="#6.7.8">6.7.8</a>) typedef-name:
23627 <pre>
23628                identifier
23629 </pre>
23630  (<a href="#6.7.9">6.7.9</a>) initializer:
23631 <pre>
23632                  assignment-expression
23633                  { initializer-list }
23634                  { initializer-list , }
23635 </pre>
23636  (<a href="#6.7.9">6.7.9</a>) initializer-list:
23637 <pre>
23638                  designation<sub>opt</sub> initializer
23639                  initializer-list , designation<sub>opt</sub> initializer
23640 </pre>
23641  (<a href="#6.7.9">6.7.9</a>) designation:
23642 <pre>
23643                designator-list =
23644 </pre>
23645  (<a href="#6.7.9">6.7.9</a>) designator-list:
23646 <pre>
23647                designator
23648                designator-list designator
23649 </pre>
23650  (<a href="#6.7.9">6.7.9</a>) designator:
23651 <pre>
23652                [ constant-expression ]
23653                . identifier
23654 </pre>
23655  (<a href="#6.7.10">6.7.10</a>) static_assert-declaration:
23656 <!--page 486 -->
23657 <pre>
23658                 _Static_assert ( constant-expression , string-literal ) ;
23659 </pre>
23660
23661 <h4><a name="A.2.3" href="#A.2.3">A.2.3 Statements</a></h4>
23662  (<a href="#6.8">6.8</a>) statement:
23663 <pre>
23664                labeled-statement
23665                compound-statement
23666                expression-statement
23667                selection-statement
23668                iteration-statement
23669                jump-statement
23670 </pre>
23671  (<a href="#6.8.1">6.8.1</a>) labeled-statement:
23672 <pre>
23673                 identifier : statement
23674                 case constant-expression : statement
23675                 default : statement
23676 </pre>
23677  (<a href="#6.8.2">6.8.2</a>) compound-statement:
23678 <pre>
23679               { block-item-list<sub>opt</sub> }
23680 </pre>
23681  (<a href="#6.8.2">6.8.2</a>) block-item-list:
23682 <pre>
23683                 block-item
23684                 block-item-list block-item
23685 </pre>
23686  (<a href="#6.8.2">6.8.2</a>) block-item:
23687 <pre>
23688                 declaration
23689                 statement
23690 </pre>
23691  (<a href="#6.8.3">6.8.3</a>) expression-statement:
23692 <pre>
23693                expression<sub>opt</sub> ;
23694 </pre>
23695  (<a href="#6.8.4">6.8.4</a>) selection-statement:
23696 <pre>
23697                 if ( expression ) statement
23698                 if ( expression ) statement else statement
23699                 switch ( expression ) statement
23700 </pre>
23701  (<a href="#6.8.5">6.8.5</a>) iteration-statement:
23702 <pre>
23703                  while ( expression ) statement
23704                  do statement while ( expression ) ;
23705                  for ( expression<sub>opt</sub> ; expression<sub>opt</sub> ; expression<sub>opt</sub> ) statement
23706                  for ( declaration expression<sub>opt</sub> ; expression<sub>opt</sub> ) statement
23707 </pre>
23708  (<a href="#6.8.6">6.8.6</a>) jump-statement:
23709 <!--page 487 -->
23710 <pre>
23711                goto identifier ;
23712                continue ;
23713                break ;
23714                return expression<sub>opt</sub> ;
23715 </pre>
23716
23717 <h4><a name="A.2.4" href="#A.2.4">A.2.4 External definitions</a></h4>
23718  (<a href="#6.9">6.9</a>) translation-unit:
23719 <pre>
23720                 external-declaration
23721                 translation-unit external-declaration
23722 </pre>
23723  (<a href="#6.9">6.9</a>) external-declaration:
23724 <pre>
23725                 function-definition
23726                 declaration
23727 </pre>
23728  (<a href="#6.9.1">6.9.1</a>) function-definition:
23729 <pre>
23730                 declaration-specifiers declarator declaration-list<sub>opt</sub> compound-statement
23731 </pre>
23732  (<a href="#6.9.1">6.9.1</a>) declaration-list:
23733 <pre>
23734                declaration
23735                declaration-list declaration
23736 </pre>
23737
23738 <h3><a name="A.3" href="#A.3">A.3 Preprocessing directives</a></h3>
23739  (<a href="#6.10">6.10</a>) preprocessing-file:
23740 <pre>
23741                group<sub>opt</sub>
23742 </pre>
23743  (<a href="#6.10">6.10</a>) group:
23744 <pre>
23745                  group-part
23746                  group group-part
23747 </pre>
23748  (<a href="#6.10">6.10</a>) group-part:
23749 <pre>
23750                if-section
23751                control-line
23752                text-line
23753                # non-directive
23754 </pre>
23755  (<a href="#6.10">6.10</a>) if-section:
23756 <pre>
23757                  if-group elif-groups<sub>opt</sub> else-group<sub>opt</sub> endif-line
23758 </pre>
23759  (<a href="#6.10">6.10</a>) if-group:
23760 <pre>
23761                 # if     constant-expression new-line group<sub>opt</sub>
23762                 # ifdef identifier new-line group<sub>opt</sub>
23763                 # ifndef identifier new-line group<sub>opt</sub>
23764 </pre>
23765  (<a href="#6.10">6.10</a>) elif-groups:
23766 <pre>
23767                 elif-group
23768                 elif-groups elif-group
23769 </pre>
23770  (<a href="#6.10">6.10</a>) elif-group:
23771 <!--page 488 -->
23772 <pre>
23773                 # elif       constant-expression new-line group<sub>opt</sub>
23774 </pre>
23775  (<a href="#6.10">6.10</a>) else-group:
23776 <pre>
23777                 # else        new-line group<sub>opt</sub>
23778 </pre>
23779  (<a href="#6.10">6.10</a>) endif-line:
23780 <pre>
23781                 # endif       new-line
23782 </pre>
23783  (<a href="#6.10">6.10</a>) control-line:
23784 <pre>
23785                # include pp-tokens new-line
23786                # define identifier replacement-list new-line
23787                # define identifier lparen identifier-list<sub>opt</sub> )
23788                                                replacement-list new-line
23789                # define identifier lparen ... ) replacement-list new-line
23790                # define identifier lparen identifier-list , ... )
23791                                                replacement-list new-line
23792                # undef   identifier new-line
23793                # line    pp-tokens new-line
23794                # error   pp-tokens<sub>opt</sub> new-line
23795                # pragma pp-tokens<sub>opt</sub> new-line
23796                #         new-line
23797 </pre>
23798  (<a href="#6.10">6.10</a>) text-line:
23799 <pre>
23800                 pp-tokens<sub>opt</sub> new-line
23801 </pre>
23802  (<a href="#6.10">6.10</a>) non-directive:
23803 <pre>
23804                pp-tokens new-line
23805 </pre>
23806  (<a href="#6.10">6.10</a>) lparen:
23807 <pre>
23808                   a ( character not immediately preceded by white-space
23809 </pre>
23810  (<a href="#6.10">6.10</a>) replacement-list:
23811 <pre>
23812                pp-tokens<sub>opt</sub>
23813 </pre>
23814  (<a href="#6.10">6.10</a>) pp-tokens:
23815 <pre>
23816                preprocessing-token
23817                pp-tokens preprocessing-token
23818 </pre>
23819  (<a href="#6.10">6.10</a>) new-line:
23820 <!--page 489 -->
23821 <pre>
23822                the new-line character
23823 </pre>
23824
23825 <h2><a name="B" href="#B">Annex B</a></h2>
23826 <pre>
23827                               (informative)
23828                           Library summary
23829 </pre>
23830
23831 <h3><a name="B.1" href="#B.1">B.1 Diagnostics <assert.h></a></h3>
23832 <pre>
23833          NDEBUG
23834          static_assert
23835          void assert(scalar expression);
23836 </pre>
23837
23838 <h3><a name="B.2" href="#B.2">B.2 Complex <complex.h></a></h3>
23839 <!--page 490 -->
23840 <!--page 491 -->
23841 <pre>
23842          __STDC_NO_COMPLEX__           imaginary
23843          complex                         _Imaginary_I
23844          _Complex_I                      I
23845          #pragma STDC CX_LIMITED_RANGE on-off-switch
23846          double complex cacos(double complex z);
23847          float complex cacosf(float complex z);
23848          long double complex cacosl(long double complex z);
23849          double complex casin(double complex z);
23850          float complex casinf(float complex z);
23851          long double complex casinl(long double complex z);
23852          double complex catan(double complex z);
23853          float complex catanf(float complex z);
23854          long double complex catanl(long double complex z);
23855          double complex ccos(double complex z);
23856          float complex ccosf(float complex z);
23857          long double complex ccosl(long double complex z);
23858          double complex csin(double complex z);
23859          float complex csinf(float complex z);
23860          long double complex csinl(long double complex z);
23861          double complex ctan(double complex z);
23862          float complex ctanf(float complex z);
23863          long double complex ctanl(long double complex z);
23864          double complex cacosh(double complex z);
23865          float complex cacoshf(float complex z);
23866          long double complex cacoshl(long double complex z);
23867          double complex casinh(double complex z);
23868          float complex casinhf(float complex z);
23869          long double complex casinhl(long double complex z);
23870        double complex catanh(double complex z);
23871        float complex catanhf(float complex z);
23872        long double complex catanhl(long double complex z);
23873        double complex ccosh(double complex z);
23874        float complex ccoshf(float complex z);
23875        long double complex ccoshl(long double complex z);
23876        double complex csinh(double complex z);
23877        float complex csinhf(float complex z);
23878        long double complex csinhl(long double complex z);
23879        double complex ctanh(double complex z);
23880        float complex ctanhf(float complex z);
23881        long double complex ctanhl(long double complex z);
23882        double complex cexp(double complex z);
23883        float complex cexpf(float complex z);
23884        long double complex cexpl(long double complex z);
23885        double complex clog(double complex z);
23886        float complex clogf(float complex z);
23887        long double complex clogl(long double complex z);
23888        double cabs(double complex z);
23889        float cabsf(float complex z);
23890        long double cabsl(long double complex z);
23891        double complex cpow(double complex x, double complex y);
23892        float complex cpowf(float complex x, float complex y);
23893        long double complex cpowl(long double complex x,
23894             long double complex y);
23895        double complex csqrt(double complex z);
23896        float complex csqrtf(float complex z);
23897        long double complex csqrtl(long double complex z);
23898        double carg(double complex z);
23899        float cargf(float complex z);
23900        long double cargl(long double complex z);
23901        double cimag(double complex z);
23902        float cimagf(float complex z);
23903        long double cimagl(long double complex z);
23904        double complex CMPLX(double x, double y);
23905        float complex CMPLXF(float x, float y);
23906        long double complex CMPLXL(long double x, long double y);
23907        double complex conj(double complex z);
23908        float complex conjf(float complex z);
23909        long double complex conjl(long double complex z);
23910        double complex cproj(double complex z);
23911          float complex cprojf(float complex z);
23912          long double complex cprojl(long double complex z);
23913          double creal(double complex z);
23914          float crealf(float complex z);
23915          long double creall(long double complex z);
23916 </pre>
23917
23918 <h3><a name="B.3" href="#B.3">B.3 Character handling <ctype.h></a></h3>
23919 <pre>
23920          int   isalnum(int c);
23921          int   isalpha(int c);
23922          int   isblank(int c);
23923          int   iscntrl(int c);
23924          int   isdigit(int c);
23925          int   isgraph(int c);
23926          int   islower(int c);
23927          int   isprint(int c);
23928          int   ispunct(int c);
23929          int   isspace(int c);
23930          int   isupper(int c);
23931          int   isxdigit(int c);
23932          int   tolower(int c);
23933          int   toupper(int c);
23934 </pre>
23935
23936 <h3><a name="B.4" href="#B.4">B.4 Errors <errno.h></a></h3>
23937 <pre>
23938          EDOM           EILSEQ            ERANGE           errno
23939          __STDC_WANT_LIB_EXT1__
23940          errno_t
23941 </pre>
23942
23943 <h3><a name="B.5" href="#B.5">B.5 Floating-point environment <fenv.h></a></h3>
23944 <!--page 492 -->
23945 <pre>
23946          fenv_t               FE_OVERFLOW             FE_TOWARDZERO
23947          fexcept_t            FE_UNDERFLOW            FE_UPWARD
23948          FE_DIVBYZERO         FE_ALL_EXCEPT           FE_DFL_ENV
23949          FE_INEXACT           FE_DOWNWARD
23950          FE_INVALID           FE_TONEAREST
23951          #pragma STDC FENV_ACCESS on-off-switch
23952          int feclearexcept(int excepts);
23953          int fegetexceptflag(fexcept_t *flagp, int excepts);
23954          int feraiseexcept(int excepts);
23955          int fesetexceptflag(const fexcept_t *flagp,
23956               int excepts);
23957          int fetestexcept(int excepts);
23958        int   fegetround(void);
23959        int   fesetround(int round);
23960        int   fegetenv(fenv_t *envp);
23961        int   feholdexcept(fenv_t *envp);
23962        int   fesetenv(const fenv_t *envp);
23963        int   feupdateenv(const fenv_t *envp);
23964 </pre>
23965
23966 <h3><a name="B.6" href="#B.6">B.6 Characteristics of floating types <float.h></a></h3>
23967 <pre>
23968        FLT_ROUNDS              DBL_DIG                 FLT_MAX
23969        FLT_EVAL_METHOD         LDBL_DIG                DBL_MAX
23970        FLT_HAS_SUBNORM         FLT_MIN_EXP             LDBL_MAX
23971        DBL_HAS_SUBNORM         DBL_MIN_EXP             FLT_EPSILON
23972        LDBL_HAS_SUBNORM        LDBL_MIN_EXP            DBL_EPSILON
23973        FLT_RADIX               FLT_MIN_10_EXP          LDBL_EPSILON
23974        FLT_MANT_DIG            DBL_MIN_10_EXP          FLT_MIN
23975        DBL_MANT_DIG            LDBL_MIN_10_EXP         DBL_MIN
23976        LDBL_MANT_DIG           FLT_MAX_EXP             LDBL_MIN
23977        FLT_DECIMAL_DIG         DBL_MAX_EXP             FLT_TRUE_MIN
23978        DBL_DECIMAL_DIG         LDBL_MAX_EXP            DBL_TRUE_MIN
23979        LDBL_DECIMAL_DIG        FLT_MAX_10_EXP          LDBL_TRUE_MIN
23980        DECIMAL_DIG             DBL_MAX_10_EXP
23981        FLT_DIG                 LDBL_MAX_10_EXP
23982 </pre>
23983
23984 <h3><a name="B.7" href="#B.7">B.7 Format conversion of integer types <inttypes.h></a></h3>
23985 <!--page 493 -->
23986 <pre>
23987        imaxdiv_t
23988        PRIdN         PRIdLEASTN       PRIdFASTN        PRIdMAX    PRIdPTR
23989        PRIiN         PRIiLEASTN       PRIiFASTN        PRIiMAX    PRIiPTR
23990        PRIoN         PRIoLEASTN       PRIoFASTN        PRIoMAX    PRIoPTR
23991        PRIuN         PRIuLEASTN       PRIuFASTN        PRIuMAX    PRIuPTR
23992        PRIxN         PRIxLEASTN       PRIxFASTN        PRIxMAX    PRIxPTR
23993        PRIXN         PRIXLEASTN       PRIXFASTN        PRIXMAX    PRIXPTR
23994        SCNdN         SCNdLEASTN       SCNdFASTN        SCNdMAX    SCNdPTR
23995        SCNiN         SCNiLEASTN       SCNiFASTN        SCNiMAX    SCNiPTR
23996        SCNoN         SCNoLEASTN       SCNoFASTN        SCNoMAX    SCNoPTR
23997        SCNuN         SCNuLEASTN       SCNuFASTN        SCNuMAX    SCNuPTR
23998        SCNxN         SCNxLEASTN       SCNxFASTN        SCNxMAX    SCNxPTR
23999        intmax_t imaxabs(intmax_t j);
24000        imaxdiv_t imaxdiv(intmax_t numer, intmax_t denom);
24001        intmax_t strtoimax(const char * restrict nptr,
24002                char ** restrict endptr, int base);
24003          uintmax_t strtoumax(const char * restrict nptr,
24004                  char ** restrict endptr, int base);
24005          intmax_t wcstoimax(const wchar_t * restrict nptr,
24006                  wchar_t ** restrict endptr, int base);
24007          uintmax_t wcstoumax(const wchar_t * restrict nptr,
24008                  wchar_t ** restrict endptr, int base);
24009 </pre>
24010
24011 <h3><a name="B.8" href="#B.8">B.8 Alternative spellings <iso646.h></a></h3>
24012 <pre>
24013          and            bitor             not_eq           xor
24014          and_eq         compl             or               xor_eq
24015          bitand         not               or_eq
24016 </pre>
24017
24018 <h3><a name="B.9" href="#B.9">B.9 Sizes of integer types <limits.h></a></h3>
24019 <pre>
24020          CHAR_BIT       CHAR_MAX          INT_MIN          ULONG_MAX
24021          SCHAR_MIN      MB_LEN_MAX        INT_MAX          LLONG_MIN
24022          SCHAR_MAX      SHRT_MIN          UINT_MAX         LLONG_MAX
24023          UCHAR_MAX      SHRT_MAX          LONG_MIN         ULLONG_MAX
24024          CHAR_MIN       USHRT_MAX         LONG_MAX
24025 </pre>
24026
24027 <h3><a name="B.10" href="#B.10">B.10 Localization <locale.h></a></h3>
24028 <pre>
24029          struct lconv   LC_ALL            LC_CTYPE         LC_NUMERIC
24030          NULL           LC_COLLATE        LC_MONETARY      LC_TIME
24031          char *setlocale(int category, const char *locale);
24032          struct lconv *localeconv(void);
24033 </pre>
24034
24035 <h3><a name="B.11" href="#B.11">B.11 Mathematics <math.h></a></h3>
24036 <!--page 494 -->
24037 <!--page 495 -->
24038 <!--page 496 -->
24039 <!--page 497 -->
24040 <!--page 498 -->
24041 <pre>
24042          float_t              FP_INFINITE             FP_FAST_FMAL
24043          double_t             FP_NAN                  FP_ILOGB0
24044          HUGE_VAL             FP_NORMAL               FP_ILOGBNAN
24045          HUGE_VALF            FP_SUBNORMAL            MATH_ERRNO
24046          HUGE_VALL            FP_ZERO                 MATH_ERREXCEPT
24047          INFINITY             FP_FAST_FMA             math_errhandling
24048          NAN                  FP_FAST_FMAF
24049          #pragma STDC FP_CONTRACT on-off-switch
24050          int fpclassify(real-floating x);
24051          int isfinite(real-floating x);
24052          int isinf(real-floating x);
24053          int isnan(real-floating x);
24054          int isnormal(real-floating x);
24055          int signbit(real-floating x);
24056        double acos(double x);
24057        float acosf(float x);
24058        long double acosl(long double x);
24059        double asin(double x);
24060        float asinf(float x);
24061        long double asinl(long double x);
24062        double atan(double x);
24063        float atanf(float x);
24064        long double atanl(long double x);
24065        double atan2(double y, double x);
24066        float atan2f(float y, float x);
24067        long double atan2l(long double y, long double x);
24068        double cos(double x);
24069        float cosf(float x);
24070        long double cosl(long double x);
24071        double sin(double x);
24072        float sinf(float x);
24073        long double sinl(long double x);
24074        double tan(double x);
24075        float tanf(float x);
24076        long double tanl(long double x);
24077        double acosh(double x);
24078        float acoshf(float x);
24079        long double acoshl(long double x);
24080        double asinh(double x);
24081        float asinhf(float x);
24082        long double asinhl(long double x);
24083        double atanh(double x);
24084        float atanhf(float x);
24085        long double atanhl(long double x);
24086        double cosh(double x);
24087        float coshf(float x);
24088        long double coshl(long double x);
24089        double sinh(double x);
24090        float sinhf(float x);
24091        long double sinhl(long double x);
24092        double tanh(double x);
24093        float tanhf(float x);
24094        long double tanhl(long double x);
24095        double exp(double x);
24096        float expf(float x);
24097          long double expl(long double x);
24098          double exp2(double x);
24099          float exp2f(float x);
24100          long double exp2l(long double x);
24101          double expm1(double x);
24102          float expm1f(float x);
24103          long double expm1l(long double x);
24104          double frexp(double value, int *exp);
24105          float frexpf(float value, int *exp);
24106          long double frexpl(long double value, int *exp);
24107          int ilogb(double x);
24108          int ilogbf(float x);
24109          int ilogbl(long double x);
24110          double ldexp(double x, int exp);
24111          float ldexpf(float x, int exp);
24112          long double ldexpl(long double x, int exp);
24113          double log(double x);
24114          float logf(float x);
24115          long double logl(long double x);
24116          double log10(double x);
24117          float log10f(float x);
24118          long double log10l(long double x);
24119          double log1p(double x);
24120          float log1pf(float x);
24121          long double log1pl(long double x);
24122          double log2(double x);
24123          float log2f(float x);
24124          long double log2l(long double x);
24125          double logb(double x);
24126          float logbf(float x);
24127          long double logbl(long double x);
24128          double modf(double value, double *iptr);
24129          float modff(float value, float *iptr);
24130          long double modfl(long double value, long double *iptr);
24131          double scalbn(double x, int n);
24132          float scalbnf(float x, int n);
24133          long double scalbnl(long double x, int n);
24134          double scalbln(double x, long int n);
24135          float scalblnf(float x, long int n);
24136          long double scalblnl(long double x, long int n);
24137          double cbrt(double x);
24138        float cbrtf(float x);
24139        long double cbrtl(long double x);
24140        double fabs(double x);
24141        float fabsf(float x);
24142        long double fabsl(long double x);
24143        double hypot(double x, double y);
24144        float hypotf(float x, float y);
24145        long double hypotl(long double x, long double y);
24146        double pow(double x, double y);
24147        float powf(float x, float y);
24148        long double powl(long double x, long double y);
24149        double sqrt(double x);
24150        float sqrtf(float x);
24151        long double sqrtl(long double x);
24152        double erf(double x);
24153        float erff(float x);
24154        long double erfl(long double x);
24155        double erfc(double x);
24156        float erfcf(float x);
24157        long double erfcl(long double x);
24158        double lgamma(double x);
24159        float lgammaf(float x);
24160        long double lgammal(long double x);
24161        double tgamma(double x);
24162        float tgammaf(float x);
24163        long double tgammal(long double x);
24164        double ceil(double x);
24165        float ceilf(float x);
24166        long double ceill(long double x);
24167        double floor(double x);
24168        float floorf(float x);
24169        long double floorl(long double x);
24170        double nearbyint(double x);
24171        float nearbyintf(float x);
24172        long double nearbyintl(long double x);
24173        double rint(double x);
24174        float rintf(float x);
24175        long double rintl(long double x);
24176        long int lrint(double x);
24177        long int lrintf(float x);
24178        long int lrintl(long double x);
24179          long long int llrint(double x);
24180          long long int llrintf(float x);
24181          long long int llrintl(long double x);
24182          double round(double x);
24183          float roundf(float x);
24184          long double roundl(long double x);
24185          long int lround(double x);
24186          long int lroundf(float x);
24187          long int lroundl(long double x);
24188          long long int llround(double x);
24189          long long int llroundf(float x);
24190          long long int llroundl(long double x);
24191          double trunc(double x);
24192          float truncf(float x);
24193          long double truncl(long double x);
24194          double fmod(double x, double y);
24195          float fmodf(float x, float y);
24196          long double fmodl(long double x, long double y);
24197          double remainder(double x, double y);
24198          float remainderf(float x, float y);
24199          long double remainderl(long double x, long double y);
24200          double remquo(double x, double y, int *quo);
24201          float remquof(float x, float y, int *quo);
24202          long double remquol(long double x, long double y,
24203               int *quo);
24204          double copysign(double x, double y);
24205          float copysignf(float x, float y);
24206          long double copysignl(long double x, long double y);
24207          double nan(const char *tagp);
24208          float nanf(const char *tagp);
24209          long double nanl(const char *tagp);
24210          double nextafter(double x, double y);
24211          float nextafterf(float x, float y);
24212          long double nextafterl(long double x, long double y);
24213          double nexttoward(double x, long double y);
24214          float nexttowardf(float x, long double y);
24215          long double nexttowardl(long double x, long double y);
24216          double fdim(double x, double y);
24217          float fdimf(float x, float y);
24218          long double fdiml(long double x, long double y);
24219          double fmax(double x, double y);
24220        float fmaxf(float x, float y);
24221        long double fmaxl(long double x, long double y);
24222        double fmin(double x, double y);
24223        float fminf(float x, float y);
24224        long double fminl(long double x, long double y);
24225        double fma(double x, double y, double z);
24226        float fmaf(float x, float y, float z);
24227        long double fmal(long double x, long double y,
24228             long double z);
24229        int isgreater(real-floating x, real-floating y);
24230        int isgreaterequal(real-floating x, real-floating y);
24231        int isless(real-floating x, real-floating y);
24232        int islessequal(real-floating x, real-floating y);
24233        int islessgreater(real-floating x, real-floating y);
24234        int isunordered(real-floating x, real-floating y);
24235 </pre>
24236
24237 <h3><a name="B.12" href="#B.12">B.12 Nonlocal jumps <setjmp.h></a></h3>
24238 <pre>
24239        jmp_buf
24240        int setjmp(jmp_buf env);
24241        _Noreturn void longjmp(jmp_buf env, int val);
24242 </pre>
24243
24244 <h3><a name="B.13" href="#B.13">B.13 Signal handling <signal.h></a></h3>
24245 <!--page 499 -->
24246 <pre>
24247        sig_atomic_t    SIG_IGN           SIGILL           SIGTERM
24248        SIG_DFL         SIGABRT           SIGINT
24249        SIG_ERR         SIGFPE            SIGSEGV
24250        void (*signal(int sig, void (*func)(int)))(int);
24251        int raise(int sig);
24252 </pre>
24253
24254 <h3><a name="B.14" href="#B.14">B.14 Alignment <stdalign.h></a></h3>
24255 <pre>
24256          alignas
24257          __alignas_is_defined
24258 </pre>
24259
24260 <h3><a name="B.15" href="#B.15">B.15 Variable arguments <stdarg.h></a></h3>
24261 <pre>
24262          va_list
24263          type va_arg(va_list ap, type);
24264          void va_copy(va_list dest, va_list src);
24265          void va_end(va_list ap);
24266          void va_start(va_list ap, parmN);
24267 </pre>
24268
24269 <h3><a name="B.16" href="#B.16">B.16 Atomics <stdatomic.h></a></h3>
24270 <!--page 500 -->
24271 <!--page 501 -->
24272 <pre>
24273          ATOMIC_CHAR_LOCK_FREE           atomic_uint
24274          ATOMIC_CHAR16_T_LOCK_FREE       atomic_long
24275          ATOMIC_CHAR32_T_LOCK_FREE       atomic_ulong
24276          ATOMIC_WCHAR_T_LOCK_FREE        atomic_llong
24277          ATOMIC_SHORT_LOCK_FREE          atomic_ullong
24278          ATOMIC_INT_LOCK_FREE            atomic_char16_t
24279          ATOMIC_LONG_LOCK_FREE           atomic_char32_t
24280          ATOMIC_LLONG_LOCK_FREE          atomic_wchar_t
24281          ATOMIC_ADDRESS_LOCK_FREE        atomic_int_least8_t
24282          ATOMIC_FLAG_INIT                atomic_uint_least8_t
24283          memory_order                    atomic_int_least16_t
24284          atomic_flag                     atomic_uint_least16_t
24285          atomic_bool                     atomic_int_least32_t
24286          atomic_address                  atomic_uint_least32_t
24287          memory_order_relaxed            atomic_int_least64_t
24288          memory_order_consume            atomic_uint_least64_t
24289          memory_order_acquire            atomic_int_fast8_t
24290          memory_order_release            atomic_uint_fast8_t
24291          memory_order_acq_rel            atomic_int_fast16_t
24292          memory_order_seq_cst            atomic_uint_fast16_t
24293          atomic_char                     atomic_int_fast32_t
24294          atomic_schar                    atomic_uint_fast32_t
24295          atomic_uchar                    atomic_int_fast64_t
24296          atomic_short                    atomic_uint_fast64_t
24297          atomic_ushort                   atomic_intptr_t
24298          atomic_int                      atomic_uintptr_t
24299        atomic_size_t                     atomic_intmax_t
24300        atomic_ptrdiff_t                  atomic_uintmax_t
24301        #define ATOMIC_VAR_INIT(C value)
24302        void atomic_init(volatile A *obj, C value);
24303        type kill_dependency(type y);
24304        void atomic_thread_fence(memory_order order);
24305        void atomic_signal_fence(memory_order order);
24306        _Bool atomic_is_lock_free(atomic_type const volatile *obj);
24307        void atomic_store(volatile A *object, C desired);
24308        void atomic_store_explicit(volatile A *object,
24309              C desired, memory_order order);
24310        C atomic_load(volatile A *object);
24311        C atomic_load_explicit(volatile A *object,
24312              memory_order order);
24313        C atomic_exchange(volatile A *object, C desired);
24314        C atomic_exchange_explicit(volatile A *object,
24315              C desired, memory_order order);
24316        _Bool atomic_compare_exchange_strong(volatile A *object,
24317              C *expected, C desired);
24318        _Bool atomic_compare_exchange_strong_explicit(
24319              volatile A *object, C *expected, C desired,
24320              memory_order success, memory_order failure);
24321        _Bool atomic_compare_exchange_weak(volatile A *object,
24322              C *expected, C desired);
24323        _Bool atomic_compare_exchange_weak_explicit(
24324              volatile A *object, C *expected, C desired,
24325              memory_order success, memory_order failure);
24326        C atomic_fetch_key(volatile A *object, M operand);
24327        C atomic_fetch_key_explicit(volatile A *object,
24328              M operand, memory_order order);
24329        bool atomic_flag_test_and_set(
24330              volatile atomic_flag *object);
24331        bool atomic_flag_test_and_set_explicit(
24332              volatile atomic_flag *object, memory_order order);
24333        void atomic_flag_clear(volatile atomic_flag *object);
24334        void atomic_flag_clear_explicit(
24335              volatile atomic_flag *object, memory_order order);
24336 </pre>
24337
24338 <h3><a name="B.17" href="#B.17">B.17 Boolean type and values <stdbool.h></a></h3>
24339 <pre>
24340          bool
24341          true
24342          false
24343          __bool_true_false_are_defined
24344 </pre>
24345
24346 <h3><a name="B.18" href="#B.18">B.18 Common definitions <stddef.h></a></h3>
24347 <pre>
24348          ptrdiff_t       max_align_t       NULL
24349          size_t          wchar_t
24350          offsetof(type, member-designator)
24351          __STDC_WANT_LIB_EXT1__
24352          rsize_t
24353 </pre>
24354
24355 <h3><a name="B.19" href="#B.19">B.19 Integer types <stdint.h></a></h3>
24356 <!--page 502 -->
24357 <pre>
24358          intN_t                INT_LEASTN_MIN          PTRDIFF_MAX
24359          uintN_t               INT_LEASTN_MAX          SIG_ATOMIC_MIN
24360          int_leastN_t          UINT_LEASTN_MAX         SIG_ATOMIC_MAX
24361          uint_leastN_t         INT_FASTN_MIN           SIZE_MAX
24362          int_fastN_t           INT_FASTN_MAX           WCHAR_MIN
24363          uint_fastN_t          UINT_FASTN_MAX          WCHAR_MAX
24364          intptr_t              INTPTR_MIN              WINT_MIN
24365          uintptr_t             INTPTR_MAX              WINT_MAX
24366          intmax_t              UINTPTR_MAX             INTN_C(value)
24367          uintmax_t             INTMAX_MIN              UINTN_C(value)
24368          INTN_MIN              INTMAX_MAX              INTMAX_C(value)
24369          INTN_MAX              UINTMAX_MAX             UINTMAX_C(value)
24370          UINTN_MAX             PTRDIFF_MIN
24371          __STDC_WANT_LIB_EXT1__
24372          RSIZE_MAX
24373 </pre>
24374
24375 <h3><a name="B.20" href="#B.20">B.20 Input/output <stdio.h></a></h3>
24376 <!--page 503 -->
24377 <!--page 504 -->
24378 <!--page 505 -->
24379 <pre>
24380        size_t          _IOLBF            FILENAME_MAX     TMP_MAX
24381        FILE            _IONBF            L_tmpnam         stderr
24382        fpos_t          BUFSIZ            SEEK_CUR         stdin
24383        NULL            EOF               SEEK_END         stdout
24384        _IOFBF          FOPEN_MAX         SEEK_SET
24385        int remove(const char *filename);
24386        int rename(const char *old, const char *new);
24387        FILE *tmpfile(void);
24388        char *tmpnam(char *s);
24389        int fclose(FILE *stream);
24390        int fflush(FILE *stream);
24391        FILE *fopen(const char * restrict filename,
24392             const char * restrict mode);
24393        FILE *freopen(const char * restrict filename,
24394             const char * restrict mode,
24395             FILE * restrict stream);
24396        void setbuf(FILE * restrict stream,
24397             char * restrict buf);
24398        int setvbuf(FILE * restrict stream,
24399             char * restrict buf,
24400             int mode, size_t size);
24401        int fprintf(FILE * restrict stream,
24402             const char * restrict format, ...);
24403        int fscanf(FILE * restrict stream,
24404             const char * restrict format, ...);
24405        int printf(const char * restrict format, ...);
24406        int scanf(const char * restrict format, ...);
24407        int snprintf(char * restrict s, size_t n,
24408             const char * restrict format, ...);
24409        int sprintf(char * restrict s,
24410             const char * restrict format, ...);
24411        int sscanf(const char * restrict s,
24412             const char * restrict format, ...);
24413        int vfprintf(FILE * restrict stream,
24414             const char * restrict format, va_list arg);
24415        int vfscanf(FILE * restrict stream,
24416             const char * restrict format, va_list arg);
24417        int vprintf(const char * restrict format, va_list arg);
24418        int vscanf(const char * restrict format, va_list arg);
24419          int vsnprintf(char * restrict s, size_t n,
24420               const char * restrict format, va_list arg);
24421          int vsprintf(char * restrict s,
24422               const char * restrict format, va_list arg);
24423          int vsscanf(const char * restrict s,
24424               const char * restrict format, va_list arg);
24425          int fgetc(FILE *stream);
24426          char *fgets(char * restrict s, int n,
24427               FILE * restrict stream);
24428          int fputc(int c, FILE *stream);
24429          int fputs(const char * restrict s,
24430               FILE * restrict stream);
24431          int getc(FILE *stream);
24432          int getchar(void);
24433          int putc(int c, FILE *stream);                                       *
24434          int putchar(int c);
24435          int puts(const char *s);
24436          int ungetc(int c, FILE *stream);
24437          size_t fread(void * restrict ptr,
24438               size_t size, size_t nmemb,
24439               FILE * restrict stream);
24440          size_t fwrite(const void * restrict ptr,
24441               size_t size, size_t nmemb,
24442               FILE * restrict stream);
24443          int fgetpos(FILE * restrict stream,
24444               fpos_t * restrict pos);
24445          int fseek(FILE *stream, long int offset, int whence);
24446          int fsetpos(FILE *stream, const fpos_t *pos);
24447          long int ftell(FILE *stream);
24448          void rewind(FILE *stream);
24449          void clearerr(FILE *stream);
24450          int feof(FILE *stream);
24451          int ferror(FILE *stream);
24452          void perror(const char *s);
24453          __STDC_WANT_LIB_EXT1__
24454          L_tmpnam_s    TMP_MAX_S         errno_t          rsize_t
24455          errno_t tmpfile_s(FILE * restrict * restrict streamptr);
24456          errno_t tmpnam_s(char *s, rsize_t maxsize);
24457        errno_t fopen_s(FILE * restrict * restrict streamptr,
24458             const char * restrict filename,
24459             const char * restrict mode);
24460        errno_t freopen_s(FILE * restrict * restrict newstreamptr,
24461             const char * restrict filename,
24462             const char * restrict mode,
24463             FILE * restrict stream);
24464        int fprintf_s(FILE * restrict stream,
24465             const char * restrict format, ...);
24466        int fscanf_s(FILE * restrict stream,
24467             const char * restrict format, ...);
24468        int printf_s(const char * restrict format, ...);
24469        int scanf_s(const char * restrict format, ...);
24470        int snprintf_s(char * restrict s, rsize_t n,
24471             const char * restrict format, ...);
24472        int sprintf_s(char * restrict s, rsize_t n,
24473             const char * restrict format, ...);
24474        int sscanf_s(const char * restrict s,
24475             const char * restrict format, ...);
24476        int vfprintf_s(FILE * restrict stream,
24477             const char * restrict format,
24478             va_list arg);
24479        int vfscanf_s(FILE * restrict stream,
24480             const char * restrict format,
24481             va_list arg);
24482        int vprintf_s(const char * restrict format,
24483             va_list arg);
24484        int vscanf_s(const char * restrict format,
24485             va_list arg);
24486        int vsnprintf_s(char * restrict s, rsize_t n,
24487             const char * restrict format,
24488             va_list arg);
24489        int vsprintf_s(char * restrict s, rsize_t n,
24490             const char * restrict format,
24491             va_list arg);
24492        int vsscanf_s(const char * restrict s,
24493             const char * restrict format,
24494             va_list arg);
24495        char *gets_s(char *s, rsize_t n);
24496 </pre>
24497
24498 <h3><a name="B.21" href="#B.21">B.21 General utilities <stdlib.h></a></h3>
24499 <!--page 506 -->
24500 <!--page 507 -->
24501 <pre>
24502          size_t       ldiv_t            EXIT_FAILURE     MB_CUR_MAX
24503          wchar_t      lldiv_t           EXIT_SUCCESS
24504          div_t        NULL              RAND_MAX
24505          double atof(const char *nptr);
24506          int atoi(const char *nptr);
24507          long int atol(const char *nptr);
24508          long long int atoll(const char *nptr);
24509          double strtod(const char * restrict nptr,
24510               char ** restrict endptr);
24511          float strtof(const char * restrict nptr,
24512               char ** restrict endptr);
24513          long double strtold(const char * restrict nptr,
24514               char ** restrict endptr);
24515          long int strtol(const char * restrict nptr,
24516               char ** restrict endptr, int base);
24517          long long int strtoll(const char * restrict nptr,
24518               char ** restrict endptr, int base);
24519          unsigned long int strtoul(
24520               const char * restrict nptr,
24521               char ** restrict endptr, int base);
24522          unsigned long long int strtoull(
24523               const char * restrict nptr,
24524               char ** restrict endptr, int base);
24525          int rand(void);
24526          void srand(unsigned int seed);
24527          void *aligned_alloc(size_t alignment, size_t size);
24528          void *calloc(size_t nmemb, size_t size);
24529          void free(void *ptr);
24530          void *malloc(size_t size);
24531          void *realloc(void *ptr, size_t size);
24532          _Noreturn void abort(void);
24533          int atexit(void (*func)(void));
24534          int at_quick_exit(void (*func)(void));
24535          _Noreturn void exit(int status);
24536          _Noreturn void _Exit(int status);
24537          char *getenv(const char *name);
24538          _Noreturn void quick_exit(int status);
24539          int system(const char *string);
24540        void *bsearch(const void *key, const void *base,
24541             size_t nmemb, size_t size,
24542             int (*compar)(const void *, const void *));
24543        void qsort(void *base, size_t nmemb, size_t size,
24544             int (*compar)(const void *, const void *));
24545        int abs(int j);
24546        long int labs(long int j);
24547        long long int llabs(long long int j);
24548        div_t div(int numer, int denom);
24549        ldiv_t ldiv(long int numer, long int denom);
24550        lldiv_t lldiv(long long int numer,
24551             long long int denom);
24552        int mblen(const char *s, size_t n);
24553        int mbtowc(wchar_t * restrict pwc,
24554             const char * restrict s, size_t n);
24555        int wctomb(char *s, wchar_t wchar);
24556        size_t mbstowcs(wchar_t * restrict pwcs,
24557             const char * restrict s, size_t n);
24558        size_t wcstombs(char * restrict s,
24559             const wchar_t * restrict pwcs, size_t n);
24560        __STDC_WANT_LIB_EXT1__
24561        errno_t
24562        rsize_t
24563        constraint_handler_t
24564        constraint_handler_t set_constraint_handler_s(
24565             constraint_handler_t handler);
24566        void abort_handler_s(
24567             const char * restrict msg,
24568             void * restrict ptr,
24569             errno_t error);
24570        void ignore_handler_s(
24571             const char * restrict msg,
24572             void * restrict ptr,
24573             errno_t error);
24574        errno_t getenv_s(size_t * restrict len,
24575                  char * restrict value, rsize_t maxsize,
24576                  const char * restrict name);
24577          void *bsearch_s(const void *key, const void *base,
24578               rsize_t nmemb, rsize_t size,
24579               int (*compar)(const void *k, const void *y,
24580                               void *context),
24581               void *context);
24582          errno_t qsort_s(void *base, rsize_t nmemb, rsize_t size,
24583               int (*compar)(const void *x, const void *y,
24584                               void *context),
24585               void *context);
24586          errno_t wctomb_s(int * restrict status,
24587               char * restrict s,
24588               rsize_t smax,
24589               wchar_t wc);
24590          errno_t mbstowcs_s(size_t * restrict retval,
24591               wchar_t * restrict dst, rsize_t dstmax,
24592               const char * restrict src, rsize_t len);
24593          errno_t wcstombs_s(size_t * restrict retval,
24594               char * restrict dst, rsize_t dstmax,
24595               const wchar_t * restrict src, rsize_t len);
24596 </pre>
24597
24598 <h3><a name="B.22" href="#B.22">B.22 String handling <string.h></a></h3>
24599 <!--page 508 -->
24600 <!--page 509 -->
24601 <pre>
24602          size_t
24603          NULL
24604          void *memcpy(void * restrict s1,
24605               const void * restrict s2, size_t n);
24606          void *memmove(void *s1, const void *s2, size_t n);
24607          char *strcpy(char * restrict s1,
24608               const char * restrict s2);
24609          char *strncpy(char * restrict s1,
24610               const char * restrict s2, size_t n);
24611          char *strcat(char * restrict s1,
24612               const char * restrict s2);
24613          char *strncat(char * restrict s1,
24614               const char * restrict s2, size_t n);
24615          int memcmp(const void *s1, const void *s2, size_t n);
24616          int strcmp(const char *s1, const char *s2);
24617          int strcoll(const char *s1, const char *s2);
24618          int strncmp(const char *s1, const char *s2, size_t n);
24619          size_t strxfrm(char * restrict s1,
24620               const char * restrict s2, size_t n);
24621          void *memchr(const void *s, int c, size_t n);
24622        char *strchr(const char *s, int c);
24623        size_t strcspn(const char *s1, const char *s2);
24624        char *strpbrk(const char *s1, const char *s2);
24625        char *strrchr(const char *s, int c);
24626        size_t strspn(const char *s1, const char *s2);
24627        char *strstr(const char *s1, const char *s2);
24628        char *strtok(char * restrict s1,
24629             const char * restrict s2);
24630        void *memset(void *s, int c, size_t n);
24631        char *strerror(int errnum);
24632        size_t strlen(const char *s);
24633        __STDC_WANT_LIB_EXT1__
24634        errno_t
24635        rsize_t
24636        errno_t memcpy_s(void * restrict s1, rsize_t s1max,
24637             const void * restrict s2, rsize_t n);
24638        errno_t memmove_s(void *s1, rsize_t s1max,
24639             const void *s2, rsize_t n);
24640        errno_t strcpy_s(char * restrict s1,
24641             rsize_t s1max,
24642             const char * restrict s2);
24643        errno_t strncpy_s(char * restrict s1,
24644             rsize_t s1max,
24645             const char * restrict s2,
24646             rsize_t n);
24647        errno_t strcat_s(char * restrict s1,
24648             rsize_t s1max,
24649             const char * restrict s2);
24650        errno_t strncat_s(char * restrict s1,
24651             rsize_t s1max,
24652             const char * restrict s2,
24653             rsize_t n);
24654        char *strtok_s(char * restrict s1,
24655             rsize_t * restrict s1max,
24656             const char * restrict s2,
24657             char ** restrict ptr);
24658        errno_t memset_s(void *s, rsize_t smax, int c, rsize_t n)
24659        errno_t strerror_s(char *s, rsize_t maxsize,
24660             errno_t errnum);
24661        size_t strerrorlen_s(errno_t errnum);
24662          size_t strnlen_s(const char *s, size_t maxsize);
24663 </pre>
24664
24665 <h3><a name="B.23" href="#B.23">B.23 Type-generic math <tgmath.h></a></h3>
24666 <pre>
24667          acos         sqrt              fmod             nextafter
24668          asin         fabs              frexp            nexttoward
24669          atan         atan2             hypot            remainder
24670          acosh        cbrt              ilogb            remquo
24671          asinh        ceil              ldexp            rint
24672          atanh        copysign          lgamma           round
24673          cos          erf               llrint           scalbn
24674          sin          erfc              llround          scalbln
24675          tan          exp2              log10            tgamma
24676          cosh         expm1             log1p            trunc
24677          sinh         fdim              log2             carg
24678          tanh         floor             logb             cimag
24679          exp          fma               lrint            conj
24680          log          fmax              lround           cproj
24681          pow          fmin              nearbyint        creal
24682 </pre>
24683
24684 <h3><a name="B.24" href="#B.24">B.24 Threads <threads.h></a></h3>
24685 <!--page 510 -->
24686 <pre>
24687          ONCE_FLAG_INIT                 mtx_plain
24688          TSS_DTOR_ITERATIONS            mtx_recursive
24689          cnd_t                          mtx_timed
24690          thrd_t                         mtx_try
24691          tss_t                          thrd_timeout
24692          mtx_t                          thrd_success
24693          tss_dtor_t                     thrd_busy
24694          thrd_start_t                   thrd_error
24695          once_flag                      thrd_nomem
24696          xtime
24697        void call_once(once_flag *flag, void (*func)(void));
24698        int cnd_broadcast(cnd_t *cond);
24699        void cnd_destroy(cnd_t *cond);
24700        int cnd_init(cnd_t *cond);
24701        int cnd_signal(cnd_t *cond);
24702        int cnd_timedwait(cnd_t *cond, mtx_t *mtx,
24703             const xtime *xt);
24704        int cnd_wait(cnd_t *cond, mtx_t *mtx);
24705        void mtx_destroy(mtx_t *mtx);
24706        int mtx_init(mtx_t *mtx, int type);
24707        int mtx_lock(mtx_t *mtx);
24708        int mtx_timedlock(mtx_t *mtx, const xtime *xt);
24709        int mtx_trylock(mtx_t *mtx);
24710        int mtx_unlock(mtx_t *mtx);
24711        int thrd_create(thrd_t *thr, thrd_start_t func,
24712             void *arg);
24713        thrd_t thrd_current(void);
24714        int thrd_detach(thrd_t thr);
24715        int thrd_equal(thrd_t thr0, thrd_t thr1);
24716        void thrd_exit(int res);
24717        int thrd_join(thrd_t thr, int *res);
24718        void thrd_sleep(const xtime *xt);
24719        void thrd_yield(void);
24720        int tss_create(tss_t *key, tss_dtor_t dtor);
24721        void tss_delete(tss_t key);
24722        void *tss_get(tss_t key);
24723        int tss_set(tss_t key, void *val);
24724        int xtime_get(xtime *xt, int base);
24725 </pre>
24726
24727 <h3><a name="B.25" href="#B.25">B.25 Date and time <time.h></a></h3>
24728 <!--page 511 -->
24729 <pre>
24730        NULL                  size_t                  time_t
24731        CLOCKS_PER_SEC        clock_t                 struct tm
24732        clock_t clock(void);
24733        double difftime(time_t time1, time_t time0);
24734        time_t mktime(struct tm *timeptr);
24735        time_t time(time_t *timer);
24736        char *asctime(const struct tm *timeptr);
24737        char *ctime(const time_t *timer);
24738        struct tm *gmtime(const time_t *timer);
24739        struct tm *localtime(const time_t *timer);
24740        size_t strftime(char * restrict s,
24741             size_t maxsize,
24742             const char * restrict format,
24743             const struct tm * restrict timeptr);
24744        __STDC_WANT_LIB_EXT1__
24745        errno_t
24746        rsize_t
24747        errno_t asctime_s(char *s, rsize_t maxsize,
24748             const struct tm *timeptr);
24749          errno_t ctime_s(char *s, rsize_t maxsize,
24750               const time_t *timer);
24751          struct tm *gmtime_s(const time_t * restrict timer,
24752               struct tm * restrict result);
24753          struct tm *localtime_s(const time_t * restrict timer,
24754               struct tm * restrict result);
24755 </pre>
24756
24757 <h3><a name="B.26" href="#B.26">B.26 Unicode utilities <uchar.h></a></h3>
24758 <pre>
24759          mbstate_t     size_t            char16_t         char32_t
24760          size_t mbrtoc16(char16_t * restrict pc16,
24761               const char * restrict s, size_t n,
24762               mbstate_t * restrict ps);
24763          size_t c16rtomb(char * restrict s, char16_t c16,
24764               mbstate_t * restrict ps);
24765          size_t mbrtoc32(char32_t * restrict pc32,
24766               const char * restrict s, size_t n,
24767               mbstate_t * restrict ps);
24768          size_t c32rtomb(char * restrict s, char32_t c32,
24769               mbstate_t * restrict ps);
24770 </pre>
24771
24772 <h3><a name="B.27" href="#B.27">B.27 Extended multibyte/wide character utilities <wchar.h></a></h3>
24773 <!--page 512 -->
24774 <!--page 513 -->
24775 <!--page 514 -->
24776 <!--page 515 -->
24777 <!--page 516 -->
24778 <pre>
24779          wchar_t             wint_t                  WCHAR_MAX
24780          size_t              struct tm               WCHAR_MIN
24781          mbstate_t           NULL                    WEOF
24782          int fwprintf(FILE * restrict stream,
24783               const wchar_t * restrict format, ...);
24784          int fwscanf(FILE * restrict stream,
24785               const wchar_t * restrict format, ...);
24786          int swprintf(wchar_t * restrict s, size_t n,
24787               const wchar_t * restrict format, ...);
24788          int swscanf(const wchar_t * restrict s,
24789               const wchar_t * restrict format, ...);
24790          int vfwprintf(FILE * restrict stream,
24791               const wchar_t * restrict format, va_list arg);
24792          int vfwscanf(FILE * restrict stream,
24793               const wchar_t * restrict format, va_list arg);
24794          int vswprintf(wchar_t * restrict s, size_t n,
24795               const wchar_t * restrict format, va_list arg);
24796        int vswscanf(const wchar_t * restrict s,
24797             const wchar_t * restrict format, va_list arg);
24798        int vwprintf(const wchar_t * restrict format,
24799             va_list arg);
24800        int vwscanf(const wchar_t * restrict format,
24801             va_list arg);
24802        int wprintf(const wchar_t * restrict format, ...);
24803        int wscanf(const wchar_t * restrict format, ...);
24804        wint_t fgetwc(FILE *stream);
24805        wchar_t *fgetws(wchar_t * restrict s, int n,
24806             FILE * restrict stream);
24807        wint_t fputwc(wchar_t c, FILE *stream);
24808        int fputws(const wchar_t * restrict s,
24809             FILE * restrict stream);
24810        int fwide(FILE *stream, int mode);
24811        wint_t getwc(FILE *stream);
24812        wint_t getwchar(void);
24813        wint_t putwc(wchar_t c, FILE *stream);
24814        wint_t putwchar(wchar_t c);
24815        wint_t ungetwc(wint_t c, FILE *stream);
24816        double wcstod(const wchar_t * restrict nptr,
24817             wchar_t ** restrict endptr);
24818        float wcstof(const wchar_t * restrict nptr,
24819             wchar_t ** restrict endptr);
24820        long double wcstold(const wchar_t * restrict nptr,
24821             wchar_t ** restrict endptr);
24822        long int wcstol(const wchar_t * restrict nptr,
24823             wchar_t ** restrict endptr, int base);
24824        long long int wcstoll(const wchar_t * restrict nptr,
24825             wchar_t ** restrict endptr, int base);
24826        unsigned long int wcstoul(const wchar_t * restrict nptr,
24827             wchar_t ** restrict endptr, int base);
24828        unsigned long long int wcstoull(
24829             const wchar_t * restrict nptr,
24830             wchar_t ** restrict endptr, int base);
24831        wchar_t *wcscpy(wchar_t * restrict s1,
24832             const wchar_t * restrict s2);
24833        wchar_t *wcsncpy(wchar_t * restrict s1,
24834             const wchar_t * restrict s2, size_t n);
24835          wchar_t *wmemcpy(wchar_t * restrict s1,
24836               const wchar_t * restrict s2, size_t n);
24837          wchar_t *wmemmove(wchar_t *s1, const wchar_t *s2,
24838               size_t n);
24839          wchar_t *wcscat(wchar_t * restrict s1,
24840               const wchar_t * restrict s2);
24841          wchar_t *wcsncat(wchar_t * restrict s1,
24842               const wchar_t * restrict s2, size_t n);
24843          int wcscmp(const wchar_t *s1, const wchar_t *s2);
24844          int wcscoll(const wchar_t *s1, const wchar_t *s2);
24845          int wcsncmp(const wchar_t *s1, const wchar_t *s2,
24846               size_t n);
24847          size_t wcsxfrm(wchar_t * restrict s1,
24848               const wchar_t * restrict s2, size_t n);
24849          int wmemcmp(const wchar_t *s1, const wchar_t *s2,
24850               size_t n);
24851          wchar_t *wcschr(const wchar_t *s, wchar_t c);
24852          size_t wcscspn(const wchar_t *s1, const wchar_t *s2);
24853          wchar_t *wcspbrk(const wchar_t *s1, const wchar_t *s2);
24854          wchar_t *wcsrchr(const wchar_t *s, wchar_t c);
24855          size_t wcsspn(const wchar_t *s1, const wchar_t *s2);
24856          wchar_t *wcsstr(const wchar_t *s1, const wchar_t *s2);
24857          wchar_t *wcstok(wchar_t * restrict s1,
24858               const wchar_t * restrict s2,
24859               wchar_t ** restrict ptr);
24860          wchar_t *wmemchr(const wchar_t *s, wchar_t c, size_t n);
24861          size_t wcslen(const wchar_t *s);
24862          wchar_t *wmemset(wchar_t *s, wchar_t c, size_t n);
24863          size_t wcsftime(wchar_t * restrict s, size_t maxsize,
24864               const wchar_t * restrict format,
24865               const struct tm * restrict timeptr);
24866          wint_t btowc(int c);
24867          int wctob(wint_t c);
24868          int mbsinit(const mbstate_t *ps);
24869          size_t mbrlen(const char * restrict s, size_t n,
24870               mbstate_t * restrict ps);
24871          size_t mbrtowc(wchar_t * restrict pwc,
24872               const char * restrict s, size_t n,
24873               mbstate_t * restrict ps);
24874        size_t wcrtomb(char * restrict s, wchar_t wc,
24875             mbstate_t * restrict ps);
24876        size_t mbsrtowcs(wchar_t * restrict dst,
24877             const char ** restrict src, size_t len,
24878             mbstate_t * restrict ps);
24879        size_t wcsrtombs(char * restrict dst,
24880             const wchar_t ** restrict src, size_t len,
24881             mbstate_t * restrict ps);
24882        __STDC_WANT_LIB_EXT1__
24883        errno_t
24884        rsize_t
24885        int fwprintf_s(FILE * restrict stream,
24886             const wchar_t * restrict format, ...);
24887        int fwscanf_s(FILE * restrict stream,
24888             const wchar_t * restrict format, ...);
24889        int snwprintf_s(wchar_t * restrict s,
24890             rsize_t n,
24891             const wchar_t * restrict format, ...);
24892        int swprintf_s(wchar_t * restrict s, rsize_t n,
24893             const wchar_t * restrict format, ...);
24894        int swscanf_s(const wchar_t * restrict s,
24895             const wchar_t * restrict format, ...);
24896        int vfwprintf_s(FILE * restrict stream,
24897             const wchar_t * restrict format,
24898             va_list arg);
24899        int vfwscanf_s(FILE * restrict stream,
24900             const wchar_t * restrict format, va_list arg);
24901        int vsnwprintf_s(wchar_t * restrict s,
24902             rsize_t n,
24903             const wchar_t * restrict format,
24904             va_list arg);
24905        int vswprintf_s(wchar_t * restrict s,
24906             rsize_t n,
24907             const wchar_t * restrict format,
24908             va_list arg);
24909        int vswscanf_s(const wchar_t * restrict s,
24910             const wchar_t * restrict format,
24911             va_list arg);
24912          int vwprintf_s(const wchar_t * restrict format,
24913               va_list arg);
24914          int vwscanf_s(const wchar_t * restrict format,
24915               va_list arg);
24916          int wprintf_s(const wchar_t * restrict format, ...);
24917          int wscanf_s(const wchar_t * restrict format, ...);
24918          errno_t wcscpy_s(wchar_t * restrict s1,
24919               rsize_t s1max,
24920               const wchar_t * restrict s2);
24921          errno_t wcsncpy_s(wchar_t * restrict s1,
24922               rsize_t s1max,
24923               const wchar_t * restrict s2,
24924               rsize_t n);
24925          errno_t wmemcpy_s(wchar_t * restrict s1,
24926               rsize_t s1max,
24927               const wchar_t * restrict s2,
24928               rsize_t n);
24929          errno_t wmemmove_s(wchar_t *s1, rsize_t s1max,
24930               const wchar_t *s2, rsize_t n);
24931          errno_t wcscat_s(wchar_t * restrict s1,
24932               rsize_t s1max,
24933               const wchar_t * restrict s2);
24934          errno_t wcsncat_s(wchar_t * restrict s1,
24935               rsize_t s1max,
24936               const wchar_t * restrict s2,
24937               rsize_t n);
24938          wchar_t *wcstok_s(wchar_t * restrict s1,
24939               rsize_t * restrict s1max,
24940               const wchar_t * restrict s2,
24941               wchar_t ** restrict ptr);
24942          size_t wcsnlen_s(const wchar_t *s, size_t maxsize);
24943          errno_t wcrtomb_s(size_t * restrict retval,
24944               char * restrict s, rsize_t smax,
24945               wchar_t wc, mbstate_t * restrict ps);
24946          errno_t mbsrtowcs_s(size_t * restrict retval,
24947               wchar_t * restrict dst, rsize_t dstmax,
24948               const char ** restrict src, rsize_t len,
24949               mbstate_t * restrict ps);
24950        errno_t wcsrtombs_s(size_t * restrict retval,
24951             char * restrict dst, rsize_t dstmax,
24952             const wchar_t ** restrict src, rsize_t len,
24953             mbstate_t * restrict ps);
24954 </pre>
24955
24956 <h3><a name="B.28" href="#B.28">B.28 Wide character classification and mapping utilities <wctype.h></a></h3>
24957 <!--page 517 -->
24958 <pre>
24959        wint_t          wctrans_t         wctype_t         WEOF
24960        int iswalnum(wint_t wc);
24961        int iswalpha(wint_t wc);
24962        int iswblank(wint_t wc);
24963        int iswcntrl(wint_t wc);
24964        int iswdigit(wint_t wc);
24965        int iswgraph(wint_t wc);
24966        int iswlower(wint_t wc);
24967        int iswprint(wint_t wc);
24968        int iswpunct(wint_t wc);
24969        int iswspace(wint_t wc);
24970        int iswupper(wint_t wc);
24971        int iswxdigit(wint_t wc);
24972        int iswctype(wint_t wc, wctype_t desc);
24973        wctype_t wctype(const char *property);
24974        wint_t towlower(wint_t wc);
24975        wint_t towupper(wint_t wc);
24976        wint_t towctrans(wint_t wc, wctrans_t desc);
24977        wctrans_t wctrans(const char *property);
24978 </pre>
24979
24980 <h2><a name="C" href="#C">Annex C</a></h2>
24981 <pre>
24982                                      (informative)
24983                                    Sequence points
24984 </pre>
24985 <p><!--para 1 -->
24986  The following are the sequence points described in <a href="#5.1.2.3">5.1.2.3</a>:
24987 <ul>
24988 <li>  Between the evaluations of the function designator and actual arguments in a function
24989  call and the actual call. (<a href="#6.5.2.2">6.5.2.2</a>).
24990 <li>  Between the evaluations of the first and second operands of the following operators:
24991  logical AND &amp;&amp; (<a href="#6.5.13">6.5.13</a>); logical OR || (<a href="#6.5.14">6.5.14</a>); comma , (<a href="#6.5.17">6.5.17</a>).                  *
24992 <li>  Between the evaluations of the first operand of the conditional ? : operator and
24993  whichever of the second and third operands is evaluated (<a href="#6.5.15">6.5.15</a>).
24994 <li>  The end of a full declarator: declarators (<a href="#6.7.6">6.7.6</a>);
24995 <li>  Between the evaluation of a full expression and the next full expression to be
24996  evaluated. The following are full expressions: an initializer that is not part of a
24997  compound literal (<a href="#6.7.9">6.7.9</a>); the expression in an expression statement (<a href="#6.8.3">6.8.3</a>); the
24998  controlling expression of a selection statement (if or switch) (<a href="#6.8.4">6.8.4</a>); the
24999  controlling expression of a while or do statement (<a href="#6.8.5">6.8.5</a>); each of the (optional)
25000  expressions of a for statement (<a href="#6.8.5.3">6.8.5.3</a>); the (optional) expression in a return
25001  statement (<a href="#6.8.6.4">6.8.6.4</a>).
25002 <li>  Immediately before a library function returns (<a href="#7.1.4">7.1.4</a>).
25003 <li>  After the actions associated with each formatted input/output function conversion
25004  specifier (<a href="#7.21.6">7.21.6</a>, <a href="#7.28.2">7.28.2</a>).
25005 <li>  Immediately before and immediately after each call to a comparison function, and
25006  also between any call to a comparison function and any movement of the objects
25007  passed as arguments to that call (<a href="#7.22.5">7.22.5</a>).
25008 <!--page 518 -->
25009 </ul>
25010
25011 <h2><a name="D" href="#D">Annex D</a></h2>
25012 <pre>
25013                                      (normative)
25014                 Universal character names for identifiers
25015 </pre>
25016 <p><!--para 1 -->
25017  This clause lists the hexadecimal code values that are valid in universal character names
25018  in identifiers.
25019
25020 <h3><a name="D.1" href="#D.1">D.1 Ranges of characters allowed</a></h3>
25021 <p><!--para 1 -->
25022  00A8, 00AA, 00AD, 00AF, 00B2-00B5, 00B7-00BA, 00BC-00BE, 00C0-00D6,
25023  00D8-00F6, 00F8-00FF
25024 <p><!--para 2 -->
25025  0100-167F, 1681-180D, 180F-1FFF
25026 <p><!--para 3 -->
25027  200B-200D, 202A-202E, 203F-2040, 2054, 2060-206F
25028 <p><!--para 4 -->
25029  2070-218F, 2460-24FF, 2776-2793, 2C00-2DFF, 2E80-2FFF
25030 <p><!--para 5 -->
25031  3004-3007, 3021-302F, 3031-303F
25032 <p><!--para 6 -->
25033  3040-D7FF
25034 <p><!--para 7 -->
25035  F900-FD3D, FD40-FDCF, FDF0-FE44, FE47-FFFD
25036 <p><!--para 8 -->
25037  10000-1FFFD, 20000-2FFFD, 30000-3FFFD, 40000-4FFFD, 50000-5FFFD,
25038  60000-6FFFD, 70000-7FFFD, 80000-8FFFD, 90000-9FFFD, A0000-AFFFD,
25039  B0000-BFFFD, C0000-CFFFD, D0000-DFFFD, E0000-EFFFD
25040
25041 <h3><a name="D.2" href="#D.2">D.2 Ranges of characters disallowed initially</a></h3>
25042 <p><!--para 1 -->
25043  0300-036F, 1DC0-1DFF, 20D0-20FF, FE20-FE2F
25044 <!--page 519 -->
25045
25046 <h2><a name="E" href="#E">Annex E</a></h2>
25047 <pre>
25048                                     (informative)
25049                              Implementation limits
25050 </pre>
25051 <p><!--para 1 -->
25052  The contents of the header <a href="#7.10">&lt;limits.h&gt;</a> are given below, in alphabetical order. The
25053  minimum magnitudes shown shall be replaced by implementation-defined magnitudes
25054  with the same sign. The values shall all be constant expressions suitable for use in #if
25055  preprocessing directives. The components are described further in <a href="#5.2.4.2.1">5.2.4.2.1</a>.
25056 <pre>
25057          #define    CHAR_BIT                               8
25058          #define    CHAR_MAX          UCHAR_MAX or SCHAR_MAX
25059          #define    CHAR_MIN                  0 or SCHAR_MIN
25060          #define    INT_MAX                           +32767
25061          #define    INT_MIN                           -32767
25062          #define    LONG_MAX                     +2147483647
25063          #define    LONG_MIN                     -2147483647
25064          #define    LLONG_MAX           +9223372036854775807
25065          #define    LLONG_MIN           -9223372036854775807
25066          #define    MB_LEN_MAX                             1
25067          #define    SCHAR_MAX                           +127
25068          #define    SCHAR_MIN                           -127
25069          #define    SHRT_MAX                          +32767
25070          #define    SHRT_MIN                          -32767
25071          #define    UCHAR_MAX                            255
25072          #define    USHRT_MAX                          65535
25073          #define    UINT_MAX                           65535
25074          #define    ULONG_MAX                     4294967295
25075          #define    ULLONG_MAX          18446744073709551615
25076 </pre>
25077 <p><!--para 2 -->
25078  The contents of the header <a href="#7.7">&lt;float.h&gt;</a> are given below. All integer values, except
25079  FLT_ROUNDS, shall be constant expressions suitable for use in #if preprocessing
25080  directives; all floating values shall be constant expressions. The components are
25081  described further in <a href="#5.2.4.2.2">5.2.4.2.2</a>.
25082 <p><!--para 3 -->
25083  The values given in the following list shall be replaced by implementation-defined
25084  expressions:
25085 <pre>
25086          #define FLT_EVAL_METHOD
25087          #define FLT_ROUNDS
25088 </pre>
25089 <p><!--para 4 -->
25090  The values given in the following list shall be replaced by implementation-defined
25091  constant expressions that are greater or equal in magnitude (absolute value) to those
25092  shown, with the same sign:
25093 <!--page 520 -->
25094 <pre>
25095         #define    DLB_DECIMAL_DIG                                10
25096         #define    DBL_DIG                                        10
25097         #define    DBL_MANT_DIG
25098         #define    DBL_MAX_10_EXP                               +37
25099         #define    DBL_MAX_EXP
25100         #define    DBL_MIN_10_EXP                               -37
25101         #define    DBL_MIN_EXP
25102         #define    DECIMAL_DIG                                    10
25103         #define    FLT_DECIMAL_DIG                                 6
25104         #define    FLT_DIG                                         6
25105         #define    FLT_MANT_DIG
25106         #define    FLT_MAX_10_EXP                               +37
25107         #define    FLT_MAX_EXP
25108         #define    FLT_MIN_10_EXP                               -37
25109         #define    FLT_MIN_EXP
25110         #define    FLT_RADIX                                       2
25111         #define    LDLB_DECIMAL_DIG                               10
25112         #define    LDBL_DIG                                       10
25113         #define    LDBL_MANT_DIG
25114         #define    LDBL_MAX_10_EXP                              +37
25115         #define    LDBL_MAX_EXP
25116         #define    LDBL_MIN_10_EXP                              -37
25117         #define    LDBL_MIN_EXP
25118 </pre>
25119 <p><!--para 5 -->
25120  The values given in the following list shall be replaced by implementation-defined
25121  constant expressions with values that are greater than or equal to those shown:
25122 <pre>
25123         #define DBL_MAX                                      1E+37
25124         #define FLT_MAX                                      1E+37
25125         #define LDBL_MAX                                     1E+37
25126 </pre>
25127 <p><!--para 6 -->
25128  The values given in the following list shall be replaced by implementation-defined
25129  constant expressions with (positive) values that are less than or equal to those shown:
25130 <!--page 521 -->
25131 <pre>
25132         #define    DBL_EPSILON                                1E-9
25133         #define    DBL_MIN                                   1E-37
25134         #define    FLT_EPSILON                                1E-5
25135         #define    FLT_MIN                                   1E-37
25136         #define    LDBL_EPSILON                               1E-9
25137         #define    LDBL_MIN                                  1E-37
25138 </pre>
25139
25140 <h2><a name="F" href="#F">Annex F</a></h2>
25141 <pre>
25142                                            (normative)
25143                        IEC 60559 floating-point arithmetic
25144 </pre>
25145
25146 <h3><a name="F.1" href="#F.1">F.1 Introduction</a></h3>
25147 <p><!--para 1 -->
25148  This annex specifies C language support for the IEC 60559 floating-point standard. The
25149  IEC 60559 floating-point standard is specifically Binary floating-point arithmetic for
25150  microprocessor systems, second edition (IEC 60559:1989), previously designated
25151  IEC 559:1989 and as IEEE Standard for Binary Floating-Point Arithmetic
25152  (ANSI/IEEE 754-1985). IEEE Standard for Radix-Independent Floating-Point
25153  Arithmetic (ANSI/IEEE 854-1987) generalizes the binary standard to remove
25154  dependencies on radix and word length. IEC 60559 generally refers to the floating-point
25155  standard, as in IEC 60559 operation, IEC 60559 format, etc. An implementation that
25156  defines __STDC_IEC_559__ shall conform to the specifications in this annex.<sup><a href="#note343"><b>343)</b></a></sup>
25157  Where a binding between the C language and IEC 60559 is indicated, the
25158  IEC 60559-specified behavior is adopted by reference, unless stated otherwise. Since
25159  negative and positive infinity are representable in IEC 60559 formats, all real numbers lie
25160  within the range of representable values.
25161
25162 <h6>footnotes</h6>
25163 <p><small><a name="note343" href="#note343">343)</a> Implementations that do not define __STDC_IEC_559__ are not required to conform to these
25164  specifications.
25165 </small>
25166
25167 <h3><a name="F.2" href="#F.2">F.2 Types</a></h3>
25168 <p><!--para 1 -->
25169  The C floating types match the IEC 60559 formats as follows:
25170 <ul>
25171 <li>  The float type matches the IEC 60559 single format.
25172 <li>  The double type matches the IEC 60559 double format.
25173 <li>  The long double type matches an IEC 60559 extended format,<sup><a href="#note344"><b>344)</b></a></sup> else a
25174  non-IEC 60559 extended format, else the IEC 60559 double format.
25175 </ul>
25176  Any non-IEC 60559 extended format used for the long double type shall have more
25177  precision than IEC 60559 double and at least the range of IEC 60559 double.<sup><a href="#note345"><b>345)</b></a></sup>
25178  
25179  
25180  
25181  
25182 <!--page 522 -->
25183 <h6>Recommended practice</h6>
25184 <p><!--para 2 -->
25185  The long double type should match an IEC 60559 extended format.
25186
25187 <h6>footnotes</h6>
25188 <p><small><a name="note344" href="#note344">344)</a> ''Extended'' is IEC 60559's double-extended data format. Extended refers to both the common 80-bit
25189  and quadruple 128-bit IEC 60559 formats.
25190 </small>
25191 <p><small><a name="note345" href="#note345">345)</a> A non-IEC 60559 long double type is required to provide infinity and NaNs, as its values include
25192  all double values.
25193 </small>
25194
25195 <h4><a name="F.2.1" href="#F.2.1">F.2.1 Infinities, signed zeros, and NaNs</a></h4>
25196 <p><!--para 1 -->
25197  This specification does not define the behavior of signaling NaNs.<sup><a href="#note346"><b>346)</b></a></sup> It generally uses
25198  the term NaN to denote quiet NaNs. The NAN and INFINITY macros and the nan
25199  functions in <a href="#7.12">&lt;math.h&gt;</a> provide designations for IEC 60559 NaNs and infinities.
25200
25201 <h6>footnotes</h6>
25202 <p><small><a name="note346" href="#note346">346)</a> Since NaNs created by IEC 60559 operations are always quiet, quiet NaNs (along with infinities) are
25203  sufficient for closure of the arithmetic.
25204 </small>
25205
25206 <h3><a name="F.3" href="#F.3">F.3 Operators and functions</a></h3>
25207 <p><!--para 1 -->
25208  C operators and functions provide IEC 60559 required and recommended facilities as
25209  listed below.
25210 <ul>
25211 <li>  The +, -, *, and / operators provide the IEC 60559 add, subtract, multiply, and
25212  divide operations.
25213 <li>  The sqrt functions in <a href="#7.12">&lt;math.h&gt;</a> provide the IEC 60559 square root operation.
25214 <li>  The remainder functions in <a href="#7.12">&lt;math.h&gt;</a> provide the IEC 60559 remainder
25215  operation. The remquo functions in <a href="#7.12">&lt;math.h&gt;</a> provide the same operation but
25216  with additional information.
25217 <li>  The rint functions in <a href="#7.12">&lt;math.h&gt;</a> provide the IEC 60559 operation that rounds a
25218  floating-point number to an integer value (in the same precision). The nearbyint
25219  functions in <a href="#7.12">&lt;math.h&gt;</a> provide the nearbyinteger function recommended in the
25220  Appendix to ANSI/IEEE 854.
25221 <li>  The conversions for floating types provide the IEC 60559 conversions between
25222  floating-point precisions.
25223 <li>  The conversions from integer to floating types provide the IEC 60559 conversions
25224  from integer to floating point.
25225 <li>  The conversions from floating to integer types provide IEC 60559-like conversions
25226  but always round toward zero.
25227 <li>  The lrint and llrint functions in <a href="#7.12">&lt;math.h&gt;</a> provide the IEC 60559
25228  conversions, which honor the directed rounding mode, from floating point to the
25229  long int and long long int integer formats. The lrint and llrint
25230  functions can be used to implement IEC 60559 conversions from floating to other
25231  integer formats.
25232 <li>  The translation time conversion of floating constants and the strtod, strtof,
25233  strtold, fprintf, fscanf, and related library functions in <a href="#7.22">&lt;stdlib.h&gt;</a>,
25234  
25235  
25236 <!--page 523 -->
25237   <a href="#7.21">&lt;stdio.h&gt;</a>, and <a href="#7.28">&lt;wchar.h&gt;</a> provide IEC 60559 binary-decimal conversions. The
25238   strtold function in <a href="#7.22">&lt;stdlib.h&gt;</a> provides the conv function recommended in the
25239   Appendix to ANSI/IEEE 854.
25240 <li>  The relational and equality operators provide IEC 60559 comparisons. IEC 60559
25241  identifies a need for additional comparison predicates to facilitate writing code that
25242  accounts for NaNs. The comparison macros (isgreater, isgreaterequal,
25243  isless, islessequal, islessgreater, and isunordered) in <a href="#7.12">&lt;math.h&gt;</a>
25244  supplement the language operators to address this need. The islessgreater and
25245  isunordered macros provide respectively a quiet version of the &lt;&gt; predicate and
25246  the unordered predicate recommended in the Appendix to IEC 60559.
25247 <li>  The feclearexcept, feraiseexcept, and fetestexcept functions in
25248  <a href="#7.6">&lt;fenv.h&gt;</a> provide the facility to test and alter the IEC 60559 floating-point
25249  exception status flags. The fegetexceptflag and fesetexceptflag
25250  functions in <a href="#7.6">&lt;fenv.h&gt;</a> provide the facility to save and restore all five status flags at
25251  one time. These functions are used in conjunction with the type fexcept_t and the
25252  floating-point     exception      macros      (FE_INEXACT,         FE_DIVBYZERO,
25253  FE_UNDERFLOW, FE_OVERFLOW, FE_INVALID) also in <a href="#7.6">&lt;fenv.h&gt;</a>.
25254 <li>  The fegetround and fesetround functions in <a href="#7.6">&lt;fenv.h&gt;</a> provide the facility
25255  to select among the IEC 60559 directed rounding modes represented by the rounding
25256  direction macros in <a href="#7.6">&lt;fenv.h&gt;</a> (FE_TONEAREST, FE_UPWARD, FE_DOWNWARD,
25257  FE_TOWARDZERO) and the values 0, 1, 2, and 3 of FLT_ROUNDS are the
25258  IEC 60559 directed rounding modes.
25259 <li>  The fegetenv, feholdexcept, fesetenv, and feupdateenv functions in
25260  <a href="#7.6">&lt;fenv.h&gt;</a> provide a facility to manage the floating-point environment, comprising
25261  the IEC 60559 status flags and control modes.
25262 <li>  The copysign functions in <a href="#7.12">&lt;math.h&gt;</a> provide the copysign function
25263  recommended in the Appendix to IEC 60559.
25264 <li>  The fabs functions in <a href="#7.12">&lt;math.h&gt;</a> provide the abs function recommended in the
25265  Appendix to IEC 60559.
25266 <li>  The unary minus (-) operator provides the unary minus (-) operation recommended
25267  in the Appendix to IEC 60559.
25268 <li>  The scalbn and scalbln functions in <a href="#7.12">&lt;math.h&gt;</a> provide the scalb function
25269  recommended in the Appendix to IEC 60559.
25270 <li>  The logb functions in <a href="#7.12">&lt;math.h&gt;</a> provide the logb function recommended in the
25271  Appendix to IEC 60559, but following the newer specifications in ANSI/IEEE 854.
25272 <li>  The nextafter and nexttoward functions in <a href="#7.12">&lt;math.h&gt;</a> provide the nextafter
25273  function recommended in the Appendix to IEC 60559 (but with a minor change to
25274 <!--page 524 -->
25275    better handle signed zeros).
25276 <li>  The isfinite macro in <a href="#7.12">&lt;math.h&gt;</a> provides the finite function recommended in
25277  the Appendix to IEC 60559.
25278 <li>  The isnan macro in <a href="#7.12">&lt;math.h&gt;</a> provides the isnan function recommended in the
25279  Appendix to IEC 60559.
25280 <li>  The signbit macro and the fpclassify macro in <a href="#7.12">&lt;math.h&gt;</a>, used in
25281  conjunction with the number classification macros (FP_NAN, FP_INFINITE,
25282  FP_NORMAL, FP_SUBNORMAL, FP_ZERO), provide the facility of the class
25283  function recommended in the Appendix to IEC 60559 (except that the classification
25284  macros defined in <a href="#7.12.3">7.12.3</a> do not distinguish signaling from quiet NaNs).
25285 </ul>
25286
25287 <h3><a name="F.4" href="#F.4">F.4 Floating to integer conversion</a></h3>
25288 <p><!--para 1 -->
25289  If the integer type is _Bool, <a href="#6.3.1.2">6.3.1.2</a> applies and no floating-point exceptions are raised
25290  (even for NaN). Otherwise, if the floating value is infinite or NaN or if the integral part
25291  of the floating value exceeds the range of the integer type, then the ''invalid'' floating-
25292  point exception is raised and the resulting value is unspecified. Otherwise, the resulting
25293  value is determined by <a href="#6.3.1.4">6.3.1.4</a>. Conversion of an integral floating value that does not
25294  exceed the range of the integer type raises no floating-point exceptions; whether
25295  conversion of a non-integral floating value raises the ''inexact'' floating-point exception is
25296  unspecified.<sup><a href="#note347"><b>347)</b></a></sup>
25297
25298 <h6>footnotes</h6>
25299 <p><small><a name="note347" href="#note347">347)</a> ANSI/IEEE 854, but not IEC 60559 (ANSI/IEEE 754), directly specifies that floating-to-integer
25300  conversions raise the ''inexact'' floating-point exception for non-integer in-range values. In those
25301  cases where it matters, library functions can be used to effect such conversions with or without raising
25302  the ''inexact'' floating-point exception. See rint, lrint, llrint, and nearbyint in
25303  <a href="#7.12">&lt;math.h&gt;</a>.
25304 </small>
25305
25306 <h3><a name="F.5" href="#F.5">F.5 Binary-decimal conversion</a></h3>
25307 <p><!--para 1 -->
25308  Conversion from the widest supported IEC 60559 format to decimal with
25309  DECIMAL_DIG digits and back is the identity function.<sup><a href="#note348"><b>348)</b></a></sup>
25310 <p><!--para 2 -->
25311  Conversions involving IEC 60559 formats follow all pertinent recommended practice. In
25312  particular, conversion between any supported IEC 60559 format and decimal with
25313  DECIMAL_DIG or fewer significant digits is correctly rounded (honoring the current
25314  rounding mode), which assures that conversion from the widest supported IEC 60559
25315  format to decimal with DECIMAL_DIG digits and back is the identity function.
25316  
25317  
25318  
25319 <!--page 525 -->
25320 <p><!--para 3 -->
25321  Functions such as strtod that convert character sequences to floating types honor the
25322  rounding direction. Hence, if the rounding direction might be upward or downward, the
25323  implementation cannot convert a minus-signed sequence by negating the converted
25324  unsigned sequence.
25325
25326 <h6>footnotes</h6>
25327 <p><small><a name="note348" href="#note348">348)</a> If the minimum-width IEC 60559 extended format (64 bits of precision) is supported,
25328  DECIMAL_DIG shall be at least 21. If IEC 60559 double (53 bits of precision) is the widest
25329  IEC 60559 format supported, then DECIMAL_DIG shall be at least 17. (By contrast, LDBL_DIG and
25330  DBL_DIG are 18 and 15, respectively, for these formats.)
25331 </small>
25332
25333 <h3><a name="F.6" href="#F.6">F.6 The return statement</a></h3>
25334  If the return expression is evaluated in a floating-point format different from the return
25335  type, the expression is converted as if by assignment<sup><a href="#note349"><b>349)</b></a></sup> to the return type of the function
25336  and the resulting value is returned to the caller.
25337
25338 <h6>footnotes</h6>
25339 <p><small><a name="note349" href="#note349">349)</a> Assignment removes any extra range and precision.
25340 </small>
25341
25342 <h3><a name="F.7" href="#F.7">F.7 Contracted expressions</a></h3>
25343 <p><!--para 1 -->
25344  A contracted expression is correctly rounded (once) and treats infinities, NaNs, signed
25345  zeros, subnormals, and the rounding directions in a manner consistent with the basic
25346  arithmetic operations covered by IEC 60559.
25347 <h6>Recommended practice</h6>
25348 <p><!--para 2 -->
25349  A contracted expression should raise floating-point exceptions in a manner generally
25350  consistent with the basic arithmetic operations.                                    *
25351
25352 <h3><a name="F.8" href="#F.8">F.8 Floating-point environment</a></h3>
25353 <p><!--para 1 -->
25354  The floating-point environment defined in <a href="#7.6">&lt;fenv.h&gt;</a> includes the IEC 60559 floating-
25355  point exception status flags and directed-rounding control modes. It includes also
25356  IEC 60559 dynamic rounding precision and trap enablement modes, if the
25357  implementation supports them.<sup><a href="#note350"><b>350)</b></a></sup>
25358
25359 <h6>footnotes</h6>
25360 <p><small><a name="note350" href="#note350">350)</a> This specification does not require dynamic rounding precision nor trap enablement modes.
25361 </small>
25362
25363 <h4><a name="F.8.1" href="#F.8.1">F.8.1 Environment management</a></h4>
25364 <p><!--para 1 -->
25365  IEC 60559 requires that floating-point operations implicitly raise floating-point exception
25366  status flags, and that rounding control modes can be set explicitly to affect result values of
25367  floating-point operations. When the state for the FENV_ACCESS pragma (defined in
25368  <a href="#7.6">&lt;fenv.h&gt;</a>) is ''on'', these changes to the floating-point state are treated as side effects
25369  which respect sequence points.<sup><a href="#note351"><b>351)</b></a></sup>
25370  
25371  
25372  
25373  
25374 <!--page 526 -->
25375
25376 <h6>footnotes</h6>
25377 <p><small><a name="note351" href="#note351">351)</a> If the state for the FENV_ACCESS pragma is ''off'', the implementation is free to assume the floating-
25378  point control modes will be the default ones and the floating-point status flags will not be tested,
25379  which allows certain optimizations (see <a href="#F.9">F.9</a>).
25380 </small>
25381
25382 <h4><a name="F.8.2" href="#F.8.2">F.8.2 Translation</a></h4>
25383 <p><!--para 1 -->
25384  During translation the IEC 60559 default modes are in effect:
25385 <ul>
25386 <li>  The rounding direction mode is rounding to nearest.
25387 <li>  The rounding precision mode (if supported) is set so that results are not shortened.
25388 <li>  Trapping or stopping (if supported) is disabled on all floating-point exceptions.
25389 </ul>
25390 <h6>Recommended practice</h6>
25391 <p><!--para 2 -->
25392  The implementation should produce a diagnostic message for each translation-time
25393  floating-point exception, other than ''inexact'';<sup><a href="#note352"><b>352)</b></a></sup> the implementation should then
25394  proceed with the translation of the program.
25395
25396 <h6>footnotes</h6>
25397 <p><small><a name="note352" href="#note352">352)</a> As floating constants are converted to appropriate internal representations at translation time, their
25398  conversion is subject to default rounding modes and raises no execution-time floating-point exceptions
25399  (even where the state of the FENV_ACCESS pragma is ''on''). Library functions, for example
25400  strtod, provide execution-time conversion of numeric strings.
25401 </small>
25402
25403 <h4><a name="F.8.3" href="#F.8.3">F.8.3 Execution</a></h4>
25404 <p><!--para 1 -->
25405  At program startup the floating-point environment is initialized as prescribed by
25406  IEC 60559:
25407 <ul>
25408 <li>  All floating-point exception status flags are cleared.
25409 <li>  The rounding direction mode is rounding to nearest.
25410 <li>  The dynamic rounding precision mode (if supported) is set so that results are not
25411  shortened.
25412 <li>  Trapping or stopping (if supported) is disabled on all floating-point exceptions.
25413 </ul>
25414
25415 <h4><a name="F.8.4" href="#F.8.4">F.8.4 Constant expressions</a></h4>
25416 <p><!--para 1 -->
25417  An arithmetic constant expression of floating type, other than one in an initializer for an
25418  object that has static or thread storage duration, is evaluated (as if) during execution; thus,
25419  it is affected by any operative floating-point control modes and raises floating-point
25420  exceptions as required by IEC 60559 (provided the state for the FENV_ACCESS pragma
25421  is ''on'').<sup><a href="#note353"><b>353)</b></a></sup>
25422 <p><!--para 2 -->
25423  EXAMPLE
25424  
25425  
25426  
25427 <!--page 527 -->
25428 <pre>
25429           #include <a href="#7.6">&lt;fenv.h&gt;</a>
25430           #pragma STDC FENV_ACCESS ON
25431           void f(void)
25432           {
25433                 float w[] = { 0.0/0.0 };                  //   raises an exception
25434                 static float x = 0.0/0.0;                 //   does not raise an exception
25435                 float y = 0.0/0.0;                        //   raises an exception
25436                 double z = 0.0/0.0;                       //   raises an exception
25437                 /* ... */
25438           }
25439 </pre>
25440 <p><!--para 3 -->
25441  For the static initialization, the division is done at translation time, raising no (execution-time) floating-
25442  point exceptions. On the other hand, for the three automatic initializations the invalid division occurs at
25443  execution time.
25444  
25445
25446 <h6>footnotes</h6>
25447 <p><small><a name="note353" href="#note353">353)</a> Where the state for the FENV_ACCESS pragma is ''on'', results of inexact expressions like 1.0/3.0
25448  are affected by rounding modes set at execution time, and expressions such as 0.0/0.0 and
25449  1.0/0.0 generate execution-time floating-point exceptions. The programmer can achieve the
25450  efficiency of translation-time evaluation through static initialization, such as
25451
25452 <pre>
25453           const static double one_third = 1.0/3.0;
25454 </pre>
25455 </small>
25456
25457 <h4><a name="F.8.5" href="#F.8.5">F.8.5 Initialization</a></h4>
25458 <p><!--para 1 -->
25459  All computation for automatic initialization is done (as if) at execution time; thus, it is
25460  affected by any operative modes and raises floating-point exceptions as required by
25461  IEC 60559 (provided the state for the FENV_ACCESS pragma is ''on''). All computation
25462  for initialization of objects that have static or thread storage duration is done (as if) at
25463  translation time.
25464 <p><!--para 2 -->
25465  EXAMPLE
25466 <pre>
25467           #include <a href="#7.6">&lt;fenv.h&gt;</a>
25468           #pragma STDC FENV_ACCESS ON
25469           void f(void)
25470           {
25471                 float u[] = { 1.1e75 };                  //   raises exceptions
25472                 static float v = 1.1e75;                 //   does not raise exceptions
25473                 float w = 1.1e75;                        //   raises exceptions
25474                 double x = 1.1e75;                       //   may raise exceptions
25475                 float y = 1.1e75f;                       //   may raise exceptions
25476                 long double z = 1.1e75;                  //   does not raise exceptions
25477                 /* ... */
25478           }
25479 </pre>
25480 <p><!--para 3 -->
25481  The static initialization of v raises no (execution-time) floating-point exceptions because its computation is
25482  done at translation time. The automatic initialization of u and w require an execution-time conversion to
25483  float of the wider value 1.1e75, which raises floating-point exceptions. The automatic initializations
25484  of x and y entail execution-time conversion; however, in some expression evaluation methods, the
25485  conversions is not to a narrower format, in which case no floating-point exception is raised.<sup><a href="#note354"><b>354)</b></a></sup> The
25486  automatic initialization of z entails execution-time conversion, but not to a narrower format, so no floating-
25487  point exception is raised. Note that the conversions of the floating constants 1.1e75 and 1.1e75f to
25488  
25489  
25490  
25491 <!--page 528 -->
25492  their internal representations occur at translation time in all cases.
25493  
25494
25495 <h6>footnotes</h6>
25496 <p><small><a name="note354" href="#note354">354)</a> Use of float_t and double_t variables increases the likelihood of translation-time computation.
25497  For example, the automatic initialization
25498
25499 <pre>
25500           double_t x = 1.1e75;
25501 </pre>
25502  could be done at translation time, regardless of the expression evaluation method.
25503 </small>
25504
25505 <h4><a name="F.8.6" href="#F.8.6">F.8.6 Changing the environment</a></h4>
25506 <p><!--para 1 -->
25507  Operations defined in <a href="#6.5">6.5</a> and functions and macros defined for the standard libraries
25508  change floating-point status flags and control modes just as indicated by their
25509  specifications (including conformance to IEC 60559). They do not change flags or modes
25510  (so as to be detectable by the user) in any other cases.
25511 <p><!--para 2 -->
25512  If the argument to the feraiseexcept function in <a href="#7.6">&lt;fenv.h&gt;</a> represents IEC 60559
25513  valid coincident floating-point exceptions for atomic operations (namely ''overflow'' and
25514  ''inexact'', or ''underflow'' and ''inexact''), then ''overflow'' or ''underflow'' is raised
25515  before ''inexact''.
25516
25517 <h3><a name="F.9" href="#F.9">F.9 Optimization</a></h3>
25518 <p><!--para 1 -->
25519  This section identifies code transformations that might subvert IEC 60559-specified
25520  behavior, and others that do not.
25521
25522 <h4><a name="F.9.1" href="#F.9.1">F.9.1 Global transformations</a></h4>
25523 <p><!--para 1 -->
25524  Floating-point arithmetic operations and external function calls may entail side effects
25525  which optimization shall honor, at least where the state of the FENV_ACCESS pragma is
25526  ''on''. The flags and modes in the floating-point environment may be regarded as global
25527  variables; floating-point operations (+, *, etc.) implicitly read the modes and write the
25528  flags.
25529 <p><!--para 2 -->
25530  Concern about side effects may inhibit code motion and removal of seemingly useless
25531  code. For example, in
25532 <pre>
25533           #include <a href="#7.6">&lt;fenv.h&gt;</a>
25534           #pragma STDC FENV_ACCESS ON
25535           void f(double x)
25536           {
25537                /* ... */
25538                for (i = 0; i &lt; n; i++) x + 1;
25539                /* ... */
25540           }
25541 </pre>
25542  x + 1 might raise floating-point exceptions, so cannot be removed. And since the loop
25543  body might not execute (maybe 0 &gt;= n), x + 1 cannot be moved out of the loop. (Of
25544  course these optimizations are valid if the implementation can rule out the nettlesome
25545  cases.)
25546 <p><!--para 3 -->
25547  This specification does not require support for trap handlers that maintain information
25548  about the order or count of floating-point exceptions. Therefore, between function calls,
25549  floating-point exceptions need not be precise: the actual order and number of occurrences
25550  of floating-point exceptions (&gt; 1) may vary from what the source code expresses. Thus,
25551 <!--page 529 -->
25552  the preceding loop could be treated as
25553 <pre>
25554           if (0 &lt; n) x + 1;
25555 </pre>
25556
25557 <h4><a name="F.9.2" href="#F.9.2">F.9.2 Expression transformations</a></h4>
25558 <p><!--para 1 -->
25559  x/2 &lt;-&gt; x x 0.5          Although similar transformations involving inexact constants
25560 <pre>
25561                         generally do not yield numerically equivalent expressions, if the
25562                         constants are exact then such transformations can be made on
25563                         IEC 60559 machines and others that round perfectly.
25564 </pre>
25565  1 x x and x/1 -&gt; x The expressions 1 x x, x/1, and x are equivalent (on IEC 60559
25566 <pre>
25567                    machines, among others).<sup><a href="#note355"><b>355)</b></a></sup>
25568 </pre>
25569  x/x -&gt; 1.0             The expressions x/x and 1.0 are not equivalent if x can be zero,
25570 <pre>
25571                         infinite, or NaN.
25572 </pre>
25573  x - y &lt;-&gt; x + (-y)       The expressions x - y, x + (-y), and (-y) + x are equivalent (on
25574 <pre>
25575                         IEC 60559 machines, among others).
25576 </pre>
25577  x - y &lt;-&gt; -(y - x)       The expressions x - y and -(y - x) are not equivalent because 1 - 1
25578 <pre>
25579                         is +0 but -(1 - 1) is -0 (in the default rounding direction).<sup><a href="#note356"><b>356)</b></a></sup>
25580 </pre>
25581  x - x -&gt; 0.0           The expressions x - x and 0.0 are not equivalent if x is a NaN or
25582 <pre>
25583                         infinite.
25584 </pre>
25585  0 x x -&gt; 0.0           The expressions 0 x x and 0.0 are not equivalent if x is a NaN,
25586 <pre>
25587                         infinite, or -0.
25588 </pre>
25589  x+0-&gt; x                 The expressions x + 0 and x are not equivalent if x is -0, because
25590 <pre>
25591                         (-0) + (+0) yields +0 (in the default rounding direction), not -0.
25592 </pre>
25593  x-0-&gt; x                 (+0) - (+0) yields -0 when rounding is downward (toward -(inf)), but
25594 <pre>
25595                         +0 otherwise, and (-0) - (+0) always yields -0; so, if the state of the
25596                         FENV_ACCESS pragma is ''off'', promising default rounding, then
25597                         the implementation can replace x - 0 by x, even if x might be zero.
25598 </pre>
25599  -x &lt;-&gt; 0 - x             The expressions -x and 0 - x are not equivalent if x is +0, because
25600 <pre>
25601                         -(+0) yields -0, but 0 - (+0) yields +0 (unless rounding is
25602                         downward).
25603 </pre>
25604  
25605 <!--page 530 -->
25606
25607 <h6>footnotes</h6>
25608 <p><small><a name="note355" href="#note355">355)</a> Strict support for signaling NaNs -- not required by this specification -- would invalidate these and
25609  other transformations that remove arithmetic operators.
25610 </small>
25611 <p><small><a name="note356" href="#note356">356)</a> IEC 60559 prescribes a signed zero to preserve mathematical identities across certain discontinuities.
25612  Examples include:
25613
25614 <pre>
25615     1/(1/ (+-) (inf)) is (+-) (inf)
25616 </pre>
25617  and
25618
25619 <pre>
25620     conj(csqrt(z)) is csqrt(conj(z)),
25621 </pre>
25622  for complex z.
25623 </small>
25624
25625 <h4><a name="F.9.3" href="#F.9.3">F.9.3 Relational operators</a></h4>
25626 <p><!--para 1 -->
25627  x != x -&gt; false           The expression x != x is true if x is a NaN.
25628  x = x -&gt; true            The expression x = x is false if x is a NaN.
25629  x &lt; y -&gt; isless(x,y) (and similarly for &lt;=, &gt;, &gt;=) Though numerically equal, these
25630 <pre>
25631                 expressions are not equivalent because of side effects when x or y is a
25632                 NaN and the state of the FENV_ACCESS pragma is ''on''. This
25633                 transformation, which would be desirable if extra code were required
25634                 to cause the ''invalid'' floating-point exception for unordered cases,
25635                 could be performed provided the state of the FENV_ACCESS pragma
25636                 is ''off''.
25637 </pre>
25638  The sense of relational operators shall be maintained. This includes handling unordered
25639  cases as expressed by the source code.
25640 <p><!--para 2 -->
25641  EXAMPLE
25642 <pre>
25643           // calls g and raises ''invalid'' if a and b are unordered
25644           if (a &lt; b)
25645                   f();
25646           else
25647                   g();
25648 </pre>
25649  is not equivalent to
25650 <pre>
25651           // calls f and raises ''invalid'' if a and b are unordered
25652           if (a &gt;= b)
25653                   g();
25654           else
25655                   f();
25656 </pre>
25657  nor to
25658 <pre>
25659           // calls f without raising ''invalid'' if a and b are unordered
25660           if (isgreaterequal(a,b))
25661                   g();
25662           else
25663                   f();
25664 </pre>
25665  nor, unless the state of the FENV_ACCESS pragma is ''off'', to
25666 <pre>
25667           // calls g without raising ''invalid'' if a and b are unordered
25668           if (isless(a,b))
25669                   f();
25670           else
25671                   g();
25672 </pre>
25673  but is equivalent to
25674 <!--page 531 -->
25675 <pre>
25676          if (!(a &lt; b))
25677                g();
25678          else
25679                f();
25680 </pre>
25681  
25682
25683 <h4><a name="F.9.4" href="#F.9.4">F.9.4 Constant arithmetic</a></h4>
25684 <p><!--para 1 -->
25685  The implementation shall honor floating-point exceptions raised by execution-time
25686  constant arithmetic wherever the state of the FENV_ACCESS pragma is ''on''. (See <a href="#F.8.4">F.8.4</a>
25687  and <a href="#F.8.5">F.8.5</a>.) An operation on constants that raises no floating-point exception can be
25688  folded during translation, except, if the state of the FENV_ACCESS pragma is ''on'', a
25689  further check is required to assure that changing the rounding direction to downward does
25690  not alter the sign of the result,<sup><a href="#note357"><b>357)</b></a></sup> and implementations that support dynamic rounding
25691  precision modes shall assure further that the result of the operation raises no floating-
25692  point exception when converted to the semantic type of the operation.
25693
25694 <h6>footnotes</h6>
25695 <p><small><a name="note357" href="#note357">357)</a> 0 - 0 yields -0 instead of +0 just when the rounding direction is downward.
25696 </small>
25697
25698 <h3><a name="F.10" href="#F.10">F.10 Mathematics <math.h></a></h3>
25699 <p><!--para 1 -->
25700  This subclause contains specifications of <a href="#7.12">&lt;math.h&gt;</a> facilities that are particularly suited
25701  for IEC 60559 implementations.
25702 <p><!--para 2 -->
25703  The Standard C macro HUGE_VAL and its float and long double analogs,
25704  HUGE_VALF and HUGE_VALL, expand to expressions whose values are positive
25705  infinities.
25706 <p><!--para 3 -->
25707  Special cases for functions in <a href="#7.12">&lt;math.h&gt;</a> are covered directly or indirectly by
25708  IEC 60559. The functions that IEC 60559 specifies directly are identified in <a href="#F.3">F.3</a>. The
25709  other functions in <a href="#7.12">&lt;math.h&gt;</a> treat infinities, NaNs, signed zeros, subnormals, and
25710  (provided the state of the FENV_ACCESS pragma is ''on'') the floating-point status flags
25711  in a manner consistent with the basic arithmetic operations covered by IEC 60559.
25712 <p><!--para 4 -->
25713  The expression math_errhandling &amp; MATH_ERREXCEPT shall evaluate to a
25714  nonzero value.
25715 <p><!--para 5 -->
25716  The ''invalid'' and ''divide-by-zero'' floating-point exceptions are raised as specified in
25717  subsequent subclauses of this annex.
25718 <p><!--para 6 -->
25719  The ''overflow'' floating-point exception is raised whenever an infinity -- or, because of
25720  rounding direction, a maximal-magnitude finite number -- is returned in lieu of a value
25721  whose magnitude is too large.
25722 <p><!--para 7 -->
25723  The ''underflow'' floating-point exception is raised whenever a result is tiny (essentially
25724  subnormal or zero) and suffers loss of accuracy.<sup><a href="#note358"><b>358)</b></a></sup>
25725  
25726  
25727 <!--page 532 -->
25728 <p><!--para 8 -->
25729  Whether or when library functions raise the ''inexact'' floating-point exception is
25730  unspecified, unless explicitly specified otherwise.
25731 <p><!--para 9 -->
25732  Whether or when library functions raise an undeserved ''underflow'' floating-point
25733  exception is unspecified.<sup><a href="#note359"><b>359)</b></a></sup> Otherwise, as implied by <a href="#F.8.6">F.8.6</a>, the <a href="#7.12">&lt;math.h&gt;</a> functions do
25734  not raise spurious floating-point exceptions (detectable by the user), other than the
25735  ''inexact'' floating-point exception.
25736 <p><!--para 10 -->
25737  Whether the functions honor the rounding direction mode is implementation-defined,
25738  unless explicitly specified otherwise.
25739 <p><!--para 11 -->
25740  Functions with a NaN argument return a NaN result and raise no floating-point exception,
25741  except where stated otherwise.
25742 <p><!--para 12 -->
25743  The specifications in the following subclauses append to the definitions in <a href="#7.12">&lt;math.h&gt;</a>.
25744  For families of functions, the specifications apply to all of the functions even though only
25745  the principal function is shown. Unless otherwise specified, where the symbol ''(+-)''
25746  occurs in both an argument and the result, the result has the same sign as the argument.
25747 <h6>Recommended practice</h6>
25748 <p><!--para 13 -->
25749  If a function with one or more NaN arguments returns a NaN result, the result should be
25750  the same as one of the NaN arguments (after possible type conversion), except perhaps
25751  for the sign.
25752
25753 <h6>footnotes</h6>
25754 <p><small><a name="note358" href="#note358">358)</a> IEC 60559 allows different definitions of underflow. They all result in the same values, but differ on
25755  when the floating-point exception is raised.
25756 </small>
25757 <p><small><a name="note359" href="#note359">359)</a> It is intended that undeserved ''underflow'' and ''inexact'' floating-point exceptions are raised only if
25758  avoiding them would be too costly.
25759 </small>
25760
25761 <h4><a name="F.10.1" href="#F.10.1">F.10.1 Trigonometric functions</a></h4>
25762
25763 <h5><a name="F.10.1.1" href="#F.10.1.1">F.10.1.1 The acos functions</a></h5>
25764 <p><!--para 1 -->
25765 <ul>
25766 <li>  acos(1) returns +0.
25767 <li>  acos(x) returns a NaN and raises the ''invalid'' floating-point exception for
25768  | x | &gt; 1.
25769 </ul>
25770
25771 <h5><a name="F.10.1.2" href="#F.10.1.2">F.10.1.2 The asin functions</a></h5>
25772 <p><!--para 1 -->
25773 <ul>
25774 <li>  asin((+-)0) returns (+-)0.
25775 <li>  asin(x) returns a NaN and raises the ''invalid'' floating-point exception for
25776  | x | &gt; 1.
25777  
25778  
25779  
25780  
25781 <!--page 533 -->
25782 </ul>
25783
25784 <h5><a name="F.10.1.3" href="#F.10.1.3">F.10.1.3 The atan functions</a></h5>
25785 <p><!--para 1 -->
25786 <ul>
25787 <li>  atan((+-)0) returns (+-)0.
25788 <li>  atan((+-)(inf)) returns (+-)pi /2.
25789 </ul>
25790
25791 <h5><a name="F.10.1.4" href="#F.10.1.4">F.10.1.4 The atan2 functions</a></h5>
25792 <p><!--para 1 -->
25793 <ul>
25794 <li>  atan2((+-)0, -0) returns (+-)pi .<sup><a href="#note360"><b>360)</b></a></sup>
25795 <li>  atan2((+-)0, +0) returns (+-)0.
25796 <li>  atan2((+-)0, x) returns (+-)pi for x &lt; 0.
25797 <li>  atan2((+-)0, x) returns (+-)0 for x &gt; 0.
25798 <li>  atan2(y, (+-)0) returns -pi /2 for y &lt; 0.
25799 <li>  atan2(y, (+-)0) returns pi /2 for y &gt; 0.
25800 <li>  atan2((+-)y, -(inf)) returns (+-)pi for finite y &gt; 0.
25801 <li>  atan2((+-)y, +(inf)) returns (+-)0 for finite y &gt; 0.
25802 <li>  atan2((+-)(inf), x) returns (+-)pi /2 for finite x.
25803 <li>  atan2((+-)(inf), -(inf)) returns (+-)3pi /4.
25804 <li>  atan2((+-)(inf), +(inf)) returns (+-)pi /4.
25805 </ul>
25806
25807 <h6>footnotes</h6>
25808 <p><small><a name="note360" href="#note360">360)</a> atan2(0, 0) does not raise the ''invalid'' floating-point exception, nor does atan2( y , 0) raise
25809  the ''divide-by-zero'' floating-point exception.
25810 </small>
25811
25812 <h5><a name="F.10.1.5" href="#F.10.1.5">F.10.1.5 The cos functions</a></h5>
25813 <p><!--para 1 -->
25814 <ul>
25815 <li>  cos((+-)0) returns 1.
25816 <li>  cos((+-)(inf)) returns a NaN and raises the ''invalid'' floating-point exception.
25817 </ul>
25818
25819 <h5><a name="F.10.1.6" href="#F.10.1.6">F.10.1.6 The sin functions</a></h5>
25820 <p><!--para 1 -->
25821 <ul>
25822 <li>  sin((+-)0) returns (+-)0.
25823 <li>  sin((+-)(inf)) returns a NaN and raises the ''invalid'' floating-point exception.
25824 </ul>
25825
25826 <h5><a name="F.10.1.7" href="#F.10.1.7">F.10.1.7 The tan functions</a></h5>
25827 <p><!--para 1 -->
25828 <ul>
25829 <li>  tan((+-)0) returns (+-)0.
25830 <li>  tan((+-)(inf)) returns a NaN and raises the ''invalid'' floating-point exception.
25831  
25832  
25833  
25834  
25835 <!--page 534 -->
25836 </ul>
25837
25838 <h4><a name="F.10.2" href="#F.10.2">F.10.2 Hyperbolic functions</a></h4>
25839
25840 <h5><a name="F.10.2.1" href="#F.10.2.1">F.10.2.1 The acosh functions</a></h5>
25841 <p><!--para 1 -->
25842 <ul>
25843 <li>  acosh(1) returns +0.
25844 <li>  acosh(x) returns a NaN and raises the ''invalid'' floating-point exception for x &lt; 1.
25845 <li>  acosh(+(inf)) returns +(inf).
25846 </ul>
25847
25848 <h5><a name="F.10.2.2" href="#F.10.2.2">F.10.2.2 The asinh functions</a></h5>
25849 <p><!--para 1 -->
25850 <ul>
25851 <li>  asinh((+-)0) returns (+-)0.
25852 <li>  asinh((+-)(inf)) returns (+-)(inf).
25853 </ul>
25854
25855 <h5><a name="F.10.2.3" href="#F.10.2.3">F.10.2.3 The atanh functions</a></h5>
25856 <p><!--para 1 -->
25857 <ul>
25858 <li>  atanh((+-)0) returns (+-)0.
25859 <li>  atanh((+-)1) returns (+-)(inf) and raises the ''divide-by-zero'' floating-point exception.
25860 <li>  atanh(x) returns a NaN and raises the ''invalid'' floating-point exception for
25861  | x | &gt; 1.
25862 </ul>
25863
25864 <h5><a name="F.10.2.4" href="#F.10.2.4">F.10.2.4 The cosh functions</a></h5>
25865 <p><!--para 1 -->
25866 <ul>
25867 <li>  cosh((+-)0) returns 1.
25868 <li>  cosh((+-)(inf)) returns +(inf).
25869 </ul>
25870
25871 <h5><a name="F.10.2.5" href="#F.10.2.5">F.10.2.5 The sinh functions</a></h5>
25872 <p><!--para 1 -->
25873 <ul>
25874 <li>  sinh((+-)0) returns (+-)0.
25875 <li>  sinh((+-)(inf)) returns (+-)(inf).
25876 </ul>
25877
25878 <h5><a name="F.10.2.6" href="#F.10.2.6">F.10.2.6 The tanh functions</a></h5>
25879 <p><!--para 1 -->
25880 <ul>
25881 <li>  tanh((+-)0) returns (+-)0.
25882 <li>  tanh((+-)(inf)) returns (+-)1.
25883 </ul>
25884
25885 <h4><a name="F.10.3" href="#F.10.3">F.10.3 Exponential and logarithmic functions</a></h4>
25886
25887 <h5><a name="F.10.3.1" href="#F.10.3.1">F.10.3.1 The exp functions</a></h5>
25888 <p><!--para 1 -->
25889 <ul>
25890 <li>  exp((+-)0) returns 1.
25891 <li>  exp(-(inf)) returns +0.
25892 <li>  exp(+(inf)) returns +(inf).
25893 <!--page 535 -->
25894 </ul>
25895
25896 <h5><a name="F.10.3.2" href="#F.10.3.2">F.10.3.2 The exp2 functions</a></h5>
25897 <p><!--para 1 -->
25898 <ul>
25899 <li>  exp2((+-)0) returns 1.
25900 <li>  exp2(-(inf)) returns +0.
25901 <li>  exp2(+(inf)) returns +(inf).
25902 </ul>
25903
25904 <h5><a name="F.10.3.3" href="#F.10.3.3">F.10.3.3 The expm1 functions</a></h5>
25905 <p><!--para 1 -->
25906 <ul>
25907 <li>  expm1((+-)0) returns (+-)0.
25908 <li>  expm1(-(inf)) returns -1.
25909 <li>  expm1(+(inf)) returns +(inf).
25910 </ul>
25911
25912 <h5><a name="F.10.3.4" href="#F.10.3.4">F.10.3.4 The frexp functions</a></h5>
25913 <p><!--para 1 -->
25914 <ul>
25915 <li>  frexp((+-)0, exp) returns (+-)0, and stores 0 in the object pointed to by exp.
25916 <li>  frexp((+-)(inf), exp) returns (+-)(inf), and stores an unspecified value in the object
25917  pointed to by exp.
25918 <li>  frexp(NaN, exp) stores an unspecified value in the object pointed to by exp
25919  (and returns a NaN).
25920 </ul>
25921 <p><!--para 2 -->
25922  frexp raises no floating-point exceptions.
25923 <p><!--para 3 -->
25924  When the radix of the argument is a power of 2, the returned value is exact and is
25925  independent of the current rounding direction mode.
25926 <p><!--para 4 -->
25927  On a binary system, the body of the frexp function might be
25928 <pre>
25929          {
25930                 *exp = (value == 0) ? 0 : (int)(1 + logb(value));
25931                 return scalbn(value, -(*exp));
25932          }
25933 </pre>
25934
25935 <h5><a name="F.10.3.5" href="#F.10.3.5">F.10.3.5 The ilogb functions</a></h5>
25936 <p><!--para 1 -->
25937  When the correct result is representable in the range of the return type, the returned value
25938  is exact and is independent of the current rounding direction mode.
25939 <p><!--para 2 -->
25940  If the correct result is outside the range of the return type, the numeric result is
25941  unspecified and the ''invalid'' floating-point exception is raised.
25942 <!--page 536 -->
25943
25944 <h5><a name="F.10.3.6" href="#F.10.3.6">F.10.3.6 The ldexp functions</a></h5>
25945 <p><!--para 1 -->
25946  On a binary system, ldexp(x, exp) is equivalent to scalbn(x, exp).
25947
25948 <h5><a name="F.10.3.7" href="#F.10.3.7">F.10.3.7 The log functions</a></h5>
25949 <p><!--para 1 -->
25950 <ul>
25951 <li>  log((+-)0) returns -(inf) and raises the ''divide-by-zero'' floating-point exception.
25952 <li>  log(1) returns +0.
25953 <li>  log(x) returns a NaN and raises the ''invalid'' floating-point exception for x &lt; 0.
25954 <li>  log(+(inf)) returns +(inf).
25955 </ul>
25956
25957 <h5><a name="F.10.3.8" href="#F.10.3.8">F.10.3.8 The log10 functions</a></h5>
25958 <p><!--para 1 -->
25959 <ul>
25960 <li>  log10((+-)0) returns -(inf) and raises the ''divide-by-zero'' floating-point exception.
25961 <li>  log10(1) returns +0.
25962 <li>  log10(x) returns a NaN and raises the ''invalid'' floating-point exception for x &lt; 0.
25963 <li>  log10(+(inf)) returns +(inf).
25964 </ul>
25965
25966 <h5><a name="F.10.3.9" href="#F.10.3.9">F.10.3.9 The log1p functions</a></h5>
25967 <p><!--para 1 -->
25968 <ul>
25969 <li>  log1p((+-)0) returns (+-)0.
25970 <li>  log1p(-1) returns -(inf) and raises the ''divide-by-zero'' floating-point exception.
25971 <li>  log1p(x) returns a NaN and raises the ''invalid'' floating-point exception for
25972  x &lt; -1.
25973 <li>  log1p(+(inf)) returns +(inf).
25974 </ul>
25975
25976 <h5><a name="F.10.3.10" href="#F.10.3.10">F.10.3.10 The log2 functions</a></h5>
25977 <p><!--para 1 -->
25978 <ul>
25979 <li>  log2((+-)0) returns -(inf) and raises the ''divide-by-zero'' floating-point exception.
25980 <li>  log2(1) returns +0.
25981 <li>  log2(x) returns a NaN and raises the ''invalid'' floating-point exception for x &lt; 0.
25982 <li>  log2(+(inf)) returns +(inf).
25983 </ul>
25984
25985 <h5><a name="F.10.3.11" href="#F.10.3.11">F.10.3.11 The logb functions</a></h5>
25986 <p><!--para 1 -->
25987 <ul>
25988 <li>  logb((+-)0) returns -(inf) and raises the ''divide-by-zero'' floating-point exception.
25989 <li>  logb((+-)(inf)) returns +(inf).
25990 </ul>
25991 <p><!--para 2 -->
25992  The returned value is exact and is independent of the current rounding direction mode.
25993 <!--page 537 -->
25994
25995 <h5><a name="F.10.3.12" href="#F.10.3.12">F.10.3.12 The modf functions</a></h5>
25996 <p><!--para 1 -->
25997 <ul>
25998 <li>  modf((+-)x, iptr) returns a result with the same sign as x.
25999 <li>  modf((+-)(inf), iptr) returns (+-)0 and stores (+-)(inf) in the object pointed to by iptr.
26000 <li>  modf(NaN, iptr) stores a NaN in the object pointed to by iptr (and returns a
26001  NaN).
26002 </ul>
26003 <p><!--para 2 -->
26004  The returned values are exact and are independent of the current rounding direction
26005  mode.
26006 <p><!--para 3 -->
26007  modf behaves as though implemented by
26008 <pre>
26009          #include <a href="#7.12">&lt;math.h&gt;</a>
26010          #include <a href="#7.6">&lt;fenv.h&gt;</a>
26011          #pragma STDC FENV_ACCESS ON
26012          double modf(double value, double *iptr)
26013          {
26014               int save_round = fegetround();
26015               fesetround(FE_TOWARDZERO);
26016               *iptr = nearbyint(value);
26017               fesetround(save_round);
26018               return copysign(
26019                    isinf(value) ? 0.0 :
26020                         value - (*iptr), value);
26021          }
26022 </pre>
26023
26024 <h5><a name="F.10.3.13" href="#F.10.3.13">F.10.3.13 The scalbn and scalbln functions</a></h5>
26025 <p><!--para 1 -->
26026 <ul>
26027 <li>  scalbn((+-)0, n) returns (+-)0.
26028 <li>  scalbn(x, 0) returns x.
26029 <li>  scalbn((+-)(inf), n) returns (+-)(inf).
26030 </ul>
26031 <p><!--para 2 -->
26032  If the calculation does not overflow or underflow, the returned value is exact and
26033  independent of the current rounding direction mode.
26034 <!--page 538 -->
26035
26036 <h4><a name="F.10.4" href="#F.10.4">F.10.4 Power and absolute value functions</a></h4>
26037
26038 <h5><a name="F.10.4.1" href="#F.10.4.1">F.10.4.1 The cbrt functions</a></h5>
26039 <p><!--para 1 -->
26040 <ul>
26041 <li>  cbrt((+-)0) returns (+-)0.
26042 <li>  cbrt((+-)(inf)) returns (+-)(inf).
26043 </ul>
26044
26045 <h5><a name="F.10.4.2" href="#F.10.4.2">F.10.4.2 The fabs functions</a></h5>
26046 <p><!--para 1 -->
26047 <ul>
26048 <li>  fabs((+-)0) returns +0.
26049 <li>  fabs((+-)(inf)) returns +(inf).
26050 </ul>
26051 <p><!--para 2 -->
26052  The returned value is exact and is independent of the current rounding direction mode.
26053
26054 <h5><a name="F.10.4.3" href="#F.10.4.3">F.10.4.3 The hypot functions</a></h5>
26055 <p><!--para 1 -->
26056 <ul>
26057 <li>  hypot(x, y), hypot(y, x), and hypot(x, -y) are equivalent.
26058 <li>  hypot(x, (+-)0) is equivalent to fabs(x).
26059 <li>  hypot((+-)(inf), y) returns +(inf), even if y is a NaN.
26060 </ul>
26061
26062 <h5><a name="F.10.4.4" href="#F.10.4.4">F.10.4.4 The pow functions</a></h5>
26063 <p><!--para 1 -->
26064 <ul>
26065 <li>  pow((+-)0, y) returns (+-)(inf) and raises the ''divide-by-zero'' floating-point exception
26066  for y an odd integer &lt; 0.
26067 <li>  pow((+-)0, y) returns +(inf) and raises the ''divide-by-zero'' floating-point exception
26068  for y &lt; 0, finite, and not an odd integer.
26069 <li>  pow((+-)0, -(inf)) returns +(inf) and may raise the ''divide-by-zero'' floating-point
26070  exception.
26071 <li>  pow((+-)0, y) returns (+-)0 for y an odd integer &gt; 0.
26072 <li>  pow((+-)0, y) returns +0 for y &gt; 0 and not an odd integer.
26073 <li>  pow(-1, (+-)(inf)) returns 1.
26074 <li>  pow(+1, y) returns 1 for any y, even a NaN.
26075 <li>  pow(x, (+-)0) returns 1 for any x, even a NaN.
26076 <li>  pow(x, y) returns a NaN and raises the ''invalid'' floating-point exception for
26077  finite x &lt; 0 and finite non-integer y.
26078 <li>  pow(x, -(inf)) returns +(inf) for | x | &lt; 1.
26079 <li>  pow(x, -(inf)) returns +0 for | x | &gt; 1.
26080 <li>  pow(x, +(inf)) returns +0 for | x | &lt; 1.
26081 <li>  pow(x, +(inf)) returns +(inf) for | x | &gt; 1.
26082 <!--page 539 -->
26083 <li>  pow(-(inf), y) returns -0 for y an odd integer &lt; 0.
26084 <li>  pow(-(inf), y) returns +0 for y &lt; 0 and not an odd integer.
26085 <li>  pow(-(inf), y) returns -(inf) for y an odd integer &gt; 0.
26086 <li>  pow(-(inf), y) returns +(inf) for y &gt; 0 and not an odd integer.
26087 <li>  pow(+(inf), y) returns +0 for y &lt; 0.
26088 <li>  pow(+(inf), y) returns +(inf) for y &gt; 0.
26089 </ul>
26090
26091 <h5><a name="F.10.4.5" href="#F.10.4.5">F.10.4.5 The sqrt functions</a></h5>
26092 <p><!--para 1 -->
26093  sqrt is fully specified as a basic arithmetic operation in IEC 60559. The returned value
26094  is dependent on the current rounding direction mode.
26095
26096 <h4><a name="F.10.5" href="#F.10.5">F.10.5 Error and gamma functions</a></h4>
26097
26098 <h5><a name="F.10.5.1" href="#F.10.5.1">F.10.5.1 The erf functions</a></h5>
26099 <p><!--para 1 -->
26100 <ul>
26101 <li>  erf((+-)0) returns (+-)0.
26102 <li>  erf((+-)(inf)) returns (+-)1.
26103 </ul>
26104
26105 <h5><a name="F.10.5.2" href="#F.10.5.2">F.10.5.2 The erfc functions</a></h5>
26106 <p><!--para 1 -->
26107 <ul>
26108 <li>  erfc(-(inf)) returns 2.
26109 <li>  erfc(+(inf)) returns +0.
26110 </ul>
26111
26112 <h5><a name="F.10.5.3" href="#F.10.5.3">F.10.5.3 The lgamma functions</a></h5>
26113 <p><!--para 1 -->
26114 <ul>
26115 <li>  lgamma(1) returns +0.
26116 <li>  lgamma(2) returns +0.
26117 <li>  lgamma(x) returns +(inf) and raises the ''divide-by-zero'' floating-point exception for
26118  x a negative integer or zero.
26119 <li>  lgamma(-(inf)) returns +(inf).
26120 <li>  lgamma(+(inf)) returns +(inf).
26121 </ul>
26122
26123 <h5><a name="F.10.5.4" href="#F.10.5.4">F.10.5.4 The tgamma functions</a></h5>
26124 <p><!--para 1 -->
26125 <ul>
26126 <li>  tgamma((+-)0) returns (+-)(inf) and raises the ''divide-by-zero'' floating-point exception.
26127 <li>  tgamma(x) returns a NaN and raises the ''invalid'' floating-point exception for x a
26128  negative integer.
26129 <li>  tgamma(-(inf)) returns a NaN and raises the ''invalid'' floating-point exception.
26130 <li>  tgamma(+(inf)) returns +(inf).
26131 <!--page 540 -->
26132 </ul>
26133
26134 <h4><a name="F.10.6" href="#F.10.6">F.10.6 Nearest integer functions</a></h4>
26135
26136 <h5><a name="F.10.6.1" href="#F.10.6.1">F.10.6.1 The ceil functions</a></h5>
26137 <p><!--para 1 -->
26138 <ul>
26139 <li>  ceil((+-)0) returns (+-)0.
26140 <li>  ceil((+-)(inf)) returns (+-)(inf).
26141 </ul>
26142 <p><!--para 2 -->
26143  The returned value is independent of the current rounding direction mode.
26144 <p><!--para 3 -->
26145  The double version of ceil behaves as though implemented by
26146 <pre>
26147         #include <a href="#7.12">&lt;math.h&gt;</a>
26148         #include <a href="#7.6">&lt;fenv.h&gt;</a>
26149         #pragma STDC FENV_ACCESS ON
26150         double ceil(double x)
26151         {
26152              double result;
26153              int save_round = fegetround();
26154              fesetround(FE_UPWARD);
26155              result = rint(x); // or nearbyint instead of rint
26156              fesetround(save_round);
26157              return result;
26158         }
26159 </pre>
26160 <p><!--para 4 -->
26161  The ceil functions may, but are not required to, raise the ''inexact'' floating-point
26162  exception for finite non-integer arguments, as this implementation does.
26163
26164 <h5><a name="F.10.6.2" href="#F.10.6.2">F.10.6.2 The floor functions</a></h5>
26165 <p><!--para 1 -->
26166 <ul>
26167 <li>  floor((+-)0) returns (+-)0.
26168 <li>  floor((+-)(inf)) returns (+-)(inf).
26169 </ul>
26170 <p><!--para 2 -->
26171  The returned value and is independent of the current rounding direction mode.
26172 <p><!--para 3 -->
26173  See the sample implementation for ceil in <a href="#F.10.6.1">F.10.6.1</a>. The floor functions may, but are
26174  not required to, raise the ''inexact'' floating-point exception for finite non-integer
26175  arguments, as that implementation does.
26176
26177 <h5><a name="F.10.6.3" href="#F.10.6.3">F.10.6.3 The nearbyint functions</a></h5>
26178 <p><!--para 1 -->
26179  The nearbyint functions use IEC 60559 rounding according to the current rounding
26180  direction. They do not raise the ''inexact'' floating-point exception if the result differs in
26181  value from the argument.
26182 <ul>
26183 <li>  nearbyint((+-)0) returns (+-)0 (for all rounding directions).
26184 <li>  nearbyint((+-)(inf)) returns (+-)(inf) (for all rounding directions).
26185 <!--page 541 -->
26186 </ul>
26187
26188 <h5><a name="F.10.6.4" href="#F.10.6.4">F.10.6.4 The rint functions</a></h5>
26189 <p><!--para 1 -->
26190  The rint functions differ from the nearbyint functions only in that they do raise the
26191  ''inexact'' floating-point exception if the result differs in value from the argument.
26192
26193 <h5><a name="F.10.6.5" href="#F.10.6.5">F.10.6.5 The lrint and llrint functions</a></h5>
26194 <p><!--para 1 -->
26195  The lrint and llrint functions provide floating-to-integer conversion as prescribed
26196  by IEC 60559. They round according to the current rounding direction. If the rounded
26197  value is outside the range of the return type, the numeric result is unspecified and the
26198  ''invalid'' floating-point exception is raised. When they raise no other floating-point
26199  exception and the result differs from the argument, they raise the ''inexact'' floating-point
26200  exception.
26201
26202 <h5><a name="F.10.6.6" href="#F.10.6.6">F.10.6.6 The round functions</a></h5>
26203 <p><!--para 1 -->
26204 <ul>
26205 <li>  round((+-)0) returns (+-)0.
26206 <li>  round((+-)(inf)) returns (+-)(inf).
26207 </ul>
26208 <p><!--para 2 -->
26209  The returned value is independent of the current rounding direction mode.
26210 <p><!--para 3 -->
26211  The double version of round behaves as though implemented by
26212 <pre>
26213          #include <a href="#7.12">&lt;math.h&gt;</a>
26214          #include <a href="#7.6">&lt;fenv.h&gt;</a>
26215          #pragma STDC FENV_ACCESS ON
26216          double round(double x)
26217          {
26218               double result;
26219               fenv_t save_env;
26220               feholdexcept(&amp;save_env);
26221               result = rint(x);
26222               if (fetestexcept(FE_INEXACT)) {
26223                    fesetround(FE_TOWARDZERO);
26224                    result = rint(copysign(0.5 + fabs(x), x));
26225               }
26226               feupdateenv(&amp;save_env);
26227               return result;
26228          }
26229 </pre>
26230  The round functions may, but are not required to, raise the ''inexact'' floating-point
26231  exception for finite non-integer numeric arguments, as this implementation does.
26232 <!--page 542 -->
26233
26234 <h5><a name="F.10.6.7" href="#F.10.6.7">F.10.6.7 The lround and llround functions</a></h5>
26235 <p><!--para 1 -->
26236  The lround and llround functions differ from the lrint and llrint functions
26237  with the default rounding direction just in that the lround and llround functions
26238  round halfway cases away from zero and need not raise the ''inexact'' floating-point
26239  exception for non-integer arguments that round to within the range of the return type.
26240
26241 <h5><a name="F.10.6.8" href="#F.10.6.8">F.10.6.8 The trunc functions</a></h5>
26242 <p><!--para 1 -->
26243  The trunc functions use IEC 60559 rounding toward zero (regardless of the current
26244  rounding direction). The returned value is exact.
26245 <ul>
26246 <li>  trunc((+-)0) returns (+-)0.
26247 <li>  trunc((+-)(inf)) returns (+-)(inf).
26248 </ul>
26249 <p><!--para 2 -->
26250  The returned value is independent of the current rounding direction mode. The trunc
26251  functions may, but are not required to, raise the ''inexact'' floating-point exception for
26252  finite non-integer arguments.
26253
26254 <h4><a name="F.10.7" href="#F.10.7">F.10.7 Remainder functions</a></h4>
26255
26256 <h5><a name="F.10.7.1" href="#F.10.7.1">F.10.7.1 The fmod functions</a></h5>
26257 <p><!--para 1 -->
26258 <ul>
26259 <li>  fmod((+-)0, y) returns (+-)0 for y not zero.
26260 <li>  fmod(x, y) returns a NaN and raises the ''invalid'' floating-point exception for x
26261  infinite or y zero (and neither is a NaN).
26262 <li>  fmod(x, (+-)(inf)) returns x for x not infinite.
26263 </ul>
26264 <p><!--para 2 -->
26265  When subnormal results are supported, the returned value is exact and is independent of
26266  the current rounding direction mode.
26267 <p><!--para 3 -->
26268  The double version of fmod behaves as though implemented by
26269 <!--page 543 -->
26270 <pre>
26271         #include <a href="#7.12">&lt;math.h&gt;</a>
26272         #include <a href="#7.6">&lt;fenv.h&gt;</a>
26273         #pragma STDC FENV_ACCESS ON
26274         double fmod(double x, double y)
26275         {
26276              double result;
26277              result = remainder(fabs(x), (y = fabs(y)));
26278              if (signbit(result)) result += y;
26279              return copysign(result, x);
26280         }
26281 </pre>
26282
26283 <h5><a name="F.10.7.2" href="#F.10.7.2">F.10.7.2 The remainder functions</a></h5>
26284 <p><!--para 1 -->
26285  The remainder functions are fully specified as a basic arithmetic operation in
26286  IEC 60559.
26287 <p><!--para 2 -->
26288  When subnormal results are supported, the returned value is exact and is independent of
26289  the current rounding direction mode.
26290
26291 <h5><a name="F.10.7.3" href="#F.10.7.3">F.10.7.3 The remquo functions</a></h5>
26292 <p><!--para 1 -->
26293  The remquo functions follow the specifications for the remainder functions. They
26294  have no further specifications special to IEC 60559 implementations.
26295 <p><!--para 2 -->
26296  When subnormal results are supported, the returned value is exact and is independent of
26297  the current rounding direction mode.
26298
26299 <h4><a name="F.10.8" href="#F.10.8">F.10.8 Manipulation functions</a></h4>
26300
26301 <h5><a name="F.10.8.1" href="#F.10.8.1">F.10.8.1 The copysign functions</a></h5>
26302 <p><!--para 1 -->
26303  copysign is specified in the Appendix to IEC 60559.
26304 <p><!--para 2 -->
26305  The returned value is exact and is independent of the current rounding direction mode.
26306
26307 <h5><a name="F.10.8.2" href="#F.10.8.2">F.10.8.2 The nan functions</a></h5>
26308 <p><!--para 1 -->
26309  All IEC 60559 implementations support quiet NaNs, in all floating formats.
26310 <p><!--para 2 -->
26311  The returned value is exact and is independent of the current rounding direction mode.
26312
26313 <h5><a name="F.10.8.3" href="#F.10.8.3">F.10.8.3 The nextafter functions</a></h5>
26314 <p><!--para 1 -->
26315 <ul>
26316 <li>  nextafter(x, y) raises the ''overflow'' and ''inexact'' floating-point exceptions
26317  for x finite and the function value infinite.
26318 <li>  nextafter(x, y) raises the ''underflow'' and ''inexact'' floating-point
26319  exceptions for the function value subnormal or zero and x != y.
26320 </ul>
26321 <p><!--para 2 -->
26322  Even though underflow or overflow can occur, the returned value is independent of the
26323  current rounding direction mode.
26324
26325 <h5><a name="F.10.8.4" href="#F.10.8.4">F.10.8.4 The nexttoward functions</a></h5>
26326 <p><!--para 1 -->
26327  No additional requirements beyond those on nextafter.
26328 <p><!--para 2 -->
26329  Even though underflow or overflow can occur, the returned value is independent of the
26330  current rounding direction mode.
26331 <!--page 544 -->
26332
26333 <h4><a name="F.10.9" href="#F.10.9">F.10.9 Maximum, minimum, and positive difference functions</a></h4>
26334
26335 <h5><a name="F.10.9.1" href="#F.10.9.1">F.10.9.1 The fdim functions</a></h5>
26336 <p><!--para 1 -->
26337  No additional requirements.
26338
26339 <h5><a name="F.10.9.2" href="#F.10.9.2">F.10.9.2 The fmax functions</a></h5>
26340 <p><!--para 1 -->
26341  If just one argument is a NaN, the fmax functions return the other argument (if both
26342  arguments are NaNs, the functions return a NaN).
26343 <p><!--para 2 -->
26344  The returned value is exact and is independent of the current rounding direction mode.
26345 <p><!--para 3 -->
26346  The body of the fmax function might be<sup><a href="#note361"><b>361)</b></a></sup>
26347 <pre>
26348         { return (isgreaterequal(x, y) ||
26349              isnan(y)) ? x : y; }
26350 </pre>
26351
26352 <h6>footnotes</h6>
26353 <p><small><a name="note361" href="#note361">361)</a> Ideally, fmax would be sensitive to the sign of zero, for example fmax(-0.0, +0.0) would
26354  return +0; however, implementation in software might be impractical.
26355 </small>
26356
26357 <h5><a name="F.10.9.3" href="#F.10.9.3">F.10.9.3 The fmin functions</a></h5>
26358 <p><!--para 1 -->
26359  The fmin functions are analogous to the fmax functions (see <a href="#F.10.9.2">F.10.9.2</a>).
26360 <p><!--para 2 -->
26361  The returned value is exact and is independent of the current rounding direction mode.
26362
26363 <h4><a name="F.10.10" href="#F.10.10">F.10.10 Floating multiply-add</a></h4>
26364
26365 <h5><a name="F.10.10.1" href="#F.10.10.1">F.10.10.1 The fma functions</a></h5>
26366 <p><!--para 1 -->
26367 <ul>
26368 <li>  fma(x, y, z) computes xy + z, correctly rounded once.
26369 <li>  fma(x, y, z) returns a NaN and optionally raises the ''invalid'' floating-point
26370  exception if one of x and y is infinite, the other is zero, and z is a NaN.
26371 <li>  fma(x, y, z) returns a NaN and raises the ''invalid'' floating-point exception if
26372  one of x and y is infinite, the other is zero, and z is not a NaN.
26373 <li>  fma(x, y, z) returns a NaN and raises the ''invalid'' floating-point exception if x
26374  times y is an exact infinity and z is also an infinity but with the opposite sign.
26375  
26376  
26377  
26378  
26379 <!--page 545 -->
26380 </ul>
26381
26382 <h4><a name="F.10.11" href="#F.10.11">F.10.11 Comparison macros</a></h4>
26383 <p><!--para 1 -->
26384  Relational operators and their corresponding comparison macros (<a href="#7.12.14">7.12.14</a>) produce
26385  equivalent result values, even if argument values are represented in wider formats. Thus,
26386  comparison macro arguments represented in formats wider than their semantic types are
26387  not converted to the semantic types, unless the wide evaluation method converts operands
26388  of relational operators to their semantic types. The standard wide evaluation methods
26389  characterized by FLT_EVAL_METHOD equal to 1 or 2 (<a href="#5.2.4.2.2">5.2.4.2.2</a>), do not convert
26390  operands of relational operators to their semantic types.
26391 <!--page 546 -->
26392
26393 <h2><a name="G" href="#G">Annex G</a></h2>
26394 <pre>
26395                                        (normative)
26396                 IEC 60559-compatible complex arithmetic
26397 </pre>
26398
26399 <h3><a name="G.1" href="#G.1">G.1 Introduction</a></h3>
26400 <p><!--para 1 -->
26401  This annex supplements <a href="#F">annex F</a> to specify complex arithmetic for compatibility with
26402  IEC 60559 real floating-point arithmetic. An implementation that defines *
26403  __STDC_IEC_559_COMPLEX__ shall conform to the specifications in this annex.<sup><a href="#note362"><b>362)</b></a></sup>
26404
26405 <h6>footnotes</h6>
26406 <p><small><a name="note362" href="#note362">362)</a> Implementations that do not define __STDC_IEC_559_COMPLEX__ are not required to conform
26407  to these specifications.
26408 </small>
26409
26410 <h3><a name="G.2" href="#G.2">G.2 Types</a></h3>
26411 <p><!--para 1 -->
26412  There is a new keyword _Imaginary, which is used to specify imaginary types. It is
26413  used as a type specifier within declaration specifiers in the same way as _Complex is
26414  (thus, _Imaginary float is a valid type name).
26415 <p><!--para 2 -->
26416  There are three imaginary types, designated as float _Imaginary, double
26417  _Imaginary, and long double _Imaginary. The imaginary types (along with
26418  the real floating and complex types) are floating types.
26419 <p><!--para 3 -->
26420  For imaginary types, the corresponding real type is given by deleting the keyword
26421  _Imaginary from the type name.
26422 <p><!--para 4 -->
26423  Each imaginary type has the same representation and alignment requirements as the
26424  corresponding real type. The value of an object of imaginary type is the value of the real
26425  representation times the imaginary unit.
26426 <p><!--para 5 -->
26427  The imaginary type domain comprises the imaginary types.
26428
26429 <h3><a name="G.3" href="#G.3">G.3 Conventions</a></h3>
26430 <p><!--para 1 -->
26431  A complex or imaginary value with at least one infinite part is regarded as an infinity
26432  (even if its other part is a NaN). A complex or imaginary value is a finite number if each
26433  of its parts is a finite number (neither infinite nor NaN). A complex or imaginary value is
26434  a zero if each of its parts is a zero.
26435  
26436  
26437  
26438  
26439 <!--page 547 -->
26440
26441 <h3><a name="G.4" href="#G.4">G.4 Conversions</a></h3>
26442
26443 <h4><a name="G.4.1" href="#G.4.1">G.4.1 Imaginary types</a></h4>
26444 <p><!--para 1 -->
26445  Conversions among imaginary types follow rules analogous to those for real floating
26446  types.
26447
26448 <h4><a name="G.4.2" href="#G.4.2">G.4.2 Real and imaginary</a></h4>
26449 <p><!--para 1 -->
26450  When a value of imaginary type is converted to a real type other than _Bool,<sup><a href="#note363"><b>363)</b></a></sup> the
26451  result is a positive zero.
26452 <p><!--para 2 -->
26453  When a value of real type is converted to an imaginary type, the result is a positive
26454  imaginary zero.
26455
26456 <h6>footnotes</h6>
26457 <p><small><a name="note363" href="#note363">363)</a> See <a href="#6.3.1.2">6.3.1.2</a>.
26458 </small>
26459
26460 <h4><a name="G.4.3" href="#G.4.3">G.4.3 Imaginary and complex</a></h4>
26461 <p><!--para 1 -->
26462  When a value of imaginary type is converted to a complex type, the real part of the
26463  complex result value is a positive zero and the imaginary part of the complex result value
26464  is determined by the conversion rules for the corresponding real types.
26465 <p><!--para 2 -->
26466  When a value of complex type is converted to an imaginary type, the real part of the
26467  complex value is discarded and the value of the imaginary part is converted according to
26468  the conversion rules for the corresponding real types.
26469
26470 <h3><a name="G.5" href="#G.5">G.5 Binary operators</a></h3>
26471 <p><!--para 1 -->
26472  The following subclauses supplement <a href="#6.5">6.5</a> in order to specify the type of the result for an
26473  operation with an imaginary operand.
26474 <p><!--para 2 -->
26475  For most operand types, the value of the result of a binary operator with an imaginary or
26476  complex operand is completely determined, with reference to real arithmetic, by the usual
26477  mathematical formula. For some operand types, the usual mathematical formula is
26478  problematic because of its treatment of infinities and because of undue overflow or
26479  underflow; in these cases the result satisfies certain properties (specified in <a href="#G.5.1">G.5.1</a>), but is
26480  not completely determined.
26481  
26482  
26483  
26484  
26485 <!--page 548 -->
26486
26487 <h4><a name="G.5.1" href="#G.5.1">G.5.1 Multiplicative operators</a></h4>
26488 <h6>Semantics</h6>
26489 <p><!--para 1 -->
26490  If one operand has real type and the other operand has imaginary type, then the result has
26491  imaginary type. If both operands have imaginary type, then the result has real type. (If
26492  either operand has complex type, then the result has complex type.)
26493 <p><!--para 2 -->
26494  If the operands are not both complex, then the result and floating-point exception
26495  behavior of the * operator is defined by the usual mathematical formula:
26496 <pre>
26497         *                  u                   iv                 u + iv
26498 </pre>
26499  
26500 <pre>
26501         x                  xu                i(xv)            (xu) + i(xv)
26502 </pre>
26503  
26504 <pre>
26505         iy               i(yu)                -yv            (-yv) + i(yu)
26506 </pre>
26507  
26508 <pre>
26509         x + iy       (xu) + i(yu)        (-yv) + i(xv)
26510 </pre>
26511 <p><!--para 3 -->
26512  If the second operand is not complex, then the result and floating-point exception
26513  behavior of the / operator is defined by the usual mathematical formula:
26514 <pre>
26515         /                   u                       iv
26516 </pre>
26517  
26518 <pre>
26519         x                  x/u                 i(-x/v)
26520 </pre>
26521  
26522 <pre>
26523         iy               i(y/u)                     y/v
26524 </pre>
26525  
26526 <pre>
26527         x + iy       (x/u) + i(y/u)        (y/v) + i(-x/v)
26528 </pre>
26529 <p><!--para 4 -->
26530  The * and / operators satisfy the following infinity properties for all real, imaginary, and
26531  complex operands:<sup><a href="#note364"><b>364)</b></a></sup>
26532 <ul>
26533 <li>  if one operand is an infinity and the other operand is a nonzero finite number or an
26534  infinity, then the result of the * operator is an infinity;
26535 <li>  if the first operand is an infinity and the second operand is a finite number, then the
26536  result of the / operator is an infinity;
26537 <li>  if the first operand is a finite number and the second operand is an infinity, then the
26538  result of the / operator is a zero;
26539  
26540  
26541  
26542  
26543 <!--page 549 -->
26544 <li>  if the first operand is a nonzero finite number or an infinity and the second operand is
26545  a zero, then the result of the / operator is an infinity.
26546 </ul>
26547 <p><!--para 5 -->
26548  If both operands of the * operator are complex or if the second operand of the / operator
26549  is complex, the operator raises floating-point exceptions if appropriate for the calculation
26550  of the parts of the result, and may raise spurious floating-point exceptions.
26551 <p><!--para 6 -->
26552  EXAMPLE 1 Multiplication of double _Complex operands could be implemented as follows. Note
26553  that the imaginary unit I has imaginary type (see <a href="#G.6">G.6</a>).
26554 <!--page 550 -->
26555 <pre>
26556           #include <a href="#7.12">&lt;math.h&gt;</a>
26557           #include <a href="#7.3">&lt;complex.h&gt;</a>
26558           /* Multiply z * w ... */
26559           double complex _Cmultd(double complex z, double complex w)
26560           {
26561                  #pragma STDC FP_CONTRACT OFF
26562                  double a, b, c, d, ac, bd, ad, bc, x, y;
26563                  a = creal(z); b = cimag(z);
26564                  c = creal(w); d = cimag(w);
26565                  ac = a * c;       bd = b * d;
26566                  ad = a * d;       bc = b * c;
26567                  x = ac - bd; y = ad + bc;
26568                  if (isnan(x) &amp;&amp; isnan(y)) {
26569                          /* Recover infinities that computed as NaN+iNaN ... */
26570                          int recalc = 0;
26571                          if ( isinf(a) || isinf(b) ) { // z is infinite
26572                                  /* "Box" the infinity and change NaNs in the other factor to 0 */
26573                                  a = copysign(isinf(a) ? 1.0 : 0.0, a);
26574                                  b = copysign(isinf(b) ? 1.0 : 0.0, b);
26575                                  if (isnan(c)) c = copysign(0.0, c);
26576                                  if (isnan(d)) d = copysign(0.0, d);
26577                                  recalc = 1;
26578                          }
26579                          if ( isinf(c) || isinf(d) ) { // w is infinite
26580                                  /* "Box" the infinity and change NaNs in the other factor to 0 */
26581                                  c = copysign(isinf(c) ? 1.0 : 0.0, c);
26582                                  d = copysign(isinf(d) ? 1.0 : 0.0, d);
26583                                  if (isnan(a)) a = copysign(0.0, a);
26584                                  if (isnan(b)) b = copysign(0.0, b);
26585                                  recalc = 1;
26586                          }
26587                          if (!recalc &amp;&amp; (isinf(ac) || isinf(bd) ||
26588                                                 isinf(ad) || isinf(bc))) {
26589                                  /* Recover infinities from overflow by changing NaNs to 0 ... */
26590                                  if (isnan(a)) a = copysign(0.0, a);
26591                                  if (isnan(b)) b = copysign(0.0, b);
26592                                  if (isnan(c)) c = copysign(0.0, c);
26593                                  if (isnan(d)) d = copysign(0.0, d);
26594                                  recalc = 1;
26595                          }
26596                          if (recalc) {
26597                                    x = INFINITY * ( a * c - b * d );
26598                                    y = INFINITY * ( a * d + b * c );
26599                         }
26600                   }
26601                   return x + I * y;
26602          }
26603 </pre>
26604 <p><!--para 7 -->
26605  This implementation achieves the required treatment of infinities at the cost of only one isnan test in
26606  ordinary (finite) cases. It is less than ideal in that undue overflow and underflow may occur.
26607  
26608 <p><!--para 8 -->
26609  EXAMPLE 2      Division of two double _Complex operands could be implemented as follows.
26610 <!--page 551 -->
26611 <pre>
26612          #include <a href="#7.12">&lt;math.h&gt;</a>
26613          #include <a href="#7.3">&lt;complex.h&gt;</a>
26614          /* Divide z / w ... */
26615          double complex _Cdivd(double complex z, double complex w)
26616          {
26617                 #pragma STDC FP_CONTRACT OFF
26618                 double a, b, c, d, logbw, denom, x, y;
26619                 int ilogbw = 0;
26620                 a = creal(z); b = cimag(z);
26621                 c = creal(w); d = cimag(w);
26622                 logbw = logb(fmax(fabs(c), fabs(d)));
26623                 if (logbw == INFINITY) {
26624                        ilogbw = (int)logbw;
26625                        c = scalbn(c, -ilogbw); d = scalbn(d, -ilogbw);
26626                 }
26627                 denom = c * c + d * d;
26628                 x = scalbn((a * c + b * d) / denom, -ilogbw);
26629                 y = scalbn((b * c - a * d) / denom, -ilogbw);
26630                   /* Recover infinities and zeros that computed as NaN+iNaN;                 */
26631                   /* the only cases are nonzero/zero, infinite/finite, and finite/infinite, ... */
26632                   if (isnan(x) &amp;&amp; isnan(y)) {
26633                         if ((denom == 0.0) &amp;&amp;
26634                               (!isnan(a) || !isnan(b))) {
26635                               x = copysign(INFINITY, c) * a;
26636                               y = copysign(INFINITY, c) * b;
26637                         }
26638                         else if ((isinf(a) || isinf(b)) &amp;&amp;
26639                               isfinite(c) &amp;&amp; isfinite(d)) {
26640                               a = copysign(isinf(a) ? 1.0 : 0.0,                        a);
26641                               b = copysign(isinf(b) ? 1.0 : 0.0,                        b);
26642                               x = INFINITY * ( a * c + b * d );
26643                               y = INFINITY * ( b * c - a * d );
26644                         }
26645                         else if (isinf(logbw) &amp;&amp;
26646                               isfinite(a) &amp;&amp; isfinite(b)) {
26647                               c = copysign(isinf(c) ? 1.0 : 0.0,                        c);
26648                               d = copysign(isinf(d) ? 1.0 : 0.0,                        d);
26649                               x = 0.0 * ( a * c + b * d );
26650                               y = 0.0 * ( b * c - a * d );
26651                         }
26652                   }
26653                   return x + I * y;
26654          }
26655 </pre>
26656 <p><!--para 9 -->
26657  Scaling the denominator alleviates the main overflow and underflow problem, which is more serious than
26658  for multiplication. In the spirit of the multiplication example above, this code does not defend against
26659  overflow and underflow in the calculation of the numerator. Scaling with the scalbn function, instead of
26660  with division, provides better roundoff characteristics.
26661  
26662
26663 <h6>footnotes</h6>
26664 <p><small><a name="note364" href="#note364">364)</a> These properties are already implied for those cases covered in the tables, but are required for all cases
26665  (at least where the state for CX_LIMITED_RANGE is ''off'').
26666 </small>
26667
26668 <h4><a name="G.5.2" href="#G.5.2">G.5.2 Additive operators</a></h4>
26669 <h6>Semantics</h6>
26670 <p><!--para 1 -->
26671  If both operands have imaginary type, then the result has imaginary type. (If one operand
26672  has real type and the other operand has imaginary type, or if either operand has complex
26673  type, then the result has complex type.)
26674 <p><!--para 2 -->
26675  In all cases the result and floating-point exception behavior of a + or - operator is defined
26676  by the usual mathematical formula:
26677 <pre>
26678         + or -              u                       iv                    u + iv
26679 </pre>
26680  
26681 <pre>
26682         x                 x(+-)u                     x (+-) iv              (x (+-) u) (+-) iv
26683 </pre>
26684  
26685 <pre>
26686         iy               (+-)u + iy                 i(y (+-) v)             (+-)u + i(y (+-) v)
26687 </pre>
26688  
26689 <pre>
26690         x + iy         (x (+-) u) + iy            x + i(y (+-) v)        (x (+-) u) + i(y (+-) v)
26691 </pre>
26692
26693 <h3><a name="G.6" href="#G.6">G.6 Complex arithmetic <complex.h></a></h3>
26694 <p><!--para 1 -->
26695  The macros
26696 <pre>
26697          imaginary
26698 </pre>
26699  and
26700 <pre>
26701          _Imaginary_I
26702 </pre>
26703  are defined, respectively, as _Imaginary and a constant expression of type const
26704  float _Imaginary with the value of the imaginary unit. The macro
26705 <pre>
26706          I
26707 </pre>
26708  is defined to be _Imaginary_I (not _Complex_I as stated in <a href="#7.3">7.3</a>). Notwithstanding
26709  the provisions of <a href="#7.1.3">7.1.3</a>, a program may undefine and then perhaps redefine the macro
26710  imaginary.
26711 <p><!--para 2 -->
26712  This subclause contains specifications for the <a href="#7.3">&lt;complex.h&gt;</a> functions that are
26713  particularly suited to IEC 60559 implementations. For families of functions, the
26714  specifications apply to all of the functions even though only the principal function is
26715 <!--page 552 -->
26716  shown. Unless otherwise specified, where the symbol ''(+-)'' occurs in both an argument
26717  and the result, the result has the same sign as the argument.
26718 <p><!--para 3 -->
26719  The functions are continuous onto both sides of their branch cuts, taking into account the
26720  sign of zero. For example, csqrt(-2 (+-) i0) = (+-)i(sqrt)2.  -
26721 <p><!--para 4 -->
26722  Since complex and imaginary values are composed of real values, each function may be
26723  regarded as computing real values from real values. Except as noted, the functions treat
26724  real infinities, NaNs, signed zeros, subnormals, and the floating-point exception flags in a
26725  manner consistent with the specifications for real functions in F.10.<sup><a href="#note365"><b>365)</b></a></sup>
26726 <p><!--para 5 -->
26727  The functions cimag, conj, cproj, and creal are fully specified for all
26728  implementations, including IEC 60559 ones, in <a href="#7.3.9">7.3.9</a>. These functions raise no floating-
26729  point exceptions.
26730 <p><!--para 6 -->
26731  Each of the functions cabs and carg is specified by a formula in terms of a real
26732  function (whose special cases are covered in <a href="#F">annex F</a>):
26733 <pre>
26734          cabs(x + iy) = hypot(x, y)
26735          carg(x + iy) = atan2(y, x)
26736 </pre>
26737 <p><!--para 7 -->
26738  Each of the functions casin, catan, ccos, csin, and ctan is specified implicitly by
26739  a formula in terms of other complex functions (whose special cases are specified below):
26740 <pre>
26741          casin(z)        =   -i casinh(iz)
26742          catan(z)        =   -i catanh(iz)
26743          ccos(z)         =   ccosh(iz)
26744          csin(z)         =   -i csinh(iz)
26745          ctan(z)         =   -i ctanh(iz)
26746 </pre>
26747 <p><!--para 8 -->
26748  For the other functions, the following subclauses specify behavior for special cases,
26749  including treatment of the ''invalid'' and ''divide-by-zero'' floating-point exceptions. For
26750  families of functions, the specifications apply to all of the functions even though only the
26751  principal function is shown. For a function f satisfying f (conj(z)) = conj( f (z)), the
26752  specifications for the upper half-plane imply the specifications for the lower half-plane; if
26753  the function f is also either even, f (-z) = f (z), or odd, f (-z) = - f (z), then the
26754  specifications for the first quadrant imply the specifications for the other three quadrants.
26755 <p><!--para 9 -->
26756  In the following subclauses, cis(y) is defined as cos(y) + i sin(y).
26757  
26758  
26759  
26760  
26761 <!--page 553 -->
26762
26763 <h6>footnotes</h6>
26764 <p><small><a name="note365" href="#note365">365)</a> As noted in <a href="#G.3">G.3</a>, a complex value with at least one infinite part is regarded as an infinity even if its
26765  other part is a NaN.
26766 </small>
26767
26768 <h4><a name="G.6.1" href="#G.6.1">G.6.1 Trigonometric functions</a></h4>
26769
26770 <h5><a name="G.6.1.1" href="#G.6.1.1">G.6.1.1 The cacos functions</a></h5>
26771 <p><!--para 1 -->
26772 <ul>
26773 <li>  cacos(conj(z)) = conj(cacos(z)).
26774 <li>  cacos((+-)0 + i0) returns pi /2 - i0.
26775 <li>  cacos((+-)0 + iNaN) returns pi /2 + iNaN.
26776 <li>  cacos(x + i (inf)) returns pi /2 - i (inf), for finite x.
26777 <li>  cacos(x + iNaN) returns NaN + iNaN and optionally raises the ''invalid'' floating-
26778  point exception, for nonzero finite x.
26779 <li>  cacos(-(inf) + iy) returns pi - i (inf), for positive-signed finite y.
26780 <li>  cacos(+(inf) + iy) returns +0 - i (inf), for positive-signed finite y.
26781 <li>  cacos(-(inf) + i (inf)) returns 3pi /4 - i (inf).
26782 <li>  cacos(+(inf) + i (inf)) returns pi /4 - i (inf).
26783 <li>  cacos((+-)(inf) + iNaN) returns NaN (+-) i (inf) (where the sign of the imaginary part of the
26784  result is unspecified).
26785 <li>  cacos(NaN + iy) returns NaN + iNaN and optionally raises the ''invalid'' floating-
26786  point exception, for finite y.
26787 <li>  cacos(NaN + i (inf)) returns NaN - i (inf).
26788 <li>  cacos(NaN + iNaN) returns NaN + iNaN.
26789 </ul>
26790
26791 <h4><a name="G.6.2" href="#G.6.2">G.6.2 Hyperbolic functions</a></h4>
26792
26793 <h5><a name="G.6.2.1" href="#G.6.2.1">G.6.2.1 The cacosh functions</a></h5>
26794 <p><!--para 1 -->
26795 <ul>
26796 <li>  cacosh(conj(z)) = conj(cacosh(z)).
26797 <li>  cacosh((+-)0 + i0) returns +0 + ipi /2.
26798 <li>  cacosh(x + i (inf)) returns +(inf) + ipi /2, for finite x.
26799 <li>  cacosh(x + iNaN) returns NaN + iNaN and optionally raises the ''invalid''
26800  floating-point exception, for finite x.
26801 <li>  cacosh(-(inf) + iy) returns +(inf) + ipi , for positive-signed finite y.
26802 <li>  cacosh(+(inf) + iy) returns +(inf) + i0, for positive-signed finite y.
26803 <li>  cacosh(-(inf) + i (inf)) returns +(inf) + i3pi /4.
26804 <li>  cacosh(+(inf) + i (inf)) returns +(inf) + ipi /4.
26805 <li>  cacosh((+-)(inf) + iNaN) returns +(inf) + iNaN.
26806 <!--page 554 -->
26807 <li>  cacosh(NaN + iy) returns NaN + iNaN and optionally raises the ''invalid''
26808  floating-point exception, for finite y.
26809 <li>  cacosh(NaN + i (inf)) returns +(inf) + iNaN.
26810 <li>  cacosh(NaN + iNaN) returns NaN + iNaN.
26811 </ul>
26812
26813 <h5><a name="G.6.2.2" href="#G.6.2.2">G.6.2.2 The casinh functions</a></h5>
26814 <p><!--para 1 -->
26815 <ul>
26816 <li>  casinh(conj(z)) = conj(casinh(z)) and casinh is odd.
26817 <li>  casinh(+0 + i0) returns 0 + i0.
26818 <li>  casinh(x + i (inf)) returns +(inf) + ipi /2 for positive-signed finite x.
26819 <li>  casinh(x + iNaN) returns NaN + iNaN and optionally raises the ''invalid''
26820  floating-point exception, for finite x.
26821 <li>  casinh(+(inf) + iy) returns +(inf) + i0 for positive-signed finite y.
26822 <li>  casinh(+(inf) + i (inf)) returns +(inf) + ipi /4.
26823 <li>  casinh(+(inf) + iNaN) returns +(inf) + iNaN.
26824 <li>  casinh(NaN + i0) returns NaN + i0.
26825 <li>  casinh(NaN + iy) returns NaN + iNaN and optionally raises the ''invalid''
26826  floating-point exception, for finite nonzero y.
26827 <li>  casinh(NaN + i (inf)) returns (+-)(inf) + iNaN (where the sign of the real part of the result
26828  is unspecified).
26829 <li>  casinh(NaN + iNaN) returns NaN + iNaN.
26830 </ul>
26831
26832 <h5><a name="G.6.2.3" href="#G.6.2.3">G.6.2.3 The catanh functions</a></h5>
26833 <p><!--para 1 -->
26834 <ul>
26835 <li>  catanh(conj(z)) = conj(catanh(z)) and catanh is odd.
26836 <li>  catanh(+0 + i0) returns +0 + i0.
26837 <li>  catanh(+0 + iNaN) returns +0 + iNaN.
26838 <li>  catanh(+1 + i0) returns +(inf) + i0 and raises the ''divide-by-zero'' floating-point
26839  exception.
26840 <li>  catanh(x + i (inf)) returns +0 + ipi /2, for finite positive-signed x.
26841 <li>  catanh(x + iNaN) returns NaN + iNaN and optionally raises the ''invalid''
26842  floating-point exception, for nonzero finite x.
26843 <li>  catanh(+(inf) + iy) returns +0 + ipi /2, for finite positive-signed y.
26844 <li>  catanh(+(inf) + i (inf)) returns +0 + ipi /2.
26845 <li>  catanh(+(inf) + iNaN) returns +0 + iNaN.
26846 <!--page 555 -->
26847 <li>  catanh(NaN + iy) returns NaN + iNaN and optionally raises the ''invalid''
26848  floating-point exception, for finite y.
26849 <li>  catanh(NaN + i (inf)) returns (+-)0 + ipi /2 (where the sign of the real part of the result is
26850  unspecified).
26851 <li>  catanh(NaN + iNaN) returns NaN + iNaN.
26852 </ul>
26853
26854 <h5><a name="G.6.2.4" href="#G.6.2.4">G.6.2.4 The ccosh functions</a></h5>
26855 <p><!--para 1 -->
26856 <ul>
26857 <li>  ccosh(conj(z)) = conj(ccosh(z)) and ccosh is even.
26858 <li>  ccosh(+0 + i0) returns 1 + i0.
26859 <li>  ccosh(+0 + i (inf)) returns NaN (+-) i0 (where the sign of the imaginary part of the
26860  result is unspecified) and raises the ''invalid'' floating-point exception.
26861 <li>  ccosh(+0 + iNaN) returns NaN (+-) i0 (where the sign of the imaginary part of the
26862  result is unspecified).
26863 <li>  ccosh(x + i (inf)) returns NaN + iNaN and raises the ''invalid'' floating-point
26864  exception, for finite nonzero x.
26865 <li>  ccosh(x + iNaN) returns NaN + iNaN and optionally raises the ''invalid'' floating-
26866  point exception, for finite nonzero x.
26867 <li>  ccosh(+(inf) + i0) returns +(inf) + i0.
26868 <li>  ccosh(+(inf) + iy) returns +(inf) cis(y), for finite nonzero y.
26869 <li>  ccosh(+(inf) + i (inf)) returns (+-)(inf) + iNaN (where the sign of the real part of the result is
26870  unspecified) and raises the ''invalid'' floating-point exception.
26871 <li>  ccosh(+(inf) + iNaN) returns +(inf) + iNaN.
26872 <li>  ccosh(NaN + i0) returns NaN (+-) i0 (where the sign of the imaginary part of the
26873  result is unspecified).
26874 <li>  ccosh(NaN + iy) returns NaN + iNaN and optionally raises the ''invalid'' floating-
26875  point exception, for all nonzero numbers y.
26876 <li>  ccosh(NaN + iNaN) returns NaN + iNaN.
26877 </ul>
26878
26879 <h5><a name="G.6.2.5" href="#G.6.2.5">G.6.2.5 The csinh functions</a></h5>
26880 <p><!--para 1 -->
26881 <ul>
26882 <li>  csinh(conj(z)) = conj(csinh(z)) and csinh is odd.
26883 <li>  csinh(+0 + i0) returns +0 + i0.
26884 <li>  csinh(+0 + i (inf)) returns (+-)0 + iNaN (where the sign of the real part of the result is
26885  unspecified) and raises the ''invalid'' floating-point exception.
26886 <li>  csinh(+0 + iNaN) returns (+-)0 + iNaN (where the sign of the real part of the result is
26887  unspecified).
26888 <!--page 556 -->
26889 <li>  csinh(x + i (inf)) returns NaN + iNaN and raises the ''invalid'' floating-point
26890  exception, for positive finite x.
26891 <li>  csinh(x + iNaN) returns NaN + iNaN and optionally raises the ''invalid'' floating-
26892  point exception, for finite nonzero x.
26893 <li>  csinh(+(inf) + i0) returns +(inf) + i0.
26894 <li>  csinh(+(inf) + iy) returns +(inf) cis(y), for positive finite y.
26895 <li>  csinh(+(inf) + i (inf)) returns (+-)(inf) + iNaN (where the sign of the real part of the result is
26896  unspecified) and raises the ''invalid'' floating-point exception.
26897 <li>  csinh(+(inf) + iNaN) returns (+-)(inf) + iNaN (where the sign of the real part of the result
26898  is unspecified).
26899 <li>  csinh(NaN + i0) returns NaN + i0.
26900 <li>  csinh(NaN + iy) returns NaN + iNaN and optionally raises the ''invalid'' floating-
26901  point exception, for all nonzero numbers y.
26902 <li>  csinh(NaN + iNaN) returns NaN + iNaN.
26903 </ul>
26904
26905 <h5><a name="G.6.2.6" href="#G.6.2.6">G.6.2.6 The ctanh functions</a></h5>
26906 <p><!--para 1 -->
26907 <ul>
26908 <li>  ctanh(conj(z)) = conj(ctanh(z))and ctanh is odd.
26909 <li>  ctanh(+0 + i0) returns +0 + i0.
26910 <li>  ctanh(x + i (inf)) returns NaN + iNaN and raises the ''invalid'' floating-point
26911  exception, for finite x.
26912 <li>  ctanh(x + iNaN) returns NaN + iNaN and optionally raises the ''invalid'' floating-
26913  point exception, for finite x.
26914 <li>  ctanh(+(inf) + iy) returns 1 + i0 sin(2y), for positive-signed finite y.
26915 <li>  ctanh(+(inf) + i (inf)) returns 1 (+-) i0 (where the sign of the imaginary part of the result
26916  is unspecified).
26917 <li>  ctanh(+(inf) + iNaN) returns 1 (+-) i0 (where the sign of the imaginary part of the
26918  result is unspecified).
26919 <li>  ctanh(NaN + i0) returns NaN + i0.
26920 <li>  ctanh(NaN + iy) returns NaN + iNaN and optionally raises the ''invalid'' floating-
26921  point exception, for all nonzero numbers y.
26922 <li>  ctanh(NaN + iNaN) returns NaN + iNaN.
26923 <!--page 557 -->
26924 </ul>
26925
26926 <h4><a name="G.6.3" href="#G.6.3">G.6.3 Exponential and logarithmic functions</a></h4>
26927
26928 <h5><a name="G.6.3.1" href="#G.6.3.1">G.6.3.1 The cexp functions</a></h5>
26929 <p><!--para 1 -->
26930 <ul>
26931 <li>  cexp(conj(z)) = conj(cexp(z)).
26932 <li>  cexp((+-)0 + i0) returns 1 + i0.
26933 <li>  cexp(x + i (inf)) returns NaN + iNaN and raises the ''invalid'' floating-point
26934  exception, for finite x.
26935 <li>  cexp(x + iNaN) returns NaN + iNaN and optionally raises the ''invalid'' floating-
26936  point exception, for finite x.
26937 <li>  cexp(+(inf) + i0) returns +(inf) + i0.
26938 <li>  cexp(-(inf) + iy) returns +0 cis(y), for finite y.
26939 <li>  cexp(+(inf) + iy) returns +(inf) cis(y), for finite nonzero y.
26940 <li>  cexp(-(inf) + i (inf)) returns (+-)0 (+-) i0 (where the signs of the real and imaginary parts of
26941  the result are unspecified).
26942 <li>  cexp(+(inf) + i (inf)) returns (+-)(inf) + iNaN and raises the ''invalid'' floating-point
26943  exception (where the sign of the real part of the result is unspecified).
26944 <li>  cexp(-(inf) + iNaN) returns (+-)0 (+-) i0 (where the signs of the real and imaginary parts
26945  of the result are unspecified).
26946 <li>  cexp(+(inf) + iNaN) returns (+-)(inf) + iNaN (where the sign of the real part of the result
26947  is unspecified).
26948 <li>  cexp(NaN + i0) returns NaN + i0.
26949 <li>  cexp(NaN + iy) returns NaN + iNaN and optionally raises the ''invalid'' floating-
26950  point exception, for all nonzero numbers y.
26951 <li>  cexp(NaN + iNaN) returns NaN + iNaN.
26952 </ul>
26953
26954 <h5><a name="G.6.3.2" href="#G.6.3.2">G.6.3.2 The clog functions</a></h5>
26955 <p><!--para 1 -->
26956 <ul>
26957 <li>  clog(conj(z)) = conj(clog(z)).
26958 <li>  clog(-0 + i0) returns -(inf) + ipi and raises the ''divide-by-zero'' floating-point
26959  exception.
26960 <li>  clog(+0 + i0) returns -(inf) + i0 and raises the ''divide-by-zero'' floating-point
26961  exception.
26962 <li>  clog(x + i (inf)) returns +(inf) + ipi /2, for finite x.
26963 <li>  clog(x + iNaN) returns NaN + iNaN and optionally raises the ''invalid'' floating-
26964  point exception, for finite x.
26965 <!--page 558 -->
26966 <li>  clog(-(inf) + iy) returns +(inf) + ipi , for finite positive-signed y.
26967 <li>  clog(+(inf) + iy) returns +(inf) + i0, for finite positive-signed y.
26968 <li>  clog(-(inf) + i (inf)) returns +(inf) + i3pi /4.
26969 <li>  clog(+(inf) + i (inf)) returns +(inf) + ipi /4.
26970 <li>  clog((+-)(inf) + iNaN) returns +(inf) + iNaN.
26971 <li>  clog(NaN + iy) returns NaN + iNaN and optionally raises the ''invalid'' floating-
26972  point exception, for finite y.
26973 <li>  clog(NaN + i (inf)) returns +(inf) + iNaN.
26974 <li>  clog(NaN + iNaN) returns NaN + iNaN.
26975 </ul>
26976
26977 <h4><a name="G.6.4" href="#G.6.4">G.6.4 Power and absolute-value functions</a></h4>
26978
26979 <h5><a name="G.6.4.1" href="#G.6.4.1">G.6.4.1 The cpow functions</a></h5>
26980 <p><!--para 1 -->
26981  The cpow functions raise floating-point exceptions if appropriate for the calculation of
26982  the parts of the result, and may also raise spurious floating-point exceptions.<sup><a href="#note366"><b>366)</b></a></sup>
26983
26984 <h6>footnotes</h6>
26985 <p><small><a name="note366" href="#note366">366)</a> This allows cpow( z , c ) to be implemented as cexp(c      clog( z )) without precluding
26986  implementations that treat special cases more carefully.
26987 </small>
26988
26989 <h5><a name="G.6.4.2" href="#G.6.4.2">G.6.4.2 The csqrt functions</a></h5>
26990 <p><!--para 1 -->
26991 <ul>
26992 <li>  csqrt(conj(z)) = conj(csqrt(z)).
26993 <li>  csqrt((+-)0 + i0) returns +0 + i0.
26994 <li>  csqrt(x + i (inf)) returns +(inf) + i (inf), for all x (including NaN).
26995 <li>  csqrt(x + iNaN) returns NaN + iNaN and optionally raises the ''invalid'' floating-
26996  point exception, for finite x.
26997 <li>  csqrt(-(inf) + iy) returns +0 + i (inf), for finite positive-signed y.
26998 <li>  csqrt(+(inf) + iy) returns +(inf) + i0, for finite positive-signed y.
26999 <li>  csqrt(-(inf) + iNaN) returns NaN (+-) i (inf) (where the sign of the imaginary part of the
27000  result is unspecified).
27001 <li>  csqrt(+(inf) + iNaN) returns +(inf) + iNaN.
27002 <li>  csqrt(NaN + iy) returns NaN + iNaN and optionally raises the ''invalid'' floating-
27003  point exception, for finite y.
27004 <li>  csqrt(NaN + iNaN) returns NaN + iNaN.
27005  
27006  
27007  
27008  
27009 <!--page 559 -->
27010 </ul>
27011
27012 <h3><a name="G.7" href="#G.7">G.7 Type-generic math <tgmath.h></a></h3>
27013 <p><!--para 1 -->
27014  Type-generic macros that accept complex arguments also accept imaginary arguments. If
27015  an argument is imaginary, the macro expands to an expression whose type is real,
27016  imaginary, or complex, as appropriate for the particular function: if the argument is
27017  imaginary, then the types of cos, cosh, fabs, carg, cimag, and creal are real; the
27018  types of sin, tan, sinh, tanh, asin, atan, asinh, and atanh are imaginary; and
27019  the types of the others are complex.
27020 <p><!--para 2 -->
27021  Given an imaginary argument, each of the type-generic macros cos, sin, tan, cosh,
27022  sinh, tanh, asin, atan, asinh, atanh is specified by a formula in terms of real
27023  functions:
27024 <!--page 560 -->
27025 <pre>
27026          cos(iy)     =   cosh(y)
27027          sin(iy)     =   i sinh(y)
27028          tan(iy)     =   i tanh(y)
27029          cosh(iy)    =   cos(y)
27030          sinh(iy)    =   i sin(y)
27031          tanh(iy)    =   i tan(y)
27032          asin(iy)    =   i asinh(y)
27033          atan(iy)    =   i atanh(y)
27034          asinh(iy)   =   i asin(y)
27035          atanh(iy)   =   i atan(y)
27036 </pre>
27037
27038 <h2><a name="H" href="#H">Annex H</a></h2>
27039 <pre>
27040                                      (informative)
27041                      Language independent arithmetic
27042 </pre>
27043
27044 <h3><a name="H.1" href="#H.1">H.1 Introduction</a></h3>
27045 <p><!--para 1 -->
27046  This annex documents the extent to which the C language supports the ISO/IEC 10967-1
27047  standard for language-independent arithmetic (LIA-1). LIA-1 is more general than
27048  IEC 60559 (<a href="#F">annex F</a>) in that it covers integer and diverse floating-point arithmetics.
27049
27050 <h3><a name="H.2" href="#H.2">H.2 Types</a></h3>
27051 <p><!--para 1 -->
27052  The relevant C arithmetic types meet the requirements of LIA-1 types if an
27053  implementation adds notification of exceptional arithmetic operations and meets the 1
27054  unit in the last place (ULP) accuracy requirement (LIA-1 subclause <a href="#5.2.8">5.2.8</a>).
27055
27056 <h4><a name="H.2.1" href="#H.2.1">H.2.1 Boolean type</a></h4>
27057 <p><!--para 1 -->
27058  The LIA-1 data type Boolean is implemented by the C data type bool with values of
27059  true and false, all from <a href="#7.18">&lt;stdbool.h&gt;</a>.
27060
27061 <h4><a name="H.2.2" href="#H.2.2">H.2.2 Integer types</a></h4>
27062 <p><!--para 1 -->
27063  The signed C integer types int, long int, long long int, and the corresponding
27064  unsigned types are compatible with LIA-1. If an implementation adds support for the
27065  LIA-1 exceptional values ''integer_overflow'' and ''undefined'', then those types are
27066  LIA-1 conformant types. C's unsigned integer types are ''modulo'' in the LIA-1 sense
27067  in that overflows or out-of-bounds results silently wrap. An implementation that defines
27068  signed integer types as also being modulo need not detect integer overflow, in which case,
27069  only integer divide-by-zero need be detected.
27070 <p><!--para 2 -->
27071  The parameters for the integer data types can be accessed by the following:
27072  maxint        INT_MAX, LONG_MAX, LLONG_MAX, UINT_MAX, ULONG_MAX,
27073 <pre>
27074                ULLONG_MAX
27075 </pre>
27076  minint        INT_MIN, LONG_MIN, LLONG_MIN
27077 <p><!--para 3 -->
27078  The parameter ''bounded'' is always true, and is not provided. The parameter ''minint''
27079  is always 0 for the unsigned types, and is not provided for those types.
27080 <!--page 561 -->
27081
27082 <h5><a name="H.2.2.1" href="#H.2.2.1">H.2.2.1 Integer operations</a></h5>
27083 <p><!--para 1 -->
27084  The integer operations on integer types are the following:
27085  addI           x + y
27086  subI           x - y
27087  mulI           x * y
27088  divI, divtI    x / y
27089  remI, remtI    x % y
27090  negI           -x
27091  absI           abs(x), labs(x), llabs(x)
27092  eqI            x == y
27093  neqI           x != y
27094  lssI           x &lt; y
27095  leqI           x &lt;= y
27096  gtrI           x &gt; y
27097  geqI           x &gt;= y
27098  where x and y are expressions of the same integer type.
27099
27100 <h4><a name="H.2.3" href="#H.2.3">H.2.3 Floating-point types</a></h4>
27101 <p><!--para 1 -->
27102  The C floating-point types float, double, and long double are compatible with
27103  LIA-1. If an implementation adds support for the LIA-1 exceptional values
27104  ''underflow'', ''floating_overflow'', and ''"undefined'', then those types are conformant
27105  with LIA-1. An implementation that uses IEC 60559 floating-point formats and
27106  operations (see <a href="#F">annex F</a>) along with IEC 60559 status flags and traps has LIA-1
27107  conformant types.
27108
27109 <h5><a name="H.2.3.1" href="#H.2.3.1">H.2.3.1 Floating-point parameters</a></h5>
27110 <p><!--para 1 -->
27111  The parameters for a floating point data type can be accessed by the following:
27112  r              FLT_RADIX
27113  p              FLT_MANT_DIG, DBL_MANT_DIG, LDBL_MANT_DIG
27114  emax           FLT_MAX_EXP, DBL_MAX_EXP, LDBL_MAX_EXP
27115  emin           FLT_MIN_EXP, DBL_MIN_EXP, LDBL_MIN_EXP
27116 <p><!--para 2 -->
27117  The derived constants for the floating point types are accessed by the following:
27118 <!--page 562 -->
27119  fmax          FLT_MAX, DBL_MAX, LDBL_MAX
27120  fminN         FLT_MIN, DBL_MIN, LDBL_MIN
27121  epsilon       FLT_EPSILON, DBL_EPSILON, LDBL_EPSILON
27122  rnd_style     FLT_ROUNDS
27123
27124 <h5><a name="H.2.3.2" href="#H.2.3.2">H.2.3.2 Floating-point operations</a></h5>
27125 <p><!--para 1 -->
27126  The floating-point operations on floating-point types are the following:
27127  addF          x + y
27128  subF          x - y
27129  mulF          x * y
27130  divF          x / y
27131  negF          -x
27132  absF          fabsf(x), fabs(x), fabsl(x)
27133  exponentF     1.f+logbf(x), 1.0+logb(x), 1.L+logbl(x)
27134  scaleF        scalbnf(x, n), scalbn(x, n), scalbnl(x, n),
27135 <pre>
27136                scalblnf(x, li), scalbln(x, li), scalblnl(x, li)
27137 </pre>
27138  intpartF      modff(x, &amp;y), modf(x, &amp;y), modfl(x, &amp;y)
27139  fractpartF    modff(x, &amp;y), modf(x, &amp;y), modfl(x, &amp;y)
27140  eqF           x == y
27141  neqF          x != y
27142  lssF          x &lt; y
27143  leqF          x &lt;= y
27144  gtrF          x &gt; y
27145  geqF          x &gt;= y
27146  where x and y are expressions of the same floating point type, n is of type int, and li
27147  is of type long int.
27148
27149 <h5><a name="H.2.3.3" href="#H.2.3.3">H.2.3.3 Rounding styles</a></h5>
27150 <p><!--para 1 -->
27151  The C Standard requires all floating types to use the same radix and rounding style, so
27152  that only one identifier for each is provided to map to LIA-1.
27153 <p><!--para 2 -->
27154  The FLT_ROUNDS parameter can be used to indicate the LIA-1 rounding styles:
27155  truncate      FLT_ROUNDS == 0
27156 <!--page 563 -->
27157  nearest       FLT_ROUNDS == 1
27158  other         FLT_ROUNDS != 0 &amp;&amp; FLT_ROUNDS != 1
27159  provided that an implementation extends FLT_ROUNDS to cover the rounding style used
27160  in all relevant LIA-1 operations, not just addition as in C.
27161
27162 <h4><a name="H.2.4" href="#H.2.4">H.2.4 Type conversions</a></h4>
27163 <p><!--para 1 -->
27164  The LIA-1 type conversions are the following type casts:
27165  cvtI' -&gt; I     (int)i, (long int)i, (long long int)i,
27166 <pre>
27167                (unsigned int)i, (unsigned long int)i,
27168                (unsigned long long int)i
27169 </pre>
27170  cvtF -&gt; I      (int)x, (long int)x, (long long int)x,
27171 <pre>
27172                (unsigned int)x, (unsigned long int)x,
27173                (unsigned long long int)x
27174 </pre>
27175  cvtI -&gt; F      (float)i, (double)i, (long double)i
27176  cvtF' -&gt; F     (float)x, (double)x, (long double)x
27177 <p><!--para 2 -->
27178  In the above conversions from floating to integer, the use of (cast)x can be replaced with
27179  (cast)round(x), (cast)rint(x), (cast)nearbyint(x), (cast)trunc(x),
27180  (cast)ceil(x), or (cast)floor(x). In addition, C's floating-point to integer
27181  conversion functions, lrint(), llrint(), lround(), and llround(), can be
27182  used. They all meet LIA-1's requirements on floating to integer rounding for in-range
27183  values. For out-of-range values, the conversions shall silently wrap for the modulo types.
27184 <p><!--para 3 -->
27185  The fmod() function is useful for doing silent wrapping to unsigned integer types, e.g.,
27186  fmod( fabs(rint(x)), 65536.0 ) or (0.0 &lt;= (y = fmod( rint(x),
27187  65536.0 )) ? y : 65536.0 + y) will compute an integer value in the range 0.0
27188  to 65535.0 which can then be cast to unsigned short int. But, the
27189  remainder() function is not useful for doing silent wrapping to signed integer types,
27190  e.g., remainder( rint(x), 65536.0 ) will compute an integer value in the
27191  range -32767.0 to +32768.0 which is not, in general, in the range of signed short
27192  int.
27193 <p><!--para 4 -->
27194  C's conversions (casts) from floating-point to floating-point can meet LIA-1
27195  requirements if an implementation uses round-to-nearest (IEC 60559 default).
27196 <p><!--para 5 -->
27197  C's conversions (casts) from integer to floating-point can meet LIA-1 requirements if an
27198  implementation uses round-to-nearest.
27199 <!--page 564 -->
27200
27201 <h3><a name="H.3" href="#H.3">H.3 Notification</a></h3>
27202 <p><!--para 1 -->
27203  Notification is the process by which a user or program is informed that an exceptional
27204  arithmetic operation has occurred. C's operations are compatible with LIA-1 in that C
27205  allows an implementation to cause a notification to occur when any arithmetic operation
27206  returns an exceptional value as defined in LIA-1 clause 5.
27207
27208 <h4><a name="H.3.1" href="#H.3.1">H.3.1 Notification alternatives</a></h4>
27209 <p><!--para 1 -->
27210  LIA-1 requires at least the following two alternatives for handling of notifications:
27211  setting indicators or trap-and-terminate. LIA-1 allows a third alternative: trap-and-
27212  resume.
27213 <p><!--para 2 -->
27214  An implementation need only support a given notification alternative for the entire
27215  program. An implementation may support the ability to switch between notification
27216  alternatives during execution, but is not required to do so. An implementation can
27217  provide separate selection for each kind of notification, but this is not required.
27218 <p><!--para 3 -->
27219  C allows an implementation to provide notification. C's SIGFPE (for traps) and
27220  FE_INVALID, FE_DIVBYZERO, FE_OVERFLOW, FE_UNDERFLOW (for indicators)
27221  can provide LIA-1 notification.
27222 <p><!--para 4 -->
27223  C's signal handlers are compatible with LIA-1. Default handling of SIGFPE can
27224  provide trap-and-terminate behavior, except for those LIA-1 operations implemented by
27225  math library function calls. User-provided signal handlers for SIGFPE allow for trap-
27226  and-resume behavior with the same constraint.
27227
27228 <h5><a name="H.3.1.1" href="#H.3.1.1">H.3.1.1 Indicators</a></h5>
27229 <p><!--para 1 -->
27230  C's <a href="#7.6">&lt;fenv.h&gt;</a> status flags are compatible with the LIA-1 indicators.
27231 <p><!--para 2 -->
27232  The following mapping is for floating-point types:
27233  undefined                FE_INVALID, FE_DIVBYZERO
27234  floating_overflow         FE_OVERFLOW
27235  underflow                FE_UNDERFLOW
27236 <p><!--para 3 -->
27237  The floating-point indicator interrogation and manipulation operations are:
27238  set_indicators          feraiseexcept(i)
27239  clear_indicators        feclearexcept(i)
27240  test_indicators         fetestexcept(i)
27241  current_indicators      fetestexcept(FE_ALL_EXCEPT)
27242  where i is an expression of type int representing a subset of the LIA-1 indicators.
27243 <p><!--para 4 -->
27244  C allows an implementation to provide the following LIA-1 required behavior: at
27245  program termination if any indicator is set the implementation shall send an unambiguous
27246 <!--page 565 -->
27247  and ''hard to ignore'' message (see LIA-1 subclause <a href="#6.1.2">6.1.2</a>)
27248 <p><!--para 5 -->
27249  LIA-1 does not make the distinction between floating-point and integer for ''undefined''.
27250  This documentation makes that distinction because <a href="#7.6">&lt;fenv.h&gt;</a> covers only the floating-
27251  point indicators.
27252
27253 <h5><a name="H.3.1.2" href="#H.3.1.2">H.3.1.2 Traps</a></h5>
27254 <p><!--para 1 -->
27255  C is compatible with LIA-1's trap requirements for arithmetic operations, but not for
27256  math library functions (which are not permitted to invoke a user's signal handler for
27257  SIGFPE). An implementation can provide an alternative of notification through
27258  termination with a ''hard-to-ignore'' message (see LIA-1 subclause <a href="#6.1.3">6.1.3</a>).
27259 <p><!--para 2 -->
27260  LIA-1 does not require that traps be precise.
27261 <p><!--para 3 -->
27262  C does require that SIGFPE be the signal corresponding to LIA-1 arithmetic exceptions,
27263  if there is any signal raised for them.
27264 <p><!--para 4 -->
27265  C supports signal handlers for SIGFPE and allows trapping of LIA-1 arithmetic
27266  exceptions. When LIA-1 arithmetic exceptions do trap, C's signal-handler mechanism
27267  allows trap-and-terminate (either default implementation behavior or user replacement for
27268  it) or trap-and-resume, at the programmer's option.
27269 <!--page 566 -->
27270
27271 <h2><a name="I" href="#I">Annex I</a></h2>
27272 <pre>
27273                                      (informative)
27274                                 Common warnings
27275 </pre>
27276 <p><!--para 1 -->
27277  An implementation may generate warnings in many situations, none of which are
27278  specified as part of this International Standard. The following are a few of the more
27279  common situations.
27280 <p><!--para 2 -->
27281 <ul>
27282 <li>  A new struct or union type appears in a function prototype (<a href="#6.2.1">6.2.1</a>, <a href="#6.7.2.3">6.7.2.3</a>).
27283 <li>  A block with initialization of an object that has automatic storage duration is jumped
27284  into (<a href="#6.2.4">6.2.4</a>).
27285 <li>  An implicit narrowing conversion is encountered, such as the assignment of a long
27286  int or a double to an int, or a pointer to void to a pointer to any type other than
27287  a character type (<a href="#6.3">6.3</a>).
27288 <li>  A hexadecimal floating constant cannot be represented exactly in its evaluation format
27289  (<a href="#6.4.4.2">6.4.4.2</a>).
27290 <li>  An integer character constant includes more than one character or a wide character
27291  constant includes more than one multibyte character (<a href="#6.4.4.4">6.4.4.4</a>).
27292 <li>  The characters /* are found in a comment (<a href="#6.4.7">6.4.7</a>).
27293 <li>  An ''unordered'' binary operator (not comma, &amp;&amp;, or ||) contains a side effect to an
27294  lvalue in one operand, and a side effect to, or an access to the value of, the identical
27295  lvalue in the other operand (<a href="#6.5">6.5</a>).
27296 <li>  A function is called but no prototype has been supplied (<a href="#6.5.2.2">6.5.2.2</a>).
27297 <li>  The arguments in a function call do not agree in number and type with those of the
27298  parameters in a function definition that is not a prototype (<a href="#6.5.2.2">6.5.2.2</a>).
27299 <li>  An object is defined but not used (<a href="#6.7">6.7</a>).
27300 <li>  A value is given to an object of an enumerated type other than by assignment of an
27301  enumeration constant that is a member of that type, or an enumeration object that has
27302  the same type, or the value of a function that returns the same enumerated type
27303  (<a href="#6.7.2.2">6.7.2.2</a>).
27304 <li>  An aggregate has a partly bracketed initialization (<a href="#6.7.8">6.7.8</a>).
27305 <li>  A statement cannot be reached (<a href="#6.8">6.8</a>).
27306 <li>  A statement with no apparent effect is encountered (<a href="#6.8">6.8</a>).
27307 <li>  A constant expression is used as the controlling expression of a selection statement
27308  (<a href="#6.8.4">6.8.4</a>).
27309 <!--page 567 -->
27310 <li>  An incorrectly formed preprocessing group is encountered while skipping a
27311  preprocessing group (<a href="#6.10.1">6.10.1</a>).
27312 <li>  An unrecognized #pragma directive is encountered (<a href="#6.10.6">6.10.6</a>).
27313 <!--page 568 -->
27314 </ul>
27315
27316 <h2><a name="J" href="#J">Annex J</a></h2>
27317 <pre>
27318                                       (informative)
27319                                    Portability issues
27320 </pre>
27321 <p><!--para 1 -->
27322  This annex collects some information about portability that appears in this International
27323  Standard.
27324
27325 <h3><a name="J.1" href="#J.1">J.1 Unspecified behavior</a></h3>
27326 <p><!--para 1 -->
27327  The following are unspecified:
27328 <ul>
27329 <li>  The manner and timing of static initialization (<a href="#5.1.2">5.1.2</a>).
27330 <li>  The termination status returned to the hosted environment if the return type of main
27331  is not compatible with int (<a href="#5.1.2.2.3">5.1.2.2.3</a>).
27332 <li>  The behavior of the display device if a printing character is written when the active
27333  position is at the final position of a line (<a href="#5.2.2">5.2.2</a>).
27334 <li>  The behavior of the display device if a backspace character is written when the active
27335  position is at the initial position of a line (<a href="#5.2.2">5.2.2</a>).
27336 <li>  The behavior of the display device if a horizontal tab character is written when the
27337  active position is at or past the last defined horizontal tabulation position (<a href="#5.2.2">5.2.2</a>).
27338 <li>  The behavior of the display device if a vertical tab character is written when the active
27339  position is at or past the last defined vertical tabulation position (<a href="#5.2.2">5.2.2</a>).
27340 <li>  How an extended source character that does not correspond to a universal character
27341  name counts toward the significant initial characters in an external identifier (<a href="#5.2.4.1">5.2.4.1</a>).
27342 <li>  Many aspects of the representations of types (<a href="#6.2.6">6.2.6</a>).
27343 <li>  The value of padding bytes when storing values in structures or unions (<a href="#6.2.6.1">6.2.6.1</a>).
27344 <li>  The values of bytes that correspond to union members other than the one last stored
27345  into (<a href="#6.2.6.1">6.2.6.1</a>).
27346 <li>  The representation used when storing a value in an object that has more than one
27347  object representation for that value (<a href="#6.2.6.1">6.2.6.1</a>).
27348 <li>  The values of any padding bits in integer representations (<a href="#6.2.6.2">6.2.6.2</a>).
27349 <li>  Whether certain operators can generate negative zeros and whether a negative zero
27350  becomes a normal zero when stored in an object (<a href="#6.2.6.2">6.2.6.2</a>).
27351 <li>  Whether two string literals result in distinct arrays (<a href="#6.4.5">6.4.5</a>).
27352 <li>  The order in which subexpressions are evaluated and the order in which side effects
27353  take place, except as specified for the function-call (), &amp;&amp;, ||, ? :, and comma
27354 <!--page 569 -->
27355   operators (<a href="#6.5">6.5</a>).
27356 <li>  The order in which the function designator, arguments, and subexpressions within the
27357  arguments are evaluated in a function call (<a href="#6.5.2.2">6.5.2.2</a>).
27358 <li>  The order of side effects among compound literal initialization list expressions
27359  (<a href="#6.5.2.5">6.5.2.5</a>).
27360 <li>  The order in which the operands of an assignment operator are evaluated (<a href="#6.5.16">6.5.16</a>).
27361 <li>  The alignment of the addressable storage unit allocated to hold a bit-field (<a href="#6.7.2.1">6.7.2.1</a>).
27362 <li>  Whether a call to an inline function uses the inline definition or the external definition
27363  of the function (<a href="#6.7.4">6.7.4</a>).
27364 <li>  Whether or not a size expression is evaluated when it is part of the operand of a
27365  sizeof operator and changing the value of the size expression would not affect the
27366  result of the operator (<a href="#6.7.6.2">6.7.6.2</a>).
27367 <li>  The order in which any side effects occur among the initialization list expressions in
27368  an initializer (<a href="#6.7.9">6.7.9</a>).
27369 <li>  The layout of storage for function parameters (<a href="#6.9.1">6.9.1</a>).
27370 <li>  When a fully expanded macro replacement list contains a function-like macro name
27371  as its last preprocessing token and the next preprocessing token from the source file is
27372  a (, and the fully expanded replacement of that macro ends with the name of the first
27373  macro and the next preprocessing token from the source file is again a (, whether that
27374  is considered a nested replacement (<a href="#6.10.3">6.10.3</a>).
27375 <li>  The order in which # and ## operations are evaluated during macro substitution
27376  (<a href="#6.10.3.2">6.10.3.2</a>, <a href="#6.10.3.3">6.10.3.3</a>).
27377 <li>  The state of the floating-point status flags when execution passes from a part of the *
27378  program translated with FENV_ACCESS ''off'' to a part translated with
27379  FENV_ACCESS ''on'' (<a href="#7.6.1">7.6.1</a>).
27380 <li>  The order in which feraiseexcept raises floating-point exceptions, except as
27381  stated in <a href="#F.8.6">F.8.6</a> (<a href="#7.6.2.3">7.6.2.3</a>).
27382 <li>  Whether math_errhandling is a macro or an identifier with external linkage
27383  (<a href="#7.12">7.12</a>).
27384 <li>  The results of the frexp functions when the specified value is not a floating-point
27385  number (<a href="#7.12.6.4">7.12.6.4</a>).
27386 <li>  The numeric result of the ilogb functions when the correct value is outside the
27387  range of the return type (<a href="#7.12.6.5">7.12.6.5</a>, <a href="#F.10.3.5">F.10.3.5</a>).
27388 <li>  The result of rounding when the value is out of range (<a href="#7.12.9.5">7.12.9.5</a>, <a href="#7.12.9.7">7.12.9.7</a>, <a href="#F.10.6.5">F.10.6.5</a>).
27389 <!--page 570 -->
27390 <li>  The value stored by the remquo functions in the object pointed to by quo when y is
27391  zero (<a href="#7.12.10.3">7.12.10.3</a>).
27392 <li>  Whether a comparison macro argument that is represented in a format wider than its
27393  semantic type is converted to the semantic type (<a href="#7.12.14">7.12.14</a>).
27394 <li>  Whether setjmp is a macro or an identifier with external linkage (<a href="#7.13">7.13</a>).
27395 <li>  Whether va_copy and va_end are macros or identifiers with external linkage
27396  (<a href="#7.16.1">7.16.1</a>).
27397 <li>  The hexadecimal digit before the decimal point when a non-normalized floating-point
27398  number is printed with an a or A conversion specifier (<a href="#7.21.6.1">7.21.6.1</a>, <a href="#7.28.2.1">7.28.2.1</a>).
27399 <li>  The value of the file position indicator after a successful call to the ungetc function
27400  for a text stream, or the ungetwc function for any stream, until all pushed-back
27401  characters are read or discarded (<a href="#7.21.7.10">7.21.7.10</a>, <a href="#7.28.3.10">7.28.3.10</a>).
27402 <li>  The details of the value stored by the fgetpos function (<a href="#7.21.9.1">7.21.9.1</a>).
27403 <li>  The details of the value returned by the ftell function for a text stream (<a href="#7.21.9.4">7.21.9.4</a>).
27404 <li>  Whether the strtod, strtof, strtold, wcstod, wcstof, and wcstold
27405  functions convert a minus-signed sequence to a negative number directly or by
27406  negating the value resulting from converting the corresponding unsigned sequence
27407  (<a href="#7.22.1.3">7.22.1.3</a>, <a href="#7.28.4.1.1">7.28.4.1.1</a>).
27408 <li>  The order and contiguity of storage allocated by successive calls to the calloc,
27409  malloc, and realloc functions (<a href="#7.22.3">7.22.3</a>).
27410 <li>  The amount of storage allocated by a successful call to the calloc, malloc, or
27411  realloc function when 0 bytes was requested (<a href="#7.22.3">7.22.3</a>).
27412 <li>  Which of two elements that compare as equal is matched by the bsearch function
27413  (<a href="#7.22.5.1">7.22.5.1</a>).
27414 <li>  The order of two elements that compare as equal in an array sorted by the qsort
27415  function (<a href="#7.22.5.2">7.22.5.2</a>).
27416 <li>  The encoding of the calendar time returned by the time function (<a href="#7.26.2.4">7.26.2.4</a>).
27417 <li>  The characters stored by the strftime or wcsftime function if any of the time
27418  values being converted is outside the normal range (<a href="#7.26.3.5">7.26.3.5</a>, <a href="#7.28.5.1">7.28.5.1</a>).
27419 <li>  The conversion state after an encoding error occurs (<a href="#7.28.6.3.2">7.28.6.3.2</a>, <a href="#7.28.6.3.3">7.28.6.3.3</a>, <a href="#7.28.6.4.1">7.28.6.4.1</a>,
27420  <a href="#7.28.6.4.2">7.28.6.4.2</a>,
27421 <li>  The resulting value when the ''invalid'' floating-point exception is raised during
27422  IEC 60559 floating to integer conversion (<a href="#F.4">F.4</a>).
27423 <!--page 571 -->
27424 <li>  Whether conversion of non-integer IEC 60559 floating values to integer raises the
27425  ''inexact'' floating-point exception (<a href="#F.4">F.4</a>).
27426 <li>  Whether or when library functions in <a href="#7.12">&lt;math.h&gt;</a> raise the ''inexact'' floating-point
27427  exception in an IEC 60559 conformant implementation (<a href="#F.10">F.10</a>).
27428 <li>  Whether or when library functions in <a href="#7.12">&lt;math.h&gt;</a> raise an undeserved ''underflow''
27429  floating-point exception in an IEC 60559 conformant implementation (<a href="#F.10">F.10</a>).
27430 <li>  The exponent value stored by frexp for a NaN or infinity (<a href="#F.10.3.4">F.10.3.4</a>).
27431 <li>  The numeric result returned by the lrint, llrint, lround, and llround
27432  functions if the rounded value is outside the range of the return type (<a href="#F.10.6.5">F.10.6.5</a>,
27433  <a href="#F.10.6.7">F.10.6.7</a>).
27434 <li>  The sign of one part of the complex result of several math functions for certain
27435  special cases in IEC 60559 compatible implementations (<a href="#G.6.1.1">G.6.1.1</a>, <a href="#G.6.2.2">G.6.2.2</a>, <a href="#G.6.2.3">G.6.2.3</a>,
27436  <a href="#G.6.2.4">G.6.2.4</a>, <a href="#G.6.2.5">G.6.2.5</a>, <a href="#G.6.2.6">G.6.2.6</a>, <a href="#G.6.3.1">G.6.3.1</a>, <a href="#G.6.4.2">G.6.4.2</a>).
27437 </ul>
27438
27439 <h3><a name="J.2" href="#J.2">J.2 Undefined behavior</a></h3>
27440 <p><!--para 1 -->
27441  The behavior is undefined in the following circumstances:
27442 <ul>
27443 <li>  A ''shall'' or ''shall not'' requirement that appears outside of a constraint is violated
27444  (clause 4).
27445 <li>  A nonempty source file does not end in a new-line character which is not immediately
27446  preceded by a backslash character or ends in a partial preprocessing token or
27447  comment (<a href="#5.1.1.2">5.1.1.2</a>).
27448 <li>  Token concatenation produces a character sequence matching the syntax of a
27449  universal character name (<a href="#5.1.1.2">5.1.1.2</a>).
27450 <li>  A program in a hosted environment does not define a function named main using one
27451  of the specified forms (<a href="#5.1.2.2.1">5.1.2.2.1</a>).
27452 <li>  The execution of a program contains a data race (<a href="#5.1.2.4">5.1.2.4</a>).
27453 <li>  A character not in the basic source character set is encountered in a source file, except
27454  in an identifier, a character constant, a string literal, a header name, a comment, or a
27455  preprocessing token that is never converted to a token (<a href="#5.2.1">5.2.1</a>).
27456 <li>  An identifier, comment, string literal, character constant, or header name contains an
27457  invalid multibyte character or does not begin and end in the initial shift state (<a href="#5.2.1.2">5.2.1.2</a>).
27458 <li>  The same identifier has both internal and external linkage in the same translation unit
27459  (<a href="#6.2.2">6.2.2</a>).
27460 <li>  An object is referred to outside of its lifetime (<a href="#6.2.4">6.2.4</a>).
27461 <!--page 572 -->
27462 <li>  The value of a pointer to an object whose lifetime has ended is used (<a href="#6.2.4">6.2.4</a>).
27463 <li>  The value of an object with automatic storage duration is used while it is
27464  indeterminate (<a href="#6.2.4">6.2.4</a>, <a href="#6.7.9">6.7.9</a>, <a href="#6.8">6.8</a>).
27465 <li>  A trap representation is read by an lvalue expression that does not have character type
27466  (<a href="#6.2.6.1">6.2.6.1</a>).
27467 <li>  A trap representation is produced by a side effect that modifies any part of the object
27468  using an lvalue expression that does not have character type (<a href="#6.2.6.1">6.2.6.1</a>).
27469 <li>  The operands to certain operators are such that they could produce a negative zero
27470  result, but the implementation does not support negative zeros (<a href="#6.2.6.2">6.2.6.2</a>).
27471 <li>  Two declarations of the same object or function specify types that are not compatible
27472  (<a href="#6.2.7">6.2.7</a>).
27473 <li>  A program requires the formation of a composite type from a variable length array
27474  type whose size is specified by an expression that is not evaluated (<a href="#6.2.7">6.2.7</a>).
27475 <li>  Conversion to or from an integer type produces a value outside the range that can be
27476  represented (<a href="#6.3.1.4">6.3.1.4</a>).
27477 <li>  Demotion of one real floating type to another produces a value outside the range that
27478  can be represented (<a href="#6.3.1.5">6.3.1.5</a>).
27479 <li>  An lvalue does not designate an object when evaluated (<a href="#6.3.2.1">6.3.2.1</a>).
27480 <li>  A non-array lvalue with an incomplete type is used in a context that requires the value
27481  of the designated object (<a href="#6.3.2.1">6.3.2.1</a>).
27482 <li>  An lvalue designating an object of automatic storage duration that could have been
27483  declared with the register storage class is used in a context that requires the value
27484  of the designated object, but the object is uninitialized. (<a href="#6.3.2.1">6.3.2.1</a>).
27485 <li>  An lvalue having array type is converted to a pointer to the initial element of the
27486  array, and the array object has register storage class (<a href="#6.3.2.1">6.3.2.1</a>).
27487 <li>  An attempt is made to use the value of a void expression, or an implicit or explicit
27488  conversion (except to void) is applied to a void expression (<a href="#6.3.2.2">6.3.2.2</a>).
27489 <li>  Conversion of a pointer to an integer type produces a value outside the range that can
27490  be represented (<a href="#6.3.2.3">6.3.2.3</a>).
27491 <li>  Conversion between two pointer types produces a result that is incorrectly aligned
27492  (<a href="#6.3.2.3">6.3.2.3</a>).
27493 <li>  A pointer is used to call a function whose type is not compatible with the referenced
27494  type (<a href="#6.3.2.3">6.3.2.3</a>).
27495 <!--page 573 -->
27496 <li>  An unmatched ' or " character is encountered on a logical source line during
27497  tokenization (<a href="#6.4">6.4</a>).
27498 <li>  A reserved keyword token is used in translation phase 7 or 8 for some purpose other
27499  than as a keyword (<a href="#6.4.1">6.4.1</a>).
27500 <li>  A universal character name in an identifier does not designate a character whose
27501  encoding falls into one of the specified ranges (<a href="#6.4.2.1">6.4.2.1</a>).
27502 <li>  The initial character of an identifier is a universal character name designating a digit
27503  (<a href="#6.4.2.1">6.4.2.1</a>).
27504 <li>  Two identifiers differ only in nonsignificant characters (<a href="#6.4.2.1">6.4.2.1</a>).
27505 <li>  The identifier __func__ is explicitly declared (<a href="#6.4.2.2">6.4.2.2</a>).
27506 <li>  The program attempts to modify a string literal (<a href="#6.4.5">6.4.5</a>).
27507 <li>  The characters ', \, ", //, or /* occur in the sequence between the &lt; and &gt;
27508  delimiters, or the characters ', \, //, or /* occur in the sequence between the "
27509  delimiters, in a header name preprocessing token (<a href="#6.4.7">6.4.7</a>).
27510 <li>  A side effect on a scalar object is unsequenced relative to either a different side effect
27511  on the same scalar object or a value computation using the value of the same scalar
27512  object (<a href="#6.5">6.5</a>).
27513 <li>  An exceptional condition occurs during the evaluation of an expression (<a href="#6.5">6.5</a>).
27514 <li>  An object has its stored value accessed other than by an lvalue of an allowable type
27515  (<a href="#6.5">6.5</a>).
27516 <li>  For a call to a function without a function prototype in scope, the number of *
27517  arguments does not equal the number of parameters (<a href="#6.5.2.2">6.5.2.2</a>).
27518 <li>  For call to a function without a function prototype in scope where the function is
27519  defined with a function prototype, either the prototype ends with an ellipsis or the
27520  types of the arguments after promotion are not compatible with the types of the
27521  parameters (<a href="#6.5.2.2">6.5.2.2</a>).
27522 <li>  For a call to a function without a function prototype in scope where the function is not
27523  defined with a function prototype, the types of the arguments after promotion are not
27524  compatible with those of the parameters after promotion (with certain exceptions)
27525  (<a href="#6.5.2.2">6.5.2.2</a>).
27526 <li>  A function is defined with a type that is not compatible with the type (of the
27527  expression) pointed to by the expression that denotes the called function (<a href="#6.5.2.2">6.5.2.2</a>).
27528 <li>  A member of an atomic structure or union is accessed (<a href="#6.5.2.3">6.5.2.3</a>).
27529 <li>  The operand of the unary * operator has an invalid value (<a href="#6.5.3.2">6.5.3.2</a>).
27530 <!--page 574 -->
27531 <li>  A pointer is converted to other than an integer or pointer type (<a href="#6.5.4">6.5.4</a>).
27532 <li>  The value of the second operand of the / or % operator is zero (<a href="#6.5.5">6.5.5</a>).
27533 <li>  Addition or subtraction of a pointer into, or just beyond, an array object and an
27534  integer type produces a result that does not point into, or just beyond, the same array
27535  object (<a href="#6.5.6">6.5.6</a>).
27536 <li>  Addition or subtraction of a pointer into, or just beyond, an array object and an
27537  integer type produces a result that points just beyond the array object and is used as
27538  the operand of a unary * operator that is evaluated (<a href="#6.5.6">6.5.6</a>).
27539 <li>  Pointers that do not point into, or just beyond, the same array object are subtracted
27540  (<a href="#6.5.6">6.5.6</a>).
27541 <li>  An array subscript is out of range, even if an object is apparently accessible with the
27542  given subscript (as in the lvalue expression a[1][7] given the declaration int
27543  a[4][5]) (<a href="#6.5.6">6.5.6</a>).
27544 <li>  The result of subtracting two pointers is not representable in an object of type
27545  ptrdiff_t (<a href="#6.5.6">6.5.6</a>).
27546 <li>  An expression is shifted by a negative number or by an amount greater than or equal
27547  to the width of the promoted expression (<a href="#6.5.7">6.5.7</a>).
27548 <li>  An expression having signed promoted type is left-shifted and either the value of the
27549  expression is negative or the result of shifting would be not be representable in the
27550  promoted type (<a href="#6.5.7">6.5.7</a>).
27551 <li>  Pointers that do not point to the same aggregate or union (nor just beyond the same
27552  array object) are compared using relational operators (<a href="#6.5.8">6.5.8</a>).
27553 <li>  An object is assigned to an inexactly overlapping object or to an exactly overlapping
27554  object with incompatible type (<a href="#6.5.16.1">6.5.16.1</a>).
27555 <li>  An expression that is required to be an integer constant expression does not have an
27556  integer type; has operands that are not integer constants, enumeration constants,
27557  character constants, sizeof expressions whose results are integer constants, or
27558  immediately-cast floating constants; or contains casts (outside operands to sizeof
27559  operators) other than conversions of arithmetic types to integer types (<a href="#6.6">6.6</a>).
27560 <li>  A constant expression in an initializer is not, or does not evaluate to, one of the
27561  following: an arithmetic constant expression, a null pointer constant, an address
27562  constant, or an address constant for a complete object type plus or minus an integer
27563  constant expression (<a href="#6.6">6.6</a>).
27564 <li>  An arithmetic constant expression does not have arithmetic type; has operands that
27565  are not integer constants, floating constants, enumeration constants, character
27566  constants, or sizeof expressions; or contains casts (outside operands to sizeof
27567 <!--page 575 -->
27568   operators) other than conversions of arithmetic types to arithmetic types (<a href="#6.6">6.6</a>).
27569 <li>  The value of an object is accessed by an array-subscript [], member-access . or -&gt;,
27570  address &amp;, or indirection * operator or a pointer cast in creating an address constant
27571  (<a href="#6.6">6.6</a>).
27572 <li>  An identifier for an object is declared with no linkage and the type of the object is
27573  incomplete after its declarator, or after its init-declarator if it has an initializer (<a href="#6.7">6.7</a>).
27574 <li>  A function is declared at block scope with an explicit storage-class specifier other
27575  than extern (<a href="#6.7.1">6.7.1</a>).
27576 <li>  A structure or union is defined as containing no named members, no anonymous
27577  structures, and no anonymous unions (<a href="#6.7.2.1">6.7.2.1</a>).
27578 <li>  An attempt is made to access, or generate a pointer to just past, a flexible array
27579  member of a structure when the referenced object provides no elements for that array
27580  (<a href="#6.7.2.1">6.7.2.1</a>).
27581 <li>  When the complete type is needed, an incomplete structure or union type is not
27582  completed in the same scope by another declaration of the tag that defines the content
27583  (<a href="#6.7.2.3">6.7.2.3</a>).
27584 <li>  An attempt is made to modify an object defined with a const-qualified type through
27585  use of an lvalue with non-const-qualified type (<a href="#6.7.3">6.7.3</a>).
27586 <li>  An attempt is made to refer to an object defined with a volatile-qualified type through
27587  use of an lvalue with non-volatile-qualified type (<a href="#6.7.3">6.7.3</a>).
27588 <li>  The specification of a function type includes any type qualifiers (<a href="#6.7.3">6.7.3</a>).                        *
27589 <li>  Two qualified types that are required to be compatible do not have the identically
27590  qualified version of a compatible type (<a href="#6.7.3">6.7.3</a>).
27591 <li>  An object which has been modified is accessed through a restrict-qualified pointer to
27592  a const-qualified type, or through a restrict-qualified pointer and another pointer that
27593  are not both based on the same object (<a href="#6.7.3.1">6.7.3.1</a>).
27594 <li>  A restrict-qualified pointer is assigned a value based on another restricted pointer
27595  whose associated block neither began execution before the block associated with this
27596  pointer, nor ended before the assignment (<a href="#6.7.3.1">6.7.3.1</a>).
27597 <li>  A function with external linkage is declared with an inline function specifier, but is
27598  not also defined in the same translation unit (<a href="#6.7.4">6.7.4</a>).
27599 <li>  A function declared with a _Noreturn function specifier returns to its caller (<a href="#6.7.4">6.7.4</a>).
27600 <li>  The definition of an object has an alignment specifier and another declaration of that
27601  object has a different alignment specifier (<a href="#6.7.5">6.7.5</a>).
27602 <!--page 576 -->
27603 <li>  Declarations of an object in different translation units have different alignment
27604  specifiers (<a href="#6.7.5">6.7.5</a>).
27605 <li>  Two pointer types that are required to be compatible are not identically qualified, or
27606  are not pointers to compatible types (<a href="#6.7.6.1">6.7.6.1</a>).
27607 <li>  The size expression in an array declaration is not a constant expression and evaluates
27608  at program execution time to a nonpositive value (<a href="#6.7.6.2">6.7.6.2</a>).
27609 <li>  In a context requiring two array types to be compatible, they do not have compatible
27610  element types, or their size specifiers evaluate to unequal values (<a href="#6.7.6.2">6.7.6.2</a>).
27611 <li>  A declaration of an array parameter includes the keyword static within the [ and
27612  ] and the corresponding argument does not provide access to the first element of an
27613  array with at least the specified number of elements (<a href="#6.7.6.3">6.7.6.3</a>).
27614 <li>  A storage-class specifier or type qualifier modifies the keyword void as a function
27615  parameter type list (<a href="#6.7.6.3">6.7.6.3</a>).
27616 <li>  In a context requiring two function types to be compatible, they do not have
27617  compatible return types, or their parameters disagree in use of the ellipsis terminator
27618  or the number and type of parameters (after default argument promotion, when there
27619  is no parameter type list or when one type is specified by a function definition with an
27620  identifier list) (<a href="#6.7.6.3">6.7.6.3</a>).
27621 <li>  The value of an unnamed member of a structure or union is used (<a href="#6.7.9">6.7.9</a>).
27622 <li>  The initializer for a scalar is neither a single expression nor a single expression
27623  enclosed in braces (<a href="#6.7.9">6.7.9</a>).
27624 <li>  The initializer for a structure or union object that has automatic storage duration is
27625  neither an initializer list nor a single expression that has compatible structure or union
27626  type (<a href="#6.7.9">6.7.9</a>).
27627 <li>  The initializer for an aggregate or union, other than an array initialized by a string
27628  literal, is not a brace-enclosed list of initializers for its elements or members (<a href="#6.7.9">6.7.9</a>).
27629 <li>  An identifier with external linkage is used, but in the program there does not exist
27630  exactly one external definition for the identifier, or the identifier is not used and there
27631  exist multiple external definitions for the identifier (<a href="#6.9">6.9</a>).
27632 <li>  A function definition includes an identifier list, but the types of the parameters are not
27633  declared in a following declaration list (<a href="#6.9.1">6.9.1</a>).
27634 <li>  An adjusted parameter type in a function definition is not a complete object type
27635  (<a href="#6.9.1">6.9.1</a>).
27636 <li>  A function that accepts a variable number of arguments is defined without a
27637  parameter type list that ends with the ellipsis notation (<a href="#6.9.1">6.9.1</a>).
27638 <!--page 577 -->
27639 <li>  The } that terminates a function is reached, and the value of the function call is used
27640  by the caller (<a href="#6.9.1">6.9.1</a>).
27641 <li>  An identifier for an object with internal linkage and an incomplete type is declared
27642  with a tentative definition (<a href="#6.9.2">6.9.2</a>).
27643 <li>  The token defined is generated during the expansion of a #if or #elif
27644  preprocessing directive, or the use of the defined unary operator does not match
27645  one of the two specified forms prior to macro replacement (<a href="#6.10.1">6.10.1</a>).
27646 <li>  The #include preprocessing directive that results after expansion does not match
27647  one of the two header name forms (<a href="#6.10.2">6.10.2</a>).
27648 <li>  The character sequence in an #include preprocessing directive does not start with a
27649  letter (<a href="#6.10.2">6.10.2</a>).
27650 <li>  There are sequences of preprocessing tokens within the list of macro arguments that
27651  would otherwise act as preprocessing directives (<a href="#6.10.3">6.10.3</a>).
27652 <li>  The result of the preprocessing operator # is not a valid character string literal
27653  (<a href="#6.10.3.2">6.10.3.2</a>).
27654 <li>  The result of the preprocessing operator ## is not a valid preprocessing token
27655  (<a href="#6.10.3.3">6.10.3.3</a>).
27656 <li>  The #line preprocessing directive that results after expansion does not match one of
27657  the two well-defined forms, or its digit sequence specifies zero or a number greater
27658  than 2147483647 (<a href="#6.10.4">6.10.4</a>).
27659 <li>  A non-STDC #pragma preprocessing directive that is documented as causing
27660  translation failure or some other form of undefined behavior is encountered (<a href="#6.10.6">6.10.6</a>).
27661 <li>  A #pragma STDC preprocessing directive does not match one of the well-defined
27662  forms (<a href="#6.10.6">6.10.6</a>).
27663 <li>  The name of a predefined macro, or the identifier defined, is the subject of a
27664  #define or #undef preprocessing directive (<a href="#6.10.8">6.10.8</a>).
27665 <li>  An attempt is made to copy an object to an overlapping object by use of a library
27666  function, other than as explicitly allowed (e.g., memmove) (clause 7).
27667 <li>  A file with the same name as one of the standard headers, not provided as part of the
27668  implementation, is placed in any of the standard places that are searched for included
27669  source files (<a href="#7.1.2">7.1.2</a>).
27670 <li>  A header is included within an external declaration or definition (<a href="#7.1.2">7.1.2</a>).
27671 <li>  A function, object, type, or macro that is specified as being declared or defined by
27672  some standard header is used before any header that declares or defines it is included
27673  (<a href="#7.1.2">7.1.2</a>).
27674 <!--page 578 -->
27675 <li>  A standard header is included while a macro is defined with the same name as a
27676  keyword (<a href="#7.1.2">7.1.2</a>).
27677 <li>  The program attempts to declare a library function itself, rather than via a standard
27678  header, but the declaration does not have external linkage (<a href="#7.1.2">7.1.2</a>).
27679 <li>  The program declares or defines a reserved identifier, other than as allowed by <a href="#7.1.4">7.1.4</a>
27680  (<a href="#7.1.3">7.1.3</a>).
27681 <li>  The program removes the definition of a macro whose name begins with an
27682  underscore and either an uppercase letter or another underscore (<a href="#7.1.3">7.1.3</a>).
27683 <li>  An argument to a library function has an invalid value or a type not expected by a
27684  function with variable number of arguments (<a href="#7.1.4">7.1.4</a>).
27685 <li>  The pointer passed to a library function array parameter does not have a value such
27686  that all address computations and object accesses are valid (<a href="#7.1.4">7.1.4</a>).
27687 <li>  The macro definition of assert is suppressed in order to access an actual function
27688  (<a href="#7.2">7.2</a>).
27689 <li>  The argument to the assert macro does not have a scalar type (<a href="#7.2">7.2</a>).
27690 <li>  The CX_LIMITED_RANGE, FENV_ACCESS, or FP_CONTRACT pragma is used in
27691  any context other than outside all external declarations or preceding all explicit
27692  declarations and statements inside a compound statement (<a href="#7.3.4">7.3.4</a>, <a href="#7.6.1">7.6.1</a>, <a href="#7.12.2">7.12.2</a>).
27693 <li>  The value of an argument to a character handling function is neither equal to the value
27694  of EOF nor representable as an unsigned char (<a href="#7.4">7.4</a>).
27695 <li>  A macro definition of errno is suppressed in order to access an actual object, or the
27696  program defines an identifier with the name errno (<a href="#7.5">7.5</a>).
27697 <li>  Part of the program tests floating-point status flags, sets floating-point control modes,
27698  or runs under non-default mode settings, but was translated with the state for the
27699  FENV_ACCESS pragma ''off'' (<a href="#7.6.1">7.6.1</a>).
27700 <li>  The exception-mask argument for one of the functions that provide access to the
27701  floating-point status flags has a nonzero value not obtained by bitwise OR of the
27702  floating-point exception macros (<a href="#7.6.2">7.6.2</a>).
27703 <li>  The fesetexceptflag function is used to set floating-point status flags that were
27704  not specified in the call to the fegetexceptflag function that provided the value
27705  of the corresponding fexcept_t object (<a href="#7.6.2.4">7.6.2.4</a>).
27706 <li>  The argument to fesetenv or feupdateenv is neither an object set by a call to
27707  fegetenv or feholdexcept, nor is it an environment macro (<a href="#7.6.4.3">7.6.4.3</a>, <a href="#7.6.4.4">7.6.4.4</a>).
27708 <li>  The value of the result of an integer arithmetic or conversion function cannot be
27709  represented (<a href="#7.8.2.1">7.8.2.1</a>, <a href="#7.8.2.2">7.8.2.2</a>, <a href="#7.8.2.3">7.8.2.3</a>, <a href="#7.8.2.4">7.8.2.4</a>, <a href="#7.22.6.1">7.22.6.1</a>, <a href="#7.22.6.2">7.22.6.2</a>, <a href="#7.22.1">7.22.1</a>).
27710 <!--page 579 -->
27711 <li>  The program modifies the string pointed to by the value returned by the setlocale
27712  function (<a href="#7.11.1.1">7.11.1.1</a>).
27713 <li>  The program modifies the structure pointed to by the value returned by the
27714  localeconv function (<a href="#7.11.2.1">7.11.2.1</a>).
27715 <li>  A macro definition of math_errhandling is suppressed or the program defines
27716  an identifier with the name math_errhandling (<a href="#7.12">7.12</a>).
27717 <li>  An argument to a floating-point classification or comparison macro is not of real
27718  floating type (<a href="#7.12.3">7.12.3</a>, <a href="#7.12.14">7.12.14</a>).
27719 <li>  A macro definition of setjmp is suppressed in order to access an actual function, or
27720  the program defines an external identifier with the name setjmp (<a href="#7.13">7.13</a>).
27721 <li>  An invocation of the setjmp macro occurs other than in an allowed context
27722  (<a href="#7.13.2.1">7.13.2.1</a>).
27723 <li>  The longjmp function is invoked to restore a nonexistent environment (<a href="#7.13.2.1">7.13.2.1</a>).
27724 <li>  After a longjmp, there is an attempt to access the value of an object of automatic
27725  storage duration that does not have volatile-qualified type, local to the function
27726  containing the invocation of the corresponding setjmp macro, that was changed
27727  between the setjmp invocation and longjmp call (<a href="#7.13.2.1">7.13.2.1</a>).
27728 <li>  The program specifies an invalid pointer to a signal handler function (<a href="#7.14.1.1">7.14.1.1</a>).
27729 <li>  A signal handler returns when the signal corresponded to a computational exception
27730  (<a href="#7.14.1.1">7.14.1.1</a>).
27731 <li>  A signal occurs as the result of calling the abort or raise function, and the signal
27732  handler calls the raise function (<a href="#7.14.1.1">7.14.1.1</a>).
27733 <li>  A signal occurs other than as the result of calling the abort or raise function, and
27734  the signal handler refers to an object with static or thread storage duration that is not a
27735  lock-free atomic object other than by assigning a value to an object declared as
27736  volatile sig_atomic_t, or calls any function in the standard library other
27737  than the abort function, the _Exit function, the quick_exit function, or the
27738  signal function (for the same signal number) (<a href="#7.14.1.1">7.14.1.1</a>).
27739 <li>  The value of errno is referred to after a signal occurred other than as the result of
27740  calling the abort or raise function and the corresponding signal handler obtained
27741  a SIG_ERR return from a call to the signal function (<a href="#7.14.1.1">7.14.1.1</a>).
27742 <li>  A signal is generated by an asynchronous signal handler (<a href="#7.14.1.1">7.14.1.1</a>).
27743 <li>  A function with a variable number of arguments attempts to access its varying
27744  arguments other than through a properly declared and initialized va_list object, or
27745  before the va_start macro is invoked (<a href="#7.16">7.16</a>, <a href="#7.16.1.1">7.16.1.1</a>, <a href="#7.16.1.4">7.16.1.4</a>).
27746 <!--page 580 -->
27747 <li>  The macro va_arg is invoked using the parameter ap that was passed to a function
27748  that invoked the macro va_arg with the same parameter (<a href="#7.16">7.16</a>).
27749 <li>  A macro definition of va_start, va_arg, va_copy, or va_end is suppressed in
27750  order to access an actual function, or the program defines an external identifier with
27751  the name va_copy or va_end (<a href="#7.16.1">7.16.1</a>).
27752 <li>  The va_start or va_copy macro is invoked without a corresponding invocation
27753  of the va_end macro in the same function, or vice versa (<a href="#7.16.1">7.16.1</a>, <a href="#7.16.1.2">7.16.1.2</a>, <a href="#7.16.1.3">7.16.1.3</a>,
27754  <a href="#7.16.1.4">7.16.1.4</a>).
27755 <li>  The type parameter to the va_arg macro is not such that a pointer to an object of
27756  that type can be obtained simply by postfixing a * (<a href="#7.16.1.1">7.16.1.1</a>).
27757 <li>  The va_arg macro is invoked when there is no actual next argument, or with a
27758  specified type that is not compatible with the promoted type of the actual next
27759  argument, with certain exceptions (<a href="#7.16.1.1">7.16.1.1</a>).
27760 <li>  The va_copy or va_start macro is called to initialize a va_list that was
27761  previously initialized by either macro without an intervening invocation of the
27762  va_end macro for the same va_list (<a href="#7.16.1.2">7.16.1.2</a>, <a href="#7.16.1.4">7.16.1.4</a>).
27763 <li>  The parameter parmN of a va_start macro is declared with the register
27764  storage class, with a function or array type, or with a type that is not compatible with
27765  the type that results after application of the default argument promotions (<a href="#7.16.1.4">7.16.1.4</a>).
27766 <li>  The member designator parameter of an offsetof macro is an invalid right
27767  operand of the . operator for the type parameter, or designates a bit-field (<a href="#7.19">7.19</a>).
27768 <li>  The argument in an instance of one of the integer-constant macros is not a decimal,
27769  octal, or hexadecimal constant, or it has a value that exceeds the limits for the
27770  corresponding type (<a href="#7.20.4">7.20.4</a>).
27771 <li>  A byte input/output function is applied to a wide-oriented stream, or a wide character
27772  input/output function is applied to a byte-oriented stream (<a href="#7.21.2">7.21.2</a>).
27773 <li>  Use is made of any portion of a file beyond the most recent wide character written to
27774  a wide-oriented stream (<a href="#7.21.2">7.21.2</a>).
27775 <li>  The value of a pointer to a FILE object is used after the associated file is closed
27776  (<a href="#7.21.3">7.21.3</a>).
27777 <li>  The stream for the fflush function points to an input stream or to an update stream
27778  in which the most recent operation was input (<a href="#7.21.5.2">7.21.5.2</a>).
27779 <li>  The string pointed to by the mode argument in a call to the fopen function does not
27780  exactly match one of the specified character sequences (<a href="#7.21.5.3">7.21.5.3</a>).
27781 <li>  An output operation on an update stream is followed by an input operation without an
27782    intervening call to the fflush function or a file positioning function, or an input
27783 <!--page 581 -->
27784   operation on an update stream is followed by an output operation with an intervening
27785   call to a file positioning function (<a href="#7.21.5.3">7.21.5.3</a>).
27786 <li>  An attempt is made to use the contents of the array that was supplied in a call to the
27787  setvbuf function (<a href="#7.21.5.6">7.21.5.6</a>).
27788 <li>  There are insufficient arguments for the format in a call to one of the formatted
27789  input/output functions, or an argument does not have an appropriate type (<a href="#7.21.6.1">7.21.6.1</a>,
27790  <a href="#7.21.6.2">7.21.6.2</a>, <a href="#7.28.2.1">7.28.2.1</a>, <a href="#7.28.2.2">7.28.2.2</a>).
27791 <li>  The format in a call to one of the formatted input/output functions or to the
27792  strftime or wcsftime function is not a valid multibyte character sequence that
27793  begins and ends in its initial shift state (<a href="#7.21.6.1">7.21.6.1</a>, <a href="#7.21.6.2">7.21.6.2</a>, <a href="#7.26.3.5">7.26.3.5</a>, <a href="#7.28.2.1">7.28.2.1</a>, <a href="#7.28.2.2">7.28.2.2</a>,
27794  <a href="#7.28.5.1">7.28.5.1</a>).
27795 <li>  In a call to one of the formatted output functions, a precision appears with a
27796  conversion specifier other than those described (<a href="#7.21.6.1">7.21.6.1</a>, <a href="#7.28.2.1">7.28.2.1</a>).
27797 <li>  A conversion specification for a formatted output function uses an asterisk to denote
27798  an argument-supplied field width or precision, but the corresponding argument is not
27799  provided (<a href="#7.21.6.1">7.21.6.1</a>, <a href="#7.28.2.1">7.28.2.1</a>).
27800 <li>  A conversion specification for a formatted output function uses a # or 0 flag with a
27801  conversion specifier other than those described (<a href="#7.21.6.1">7.21.6.1</a>, <a href="#7.28.2.1">7.28.2.1</a>).
27802 <li>  A conversion specification for one of the formatted input/output functions uses a
27803  length modifier with a conversion specifier other than those described (<a href="#7.21.6.1">7.21.6.1</a>,
27804  <a href="#7.21.6.2">7.21.6.2</a>, <a href="#7.28.2.1">7.28.2.1</a>, <a href="#7.28.2.2">7.28.2.2</a>).
27805 <li>  An s conversion specifier is encountered by one of the formatted output functions,
27806  and the argument is missing the null terminator (unless a precision is specified that
27807  does not require null termination) (<a href="#7.21.6.1">7.21.6.1</a>, <a href="#7.28.2.1">7.28.2.1</a>).
27808 <li>  An n conversion specification for one of the formatted input/output functions includes
27809  any flags, an assignment-suppressing character, a field width, or a precision (<a href="#7.21.6.1">7.21.6.1</a>,
27810  <a href="#7.21.6.2">7.21.6.2</a>, <a href="#7.28.2.1">7.28.2.1</a>, <a href="#7.28.2.2">7.28.2.2</a>).
27811 <li>  A % conversion specifier is encountered by one of the formatted input/output
27812  functions, but the complete conversion specification is not exactly %% (<a href="#7.21.6.1">7.21.6.1</a>,
27813  <a href="#7.21.6.2">7.21.6.2</a>, <a href="#7.28.2.1">7.28.2.1</a>, <a href="#7.28.2.2">7.28.2.2</a>).
27814 <li>  An invalid conversion specification is found in the format for one of the formatted
27815  input/output functions, or the strftime or wcsftime function (<a href="#7.21.6.1">7.21.6.1</a>, <a href="#7.21.6.2">7.21.6.2</a>,
27816  <a href="#7.26.3.5">7.26.3.5</a>, <a href="#7.28.2.1">7.28.2.1</a>, <a href="#7.28.2.2">7.28.2.2</a>, <a href="#7.28.5.1">7.28.5.1</a>).
27817 <li>  The number of characters transmitted by a formatted output function is greater than
27818  INT_MAX (<a href="#7.21.6.1">7.21.6.1</a>, <a href="#7.21.6.3">7.21.6.3</a>, <a href="#7.21.6.8">7.21.6.8</a>, <a href="#7.21.6.10">7.21.6.10</a>).
27819 <!--page 582 -->
27820 <li>  The result of a conversion by one of the formatted input functions cannot be
27821  represented in the corresponding object, or the receiving object does not have an
27822  appropriate type (<a href="#7.21.6.2">7.21.6.2</a>, <a href="#7.28.2.2">7.28.2.2</a>).
27823 <li>  A c, s, or [ conversion specifier is encountered by one of the formatted input
27824  functions, and the array pointed to by the corresponding argument is not large enough
27825  to accept the input sequence (and a null terminator if the conversion specifier is s or
27826  [) (<a href="#7.21.6.2">7.21.6.2</a>, <a href="#7.28.2.2">7.28.2.2</a>).
27827 <li>  A c, s, or [ conversion specifier with an l qualifier is encountered by one of the
27828  formatted input functions, but the input is not a valid multibyte character sequence
27829  that begins in the initial shift state (<a href="#7.21.6.2">7.21.6.2</a>, <a href="#7.28.2.2">7.28.2.2</a>).
27830 <li>  The input item for a %p conversion by one of the formatted input functions is not a
27831  value converted earlier during the same program execution (<a href="#7.21.6.2">7.21.6.2</a>, <a href="#7.28.2.2">7.28.2.2</a>).
27832 <li>  The vfprintf, vfscanf, vprintf, vscanf, vsnprintf, vsprintf,
27833  vsscanf, vfwprintf, vfwscanf, vswprintf, vswscanf, vwprintf, or
27834  vwscanf function is called with an improperly initialized va_list argument, or
27835  the argument is used (other than in an invocation of va_end) after the function
27836  returns (<a href="#7.21.6.8">7.21.6.8</a>, <a href="#7.21.6.9">7.21.6.9</a>, <a href="#7.21.6.10">7.21.6.10</a>, <a href="#7.21.6.11">7.21.6.11</a>, <a href="#7.21.6.12">7.21.6.12</a>, <a href="#7.21.6.13">7.21.6.13</a>, <a href="#7.21.6.14">7.21.6.14</a>,
27837  <a href="#7.28.2.5">7.28.2.5</a>, <a href="#7.28.2.6">7.28.2.6</a>, <a href="#7.28.2.7">7.28.2.7</a>, <a href="#7.28.2.8">7.28.2.8</a>, <a href="#7.28.2.9">7.28.2.9</a>, <a href="#7.28.2.10">7.28.2.10</a>).
27838 <li>  The contents of the array supplied in a call to the fgets or fgetws function are
27839  used after a read error occurred (<a href="#7.21.7.2">7.21.7.2</a>, <a href="#7.28.3.2">7.28.3.2</a>).
27840 <li>  The file position indicator for a binary stream is used after a call to the ungetc
27841  function where its value was zero before the call (<a href="#7.21.7.10">7.21.7.10</a>).
27842 <li>  The file position indicator for a stream is used after an error occurred during a call to
27843  the fread or fwrite function (<a href="#7.21.8.1">7.21.8.1</a>, <a href="#7.21.8.2">7.21.8.2</a>).
27844 <li>  A partial element read by a call to the fread function is used (<a href="#7.21.8.1">7.21.8.1</a>).
27845 <li>  The fseek function is called for a text stream with a nonzero offset and either the
27846  offset was not returned by a previous successful call to the ftell function on a
27847  stream associated with the same file or whence is not SEEK_SET (<a href="#7.21.9.2">7.21.9.2</a>).
27848 <li>  The fsetpos function is called to set a position that was not returned by a previous
27849  successful call to the fgetpos function on a stream associated with the same file
27850  (<a href="#7.21.9.3">7.21.9.3</a>).
27851 <li>  A non-null pointer returned by a call to the calloc, malloc, or realloc function
27852  with a zero requested size is used to access an object (<a href="#7.22.3">7.22.3</a>).
27853 <li>  The value of a pointer that refers to space deallocated by a call to the free or
27854  realloc function is used (<a href="#7.22.3">7.22.3</a>).
27855 <!--page 583 -->
27856 <li>  The alignment requested of the aligned_alloc function is not valid or not
27857  supported by the implementation, or the size requested is not an integral multiple of
27858  the alignment (<a href="#7.22.3.1">7.22.3.1</a>).
27859 <li>  The pointer argument to the free or realloc function does not match a pointer
27860  earlier returned by a memory management function, or the space has been deallocated
27861  by a call to free or realloc (<a href="#7.22.3.3">7.22.3.3</a>, <a href="#7.22.3.5">7.22.3.5</a>).
27862 <li>  The value of the object allocated by the malloc function is used (<a href="#7.22.3.4">7.22.3.4</a>).
27863 <li>  The value of any bytes in a new object allocated by the realloc function beyond
27864  the size of the old object are used (<a href="#7.22.3.5">7.22.3.5</a>).
27865 <li>  The program calls the exit or quick_exit function more than once, or calls both
27866  functions (<a href="#7.22.4.4">7.22.4.4</a>, <a href="#7.22.4.7">7.22.4.7</a>).
27867 <li>  During the call to a function registered with the atexit or at_quick_exit
27868  function, a call is made to the longjmp function that would terminate the call to the
27869  registered function (<a href="#7.22.4.4">7.22.4.4</a>, <a href="#7.22.4.7">7.22.4.7</a>).
27870 <li>  The string set up by the getenv or strerror function is modified by the program
27871  (<a href="#7.22.4.6">7.22.4.6</a>, <a href="#7.23.6.2">7.23.6.2</a>).
27872 <li>  A command is executed through the system function in a way that is documented as
27873  causing termination or some other form of undefined behavior (<a href="#7.22.4.8">7.22.4.8</a>).
27874 <li>  A searching or sorting utility function is called with an invalid pointer argument, even
27875  if the number of elements is zero (<a href="#7.22.5">7.22.5</a>).
27876 <li>  The comparison function called by a searching or sorting utility function alters the
27877  contents of the array being searched or sorted, or returns ordering values
27878  inconsistently (<a href="#7.22.5">7.22.5</a>).
27879 <li>  The array being searched by the bsearch function does not have its elements in
27880  proper order (<a href="#7.22.5.1">7.22.5.1</a>).
27881 <li>  The current conversion state is used by a multibyte/wide character conversion
27882  function after changing the LC_CTYPE category (<a href="#7.22.7">7.22.7</a>).
27883 <li>  A string or wide string utility function is instructed to access an array beyond the end
27884  of an object (<a href="#7.23.1">7.23.1</a>, <a href="#7.28.4">7.28.4</a>).
27885 <li>  A string or wide string utility function is called with an invalid pointer argument, even
27886  if the length is zero (<a href="#7.23.1">7.23.1</a>, <a href="#7.28.4">7.28.4</a>).
27887 <li>  The contents of the destination array are used after a call to the strxfrm,
27888  strftime, wcsxfrm, or wcsftime function in which the specified length was
27889  too small to hold the entire null-terminated result (<a href="#7.23.4.5">7.23.4.5</a>, <a href="#7.26.3.5">7.26.3.5</a>, <a href="#7.28.4.4.4">7.28.4.4.4</a>,
27890  <a href="#7.28.5.1">7.28.5.1</a>).
27891 <!--page 584 -->
27892 <li>  The first argument in the very first call to the strtok or wcstok is a null pointer
27893  (<a href="#7.23.5.8">7.23.5.8</a>, <a href="#7.28.4.5.7">7.28.4.5.7</a>).
27894 <li>  The type of an argument to a type-generic macro is not compatible with the type of
27895  the corresponding parameter of the selected function (<a href="#7.24">7.24</a>).
27896 <li>  A complex argument is supplied for a generic parameter of a type-generic macro that
27897  has no corresponding complex function (<a href="#7.24">7.24</a>).
27898 <li>  At least one field of the broken-down time passed to asctime contains a value
27899  outside its normal range, or the calculated year exceeds four digits or is less than the
27900  year 1000 (<a href="#7.26.3.1">7.26.3.1</a>).
27901 <li>  The argument corresponding to an s specifier without an l qualifier in a call to the
27902  fwprintf function does not point to a valid multibyte character sequence that
27903  begins in the initial shift state (<a href="#7.28.2.11">7.28.2.11</a>).
27904 <li>  In a call to the wcstok function, the object pointed to by ptr does not have the
27905  value stored by the previous call for the same wide string (<a href="#7.28.4.5.7">7.28.4.5.7</a>).
27906 <li>  An mbstate_t object is used inappropriately (<a href="#7.28.6">7.28.6</a>).
27907 <li>  The value of an argument of type wint_t to a wide character classification or case
27908  mapping function is neither equal to the value of WEOF nor representable as a
27909  wchar_t (<a href="#7.29.1">7.29.1</a>).
27910 <li>  The iswctype function is called using a different LC_CTYPE category from the
27911  one in effect for the call to the wctype function that returned the description
27912  (<a href="#7.29.2.2.1">7.29.2.2.1</a>).
27913 <li>  The towctrans function is called using a different LC_CTYPE category from the
27914  one in effect for the call to the wctrans function that returned the description
27915  (<a href="#7.29.3.2.1">7.29.3.2.1</a>).
27916 </ul>
27917
27918 <h3><a name="J.3" href="#J.3">J.3 Implementation-defined behavior</a></h3>
27919 <p><!--para 1 -->
27920  A conforming implementation is required to document its choice of behavior in each of
27921  the areas listed in this subclause. The following are implementation-defined:
27922 <!--page 585 -->
27923
27924 <h4><a name="J.3.1" href="#J.3.1">J.3.1 Translation</a></h4>
27925 <p><!--para 1 -->
27926 <ul>
27927 <li>  How a diagnostic is identified (<a href="#3.10">3.10</a>, <a href="#5.1.1.3">5.1.1.3</a>).
27928 <li>  Whether each nonempty sequence of white-space characters other than new-line is
27929  retained or replaced by one space character in translation phase 3 (<a href="#5.1.1.2">5.1.1.2</a>).
27930 </ul>
27931
27932 <h4><a name="J.3.2" href="#J.3.2">J.3.2 Environment</a></h4>
27933 <p><!--para 1 -->
27934 <ul>
27935 <li>  The mapping between physical source file multibyte characters and the source
27936  character set in translation phase 1 (<a href="#5.1.1.2">5.1.1.2</a>).
27937 <li>  The name and type of the function called at program startup in a freestanding
27938  environment (<a href="#5.1.2.1">5.1.2.1</a>).
27939 <li>  The effect of program termination in a freestanding environment (<a href="#5.1.2.1">5.1.2.1</a>).
27940 <li>  An alternative manner in which the main function may be defined (<a href="#5.1.2.2.1">5.1.2.2.1</a>).
27941 <li>  The values given to the strings pointed to by the argv argument to main (<a href="#5.1.2.2.1">5.1.2.2.1</a>).
27942 <li>  What constitutes an interactive device (<a href="#5.1.2.3">5.1.2.3</a>).
27943 <li>  Whether a program can have more than one thread of execution in a freestanding
27944  environment (<a href="#5.1.2.4">5.1.2.4</a>).
27945 <li>  The set of signals, their semantics, and their default handling (<a href="#7.14">7.14</a>).
27946 <li>  Signal values other than SIGFPE, SIGILL, and SIGSEGV that correspond to a
27947  computational exception (<a href="#7.14.1.1">7.14.1.1</a>).
27948 <li>  Signals for which the equivalent of signal(sig, SIG_IGN); is executed at
27949  program startup (<a href="#7.14.1.1">7.14.1.1</a>).
27950 <li>  The set of environment names and the method for altering the environment list used
27951  by the getenv function (<a href="#7.22.4.6">7.22.4.6</a>).
27952 <li>  The manner of execution of the string by the system function (<a href="#7.22.4.8">7.22.4.8</a>).
27953 </ul>
27954
27955 <h4><a name="J.3.3" href="#J.3.3">J.3.3 Identifiers</a></h4>
27956 <p><!--para 1 -->
27957 <ul>
27958 <li>  Which additional multibyte characters may appear in identifiers and their
27959  correspondence to universal character names (<a href="#6.4.2">6.4.2</a>).
27960 <li>  The number of significant initial characters in an identifier (<a href="#5.2.4.1">5.2.4.1</a>, <a href="#6.4.2">6.4.2</a>).
27961 <!--page 586 -->
27962 </ul>
27963
27964 <h4><a name="J.3.4" href="#J.3.4">J.3.4 Characters</a></h4>
27965 <p><!--para 1 -->
27966 <ul>
27967 <li>  The number of bits in a byte (<a href="#3.6">3.6</a>).
27968 <li>  The values of the members of the execution character set (<a href="#5.2.1">5.2.1</a>).
27969 <li>  The unique value of the member of the execution character set produced for each of
27970  the standard alphabetic escape sequences (<a href="#5.2.2">5.2.2</a>).
27971 <li>  The value of a char object into which has been stored any character other than a
27972  member of the basic execution character set (<a href="#6.2.5">6.2.5</a>).
27973 <li>  Which of signed char or unsigned char has the same range, representation,
27974  and behavior as ''plain'' char (<a href="#6.2.5">6.2.5</a>, <a href="#6.3.1.1">6.3.1.1</a>).
27975 <li>  The mapping of members of the source character set (in character constants and string
27976  literals) to members of the execution character set (<a href="#6.4.4.4">6.4.4.4</a>, <a href="#5.1.1.2">5.1.1.2</a>).
27977 <li>  The value of an integer character constant containing more than one character or
27978  containing a character or escape sequence that does not map to a single-byte
27979  execution character (<a href="#6.4.4.4">6.4.4.4</a>).
27980 <li>  The value of a wide character constant containing more than one multibyte character
27981  or a single multibyte character that maps to multiple members of the extended
27982  execution character set, or containing a multibyte character or escape sequence not
27983  represented in the extended execution character set (<a href="#6.4.4.4">6.4.4.4</a>).
27984 <li>  The current locale used to convert a wide character constant consisting of a single
27985  multibyte character that maps to a member of the extended execution character set
27986  into a corresponding wide character code (<a href="#6.4.4.4">6.4.4.4</a>).
27987 <li>  Whether differently-prefixed wide string literal tokens can be concatenated and, if so,
27988  the treatment of the resulting multibyte character sequence (<a href="#6.4.5">6.4.5</a>).
27989 <li>  The current locale used to convert a wide string literal into corresponding wide
27990  character codes (<a href="#6.4.5">6.4.5</a>).
27991 <li>  The value of a string literal containing a multibyte character or escape sequence not
27992  represented in the execution character set (<a href="#6.4.5">6.4.5</a>).
27993 <li>  The encoding of any of wchar_t, char16_t, and char32_t where the
27994  corresponding  standard   encoding macro      (__STDC_ISO_10646__,
27995  __STDC_UTF_16__, or __STDC_UTF_32__) is not defined (<a href="#6.10.8.2">6.10.8.2</a>).
27996 <!--page 587 -->
27997 </ul>
27998
27999 <h4><a name="J.3.5" href="#J.3.5">J.3.5 Integers</a></h4>
28000 <p><!--para 1 -->
28001 <ul>
28002 <li>  Any extended integer types that exist in the implementation (<a href="#6.2.5">6.2.5</a>).
28003 <li>  Whether signed integer types are represented using sign and magnitude, two's
28004  complement, or ones' complement, and whether the extraordinary value is a trap
28005  representation or an ordinary value (<a href="#6.2.6.2">6.2.6.2</a>).
28006 <li>  The rank of any extended integer type relative to another extended integer type with
28007  the same precision (<a href="#6.3.1.1">6.3.1.1</a>).
28008 <li>  The result of, or the signal raised by, converting an integer to a signed integer type
28009  when the value cannot be represented in an object of that type (<a href="#6.3.1.3">6.3.1.3</a>).
28010 <li>  The results of some bitwise operations on signed integers (<a href="#6.5">6.5</a>).
28011 </ul>
28012
28013 <h4><a name="J.3.6" href="#J.3.6">J.3.6 Floating point</a></h4>
28014 <p><!--para 1 -->
28015 <ul>
28016 <li>  The accuracy of the floating-point operations and of the library functions in
28017  <a href="#7.12">&lt;math.h&gt;</a> and <a href="#7.3">&lt;complex.h&gt;</a> that return floating-point results (<a href="#5.2.4.2.2">5.2.4.2.2</a>).
28018 <li>  The accuracy of the conversions between floating-point internal representations and
28019  string representations performed by the library functions in <a href="#7.21">&lt;stdio.h&gt;</a>,
28020  <a href="#7.22">&lt;stdlib.h&gt;</a>, and <a href="#7.28">&lt;wchar.h&gt;</a> (<a href="#5.2.4.2.2">5.2.4.2.2</a>).
28021 <li>  The rounding behaviors characterized by non-standard values of FLT_ROUNDS
28022  (<a href="#5.2.4.2.2">5.2.4.2.2</a>).
28023 <li>  The evaluation methods characterized by non-standard negative values of
28024  FLT_EVAL_METHOD (<a href="#5.2.4.2.2">5.2.4.2.2</a>).
28025 <li>  The direction of rounding when an integer is converted to a floating-point number that
28026  cannot exactly represent the original value (<a href="#6.3.1.4">6.3.1.4</a>).
28027 <li>  The direction of rounding when a floating-point number is converted to a narrower
28028  floating-point number (<a href="#6.3.1.5">6.3.1.5</a>).
28029 <li>  How the nearest representable value or the larger or smaller representable value
28030  immediately adjacent to the nearest representable value is chosen for certain floating
28031  constants (<a href="#6.4.4.2">6.4.4.2</a>).
28032 <li>  Whether and how floating expressions are contracted when not disallowed by the
28033  FP_CONTRACT pragma (<a href="#6.5">6.5</a>).
28034 <li>  The default state for the FENV_ACCESS pragma (<a href="#7.6.1">7.6.1</a>).
28035 <li>  Additional floating-point exceptions, rounding           modes,     environments,   and
28036  classifications, and their macro names (<a href="#7.6">7.6</a>, <a href="#7.12">7.12</a>).
28037 <li>  The default state for the FP_CONTRACT pragma (<a href="#7.12.2">7.12.2</a>).
28038 <!--page 588 -->
28039 </ul>
28040
28041 <h4><a name="J.3.7" href="#J.3.7">J.3.7 Arrays and pointers</a></h4>
28042 <p><!--para 1 -->
28043 <ul>
28044 <li>  The result of converting a pointer to an integer or vice versa (<a href="#6.3.2.3">6.3.2.3</a>).
28045 <li>  The size of the result of subtracting two pointers to elements of the same array
28046  (<a href="#6.5.6">6.5.6</a>).
28047 </ul>
28048
28049 <h4><a name="J.3.8" href="#J.3.8">J.3.8 Hints</a></h4>
28050 <p><!--para 1 -->
28051 <ul>
28052 <li>  The extent to which suggestions made by using the register storage-class
28053  specifier are effective (<a href="#6.7.1">6.7.1</a>).
28054 <li>  The extent to which suggestions made by using the inline function specifier are
28055  effective (<a href="#6.7.4">6.7.4</a>).
28056 </ul>
28057
28058 <h4><a name="J.3.9" href="#J.3.9">J.3.9 Structures, unions, enumerations, and bit-fields</a></h4>
28059 <p><!--para 1 -->
28060 <ul>
28061 <li>  Whether a ''plain'' int bit-field is treated as a signed int bit-field or as an
28062  unsigned int bit-field (<a href="#6.7.2">6.7.2</a>, <a href="#6.7.2.1">6.7.2.1</a>).
28063 <li>  Allowable bit-field types other than _Bool, signed int, and unsigned int
28064  (<a href="#6.7.2.1">6.7.2.1</a>).
28065 <li>  Whether atomic types are permitted for bit-fields (<a href="#6.7.2.1">6.7.2.1</a>).
28066 <li>  Whether a bit-field can straddle a storage-unit boundary (<a href="#6.7.2.1">6.7.2.1</a>).
28067 <li>  The order of allocation of bit-fields within a unit (<a href="#6.7.2.1">6.7.2.1</a>).
28068 <li>  The alignment of non-bit-field members of structures (<a href="#6.7.2.1">6.7.2.1</a>). This should present
28069  no problem unless binary data written by one implementation is read by another.
28070 <li>  The integer type compatible with each enumerated type (<a href="#6.7.2.2">6.7.2.2</a>).
28071 </ul>
28072
28073 <h4><a name="J.3.10" href="#J.3.10">J.3.10 Qualifiers</a></h4>
28074 <p><!--para 1 -->
28075 <ul>
28076 <li>  What constitutes an access to an object that has volatile-qualified type (<a href="#6.7.3">6.7.3</a>).
28077 </ul>
28078
28079 <h4><a name="J.3.11" href="#J.3.11">J.3.11 Preprocessing directives</a></h4>
28080 <p><!--para 1 -->
28081 <ul>
28082 <li>  The locations within #pragma directives where header name preprocessing tokens
28083  are recognized (<a href="#6.4">6.4</a>, <a href="#6.4.7">6.4.7</a>).
28084 <li>  How sequences in both forms of header names are mapped to headers or external
28085  source file names (<a href="#6.4.7">6.4.7</a>).
28086 <li>  Whether the value of a character constant in a constant expression that controls
28087  conditional inclusion matches the value of the same character constant in the
28088  execution character set (<a href="#6.10.1">6.10.1</a>).
28089 <li>  Whether the value of a single-character character constant in a constant expression
28090  that controls conditional inclusion may have a negative value (<a href="#6.10.1">6.10.1</a>).
28091 <!--page 589 -->
28092 <li>  The places that are searched for an included &lt; &gt; delimited header, and how the places
28093  are specified or the header is identified (<a href="#6.10.2">6.10.2</a>).
28094 <li>  How the named source file is searched for in an included " " delimited header
28095  (<a href="#6.10.2">6.10.2</a>).
28096 <li>  The method by which preprocessing tokens (possibly resulting from macro
28097  expansion) in a #include directive are combined into a header name (<a href="#6.10.2">6.10.2</a>).
28098 <li>  The nesting limit for #include processing (<a href="#6.10.2">6.10.2</a>).
28099 <li>  Whether the # operator inserts a \ character before the \ character that begins a
28100  universal character name in a character constant or string literal (<a href="#6.10.3.2">6.10.3.2</a>).
28101 <li>  The behavior on each recognized non-STDC #pragma directive (<a href="#6.10.6">6.10.6</a>).
28102 <li>  The definitions for __DATE__ and __TIME__ when respectively, the date and
28103  time of translation are not available (<a href="#6.10.8.1">6.10.8.1</a>).
28104 </ul>
28105
28106 <h4><a name="J.3.12" href="#J.3.12">J.3.12 Library functions</a></h4>
28107 <p><!--para 1 -->
28108 <ul>
28109 <li>  Any library facilities available to a freestanding program, other than the minimal set
28110  required by clause 4 (<a href="#5.1.2.1">5.1.2.1</a>).
28111 <li>  The format of the diagnostic printed by the assert macro (<a href="#7.2.1.1">7.2.1.1</a>).
28112 <li>  The representation of the floating-point               status   flags   stored   by   the
28113  fegetexceptflag function (<a href="#7.6.2.2">7.6.2.2</a>).
28114 <li>  Whether the feraiseexcept function raises the ''inexact'' floating-point
28115  exception in addition to the ''overflow'' or ''underflow'' floating-point exception
28116  (<a href="#7.6.2.3">7.6.2.3</a>).
28117 <li>  Strings other than "C" and "" that may be passed as the second argument to the
28118  setlocale function (<a href="#7.11.1.1">7.11.1.1</a>).
28119 <li>  The types defined for float_t and double_t when the value of the
28120  FLT_EVAL_METHOD macro is less than 0 (<a href="#7.12">7.12</a>).
28121 <li>  Domain errors for the mathematics functions, other than those required by this
28122  International Standard (<a href="#7.12.1">7.12.1</a>).
28123 <li>  The values returned by the mathematics functions on domain errors or pole errors
28124  (<a href="#7.12.1">7.12.1</a>).
28125 <li>  The values returned by the mathematics functions on underflow range errors, whether
28126  errno is set to the value of the macro ERANGE when the integer expression
28127  math_errhandling &amp; MATH_ERRNO is nonzero, and whether the ''underflow''
28128  floating-point exception is raised when the integer expression math_errhandling
28129  &amp; MATH_ERREXCEPT is nonzero. (<a href="#7.12.1">7.12.1</a>).
28130 <!--page 590 -->
28131 <li>  Whether a domain error occurs or zero is returned when an fmod function has a
28132  second argument of zero (<a href="#7.12.10.1">7.12.10.1</a>).
28133 <li>  Whether a domain error occurs or zero is returned when a remainder function has
28134  a second argument of zero (<a href="#7.12.10.2">7.12.10.2</a>).
28135 <li>  The base-2 logarithm of the modulus used by the remquo functions in reducing the
28136  quotient (<a href="#7.12.10.3">7.12.10.3</a>).
28137 <li>  Whether a domain error occurs or zero is returned when a remquo function has a
28138  second argument of zero (<a href="#7.12.10.3">7.12.10.3</a>).
28139 <li>  Whether the equivalent of signal(sig, SIG_DFL); is executed prior to the call
28140  of a signal handler, and, if not, the blocking of signals that is performed (<a href="#7.14.1.1">7.14.1.1</a>).
28141 <li>  The null pointer constant to which the macro NULL expands (<a href="#7.19">7.19</a>).
28142 <li>  Whether the last line of a text stream requires a terminating new-line character
28143  (<a href="#7.21.2">7.21.2</a>).
28144 <li>  Whether space characters that are written out to a text stream immediately before a
28145  new-line character appear when read in (<a href="#7.21.2">7.21.2</a>).
28146 <li>  The number of null characters that may be appended to data written to a binary
28147  stream (<a href="#7.21.2">7.21.2</a>).
28148 <li>  Whether the file position indicator of an append-mode stream is initially positioned at
28149  the beginning or end of the file (<a href="#7.21.3">7.21.3</a>).
28150 <li>  Whether a write on a text stream causes the associated file to be truncated beyond that
28151  point (<a href="#7.21.3">7.21.3</a>).
28152 <li>  The characteristics of file buffering (<a href="#7.21.3">7.21.3</a>).
28153 <li>  Whether a zero-length file actually exists (<a href="#7.21.3">7.21.3</a>).
28154 <li>  The rules for composing valid file names (<a href="#7.21.3">7.21.3</a>).
28155 <li>  Whether the same file can be simultaneously open multiple times (<a href="#7.21.3">7.21.3</a>).
28156 <li>  The nature and choice of encodings used for multibyte characters in files (<a href="#7.21.3">7.21.3</a>).
28157 <li>  The effect of the remove function on an open file (<a href="#7.21.4.1">7.21.4.1</a>).
28158 <li>  The effect if a file with the new name exists prior to a call to the rename function
28159  (<a href="#7.21.4.2">7.21.4.2</a>).
28160 <li>  Whether an open temporary file is removed upon abnormal program termination
28161  (<a href="#7.21.4.3">7.21.4.3</a>).
28162 <li>  Which changes of mode are permitted (if any), and under what circumstances
28163  (<a href="#7.21.5.4">7.21.5.4</a>).
28164 <!--page 591 -->
28165 <li>  The style used to print an infinity or NaN, and the meaning of any n-char or n-wchar
28166  sequence printed for a NaN (<a href="#7.21.6.1">7.21.6.1</a>, <a href="#7.28.2.1">7.28.2.1</a>).
28167 <li>  The output for %p conversion in the fprintf or fwprintf function (<a href="#7.21.6.1">7.21.6.1</a>,
28168  <a href="#7.28.2.1">7.28.2.1</a>).
28169 <li>  The interpretation of a - character that is neither the first nor the last character, nor
28170  the second where a ^ character is the first, in the scanlist for %[ conversion in the
28171  fscanf or fwscanf function (<a href="#7.21.6.2">7.21.6.2</a>, <a href="#7.28.2.1">7.28.2.1</a>).
28172 <li>  The set of sequences matched by a %p conversion and the interpretation of the
28173  corresponding input item in the fscanf or fwscanf function (<a href="#7.21.6.2">7.21.6.2</a>, <a href="#7.28.2.2">7.28.2.2</a>).
28174 <li>  The value to which the macro errno is set by the fgetpos, fsetpos, or ftell
28175  functions on failure (<a href="#7.21.9.1">7.21.9.1</a>, <a href="#7.21.9.3">7.21.9.3</a>, <a href="#7.21.9.4">7.21.9.4</a>).
28176 <li>  The meaning of any n-char or n-wchar sequence in a string representing a NaN that is
28177  converted by the strtod, strtof, strtold, wcstod, wcstof, or wcstold
28178  function (<a href="#7.22.1.3">7.22.1.3</a>, <a href="#7.28.4.1.1">7.28.4.1.1</a>).
28179 <li>  Whether or not the strtod, strtof, strtold, wcstod, wcstof, or wcstold
28180  function sets errno to ERANGE when underflow occurs (<a href="#7.22.1.3">7.22.1.3</a>, <a href="#7.28.4.1.1">7.28.4.1.1</a>).
28181 <li>  Whether the calloc, malloc, and realloc functions return a null pointer or a
28182  pointer to an allocated object when the size requested is zero (<a href="#7.22.3">7.22.3</a>).
28183 <li>  Whether open streams with unwritten buffered data are flushed, open streams are
28184  closed, or temporary files are removed when the abort or _Exit function is called
28185  (<a href="#7.22.4.1">7.22.4.1</a>, <a href="#7.22.4.5">7.22.4.5</a>).
28186 <li>  The termination status returned to the host environment by the abort, exit,
28187  _Exit, or quick_exit function (<a href="#7.22.4.1">7.22.4.1</a>, <a href="#7.22.4.4">7.22.4.4</a>, <a href="#7.22.4.5">7.22.4.5</a>, <a href="#7.22.4.7">7.22.4.7</a>).
28188 <li>  The value returned by the system function when its argument is not a null pointer
28189  (<a href="#7.22.4.8">7.22.4.8</a>).
28190 <li>  The local time zone and Daylight Saving Time (<a href="#7.26.1">7.26.1</a>).
28191 <li>  The range and precision of times representable in clock_t and time_t (<a href="#7.26">7.26</a>).
28192 <li>  The era for the clock function (<a href="#7.26.2.1">7.26.2.1</a>).
28193 <li>  The replacement string for the %Z specifier to the strftime, and wcsftime
28194  functions in the "C" locale (<a href="#7.26.3.5">7.26.3.5</a>, <a href="#7.28.5.1">7.28.5.1</a>).
28195 <li>  Whether the functions in <a href="#7.12">&lt;math.h&gt;</a> honor the rounding direction mode in an
28196  IEC 60559 conformant implementation, unless explicitly specified otherwise (<a href="#F.10">F.10</a>).
28197 <!--page 592 -->
28198 </ul>
28199
28200 <h4><a name="J.3.13" href="#J.3.13">J.3.13 Architecture</a></h4>
28201 <p><!--para 1 -->
28202 <ul>
28203 <li>  The values or expressions assigned to the macros specified in the headers
28204  <a href="#7.7">&lt;float.h&gt;</a>, <a href="#7.10">&lt;limits.h&gt;</a>, and <a href="#7.20">&lt;stdint.h&gt;</a> (<a href="#5.2.4.2">5.2.4.2</a>, <a href="#7.20.2">7.20.2</a>, <a href="#7.20.3">7.20.3</a>).
28205 <li>  The result of attempting to indirectly access an object with automatic or thread
28206  storage duration from a thread other than the one with which it is associated (<a href="#6.2.4">6.2.4</a>).
28207 <li>  The number, order, and encoding of bytes in any object (when not explicitly specified
28208  in this International Standard) (<a href="#6.2.6.1">6.2.6.1</a>).
28209 <li>  Whether any extended alignments are supported and the contexts in which they are
28210  supported (<a href="#6.2.8">6.2.8</a>).
28211 <li>  Valid alignment values other than those returned by an alignof expression for
28212  fundamental types, if any (<a href="#6.2.8">6.2.8</a>).
28213 <li>  The value of the result of the sizeof and alignof operators (<a href="#6.5.3.4">6.5.3.4</a>).
28214 </ul>
28215
28216 <h3><a name="J.4" href="#J.4">J.4 Locale-specific behavior</a></h3>
28217 <p><!--para 1 -->
28218  The following characteristics of a hosted environment are locale-specific and are required
28219  to be documented by the implementation:
28220 <ul>
28221 <li>  Additional members of the source and execution character sets beyond the basic
28222  character set (<a href="#5.2.1">5.2.1</a>).
28223 <li>  The presence, meaning, and representation of additional multibyte characters in the
28224  execution character set beyond the basic character set (<a href="#5.2.1.2">5.2.1.2</a>).
28225 <li>  The shift states used for the encoding of multibyte characters (<a href="#5.2.1.2">5.2.1.2</a>).
28226 <li>  The direction of writing of successive printing characters (<a href="#5.2.2">5.2.2</a>).
28227 <li>  The decimal-point character (<a href="#7.1.1">7.1.1</a>).
28228 <li>  The set of printing characters (<a href="#7.4">7.4</a>, <a href="#7.29.2">7.29.2</a>).
28229 <li>  The set of control characters (<a href="#7.4">7.4</a>, <a href="#7.29.2">7.29.2</a>).
28230 <li>  The sets of characters tested for by the isalpha, isblank, islower, ispunct,
28231  isspace, isupper, iswalpha, iswblank, iswlower, iswpunct,
28232  iswspace, or iswupper functions (<a href="#7.4.1.2">7.4.1.2</a>, <a href="#7.4.1.3">7.4.1.3</a>, <a href="#7.4.1.7">7.4.1.7</a>, <a href="#7.4.1.9">7.4.1.9</a>, <a href="#7.4.1.10">7.4.1.10</a>,
28233  <a href="#7.4.1.11">7.4.1.11</a>, <a href="#7.29.2.1.2">7.29.2.1.2</a>, <a href="#7.29.2.1.3">7.29.2.1.3</a>, <a href="#7.29.2.1.7">7.29.2.1.7</a>, <a href="#7.29.2.1.9">7.29.2.1.9</a>, <a href="#7.29.2.1.10">7.29.2.1.10</a>, <a href="#7.29.2.1.11">7.29.2.1.11</a>).
28234 <li>  The native environment (<a href="#7.11.1.1">7.11.1.1</a>).
28235 <li>  Additional subject sequences accepted by the numeric conversion functions (<a href="#7.22.1">7.22.1</a>,
28236  <a href="#7.28.4.1">7.28.4.1</a>).
28237 <li>  The collation sequence of the execution character set (<a href="#7.23.4.3">7.23.4.3</a>, <a href="#7.28.4.4.2">7.28.4.4.2</a>).
28238 <!--page 593 -->
28239 <li>  The contents of the error message strings set up by the strerror function
28240  (<a href="#7.23.6.2">7.23.6.2</a>).
28241 <li>  The formats for time and date (<a href="#7.26.3.5">7.26.3.5</a>, <a href="#7.28.5.1">7.28.5.1</a>).
28242 <li>  Character mappings that are supported by the towctrans function (<a href="#7.29.1">7.29.1</a>).
28243 <li>  Character classifications that are supported by the iswctype function (<a href="#7.29.1">7.29.1</a>).
28244 </ul>
28245
28246 <h3><a name="J.5" href="#J.5">J.5 Common extensions</a></h3>
28247 <p><!--para 1 -->
28248  The following extensions are widely used in many systems, but are not portable to all
28249  implementations. The inclusion of any extension that may cause a strictly conforming
28250  program to become invalid renders an implementation nonconforming. Examples of such
28251  extensions are new keywords, extra library functions declared in standard headers, or
28252  predefined macros with names that do not begin with an underscore.
28253
28254 <h4><a name="J.5.1" href="#J.5.1">J.5.1 Environment arguments</a></h4>
28255 <p><!--para 1 -->
28256  In a hosted environment, the main function receives a third argument, char *envp[],
28257  that points to a null-terminated array of pointers to char, each of which points to a string
28258  that provides information about the environment for this execution of the program
28259  (<a href="#5.1.2.2.1">5.1.2.2.1</a>).
28260
28261 <h4><a name="J.5.2" href="#J.5.2">J.5.2 Specialized identifiers</a></h4>
28262 <p><!--para 1 -->
28263  Characters other than the underscore _, letters, and digits, that are not part of the basic
28264  source character set (such as the dollar sign $, or characters in national character sets)
28265  may appear in an identifier (<a href="#6.4.2">6.4.2</a>).
28266
28267 <h4><a name="J.5.3" href="#J.5.3">J.5.3 Lengths and cases of identifiers</a></h4>
28268 <p><!--para 1 -->
28269  All characters in identifiers (with or without external linkage) are significant (<a href="#6.4.2">6.4.2</a>).
28270
28271 <h4><a name="J.5.4" href="#J.5.4">J.5.4 Scopes of identifiers</a></h4>
28272 <p><!--para 1 -->
28273  A function identifier, or the identifier of an object the declaration of which contains the
28274  keyword extern, has file scope (<a href="#6.2.1">6.2.1</a>).
28275
28276 <h4><a name="J.5.5" href="#J.5.5">J.5.5 Writable string literals</a></h4>
28277 <p><!--para 1 -->
28278  String literals are modifiable (in which case, identical string literals should denote distinct
28279  objects) (<a href="#6.4.5">6.4.5</a>).
28280 <!--page 594 -->
28281
28282 <h4><a name="J.5.6" href="#J.5.6">J.5.6 Other arithmetic types</a></h4>
28283 <p><!--para 1 -->
28284  Additional arithmetic types, such as __int128 or double double, and their
28285  appropriate conversions are defined (<a href="#6.2.5">6.2.5</a>, <a href="#6.3.1">6.3.1</a>). Additional floating types may have
28286  more range or precision than long double, may be used for evaluating expressions of
28287  other floating types, and may be used to define float_t or double_t.
28288
28289 <h4><a name="J.5.7" href="#J.5.7">J.5.7 Function pointer casts</a></h4>
28290 <p><!--para 1 -->
28291  A pointer to an object or to void may be cast to a pointer to a function, allowing data to
28292  be invoked as a function (<a href="#6.5.4">6.5.4</a>).
28293 <p><!--para 2 -->
28294  A pointer to a function may be cast to a pointer to an object or to void, allowing a
28295  function to be inspected or modified (for example, by a debugger) (<a href="#6.5.4">6.5.4</a>).
28296
28297 <h4><a name="J.5.8" href="#J.5.8">J.5.8 Extended bit-field types</a></h4>
28298 <p><!--para 1 -->
28299  A bit-field may be declared with a type other than _Bool, unsigned int, or
28300  signed int, with an appropriate maximum width (<a href="#6.7.2.1">6.7.2.1</a>).
28301
28302 <h4><a name="J.5.9" href="#J.5.9">J.5.9 The fortran keyword</a></h4>
28303 <p><!--para 1 -->
28304  The fortran function specifier may be used in a function declaration to indicate that
28305  calls suitable for FORTRAN should be generated, or that a different representation for the
28306  external name is to be generated (<a href="#6.7.4">6.7.4</a>).
28307
28308 <h4><a name="J.5.10" href="#J.5.10">J.5.10 The asm keyword</a></h4>
28309 <p><!--para 1 -->
28310  The asm keyword may be used to insert assembly language directly into the translator
28311  output (<a href="#6.8">6.8</a>). The most common implementation is via a statement of the form:
28312 <pre>
28313         asm ( character-string-literal );
28314 </pre>
28315
28316 <h4><a name="J.5.11" href="#J.5.11">J.5.11 Multiple external definitions</a></h4>
28317 <p><!--para 1 -->
28318  There may be more than one external definition for the identifier of an object, with or
28319  without the explicit use of the keyword extern; if the definitions disagree, or more than
28320  one is initialized, the behavior is undefined (<a href="#6.9.2">6.9.2</a>).
28321
28322 <h4><a name="J.5.12" href="#J.5.12">J.5.12 Predefined macro names</a></h4>
28323 <p><!--para 1 -->
28324  Macro names that do not begin with an underscore, describing the translation and
28325  execution environments, are defined by the implementation before translation begins
28326  (<a href="#6.10.8">6.10.8</a>).
28327 <!--page 595 -->
28328
28329 <h4><a name="J.5.13" href="#J.5.13">J.5.13 Floating-point status flags</a></h4>
28330 <p><!--para 1 -->
28331  If any floating-point status flags are set on normal termination after all calls to functions
28332  registered by the atexit function have been made (see <a href="#7.22.4.4">7.22.4.4</a>), the implementation
28333  writes some diagnostics indicating the fact to the stderr stream, if it is still open,
28334
28335 <h4><a name="J.5.14" href="#J.5.14">J.5.14 Extra arguments for signal handlers</a></h4>
28336 <p><!--para 1 -->
28337  Handlers for specific signals are called with extra arguments in addition to the signal
28338  number (<a href="#7.14.1.1">7.14.1.1</a>).
28339
28340 <h4><a name="J.5.15" href="#J.5.15">J.5.15 Additional stream types and file-opening modes</a></h4>
28341 <p><!--para 1 -->
28342  Additional mappings from files to streams are supported (<a href="#7.21.2">7.21.2</a>).
28343 <p><!--para 2 -->
28344  Additional file-opening modes may be specified by characters appended to the mode
28345  argument of the fopen function (<a href="#7.21.5.3">7.21.5.3</a>).
28346
28347 <h4><a name="J.5.16" href="#J.5.16">J.5.16 Defined file position indicator</a></h4>
28348 <p><!--para 1 -->
28349  The file position indicator is decremented by each successful call to the ungetc or
28350  ungetwc function for a text stream, except if its value was zero before a call (<a href="#7.21.7.10">7.21.7.10</a>,
28351  <a href="#7.28.3.10">7.28.3.10</a>).
28352
28353 <h4><a name="J.5.17" href="#J.5.17">J.5.17 Math error reporting</a></h4>
28354 <p><!--para 1 -->
28355  Functions declared in <a href="#7.3">&lt;complex.h&gt;</a> and <a href="#7.12">&lt;math.h&gt;</a> raise SIGFPE to report errors
28356  instead of, or in addition to, setting errno or raising floating-point exceptions (<a href="#7.3">7.3</a>,
28357  <a href="#7.12">7.12</a>).
28358 <!--page 596 -->
28359
28360 <h2><a name="K" href="#K">Annex K</a></h2>
28361 <pre>
28362                                        (normative)
28363                            Bounds-checking interfaces
28364 </pre>
28365
28366 <h3><a name="K.1" href="#K.1">K.1 Background</a></h3>
28367 <p><!--para 1 -->
28368  Traditionally, the C Library has contained many functions that trust the programmer to
28369  provide output character arrays big enough to hold the result being produced. Not only
28370  do these functions not check that the arrays are big enough, they frequently lack the
28371  information needed to perform such checks. While it is possible to write safe, robust, and
28372  error-free code using the existing library, the library tends to promote programming styles
28373  that lead to mysterious failures if a result is too big for the provided array.
28374 <p><!--para 2 -->
28375  A common programming style is to declare character arrays large enough to handle most
28376  practical cases. However, if these arrays are not large enough to handle the resulting
28377  strings, data can be written past the end of the array overwriting other data and program
28378  structures. The program never gets any indication that a problem exists, and so never has
28379  a chance to recover or to fail gracefully.
28380 <p><!--para 3 -->
28381  Worse, this style of programming has compromised the security of computers and
28382  networks. Buffer overflows can often be exploited to run arbitrary code with the
28383  permissions of the vulnerable (defective) program.
28384 <p><!--para 4 -->
28385  If the programmer writes runtime checks to verify lengths before calling library
28386  functions, then those runtime checks frequently duplicate work done inside the library
28387  functions, which discover string lengths as a side effect of doing their job.
28388 <p><!--para 5 -->
28389  This annex provides alternative library functions that promote safer, more secure
28390  programming. The alternative functions verify that output buffers are large enough for
28391  the intended result and return a failure indicator if they are not. Data is never written past
28392  the end of an array. All string results are null terminated.
28393 <p><!--para 6 -->
28394  This annex also addresses another problem that complicates writing robust code:
28395  functions that are not reentrant because they return pointers to static objects owned by the
28396  function. Such functions can be troublesome since a previously returned result can
28397  change if the function is called again, perhaps by another thread.
28398 <!--page 597 -->
28399
28400 <h3><a name="K.2" href="#K.2">K.2 Scope</a></h3>
28401 <p><!--para 1 -->
28402  This annex specifies a series of optional extensions that can be useful in the mitigation of
28403  security vulnerabilities in programs, and comprise new functions, macros, and types
28404  declared or defined in existing standard headers.
28405 <p><!--para 2 -->
28406  An implementation that defines __STDC_LIB_EXT1__ shall conform to the
28407  specifications in this annex.<sup><a href="#note367"><b>367)</b></a></sup>
28408 <p><!--para 3 -->
28409  Subclause <a href="#K.3">K.3</a> should be read as if it were merged into the parallel structure of named
28410  subclauses of clause 7.
28411
28412 <h6>footnotes</h6>
28413 <p><small><a name="note367" href="#note367">367)</a> Implementations that do not define __STDC_LIB_EXT1__ are not required to conform to these
28414  specifications.
28415 </small>
28416
28417 <h3><a name="K.3" href="#K.3">K.3 Library</a></h3>
28418
28419 <h4><a name="K.3.1" href="#K.3.1">K.3.1 Introduction</a></h4>
28420
28421 <h5><a name="K.3.1.1" href="#K.3.1.1">K.3.1.1 Standard headers</a></h5>
28422 <p><!--para 1 -->
28423  The functions, macros, and types declared or defined in <a href="#K.3">K.3</a> and its subclauses are not
28424  declared or defined by their respective headers if __STDC_WANT_LIB_EXT1__ is
28425  defined as a macro which expands to the integer constant 0 at the point in the source file
28426  where the appropriate header is first included.
28427 <p><!--para 2 -->
28428  The functions, macros, and types declared or defined in <a href="#K.3">K.3</a> and its subclauses are
28429  declared and defined by their respective headers if __STDC_WANT_LIB_EXT1__ is
28430  defined as a macro which expands to the integer constant 1 at the point in the source file
28431  where the appropriate header is first included.<sup><a href="#note368"><b>368)</b></a></sup>
28432 <p><!--para 3 -->
28433  It is implementation-defined whether the functions, macros, and types declared or defined
28434  in <a href="#K.3">K.3</a> and its subclauses are declared or defined by their respective headers if
28435  __STDC_WANT_LIB_EXT1__ is not defined as a macro at the point in the source file
28436  where the appropriate header is first included.<sup><a href="#note369"><b>369)</b></a></sup>
28437 <p><!--para 4 -->
28438  Within a preprocessing translation unit, __STDC_WANT_LIB_EXT1__ shall be
28439  defined identically for all inclusions of any headers from subclause <a href="#K.3">K.3</a>. If
28440  __STDC_WANT_LIB_EXT1__ is defined differently for any such inclusion, the
28441  implementation shall issue a diagnostic as if a preprocessor error directive were used.
28442  
28443  
28444 <!--page 598 -->
28445
28446 <h6>footnotes</h6>
28447 <p><small><a name="note368" href="#note368">368)</a> Future revisions of this International Standard may define meanings for other values of
28448  __STDC_WANT_LIB_EXT1__.
28449 </small>
28450 <p><small><a name="note369" href="#note369">369)</a> Subclause <a href="#7.1.3">7.1.3</a> reserves certain names and patterns of names that an implementation may use in
28451  headers. All other names are not reserved, and a conforming implementation is not permitted to use
28452  them. While some of the names defined in <a href="#K.3">K.3</a> and its subclauses are reserved, others are not. If an
28453  unreserved name is defined in a header when __STDC_WANT_LIB_EXT1__ is defined as 0, the
28454  implementation is not conforming.
28455 </small>
28456
28457 <h5><a name="K.3.1.2" href="#K.3.1.2">K.3.1.2 Reserved identifiers</a></h5>
28458 <p><!--para 1 -->
28459  Each macro name in any of the following subclauses is reserved for use as specified if it
28460  is defined by any of its associated headers when included; unless explicitly stated
28461  otherwise (see <a href="#7.1.4">7.1.4</a>).
28462 <p><!--para 2 -->
28463  All identifiers with external linkage in any of the following subclauses are reserved for
28464  use as identifiers with external linkage if any of them are used by the program. None of
28465  them are reserved if none of them are used.
28466 <p><!--para 3 -->
28467  Each identifier with file scope listed in any of the following subclauses is reserved for use
28468  as a macro name and as an identifier with file scope in the same name space if it is
28469  defined by any of its associated headers when included.
28470
28471 <h5><a name="K.3.1.3" href="#K.3.1.3">K.3.1.3 Use of errno</a></h5>
28472 <p><!--para 1 -->
28473  An implementation may set errno for the functions defined in this annex, but is not
28474  required to.
28475
28476 <h5><a name="K.3.1.4" href="#K.3.1.4">K.3.1.4 Runtime-constraint violations</a></h5>
28477 <p><!--para 1 -->
28478  Most functions in this annex include as part of their specification a list of runtime-
28479  constraints. These runtime-constraints are requirements on the program using the
28480  library.<sup><a href="#note370"><b>370)</b></a></sup>
28481 <p><!--para 2 -->
28482  Implementations shall verify that the runtime-constraints for a function are not violated
28483  by the program. If a runtime-constraint is violated, the implementation shall call the
28484  currently registered runtime-constraint handler (see set_constraint_handler_s
28485  in <a href="#7.22">&lt;stdlib.h&gt;</a>). Multiple runtime-constraint violations in the same call to a library
28486  function result in only one call to the runtime-constraint handler. It is unspecified which
28487  one of the multiple runtime-constraint violations cause the handler to be called.
28488 <p><!--para 3 -->
28489  If the runtime-constraints section for a function states an action to be performed when a
28490  runtime-constraint violation occurs, the function shall perform the action before calling
28491  the runtime-constraint handler. If the runtime-constraints section lists actions that are
28492  prohibited when a runtime-constraint violation occurs, then such actions are prohibited to
28493  the function both before calling the handler and after the handler returns.
28494 <p><!--para 4 -->
28495  The runtime-constraint handler might not return. If the handler does return, the library
28496  function whose runtime-constraint was violated shall return some indication of failure as
28497  given by the returns section in the function's specification.
28498  
28499  
28500  
28501 <!--page 599 -->
28502
28503 <h6>footnotes</h6>
28504 <p><small><a name="note370" href="#note370">370)</a> Although runtime-constraints replace many cases of undefined behavior, undefined behavior still
28505  exists in this annex. Implementations are free to detect any case of undefined behavior and treat it as a
28506  runtime-constraint violation by calling the runtime-constraint handler. This license comes directly
28507  from the definition of undefined behavior.
28508 </small>
28509
28510 <h4><a name="K.3.2" href="#K.3.2">K.3.2 Errors <errno.h></a></h4>
28511 <p><!--para 1 -->
28512  The header <a href="#7.5">&lt;errno.h&gt;</a> defines a type.
28513 <p><!--para 2 -->
28514  The type is
28515 <pre>
28516           errno_t
28517 </pre>
28518  which is type int.<sup><a href="#note371"><b>371)</b></a></sup>
28519
28520 <h6>footnotes</h6>
28521 <p><small><a name="note371" href="#note371">371)</a> As a matter of programming style, errno_t may be used as the type of something that deals only
28522  with the values that might be found in errno. For example, a function which returns the value of
28523  errno might be declared as having the return type errno_t.
28524 </small>
28525
28526 <h4><a name="K.3.3" href="#K.3.3">K.3.3 Common definitions <stddef.h></a></h4>
28527 <p><!--para 1 -->
28528  The header <a href="#7.19">&lt;stddef.h&gt;</a> defines a type.
28529 <p><!--para 2 -->
28530  The type is
28531 <pre>
28532           rsize_t
28533 </pre>
28534  which is the type size_t.<sup><a href="#note372"><b>372)</b></a></sup>
28535
28536 <h6>footnotes</h6>
28537 <p><small><a name="note372" href="#note372">372)</a> See the description of the RSIZE_MAX macro in <a href="#7.20">&lt;stdint.h&gt;</a>.
28538 </small>
28539
28540 <h4><a name="K.3.4" href="#K.3.4">K.3.4 Integer types <stdint.h></a></h4>
28541 <p><!--para 1 -->
28542  The header <a href="#7.20">&lt;stdint.h&gt;</a> defines a macro.
28543 <p><!--para 2 -->
28544  The macro is
28545 <pre>
28546           RSIZE_MAX
28547 </pre>
28548  which expands to a value<sup><a href="#note373"><b>373)</b></a></sup> of type size_t. Functions that have parameters of type
28549  rsize_t consider it a runtime-constraint violation if the values of those parameters are
28550  greater than RSIZE_MAX.
28551 <h6>Recommended practice</h6>
28552 <p><!--para 3 -->
28553  Extremely large object sizes are frequently a sign that an object's size was calculated
28554  incorrectly. For example, negative numbers appear as very large positive numbers when
28555  converted to an unsigned type like size_t. Also, some implementations do not support
28556  objects as large as the maximum value that can be represented by type size_t.
28557 <p><!--para 4 -->
28558  For those reasons, it is sometimes beneficial to restrict the range of object sizes to detect
28559  programming errors. For implementations targeting machines with large address spaces,
28560  it is recommended that RSIZE_MAX be defined as the smaller of the size of the largest
28561  object supported or (SIZE_MAX &gt;&gt; 1), even if this limit is smaller than the size of
28562  some legitimate, but very large, objects. Implementations targeting machines with small
28563  address spaces may wish to define RSIZE_MAX as SIZE_MAX, which means that there
28564  
28565 <!--page 600 -->
28566  is no object size that is considered a runtime-constraint violation.
28567
28568 <h6>footnotes</h6>
28569 <p><small><a name="note373" href="#note373">373)</a> The macro RSIZE_MAX need not expand to a constant expression.
28570 </small>
28571
28572 <h4><a name="K.3.5" href="#K.3.5">K.3.5 Input/output <stdio.h></a></h4>
28573 <p><!--para 1 -->
28574  The header <a href="#7.21">&lt;stdio.h&gt;</a> defines several macros and two types.
28575 <p><!--para 2 -->
28576  The macros are
28577 <pre>
28578         L_tmpnam_s
28579 </pre>
28580  which expands to an integer constant expression that is the size needed for an array of
28581  char large enough to hold a temporary file name string generated by the tmpnam_s
28582  function;
28583 <pre>
28584         TMP_MAX_S
28585 </pre>
28586  which expands to an integer constant expression that is the maximum number of unique
28587  file names that can be generated by the tmpnam_s function.
28588 <p><!--para 3 -->
28589  The types are
28590 <pre>
28591         errno_t
28592 </pre>
28593  which is type int; and
28594 <pre>
28595         rsize_t
28596 </pre>
28597  which is the type size_t.
28598
28599 <h5><a name="K.3.5.1" href="#K.3.5.1">K.3.5.1 Operations on files</a></h5>
28600
28601 <h5><a name="K.3.5.1.1" href="#K.3.5.1.1">K.3.5.1.1 The tmpfile_s function</a></h5>
28602 <h6>Synopsis</h6>
28603 <p><!--para 1 -->
28604 <pre>
28605         #define __STDC_WANT_LIB_EXT1__ 1
28606         #include <a href="#7.21">&lt;stdio.h&gt;</a>
28607         errno_t tmpfile_s(FILE * restrict * restrict streamptr);
28608 </pre>
28609  Runtime-constraints
28610 <p><!--para 2 -->
28611  streamptr shall not be a null pointer.
28612 <p><!--para 3 -->
28613  If there is a runtime-constraint violation, tmpfile_s does not attempt to create a file.
28614 <h6>Description</h6>
28615 <p><!--para 4 -->
28616  The tmpfile_s function creates a temporary binary file that is different from any other
28617  existing file and that will automatically be removed when it is closed or at program
28618  termination. If the program terminates abnormally, whether an open temporary file is
28619  removed is implementation-defined. The file is opened for update with "wb+" mode
28620  with the meaning that mode has in the fopen_s function (including the mode's effect
28621  on exclusive access and file permissions).
28622 <!--page 601 -->
28623 <p><!--para 5 -->
28624  If the file was created successfully, then the pointer to FILE pointed to by streamptr
28625  will be set to the pointer to the object controlling the opened file. Otherwise, the pointer
28626  to FILE pointed to by streamptr will be set to a null pointer.
28627 <h6>Recommended practice</h6>
28628  It should be possible to open at least TMP_MAX_S temporary files during the lifetime of
28629  the program (this limit may be shared with tmpnam_s) and there should be no limit on
28630  the number simultaneously open other than this limit and any limit on the number of open
28631  files (FOPEN_MAX).
28632 <h6>Returns</h6>
28633 <p><!--para 6 -->
28634  The tmpfile_s function returns zero if it created the file. If it did not create the file or
28635  there was a runtime-constraint violation, tmpfile_s returns a nonzero value.
28636
28637 <h5><a name="K.3.5.1.2" href="#K.3.5.1.2">K.3.5.1.2 The tmpnam_s function</a></h5>
28638 <h6>Synopsis</h6>
28639 <p><!--para 1 -->
28640 <pre>
28641          #define __STDC_WANT_LIB_EXT1__ 1
28642          #include <a href="#7.21">&lt;stdio.h&gt;</a>
28643          errno_t tmpnam_s(char *s, rsize_t maxsize);
28644 </pre>
28645  Runtime-constraints
28646 <p><!--para 2 -->
28647  s shall not be a null pointer. maxsize shall be less than or equal to RSIZE_MAX.
28648  maxsize shall be greater than the length of the generated file name string.
28649 <h6>Description</h6>
28650 <p><!--para 3 -->
28651  The tmpnam_s function generates a string that is a valid file name and that is not the
28652  same as the name of an existing file.<sup><a href="#note374"><b>374)</b></a></sup> The function is potentially capable of generating
28653  TMP_MAX_S different strings, but any or all of them may already be in use by existing
28654  files and thus not be suitable return values. The lengths of these strings shall be less than
28655  the value of the L_tmpnam_s macro.
28656 <p><!--para 4 -->
28657  The tmpnam_s function generates a different string each time it is called.
28658 <p><!--para 5 -->
28659  It is assumed that s points to an array of at least maxsize characters. This array will be
28660  set to generated string, as specified below.
28661  
28662  
28663  
28664 <!--page 602 -->
28665 <p><!--para 6 -->
28666  The implementation shall behave as if no library function except tmpnam calls the
28667  tmpnam_s function.<sup><a href="#note375"><b>375)</b></a></sup>
28668 <h6>Recommended practice</h6>
28669 <p><!--para 7 -->
28670  After a program obtains a file name using the tmpnam_s function and before the
28671  program creates a file with that name, the possibility exists that someone else may create
28672  a file with that same name. To avoid this race condition, the tmpfile_s function
28673  should be used instead of tmpnam_s when possible. One situation that requires the use
28674  of the tmpnam_s function is when the program needs to create a temporary directory
28675  rather than a temporary file.
28676 <h6>Returns</h6>
28677 <p><!--para 8 -->
28678  If no suitable string can be generated, or if there is a runtime-constraint violation, the
28679  tmpnam_s function writes a null character to s[0] (only if s is not null and maxsize
28680  is greater than zero) and returns a nonzero value.
28681 <p><!--para 9 -->
28682  Otherwise, the tmpnam_s function writes the string in the array pointed to by s and
28683  returns zero.
28684 <h6>Environmental limits</h6>
28685 <p><!--para 10 -->
28686  The value of the macro TMP_MAX_S shall be at least 25.
28687
28688 <h6>footnotes</h6>
28689 <p><small><a name="note374" href="#note374">374)</a> Files created using strings generated by the tmpnam_s function are temporary only in the sense that
28690  their names should not collide with those generated by conventional naming rules for the
28691  implementation. It is still necessary to use the remove function to remove such files when their use
28692  is ended, and before program termination. Implementations should take care in choosing the patterns
28693  used for names returned by tmpnam_s. For example, making a thread id part of the names avoids the
28694  race condition and possible conflict when multiple programs run simultaneously by the same user
28695  generate the same temporary file names.
28696 </small>
28697 <p><small><a name="note375" href="#note375">375)</a> An implementation may have tmpnam call tmpnam_s (perhaps so there is only one naming
28698  convention for temporary files), but this is not required.
28699 </small>
28700
28701 <h5><a name="K.3.5.2" href="#K.3.5.2">K.3.5.2 File access functions</a></h5>
28702
28703 <h5><a name="K.3.5.2.1" href="#K.3.5.2.1">K.3.5.2.1 The fopen_s function</a></h5>
28704 <h6>Synopsis</h6>
28705 <p><!--para 1 -->
28706 <pre>
28707         #define __STDC_WANT_LIB_EXT1__ 1
28708         #include <a href="#7.21">&lt;stdio.h&gt;</a>
28709         errno_t fopen_s(FILE * restrict * restrict streamptr,
28710              const char * restrict filename,
28711              const char * restrict mode);
28712 </pre>
28713  Runtime-constraints
28714 <p><!--para 2 -->
28715  None of streamptr, filename, or mode shall be a null pointer.
28716 <p><!--para 3 -->
28717  If there is a runtime-constraint violation, fopen_s does not attempt to open a file.
28718  Furthermore, if streamptr is not a null pointer, fopen_s sets *streamptr to the
28719  null pointer.
28720  
28721  
28722  
28723  
28724 <!--page 603 -->
28725 <h6>Description</h6>
28726 <p><!--para 4 -->
28727  The fopen_s function opens the file whose name is the string pointed to by
28728  filename, and associates a stream with it.
28729 <p><!--para 5 -->
28730  The mode string shall be as described for fopen, with the addition that modes starting
28731  with the character 'w' or 'a' may be preceded by the character 'u', see below:
28732  uw             truncate to zero length or create text file for writing, default
28733 <pre>
28734                 permissions
28735 </pre>
28736  uwx            create text file for writing, default permissions
28737  ua             append; open or create text file for writing at end-of-file, default
28738 <pre>
28739                 permissions
28740 </pre>
28741  uwb            truncate to zero length or create binary file for writing, default
28742 <pre>
28743                 permissions
28744 </pre>
28745  uwbx           create binary file for writing, default permissions
28746  uab            append; open or create binary file for writing at end-of-file, default
28747 <pre>
28748                 permissions
28749 </pre>
28750  uw+            truncate to zero length or create text file for update, default
28751 <pre>
28752                 permissions
28753 </pre>
28754  uw+x           create text file for update, default permissions
28755  ua+            append; open or create text file for update, writing at end-of-file,
28756 <pre>
28757                 default permissions
28758 </pre>
28759  uw+b or uwb+   truncate to zero length or create binary file for update, default
28760 <pre>
28761                 permissions
28762 </pre>
28763  uw+bx or uwb+x create binary file for update, default permissions
28764  ua+b or uab+   append; open or create binary file for update, writing at end-of-file,
28765 <pre>
28766                 default permissions
28767 </pre>
28768 <p><!--para 6 -->
28769  Opening a file with exclusive mode ('x' as the last character in the mode argument)
28770  fails if the file already exists or cannot be created.
28771 <p><!--para 7 -->
28772  To the extent that the underlying system supports the concepts, files opened for writing
28773  shall be opened with exclusive (also known as non-shared) access. If the file is being
28774  created, and the first character of the mode string is not 'u', to the extent that the
28775  underlying system supports it, the file shall have a file permission that prevents other
28776  users on the system from accessing the file. If the file is being created and first character
28777  of the mode string is 'u', then by the time the file has been closed, it shall have the
28778  system default file access permissions.<sup><a href="#note376"><b>376)</b></a></sup>
28779 <p><!--para 8 -->
28780  If the file was opened successfully, then the pointer to FILE pointed to by streamptr
28781  will be set to the pointer to the object controlling the opened file. Otherwise, the pointer
28782  
28783  
28784 <!--page 604 -->
28785  to FILE pointed to by streamptr will be set to a null pointer.
28786 <h6>Returns</h6>
28787 <p><!--para 9 -->
28788  The fopen_s function returns zero if it opened the file. If it did not open the file or if
28789  there was a runtime-constraint violation, fopen_s returns a nonzero value.
28790
28791 <h6>footnotes</h6>
28792 <p><small><a name="note376" href="#note376">376)</a> These are the same permissions that the file would have been created with by fopen.
28793 </small>
28794
28795 <h5><a name="K.3.5.2.2" href="#K.3.5.2.2">K.3.5.2.2 The freopen_s function</a></h5>
28796 <h6>Synopsis</h6>
28797 <p><!--para 1 -->
28798 <pre>
28799         #define __STDC_WANT_LIB_EXT1__ 1
28800         #include <a href="#7.21">&lt;stdio.h&gt;</a>
28801         errno_t freopen_s(FILE * restrict * restrict newstreamptr,
28802              const char * restrict filename,
28803              const char * restrict mode,
28804              FILE * restrict stream);
28805 </pre>
28806  Runtime-constraints
28807 <p><!--para 2 -->
28808  None of newstreamptr, mode, and stream shall be a null pointer.
28809 <p><!--para 3 -->
28810  If there is a runtime-constraint violation, freopen_s neither attempts to close any file
28811  associated with stream nor attempts to open a file. Furthermore, if newstreamptr is
28812  not a null pointer, fopen_s sets *newstreamptr to the null pointer.
28813 <h6>Description</h6>
28814 <p><!--para 4 -->
28815  The freopen_s function opens the file whose name is the string pointed to by
28816  filename and associates the stream pointed to by stream with it. The mode
28817  argument has the same meaning as in the fopen_s function (including the mode's effect
28818  on exclusive access and file permissions).
28819 <p><!--para 5 -->
28820  If filename is a null pointer, the freopen_s function attempts to change the mode of
28821  the stream to that specified by mode, as if the name of the file currently associated with
28822  the stream had been used. It is implementation-defined which changes of mode are
28823  permitted (if any), and under what circumstances.
28824 <p><!--para 6 -->
28825  The freopen_s function first attempts to close any file that is associated with stream.
28826  Failure to close the file is ignored. The error and end-of-file indicators for the stream are
28827  cleared.
28828 <p><!--para 7 -->
28829  If the file was opened successfully, then the pointer to FILE pointed to by
28830  newstreamptr will be set to the value of stream. Otherwise, the pointer to FILE
28831  pointed to by newstreamptr will be set to a null pointer.
28832 <h6>Returns</h6>
28833 <p><!--para 8 -->
28834  The freopen_s function returns zero if it opened the file. If it did not open the file or
28835  there was a runtime-constraint violation, freopen_s returns a nonzero value.
28836 <!--page 605 -->
28837
28838 <h5><a name="K.3.5.3" href="#K.3.5.3">K.3.5.3 Formatted input/output functions</a></h5>
28839 <p><!--para 1 -->
28840  Unless explicitly stated otherwise, if the execution of a function described in this
28841  subclause causes copying to take place between objects that overlap, the objects take on
28842  unspecified values.
28843
28844 <h5><a name="K.3.5.3.1" href="#K.3.5.3.1">K.3.5.3.1 The fprintf_s function</a></h5>
28845 <h6>Synopsis</h6>
28846 <p><!--para 1 -->
28847 <pre>
28848           #define __STDC_WANT_LIB_EXT1__ 1
28849           #include <a href="#7.21">&lt;stdio.h&gt;</a>
28850           int fprintf_s(FILE * restrict stream,
28851                const char * restrict format, ...);
28852 </pre>
28853  Runtime-constraints
28854 <p><!--para 2 -->
28855  Neither stream nor format shall be a null pointer. The %n specifier<sup><a href="#note377"><b>377)</b></a></sup> (modified or
28856  not by flags, field width, or precision) shall not appear in the string pointed to by
28857  format. Any argument to fprintf_s corresponding to a %s specifier shall not be a
28858  null pointer.
28859 <p><!--para 3 -->
28860  If there is a runtime-constraint violation,<sup><a href="#note378"><b>378)</b></a></sup> the fprintf_s function does not attempt
28861  to produce further output, and it is unspecified to what extent fprintf_s produced
28862  output before discovering the runtime-constraint violation.
28863 <h6>Description</h6>
28864 <p><!--para 4 -->
28865  The fprintf_s function is equivalent to the fprintf function except for the explicit
28866  runtime-constraints listed above.
28867 <h6>Returns</h6>
28868 <p><!--para 5 -->
28869  The fprintf_s function returns the number of characters transmitted, or a negative
28870  value if an output error, encoding error, or runtime-constraint violation occurred.
28871  
28872  
28873  
28874  
28875 <!--page 606 -->
28876
28877 <h6>footnotes</h6>
28878 <p><small><a name="note377" href="#note377">377)</a> It is not a runtime-constraint violation for the characters %n to appear in sequence in the string pointed
28879  at by format when those characters are not a interpreted as a %n specifier. For example, if the entire
28880  format string was %%n.
28881 </small>
28882 <p><small><a name="note378" href="#note378">378)</a> Because an implementation may treat any undefined behavior as a runtime-constraint violation, an
28883  implementation may treat any unsupported specifiers in the string pointed to by format as a runtime-
28884  constraint violation.
28885 </small>
28886
28887 <h5><a name="K.3.5.3.2" href="#K.3.5.3.2">K.3.5.3.2 The fscanf_s function</a></h5>
28888 <h6>Synopsis</h6>
28889 <p><!--para 1 -->
28890 <pre>
28891          #define __STDC_WANT_LIB_EXT1__ 1
28892          #include <a href="#7.21">&lt;stdio.h&gt;</a>
28893          int fscanf_s(FILE * restrict stream,
28894               const char * restrict format, ...);
28895 </pre>
28896  Runtime-constraints
28897 <p><!--para 2 -->
28898  Neither stream nor format shall be a null pointer. Any argument indirected though in
28899  order to store converted input shall not be a null pointer.
28900 <p><!--para 3 -->
28901  If there is a runtime-constraint violation,<sup><a href="#note379"><b>379)</b></a></sup> the fscanf_s function does not attempt to
28902  perform further input, and it is unspecified to what extent fscanf_s performed input
28903  before discovering the runtime-constraint violation.
28904 <h6>Description</h6>
28905 <p><!--para 4 -->
28906  The fscanf_s function is equivalent to fscanf except that the c, s, and [ conversion
28907  specifiers apply to a pair of arguments (unless assignment suppression is indicated by a
28908  *). The first of these arguments is the same as for fscanf. That argument is
28909  immediately followed in the argument list by the second argument, which has type
28910  rsize_t and gives the number of elements in the array pointed to by the first argument
28911  of the pair. If the first argument points to a scalar object, it is considered to be an array of
28912  one element.<sup><a href="#note380"><b>380)</b></a></sup>
28913 <p><!--para 5 -->
28914  A matching failure occurs if the number of elements in a receiving object is insufficient to
28915  hold the converted input (including any trailing null character).
28916 <h6>Returns</h6>
28917 <p><!--para 6 -->
28918  The fscanf_s function returns the value of the macro EOF if an input failure occurs
28919  before any conversion or if there is a runtime-constraint violation. Otherwise, the
28920  
28921 <!--page 607 -->
28922  fscanf_s function returns the number of input items assigned, which can be fewer than
28923  provided for, or even zero, in the event of an early matching failure.
28924 <p><!--para 7 -->
28925  EXAMPLE 1        The call:
28926 <pre>
28927           #define __STDC_WANT_LIB_EXT1__ 1
28928           #include <a href="#7.21">&lt;stdio.h&gt;</a>
28929           /* ... */
28930           int n, i; float x; char name[50];
28931           n = fscanf_s(stdin, "%d%f%s", &amp;i, &amp;x, name, (rsize_t) 50);
28932 </pre>
28933  with the input line:
28934 <pre>
28935           25 54.32E-1 thompson
28936 </pre>
28937  will assign to n the value 3, to i the value 25, to x the value 5.432, and to name the sequence
28938  thompson\0.
28939  
28940 <p><!--para 8 -->
28941  EXAMPLE 2        The call:
28942 <pre>
28943           #define __STDC_WANT_LIB_EXT1__ 1
28944           #include <a href="#7.21">&lt;stdio.h&gt;</a>
28945           /* ... */
28946           int n; char s[5];
28947           n = fscanf_s(stdin, "%s", s, sizeof s);
28948 </pre>
28949  with the input line:
28950 <pre>
28951           hello
28952 </pre>
28953  will assign to n the value 0 since a matching failure occurred because the sequence hello\0 requires an
28954  array of six characters to store it.
28955  
28956
28957 <h6>footnotes</h6>
28958 <p><small><a name="note379" href="#note379">379)</a> Because an implementation may treat any undefined behavior as a runtime-constraint violation, an
28959  implementation may treat any unsupported specifiers in the string pointed to by format as a runtime-
28960  constraint violation.
28961 </small>
28962 <p><small><a name="note380" href="#note380">380)</a> If the format is known at translation time, an implementation may issue a diagnostic for any argument
28963  used to store the result from a c, s, or [ conversion specifier if that argument is not followed by an
28964  argument of a type compatible with rsize_t. A limited amount of checking may be done if even if
28965  the format is not known at translation time. For example, an implementation may issue a diagnostic
28966  for each argument after format that has of type pointer to one of char, signed char,
28967  unsigned char, or void that is not followed by an argument of a type compatible with
28968  rsize_t. The diagnostic could warn that unless the pointer is being used with a conversion specifier
28969  using the hh length modifier, a length argument must follow the pointer argument. Another useful
28970  diagnostic could flag any non-pointer argument following format that did not have a type
28971  compatible with rsize_t.
28972 </small>
28973
28974 <h5><a name="K.3.5.3.3" href="#K.3.5.3.3">K.3.5.3.3 The printf_s function</a></h5>
28975 <h6>Synopsis</h6>
28976 <p><!--para 1 -->
28977 <pre>
28978           #define __STDC_WANT_LIB_EXT1__ 1
28979           #include <a href="#7.21">&lt;stdio.h&gt;</a>
28980           int printf_s(const char * restrict format, ...);
28981 </pre>
28982  Runtime-constraints
28983 <p><!--para 2 -->
28984  format shall not be a null pointer. The %n specifier<sup><a href="#note381"><b>381)</b></a></sup> (modified or not by flags, field
28985  width, or precision) shall not appear in the string pointed to by format. Any argument
28986  to printf_s corresponding to a %s specifier shall not be a null pointer.
28987 <p><!--para 3 -->
28988  If there is a runtime-constraint violation, the printf_s function does not attempt to
28989  produce further output, and it is unspecified to what extent printf_s produced output
28990  before discovering the runtime-constraint violation.
28991  
28992  
28993 <!--page 608 -->
28994 <h6>Description</h6>
28995 <p><!--para 4 -->
28996  The printf_s function is equivalent to the printf function except for the explicit
28997  runtime-constraints listed above.
28998 <h6>Returns</h6>
28999 <p><!--para 5 -->
29000  The printf_s function returns the number of characters transmitted, or a negative
29001  value if an output error, encoding error, or runtime-constraint violation occurred.
29002
29003 <h6>footnotes</h6>
29004 <p><small><a name="note381" href="#note381">381)</a> It is not a runtime-constraint violation for the characters %n to appear in sequence in the string pointed
29005  at by format when those characters are not a interpreted as a %n specifier. For example, if the entire
29006  format string was %%n.
29007 </small>
29008
29009 <h5><a name="K.3.5.3.4" href="#K.3.5.3.4">K.3.5.3.4 The scanf_s function</a></h5>
29010 <h6>Synopsis</h6>
29011 <p><!--para 1 -->
29012 <pre>
29013         #define __STDC_WANT_LIB_EXT1__ 1
29014         #include <a href="#7.21">&lt;stdio.h&gt;</a>
29015         int scanf_s(const char * restrict format, ...);
29016 </pre>
29017  Runtime-constraints
29018 <p><!--para 2 -->
29019  format shall not be a null pointer. Any argument indirected though in order to store
29020  converted input shall not be a null pointer.
29021 <p><!--para 3 -->
29022  If there is a runtime-constraint violation, the scanf_s function does not attempt to
29023  perform further input, and it is unspecified to what extent scanf_s performed input
29024  before discovering the runtime-constraint violation.
29025 <h6>Description</h6>
29026 <p><!--para 4 -->
29027  The scanf_s function is equivalent to fscanf_s with the argument stdin
29028  interposed before the arguments to scanf_s.
29029 <h6>Returns</h6>
29030 <p><!--para 5 -->
29031  The scanf_s function returns the value of the macro EOF if an input failure occurs
29032  before any conversion or if there is a runtime-constraint violation. Otherwise, the
29033  scanf_s function returns the number of input items assigned, which can be fewer than
29034  provided for, or even zero, in the event of an early matching failure.
29035
29036 <h5><a name="K.3.5.3.5" href="#K.3.5.3.5">K.3.5.3.5 The snprintf_s function</a></h5>
29037 <h6>Synopsis</h6>
29038 <p><!--para 1 -->
29039 <pre>
29040         #define __STDC_WANT_LIB_EXT1__ 1
29041         #include <a href="#7.21">&lt;stdio.h&gt;</a>
29042         int snprintf_s(char * restrict s, rsize_t n,
29043              const char * restrict format, ...);
29044 </pre>
29045  Runtime-constraints
29046 <p><!--para 2 -->
29047  Neither s nor format shall be a null pointer. n shall neither equal zero nor be greater
29048  than RSIZE_MAX. The %n specifier<sup><a href="#note382"><b>382)</b></a></sup> (modified or not by flags, field width, or
29049  precision) shall not appear in the string pointed to by format. Any argument to
29050 <!--page 609 -->
29051  snprintf_s corresponding to a %s specifier shall not be a null pointer. No encoding
29052  error shall occur.
29053 <p><!--para 3 -->
29054  If there is a runtime-constraint violation, then if s is not a null pointer and n is greater
29055  than zero and less than RSIZE_MAX, then the snprintf_s function sets s[0] to the
29056  null character.
29057 <h6>Description</h6>
29058 <p><!--para 4 -->
29059  The snprintf_s function is equivalent to the snprintf function except for the
29060  explicit runtime-constraints listed above.
29061 <p><!--para 5 -->
29062  The snprintf_s function, unlike sprintf_s, will truncate the result to fit within the
29063  array pointed to by s.
29064 <h6>Returns</h6>
29065 <p><!--para 6 -->
29066  The snprintf_s function returns the number of characters that would have been
29067  written had n been sufficiently large, not counting the terminating null character, or a
29068  negative value if a runtime-constraint violation occurred. Thus, the null-terminated
29069  output has been completely written if and only if the returned value is nonnegative and
29070  less than n.
29071
29072 <h6>footnotes</h6>
29073 <p><small><a name="note382" href="#note382">382)</a> It is not a runtime-constraint violation for the characters %n to appear in sequence in the string pointed
29074  at by format when those characters are not a interpreted as a %n specifier. For example, if the entire
29075  format string was %%n.
29076 </small>
29077
29078 <h5><a name="K.3.5.3.6" href="#K.3.5.3.6">K.3.5.3.6 The sprintf_s function</a></h5>
29079 <h6>Synopsis</h6>
29080 <p><!--para 1 -->
29081 <pre>
29082           #define __STDC_WANT_LIB_EXT1__ 1
29083           #include <a href="#7.21">&lt;stdio.h&gt;</a>
29084           int sprintf_s(char * restrict s, rsize_t n,
29085                const char * restrict format, ...);
29086 </pre>
29087  Runtime-constraints
29088 <p><!--para 2 -->
29089  Neither s nor format shall be a null pointer. n shall neither equal zero nor be greater
29090  than RSIZE_MAX. The number of characters (including the trailing null) required for the
29091  result to be written to the array pointed to by s shall not be greater than n. The %n
29092  specifier<sup><a href="#note383"><b>383)</b></a></sup> (modified or not by flags, field width, or precision) shall not appear in the
29093  string pointed to by format. Any argument to sprintf_s corresponding to a %s
29094  specifier shall not be a null pointer. No encoding error shall occur.
29095  
29096  
29097  
29098 <!--page 610 -->
29099 <p><!--para 3 -->
29100  If there is a runtime-constraint violation, then if s is not a null pointer and n is greater
29101  than zero and less than RSIZE_MAX, then the sprintf_s function sets s[0] to the
29102  null character.
29103 <h6>Description</h6>
29104 <p><!--para 4 -->
29105  The sprintf_s function is equivalent to the sprintf function except for the
29106  parameter n and the explicit runtime-constraints listed above.
29107 <p><!--para 5 -->
29108  The sprintf_s function, unlike snprintf_s, treats a result too big for the array
29109  pointed to by s as a runtime-constraint violation.
29110 <h6>Returns</h6>
29111 <p><!--para 6 -->
29112  If no runtime-constraint violation occurred, the sprintf_s function returns the number
29113  of characters written in the array, not counting the terminating null character. If an
29114  encoding error occurred, sprintf_s returns a negative value. If any other runtime-
29115  constraint violation occurred, sprintf_s returns zero.
29116
29117 <h6>footnotes</h6>
29118 <p><small><a name="note383" href="#note383">383)</a> It is not a runtime-constraint violation for the characters %n to appear in sequence in the string pointed
29119  at by format when those characters are not a interpreted as a %n specifier. For example, if the entire
29120  format string was %%n.
29121 </small>
29122
29123 <h5><a name="K.3.5.3.7" href="#K.3.5.3.7">K.3.5.3.7 The sscanf_s function</a></h5>
29124 <h6>Synopsis</h6>
29125 <p><!--para 1 -->
29126 <pre>
29127         #define __STDC_WANT_LIB_EXT1__ 1
29128         #include <a href="#7.21">&lt;stdio.h&gt;</a>
29129         int sscanf_s(const char * restrict s,
29130              const char * restrict format, ...);
29131 </pre>
29132  Runtime-constraints
29133 <p><!--para 2 -->
29134  Neither s nor format shall be a null pointer. Any argument indirected though in order
29135  to store converted input shall not be a null pointer.
29136 <p><!--para 3 -->
29137  If there is a runtime-constraint violation, the sscanf_s function does not attempt to
29138  perform further input, and it is unspecified to what extent sscanf_s performed input
29139  before discovering the runtime-constraint violation.
29140 <h6>Description</h6>
29141 <p><!--para 4 -->
29142  The sscanf_s function is equivalent to fscanf_s, except that input is obtained from
29143  a string (specified by the argument s) rather than from a stream. Reaching the end of the
29144  string is equivalent to encountering end-of-file for the fscanf_s function. If copying
29145  takes place between objects that overlap, the objects take on unspecified values.
29146 <h6>Returns</h6>
29147 <p><!--para 5 -->
29148  The sscanf_s function returns the value of the macro EOF if an input failure occurs
29149  before any conversion or if there is a runtime-constraint violation. Otherwise, the
29150  sscanf_s function returns the number of input items assigned, which can be fewer than
29151  provided for, or even zero, in the event of an early matching failure.
29152 <!--page 611 -->
29153
29154 <h5><a name="K.3.5.3.8" href="#K.3.5.3.8">K.3.5.3.8 The vfprintf_s function</a></h5>
29155 <h6>Synopsis</h6>
29156 <p><!--para 1 -->
29157 <pre>
29158           #define __STDC_WANT_LIB_EXT1__ 1
29159           #include <a href="#7.16">&lt;stdarg.h&gt;</a>
29160           #include <a href="#7.21">&lt;stdio.h&gt;</a>
29161           int vfprintf_s(FILE * restrict stream,
29162                const char * restrict format,
29163                va_list arg);
29164 </pre>
29165  Runtime-constraints
29166 <p><!--para 2 -->
29167  Neither stream nor format shall be a null pointer. The %n specifier<sup><a href="#note384"><b>384)</b></a></sup> (modified or
29168  not by flags, field width, or precision) shall not appear in the string pointed to by
29169  format. Any argument to vfprintf_s corresponding to a %s specifier shall not be a
29170  null pointer.
29171 <p><!--para 3 -->
29172  If there is a runtime-constraint violation, the vfprintf_s function does not attempt to
29173  produce further output, and it is unspecified to what extent vfprintf_s produced
29174  output before discovering the runtime-constraint violation.
29175 <h6>Description</h6>
29176 <p><!--para 4 -->
29177  The vfprintf_s function is equivalent to the vfprintf function except for the
29178  explicit runtime-constraints listed above.
29179 <h6>Returns</h6>
29180 <p><!--para 5 -->
29181  The vfprintf_s function returns the number of characters transmitted, or a negative
29182  value if an output error, encoding error, or runtime-constraint violation occurred.
29183
29184 <h6>footnotes</h6>
29185 <p><small><a name="note384" href="#note384">384)</a> It is not a runtime-constraint violation for the characters %n to appear in sequence in the string pointed
29186  at by format when those characters are not a interpreted as a %n specifier. For example, if the entire
29187  format string was %%n.
29188 </small>
29189
29190 <h5><a name="K.3.5.3.9" href="#K.3.5.3.9">K.3.5.3.9 The vfscanf_s function</a></h5>
29191 <h6>Synopsis</h6>
29192 <p><!--para 1 -->
29193 <pre>
29194           #define __STDC_WANT_LIB_EXT1__ 1
29195           #include <a href="#7.16">&lt;stdarg.h&gt;</a>
29196           #include <a href="#7.21">&lt;stdio.h&gt;</a>
29197           int vfscanf_s(FILE * restrict stream,
29198                const char * restrict format,
29199                va_list arg);
29200 </pre>
29201  
29202  
29203  
29204  
29205 <!--page 612 -->
29206  Runtime-constraints
29207 <p><!--para 2 -->
29208  Neither stream nor format shall be a null pointer. Any argument indirected though in
29209  order to store converted input shall not be a null pointer.
29210 <p><!--para 3 -->
29211  If there is a runtime-constraint violation, the vfscanf_s function does not attempt to
29212  perform further input, and it is unspecified to what extent vfscanf_s performed input
29213  before discovering the runtime-constraint violation.
29214 <h6>Description</h6>
29215 <p><!--para 4 -->
29216  The vfscanf_s function is equivalent to fscanf_s, with the variable argument list
29217  replaced by arg, which shall have been initialized by the va_start macro (and
29218  possibly subsequent va_arg calls). The vfscanf_s function does not invoke the
29219  va_end macro.<sup><a href="#note385"><b>385)</b></a></sup>
29220 <h6>Returns</h6>
29221 <p><!--para 5 -->
29222  The vfscanf_s function returns the value of the macro EOF if an input failure occurs
29223  before any conversion or if there is a runtime-constraint violation. Otherwise, the
29224  vfscanf_s function returns the number of input items assigned, which can be fewer
29225  than provided for, or even zero, in the event of an early matching failure.
29226
29227 <h6>footnotes</h6>
29228 <p><small><a name="note385" href="#note385">385)</a> As the functions vfprintf_s, vfscanf_s, vprintf_s, vscanf_s, vsnprintf_s,
29229  vsprintf_s, and vsscanf_s invoke the va_arg macro, the value of arg after the return is
29230  indeterminate.
29231 </small>
29232
29233 <h5><a name="K.3.5.3.10" href="#K.3.5.3.10">K.3.5.3.10 The vprintf_s function</a></h5>
29234 <h6>Synopsis</h6>
29235 <p><!--para 1 -->
29236 <pre>
29237           #define __STDC_WANT_LIB_EXT1__ 1
29238           #include <a href="#7.16">&lt;stdarg.h&gt;</a>
29239           #include <a href="#7.21">&lt;stdio.h&gt;</a>
29240           int vprintf_s(const char * restrict format,
29241                va_list arg);
29242 </pre>
29243  Runtime-constraints
29244 <p><!--para 2 -->
29245  format shall not be a null pointer. The %n specifier<sup><a href="#note386"><b>386)</b></a></sup> (modified or not by flags, field
29246  width, or precision) shall not appear in the string pointed to by format. Any argument
29247  to vprintf_s corresponding to a %s specifier shall not be a null pointer.
29248 <p><!--para 3 -->
29249  If there is a runtime-constraint violation, the vprintf_s function does not attempt to
29250  produce further output, and it is unspecified to what extent vprintf_s produced output
29251  before discovering the runtime-constraint violation.
29252  
29253 <!--page 613 -->
29254 <h6>Description</h6>
29255 <p><!--para 4 -->
29256  The vprintf_s function is equivalent to the vprintf function except for the explicit
29257  runtime-constraints listed above.
29258 <h6>Returns</h6>
29259 <p><!--para 5 -->
29260  The vprintf_s function returns the number of characters transmitted, or a negative
29261  value if an output error, encoding error, or runtime-constraint violation occurred.
29262
29263 <h6>footnotes</h6>
29264 <p><small><a name="note386" href="#note386">386)</a> It is not a runtime-constraint violation for the characters %n to appear in sequence in the string pointed
29265  at by format when those characters are not a interpreted as a %n specifier. For example, if the entire
29266  format string was %%n.
29267 </small>
29268
29269 <h5><a name="K.3.5.3.11" href="#K.3.5.3.11">K.3.5.3.11 The vscanf_s function</a></h5>
29270 <h6>Synopsis</h6>
29271 <p><!--para 1 -->
29272 <pre>
29273          #define __STDC_WANT_LIB_EXT1__ 1
29274          #include <a href="#7.16">&lt;stdarg.h&gt;</a>
29275          #include <a href="#7.21">&lt;stdio.h&gt;</a>
29276          int vscanf_s(const char * restrict format,
29277               va_list arg);
29278 </pre>
29279  Runtime-constraints
29280 <p><!--para 2 -->
29281  format shall not be a null pointer. Any argument indirected though in order to store
29282  converted input shall not be a null pointer.
29283 <p><!--para 3 -->
29284  If there is a runtime-constraint violation, the vscanf_s function does not attempt to
29285  perform further input, and it is unspecified to what extent vscanf_s performed input
29286  before discovering the runtime-constraint violation.
29287 <h6>Description</h6>
29288 <p><!--para 4 -->
29289  The vscanf_s function is equivalent to scanf_s, with the variable argument list
29290  replaced by arg, which shall have been initialized by the va_start macro (and
29291  possibly subsequent va_arg calls). The vscanf_s function does not invoke the
29292  va_end macro.<sup><a href="#note387"><b>387)</b></a></sup>
29293 <h6>Returns</h6>
29294 <p><!--para 5 -->
29295  The vscanf_s function returns the value of the macro EOF if an input failure occurs
29296  before any conversion or if there is a runtime-constraint violation. Otherwise, the
29297  vscanf_s function returns the number of input items assigned, which can be fewer than
29298  provided for, or even zero, in the event of an early matching failure.
29299  
29300  
29301  
29302  
29303 <!--page 614 -->
29304
29305 <h6>footnotes</h6>
29306 <p><small><a name="note387" href="#note387">387)</a> As the functions vfprintf_s, vfscanf_s, vprintf_s, vscanf_s, vsnprintf_s,
29307  vsprintf_s, and vsscanf_s invoke the va_arg macro, the value of arg after the return is
29308  indeterminate.
29309 </small>
29310
29311 <h5><a name="K.3.5.3.12" href="#K.3.5.3.12">K.3.5.3.12 The vsnprintf_s function</a></h5>
29312 <h6>Synopsis</h6>
29313 <p><!--para 1 -->
29314 <pre>
29315           #define __STDC_WANT_LIB_EXT1__ 1
29316           #include <a href="#7.16">&lt;stdarg.h&gt;</a>
29317           #include <a href="#7.21">&lt;stdio.h&gt;</a>
29318           int vsnprintf_s(char * restrict s, rsize_t n,
29319                const char * restrict format,
29320                va_list arg);
29321 </pre>
29322  Runtime-constraints
29323 <p><!--para 2 -->
29324  Neither s nor format shall be a null pointer. n shall neither equal zero nor be greater
29325  than RSIZE_MAX. The %n specifier<sup><a href="#note388"><b>388)</b></a></sup> (modified or not by flags, field width, or
29326  precision) shall not appear in the string pointed to by format. Any argument to
29327  vsnprintf_s corresponding to a %s specifier shall not be a null pointer. No encoding
29328  error shall occur.
29329 <p><!--para 3 -->
29330  If there is a runtime-constraint violation, then if s is not a null pointer and n is greater
29331  than zero and less than RSIZE_MAX, then the vsnprintf_s function sets s[0] to the
29332  null character.
29333 <h6>Description</h6>
29334 <p><!--para 4 -->
29335  The vsnprintf_s function is equivalent to the vsnprintf function except for the
29336  explicit runtime-constraints listed above.
29337 <p><!--para 5 -->
29338  The vsnprintf_s function, unlike vsprintf_s, will truncate the result to fit within
29339  the array pointed to by s.
29340 <h6>Returns</h6>
29341 <p><!--para 6 -->
29342  The vsnprintf_s function returns the number of characters that would have been
29343  written had n been sufficiently large, not counting the terminating null character, or a
29344  negative value if a runtime-constraint violation occurred. Thus, the null-terminated
29345  output has been completely written if and only if the returned value is nonnegative and
29346  less than n.
29347  
29348  
29349  
29350  
29351 <!--page 615 -->
29352
29353 <h6>footnotes</h6>
29354 <p><small><a name="note388" href="#note388">388)</a> It is not a runtime-constraint violation for the characters %n to appear in sequence in the string pointed
29355  at by format when those characters are not a interpreted as a %n specifier. For example, if the entire
29356  format string was %%n.
29357 </small>
29358
29359 <h5><a name="K.3.5.3.13" href="#K.3.5.3.13">K.3.5.3.13 The vsprintf_s function</a></h5>
29360 <h6>Synopsis</h6>
29361 <p><!--para 1 -->
29362 <pre>
29363           #define __STDC_WANT_LIB_EXT1__ 1
29364           #include <a href="#7.16">&lt;stdarg.h&gt;</a>
29365           #include <a href="#7.21">&lt;stdio.h&gt;</a>
29366           int vsprintf_s(char * restrict s, rsize_t n,
29367                const char * restrict format,
29368                va_list arg);
29369 </pre>
29370  Runtime-constraints
29371 <p><!--para 2 -->
29372  Neither s nor format shall be a null pointer. n shall neither equal zero nor be greater
29373  than RSIZE_MAX. The number of characters (including the trailing null) required for the
29374  result to be written to the array pointed to by s shall not be greater than n. The %n
29375  specifier<sup><a href="#note389"><b>389)</b></a></sup> (modified or not by flags, field width, or precision) shall not appear in the
29376  string pointed to by format. Any argument to vsprintf_s corresponding to a %s
29377  specifier shall not be a null pointer. No encoding error shall occur.
29378 <p><!--para 3 -->
29379  If there is a runtime-constraint violation, then if s is not a null pointer and n is greater
29380  than zero and less than RSIZE_MAX, then the vsprintf_s function sets s[0] to the
29381  null character.
29382 <h6>Description</h6>
29383 <p><!--para 4 -->
29384  The vsprintf_s function is equivalent to the vsprintf function except for the
29385  parameter n and the explicit runtime-constraints listed above.
29386 <p><!--para 5 -->
29387  The vsprintf_s function, unlike vsnprintf_s, treats a result too big for the array
29388  pointed to by s as a runtime-constraint violation.
29389 <h6>Returns</h6>
29390 <p><!--para 6 -->
29391  If no runtime-constraint violation occurred, the vsprintf_s function returns the
29392  number of characters written in the array, not counting the terminating null character. If
29393  an encoding error occurred, vsprintf_s returns a negative value. If any other
29394  runtime-constraint violation occurred, vsprintf_s returns zero.
29395  
29396  
29397  
29398  
29399 <!--page 616 -->
29400
29401 <h6>footnotes</h6>
29402 <p><small><a name="note389" href="#note389">389)</a> It is not a runtime-constraint violation for the characters %n to appear in sequence in the string pointed
29403  at by format when those characters are not a interpreted as a %n specifier. For example, if the entire
29404  format string was %%n.
29405 </small>
29406
29407 <h5><a name="K.3.5.3.14" href="#K.3.5.3.14">K.3.5.3.14 The vsscanf_s function</a></h5>
29408 <h6>Synopsis</h6>
29409 <p><!--para 1 -->
29410 <pre>
29411         #define __STDC_WANT_LIB_EXT1__ 1
29412         #include <a href="#7.16">&lt;stdarg.h&gt;</a>
29413         #include <a href="#7.21">&lt;stdio.h&gt;</a>
29414         int vsscanf_s(const char * restrict s,
29415              const char * restrict format,
29416              va_list arg);
29417 </pre>
29418  Runtime-constraints
29419 <p><!--para 2 -->
29420  Neither s nor format shall be a null pointer. Any argument indirected though in order
29421  to store converted input shall not be a null pointer.
29422 <p><!--para 3 -->
29423  If there is a runtime-constraint violation, the vsscanf_s function does not attempt to
29424  perform further input, and it is unspecified to what extent vsscanf_s performed input
29425  before discovering the runtime-constraint violation.
29426 <h6>Description</h6>
29427 <p><!--para 4 -->
29428  The vsscanf_s function is equivalent to sscanf_s, with the variable argument list
29429  replaced by arg, which shall have been initialized by the va_start macro (and
29430  possibly subsequent va_arg calls). The vsscanf_s function does not invoke the
29431  va_end macro.<sup><a href="#note390"><b>390)</b></a></sup>
29432 <h6>Returns</h6>
29433 <p><!--para 5 -->
29434  The vsscanf_s function returns the value of the macro EOF if an input failure occurs
29435  before any conversion or if there is a runtime-constraint violation. Otherwise, the
29436  vscanf_s function returns the number of input items assigned, which can be fewer than
29437  provided for, or even zero, in the event of an early matching failure.
29438
29439 <h6>footnotes</h6>
29440 <p><small><a name="note390" href="#note390">390)</a> As the functions vfprintf_s, vfscanf_s, vprintf_s, vscanf_s, vsnprintf_s,
29441  vsprintf_s, and vsscanf_s invoke the va_arg macro, the value of arg after the return is
29442  indeterminate.
29443 </small>
29444
29445 <h5><a name="K.3.5.4" href="#K.3.5.4">K.3.5.4 Character input/output functions</a></h5>
29446
29447 <h5><a name="K.3.5.4.1" href="#K.3.5.4.1">K.3.5.4.1 The gets_s function</a></h5>
29448 <h6>Synopsis</h6>
29449 <p><!--para 1 -->
29450 <pre>
29451         #define __STDC_WANT_LIB_EXT1__ 1
29452         #include <a href="#7.21">&lt;stdio.h&gt;</a>
29453         char *gets_s(char *s, rsize_t n);
29454 </pre>
29455  
29456  
29457  
29458  
29459 <!--page 617 -->
29460  Runtime-constraints
29461 <p><!--para 2 -->
29462  s shall not be a null pointer. n shall neither be equal to zero nor be greater than
29463  RSIZE_MAX. A new-line character, end-of-file, or read error shall occur within reading
29464  n-1 characters from stdin.<sup><a href="#note391"><b>391)</b></a></sup>
29465 <p><!--para 3 -->
29466  If there is a runtime-constraint violation, s[0] is set to the null character, and characters
29467  are read and discarded from stdin until a new-line character is read, or end-of-file or a
29468  read error occurs.
29469 <h6>Description</h6>
29470 <p><!--para 4 -->
29471  The gets_s function reads at most one less than the number of characters specified by n
29472  from the stream pointed to by stdin, into the array pointed to by s. No additional
29473  characters are read after a new-line character (which is discarded) or after end-of-file.
29474  The discarded new-line character does not count towards number of characters read. A
29475  null character is written immediately after the last character read into the array.
29476 <p><!--para 5 -->
29477  If end-of-file is encountered and no characters have been read into the array, or if a read
29478  error occurs during the operation, then s[0] is set to the null character, and the other
29479  elements of s take unspecified values.
29480 <h6>Recommended practice</h6>
29481 <p><!--para 6 -->
29482  The fgets function allows properly-written programs to safely process input lines too
29483  long to store in the result array. In general this requires that callers of fgets pay
29484  attention to the presence or absence of a new-line character in the result array. Consider
29485  using fgets (along with any needed processing based on new-line characters) instead of
29486  gets_s.
29487 <h6>Returns</h6>
29488 <p><!--para 7 -->
29489  The gets_s function returns s if successful. If there was a runtime-constraint violation,
29490  or if end-of-file is encountered and no characters have been read into the array, or if a
29491  read error occurs during the operation, then a null pointer is returned.
29492  
29493  
29494  
29495  
29496 <!--page 618 -->
29497
29498 <h6>footnotes</h6>
29499 <p><small><a name="note391" href="#note391">391)</a> The gets_s function, unlike the historical gets function, makes it a runtime-constraint violation for
29500  a line of input to overflow the buffer to store it. Unlike the fgets function, gets_s maintains a
29501  one-to-one relationship between input lines and successful calls to gets_s. Programs that use gets
29502  expect such a relationship.
29503 </small>
29504
29505 <h4><a name="K.3.6" href="#K.3.6">K.3.6 General utilities <stdlib.h></a></h4>
29506 <p><!--para 1 -->
29507  The header <a href="#7.22">&lt;stdlib.h&gt;</a> defines three types.
29508 <p><!--para 2 -->
29509  The types are
29510 <pre>
29511          errno_t
29512 </pre>
29513  which is type int; and
29514 <pre>
29515          rsize_t
29516 </pre>
29517  which is the type size_t; and
29518 <pre>
29519          constraint_handler_t
29520 </pre>
29521  which has the following definition
29522 <pre>
29523          typedef void (*constraint_handler_t)(
29524               const char * restrict msg,
29525               void * restrict ptr,
29526               errno_t error);
29527 </pre>
29528
29529 <h5><a name="K.3.6.1" href="#K.3.6.1">K.3.6.1 Runtime-constraint handling</a></h5>
29530
29531 <h5><a name="K.3.6.1.1" href="#K.3.6.1.1">K.3.6.1.1 The set_constraint_handler_s function</a></h5>
29532 <h6>Synopsis</h6>
29533 <p><!--para 1 -->
29534 <pre>
29535          #define __STDC_WANT_LIB_EXT1__ 1
29536          #include <a href="#7.22">&lt;stdlib.h&gt;</a>
29537          constraint_handler_t set_constraint_handler_s(
29538               constraint_handler_t handler);
29539 </pre>
29540 <h6>Description</h6>
29541 <p><!--para 2 -->
29542  The set_constraint_handler_s function sets the runtime-constraint handler to
29543  be handler. The runtime-constraint handler is the function to be called when a library
29544  function detects a runtime-constraint violation. Only the most recent handler registered
29545  with set_constraint_handler_s is called when a runtime-constraint violation
29546  occurs.
29547 <p><!--para 3 -->
29548  When the handler is called, it is passed the following arguments in the following order:
29549 <ol>
29550 <li>  A pointer to a character string describing the runtime-constraint violation.
29551 <li>  A null pointer or a pointer to an implementation defined object.
29552 <li>  If the function calling the handler has a return type declared as errno_t, the
29553  return value of the function is passed. Otherwise, a positive value of type
29554  errno_t is passed.
29555 <!--page 619 -->
29556 </ol>
29557 <p><!--para 4 -->
29558  The implementation has a default constraint handler that is used if no calls to the
29559  set_constraint_handler_s function have been made. The behavior of the
29560  default handler is implementation-defined, and it may cause the program to exit or abort.
29561 <p><!--para 5 -->
29562  If the handler argument to set_constraint_handler_s is a null pointer, the
29563  implementation default handler becomes the current constraint handler.
29564 <h6>Returns</h6>
29565 <p><!--para 6 -->
29566  The set_constraint_handler_s function returns a pointer to the previously
29567  registered handler.<sup><a href="#note392"><b>392)</b></a></sup>
29568
29569 <h6>footnotes</h6>
29570 <p><small><a name="note392" href="#note392">392)</a> If the previous handler was registered by calling set_constraint_handler_s with a null
29571  pointer argument, a pointer to the implementation default handler is returned (not NULL).
29572 </small>
29573
29574 <h5><a name="K.3.6.1.2" href="#K.3.6.1.2">K.3.6.1.2 The abort_handler_s function</a></h5>
29575 <h6>Synopsis</h6>
29576 <p><!--para 1 -->
29577 <pre>
29578          #define __STDC_WANT_LIB_EXT1__ 1
29579          #include <a href="#7.22">&lt;stdlib.h&gt;</a>
29580          void abort_handler_s(
29581               const char * restrict msg,
29582               void * restrict ptr,
29583               errno_t error);
29584 </pre>
29585 <h6>Description</h6>
29586 <p><!--para 2 -->
29587  A pointer to the abort_handler_s function shall be a suitable argument to the
29588  set_constraint_handler_s function.
29589 <p><!--para 3 -->
29590  The abort_handler_s function writes a message on the standard error stream in an
29591  implementation-defined format. The message shall include the string pointed to by msg.
29592  The abort_handler_s function then calls the abort function.<sup><a href="#note393"><b>393)</b></a></sup>
29593 <h6>Returns</h6>
29594 <p><!--para 4 -->
29595  The abort_handler_s function does not return to its caller.
29596  
29597  
29598  
29599  
29600 <!--page 620 -->
29601
29602 <h6>footnotes</h6>
29603 <p><small><a name="note393" href="#note393">393)</a> Many implementations invoke a debugger when the abort function is called.
29604 </small>
29605
29606 <h5><a name="K.3.6.1.3" href="#K.3.6.1.3">K.3.6.1.3 The ignore_handler_s function</a></h5>
29607 <h6>Synopsis</h6>
29608 <p><!--para 1 -->
29609 <pre>
29610          #define __STDC_WANT_LIB_EXT1__ 1
29611          #include <a href="#7.22">&lt;stdlib.h&gt;</a>
29612          void ignore_handler_s(
29613               const char * restrict msg,
29614               void * restrict ptr,
29615               errno_t error);
29616 </pre>
29617 <h6>Description</h6>
29618 <p><!--para 2 -->
29619  A pointer to the ignore_handler_s function shall be a suitable argument to the
29620  set_constraint_handler_s function.
29621 <p><!--para 3 -->
29622  The ignore_handler_s function simply returns to its caller.<sup><a href="#note394"><b>394)</b></a></sup>
29623 <h6>Returns</h6>
29624 <p><!--para 4 -->
29625  The ignore_handler_s function returns no value.
29626
29627 <h6>footnotes</h6>
29628 <p><small><a name="note394" href="#note394">394)</a> If the runtime-constraint handler is set to the ignore_handler_s function, any library function in
29629  which a runtime-constraint violation occurs will return to its caller. The caller can determine whether
29630  a runtime-constraint violation occurred based on the library function's specification (usually, the
29631  library function returns a nonzero errno_t).
29632 </small>
29633
29634 <h5><a name="K.3.6.2" href="#K.3.6.2">K.3.6.2 Communication with the environment</a></h5>
29635
29636 <h5><a name="K.3.6.2.1" href="#K.3.6.2.1">K.3.6.2.1 The getenv_s function</a></h5>
29637 <h6>Synopsis</h6>
29638 <p><!--para 1 -->
29639 <pre>
29640          #define __STDC_WANT_LIB_EXT1__ 1
29641          #include <a href="#7.22">&lt;stdlib.h&gt;</a>
29642          errno_t getenv_s(size_t * restrict len,
29643                     char * restrict value, rsize_t maxsize,
29644                     const char * restrict name);
29645 </pre>
29646  Runtime-constraints
29647 <p><!--para 2 -->
29648  name shall not be a null pointer. maxsize shall neither equal zero nor be greater than
29649  RSIZE_MAX. If maxsize is not equal to zero, then value shall not be a null pointer.
29650 <p><!--para 3 -->
29651  If there is a runtime-constraint violation, the integer pointed to by len is set to 0 (if len
29652  is not null), and the environment list is not searched.
29653 <h6>Description</h6>
29654 <p><!--para 4 -->
29655  The getenv_s function searches an environment list, provided by the host environment,
29656  for a string that matches the string pointed to by name.
29657  
29658  
29659 <!--page 621 -->
29660 <p><!--para 5 -->
29661  If that name is found then getenv_s performs the following actions. If len is not a
29662  null pointer, the length of the string associated with the matched list member is stored in
29663  the integer pointed to by len. If the length of the associated string is less than maxsize,
29664  then the associated string is copied to the array pointed to by value.
29665 <p><!--para 6 -->
29666  If that name is not found then getenv_s performs the following actions. If len is not
29667  a null pointer, zero is stored in the integer pointed to by len. If maxsize is greater than
29668  zero, then value[0] is set to the null character.
29669 <p><!--para 7 -->
29670  The set of environment names and the method for altering the environment list are
29671  implementation-defined.
29672 <h6>Returns</h6>
29673 <p><!--para 8 -->
29674  The getenv_s function returns zero if the specified name is found and the associated
29675  string was successfully stored in value. Otherwise, a nonzero value is returned.
29676
29677 <h5><a name="K.3.6.3" href="#K.3.6.3">K.3.6.3 Searching and sorting utilities</a></h5>
29678 <p><!--para 1 -->
29679  These utilities make use of a comparison function to search or sort arrays of unspecified
29680  type. Where an argument declared as size_t nmemb specifies the length of the array
29681  for a function, if nmemb has the value zero on a call to that function, then the comparison
29682  function is not called, a search finds no matching element, sorting performs no
29683  rearrangement, and the pointer to the array may be null.
29684 <p><!--para 2 -->
29685  The implementation shall ensure that the second argument of the comparison function
29686  (when called from bsearch_s), or both arguments (when called from qsort_s), are
29687  pointers to elements of the array.<sup><a href="#note395"><b>395)</b></a></sup> The first argument when called from bsearch_s
29688  shall equal key.
29689 <p><!--para 3 -->
29690  The comparison function shall not alter the contents of either the array or search key. The
29691  implementation may reorder elements of the array between calls to the comparison
29692  function, but shall not otherwise alter the contents of any individual element.
29693 <p><!--para 4 -->
29694  When the same objects (consisting of size bytes, irrespective of their current positions
29695  in the array) are passed more than once to the comparison function, the results shall be
29696  consistent with one another. That is, for qsort_s they shall define a total ordering on
29697  the array, and for bsearch_s the same object shall always compare the same way with
29698  the key.
29699  
29700  
29701  
29702  
29703 <!--page 622 -->
29704 <p><!--para 5 -->
29705  A sequence point occurs immediately before and immediately after each call to the
29706  comparison function, and also between any call to the comparison function and any
29707  movement of the objects passed as arguments to that call.
29708
29709 <h6>footnotes</h6>
29710 <p><small><a name="note395" href="#note395">395)</a> That is, if the value passed is p, then the following expressions are always valid and nonzero:
29711
29712 <pre>
29713           ((char *)p - (char *)base) % size == 0
29714           (char *)p &gt;= (char *)base
29715           (char *)p &lt; (char *)base + nmemb * size
29716 </pre>
29717 </small>
29718
29719 <h5><a name="K.3.6.3.1" href="#K.3.6.3.1">K.3.6.3.1 The bsearch_s function</a></h5>
29720 <h6>Synopsis</h6>
29721 <p><!--para 1 -->
29722 <pre>
29723           #define __STDC_WANT_LIB_EXT1__ 1
29724           #include <a href="#7.22">&lt;stdlib.h&gt;</a>
29725           void *bsearch_s(const void *key, const void *base,
29726                rsize_t nmemb, rsize_t size,
29727                int (*compar)(const void *k, const void *y,
29728                                void *context),
29729                void *context);
29730 </pre>
29731  Runtime-constraints
29732 <p><!--para 2 -->
29733  Neither nmemb nor size shall be greater than RSIZE_MAX. If nmemb is not equal to
29734  zero, then none of key, base, or compar shall be a null pointer.
29735 <p><!--para 3 -->
29736  If there is a runtime-constraint violation, the bsearch_s function does not search the
29737  array.
29738 <h6>Description</h6>
29739 <p><!--para 4 -->
29740  The bsearch_s function searches an array of nmemb objects, the initial element of
29741  which is pointed to by base, for an element that matches the object pointed to by key.
29742  The size of each element of the array is specified by size.
29743 <p><!--para 5 -->
29744  The comparison function pointed to by compar is called with three arguments. The first
29745  two point to the key object and to an array element, in that order. The function shall
29746  return an integer less than, equal to, or greater than zero if the key object is considered,
29747  respectively, to be less than, to match, or to be greater than the array element. The array
29748  shall consist of: all the elements that compare less than, all the elements that compare
29749  equal to, and all the elements that compare greater than the key object, in that order.<sup><a href="#note396"><b>396)</b></a></sup>
29750  The third argument to the comparison function is the context argument passed to
29751  bsearch_s. The sole use of context by bsearch_s is to pass it to the comparison
29752  function.<sup><a href="#note397"><b>397)</b></a></sup>
29753  
29754  
29755  
29756  
29757 <!--page 623 -->
29758 <h6>Returns</h6>
29759 <p><!--para 6 -->
29760  The bsearch_s function returns a pointer to a matching element of the array, or a null
29761  pointer if no match is found or there is a runtime-constraint violation. If two elements
29762  compare as equal, which element is matched is unspecified.
29763
29764 <h6>footnotes</h6>
29765 <p><small><a name="note396" href="#note396">396)</a> In practice, this means that the entire array has been sorted according to the comparison function.
29766 </small>
29767 <p><small><a name="note397" href="#note397">397)</a> The context argument is for the use of the comparison function in performing its duties. For
29768  example, it might specify a collating sequence used by the comparison function.
29769 </small>
29770
29771 <h5><a name="K.3.6.3.2" href="#K.3.6.3.2">K.3.6.3.2 The qsort_s function</a></h5>
29772 <h6>Synopsis</h6>
29773 <p><!--para 1 -->
29774 <pre>
29775          #define __STDC_WANT_LIB_EXT1__ 1
29776          #include <a href="#7.22">&lt;stdlib.h&gt;</a>
29777          errno_t qsort_s(void *base, rsize_t nmemb, rsize_t size,
29778               int (*compar)(const void *x, const void *y,
29779                               void *context),
29780               void *context);
29781 </pre>
29782  Runtime-constraints
29783 <p><!--para 2 -->
29784  Neither nmemb nor size shall be greater than RSIZE_MAX. If nmemb is not equal to
29785  zero, then neither base nor compar shall be a null pointer.
29786 <p><!--para 3 -->
29787  If there is a runtime-constraint violation, the qsort_s function does not sort the array.
29788 <h6>Description</h6>
29789 <p><!--para 4 -->
29790  The qsort_s function sorts an array of nmemb objects, the initial element of which is
29791  pointed to by base. The size of each object is specified by size.
29792 <p><!--para 5 -->
29793  The contents of the array are sorted into ascending order according to a comparison
29794  function pointed to by compar, which is called with three arguments. The first two
29795  point to the objects being compared. The function shall return an integer less than, equal
29796  to, or greater than zero if the first argument is considered to be respectively less than,
29797  equal to, or greater than the second. The third argument to the comparison function is the
29798  context argument passed to qsort_s. The sole use of context by qsort_s is to
29799  pass it to the comparison function.<sup><a href="#note398"><b>398)</b></a></sup>
29800 <p><!--para 6 -->
29801  If two elements compare as equal, their relative order in the resulting sorted array is
29802  unspecified.
29803 <h6>Returns</h6>
29804 <p><!--para 7 -->
29805  The qsort_s function returns zero if there was no runtime-constraint violation.
29806  Otherwise, a nonzero value is returned.
29807  
29808  
29809  
29810  
29811 <!--page 624 -->
29812
29813 <h6>footnotes</h6>
29814 <p><small><a name="note398" href="#note398">398)</a> The context argument is for the use of the comparison function in performing its duties. For
29815  example, it might specify a collating sequence used by the comparison function.
29816 </small>
29817
29818 <h5><a name="K.3.6.4" href="#K.3.6.4">K.3.6.4 Multibyte/wide character conversion functions</a></h5>
29819 <p><!--para 1 -->
29820  The behavior of the multibyte character functions is affected by the LC_CTYPE category
29821  of the current locale. For a state-dependent encoding, each function is placed into its
29822  initial conversion state by a call for which its character pointer argument, s, is a null
29823  pointer. Subsequent calls with s as other than a null pointer cause the internal conversion
29824  state of the function to be altered as necessary. A call with s as a null pointer causes
29825  these functions to set the int pointed to by their status argument to a nonzero value if
29826  encodings have state dependency, and zero otherwise.<sup><a href="#note399"><b>399)</b></a></sup> Changing the LC_CTYPE
29827  category causes the conversion state of these functions to be indeterminate.
29828
29829 <h6>footnotes</h6>
29830 <p><small><a name="note399" href="#note399">399)</a> If the locale employs special bytes to change the shift state, these bytes do not produce separate wide
29831  character codes, but are grouped with an adjacent multibyte character.
29832 </small>
29833
29834 <h5><a name="K.3.6.4.1" href="#K.3.6.4.1">K.3.6.4.1 The wctomb_s function</a></h5>
29835 <h6>Synopsis</h6>
29836 <p><!--para 1 -->
29837 <pre>
29838          #define __STDC_WANT_LIB_EXT1__ 1
29839          #include <a href="#7.22">&lt;stdlib.h&gt;</a>
29840          errno_t wctomb_s(int * restrict status,
29841               char * restrict s,
29842               rsize_t smax,
29843               wchar_t wc);
29844 </pre>
29845  Runtime-constraints
29846 <p><!--para 2 -->
29847  Let n denote the number of bytes needed to represent the multibyte character
29848  corresponding to the wide character given by wc (including any shift sequences).
29849 <p><!--para 3 -->
29850  If s is not a null pointer, then smax shall not be less than n, and smax shall not be
29851  greater than RSIZE_MAX. If s is a null pointer, then smax shall equal zero.
29852 <p><!--para 4 -->
29853  If there is a runtime-constraint violation, wctomb_s does not modify the int pointed to
29854  by status, and if s is not a null pointer, no more than smax elements in the array
29855  pointed to by s will be accessed.
29856 <h6>Description</h6>
29857 <p><!--para 5 -->
29858  The wctomb_s function determines n and stores the multibyte character representation
29859  of wc in the array whose first element is pointed to by s (if s is not a null pointer). The
29860  number of characters stored never exceeds MB_CUR_MAX or smax. If wc is a null wide
29861  character, a null byte is stored, preceded by any shift sequence needed to restore the
29862  initial shift state, and the function is left in the initial conversion state.
29863 <p><!--para 6 -->
29864  The implementation shall behave as if no library function calls the wctomb_s function.
29865  
29866  
29867  
29868  
29869 <!--page 625 -->
29870 <p><!--para 7 -->
29871  If s is a null pointer, the wctomb_s function stores into the int pointed to by status a
29872  nonzero or zero value, if multibyte character encodings, respectively, do or do not have
29873  state-dependent encodings.
29874 <p><!--para 8 -->
29875  If s is not a null pointer, the wctomb_s function stores into the int pointed to by
29876  status either n or -1 if wc, respectively, does or does not correspond to a valid
29877  multibyte character.
29878 <p><!--para 9 -->
29879  In no case will the int pointed to by status be set to a value greater than the
29880  MB_CUR_MAX macro.
29881 <h6>Returns</h6>
29882 <p><!--para 10 -->
29883  The wctomb_s function returns zero if successful, and a nonzero value if there was a
29884  runtime-constraint violation or wc did not correspond to a valid multibyte character.
29885
29886 <h5><a name="K.3.6.5" href="#K.3.6.5">K.3.6.5 Multibyte/wide string conversion functions</a></h5>
29887 <p><!--para 1 -->
29888  The behavior of the multibyte string functions is affected by the LC_CTYPE category of
29889  the current locale.
29890
29891 <h5><a name="K.3.6.5.1" href="#K.3.6.5.1">K.3.6.5.1 The mbstowcs_s function</a></h5>
29892 <h6>Synopsis</h6>
29893 <p><!--para 1 -->
29894 <pre>
29895          #include <a href="#7.22">&lt;stdlib.h&gt;</a>
29896          errno_t mbstowcs_s(size_t * restrict retval,
29897               wchar_t * restrict dst, rsize_t dstmax,
29898               const char * restrict src, rsize_t len);
29899 </pre>
29900  Runtime-constraints
29901 <p><!--para 2 -->
29902  Neither retval nor src shall be a null pointer. If dst is not a null pointer, then
29903  neither len nor dstmax shall be greater than RSIZE_MAX. If dst is a null pointer,
29904  then dstmax shall equal zero. If dst is not a null pointer, then dstmax shall not equal
29905  zero. If dst is not a null pointer and len is not less than dstmax, then a null character
29906  shall occur within the first dstmax multibyte characters of the array pointed to by src.
29907 <p><!--para 3 -->
29908  If there is a runtime-constraint violation, then mbstowcs_s does the following. If
29909  retval is not a null pointer, then mbstowcs_s sets *retval to (size_t)(-1). If
29910  dst is not a null pointer and dstmax is greater than zero and less than RSIZE_MAX,
29911  then mbstowcs_s sets dst[0] to the null wide character.
29912 <h6>Description</h6>
29913 <p><!--para 4 -->
29914  The mbstowcs_s function converts a sequence of multibyte characters that begins in
29915  the initial shift state from the array pointed to by src into a sequence of corresponding
29916  wide characters. If dst is not a null pointer, the converted characters are stored into the
29917  array pointed to by dst. Conversion continues up to and including a terminating null
29918  character, which is also stored. Conversion stops earlier in two cases: when a sequence of
29919 <!--page 626 -->
29920  bytes is encountered that does not form a valid multibyte character, or (if dst is not a
29921  null pointer) when len wide characters have been stored into the array pointed to by
29922  dst.<sup><a href="#note400"><b>400)</b></a></sup> If dst is not a null pointer and no null wide character was stored into the array
29923  pointed to by dst, then dst[len] is set to the null wide character. Each conversion
29924  takes place as if by a call to the mbrtowc function.
29925 <p><!--para 5 -->
29926  Regardless of whether dst is or is not a null pointer, if the input conversion encounters a
29927  sequence of bytes that do not form a valid multibyte character, an encoding error occurs:
29928  the mbstowcs_s function stores the value (size_t)(-1) into *retval.
29929  Otherwise, the mbstowcs_s function stores into *retval the number of multibyte
29930  characters successfully converted, not including the terminating null character (if any).
29931 <p><!--para 6 -->
29932  All elements following the terminating null wide character (if any) written by
29933  mbstowcs_s in the array of dstmax wide characters pointed to by dst take
29934  unspecified values when mbstowcs_s returns.<sup><a href="#note401"><b>401)</b></a></sup>
29935 <p><!--para 7 -->
29936  If copying takes place between objects that overlap, the objects take on unspecified
29937  values.
29938 <h6>Returns</h6>
29939 <p><!--para 8 -->
29940  The mbstowcs_s function returns zero if no runtime-constraint violation and no
29941  encoding error occurred. Otherwise, a nonzero value is returned.
29942
29943 <h6>footnotes</h6>
29944 <p><small><a name="note400" href="#note400">400)</a> Thus, the value of len is ignored if dst is a null pointer.
29945 </small>
29946 <p><small><a name="note401" href="#note401">401)</a> This allows an implementation to attempt converting the multibyte string before discovering a
29947  terminating null character did not occur where required.
29948 </small>
29949
29950 <h5><a name="K.3.6.5.2" href="#K.3.6.5.2">K.3.6.5.2 The wcstombs_s function</a></h5>
29951 <h6>Synopsis</h6>
29952 <p><!--para 1 -->
29953 <pre>
29954           #include <a href="#7.22">&lt;stdlib.h&gt;</a>
29955           errno_t wcstombs_s(size_t * restrict retval,
29956                char * restrict dst, rsize_t dstmax,
29957                const wchar_t * restrict src, rsize_t len);
29958 </pre>
29959  Runtime-constraints
29960 <p><!--para 2 -->
29961  Neither retval nor src shall be a null pointer. If dst is not a null pointer, then
29962  neither len nor dstmax shall be greater than RSIZE_MAX. If dst is a null pointer,
29963  then dstmax shall equal zero. If dst is not a null pointer, then dstmax shall not equal
29964  zero. If dst is not a null pointer and len is not less than dstmax, then the conversion
29965  shall have been stopped (see below) because a terminating null wide character was
29966  reached or because an encoding error occurred.
29967  
29968  
29969  
29970  
29971 <!--page 627 -->
29972 <p><!--para 3 -->
29973  If there is a runtime-constraint violation, then wcstombs_s does the following. If
29974  retval is not a null pointer, then wcstombs_s sets *retval to (size_t)(-1). If
29975  dst is not a null pointer and dstmax is greater than zero and less than RSIZE_MAX,
29976  then wcstombs_s sets dst[0] to the null character.
29977 <h6>Description</h6>
29978 <p><!--para 4 -->
29979  The wcstombs_s function converts a sequence of wide characters from the array
29980  pointed to by src into a sequence of corresponding multibyte characters that begins in
29981  the initial shift state. If dst is not a null pointer, the converted characters are then stored
29982  into the array pointed to by dst. Conversion continues up to and including a terminating
29983  null wide character, which is also stored. Conversion stops earlier in two cases:
29984 <ul>
29985 <li>  when a wide character is reached that does not correspond to a valid multibyte
29986  character;
29987 <li>  (if dst is not a null pointer) when the next multibyte character would exceed the
29988    limit of n total bytes to be stored into the array pointed to by dst. If the wide
29989    character being converted is the null wide character, then n is the lesser of len or
29990    dstmax. Otherwise, n is the lesser of len or dstmax-1.
29991 </ul>
29992  If the conversion stops without converting a null wide character and dst is not a null
29993  pointer, then a null character is stored into the array pointed to by dst immediately
29994  following any multibyte characters already stored. Each conversion takes place as if by a
29995  call to the wcrtomb function.<sup><a href="#note402"><b>402)</b></a></sup>
29996 <p><!--para 5 -->
29997  Regardless of whether dst is or is not a null pointer, if the input conversion encounters a
29998  wide character that does not correspond to a valid multibyte character, an encoding error
29999  occurs: the wcstombs_s function stores the value (size_t)(-1) into *retval.
30000  Otherwise, the wcstombs_s function stores into *retval the number of bytes in the
30001  resulting multibyte character sequence, not including the terminating null character (if
30002  any).
30003 <p><!--para 6 -->
30004  All elements following the terminating null character (if any) written by wcstombs_s
30005  in the array of dstmax elements pointed to by dst take unspecified values when
30006  wcstombs_s returns.<sup><a href="#note403"><b>403)</b></a></sup>
30007 <p><!--para 7 -->
30008  If copying takes place between objects that overlap, the objects take on unspecified
30009  values.
30010  
30011  
30012 <!--page 628 -->
30013 <h6>Returns</h6>
30014 <p><!--para 8 -->
30015  The wcstombs_s function returns zero if no runtime-constraint violation and no
30016  encoding error occurred. Otherwise, a nonzero value is returned.
30017
30018 <h6>footnotes</h6>
30019 <p><small><a name="note402" href="#note402">402)</a> If conversion stops because a terminating null wide character has been reached, the bytes stored
30020  include those necessary to reach the initial shift state immediately before the null byte. However, if
30021  the conversion stops before a terminating null wide character has been reached, the result will be null
30022  terminated, but might not end in the initial shift state.
30023 </small>
30024 <p><small><a name="note403" href="#note403">403)</a> When len is not less than dstmax, the implementation might fill the array before discovering a
30025  runtime-constraint violation.
30026 </small>
30027
30028 <h4><a name="K.3.7" href="#K.3.7">K.3.7 String handling <string.h></a></h4>
30029 <p><!--para 1 -->
30030  The header <a href="#7.23">&lt;string.h&gt;</a> defines two types.
30031 <p><!--para 2 -->
30032  The types are
30033 <pre>
30034         errno_t
30035 </pre>
30036  which is type int; and
30037 <pre>
30038         rsize_t
30039 </pre>
30040  which is the type size_t.
30041
30042 <h5><a name="K.3.7.1" href="#K.3.7.1">K.3.7.1 Copying functions</a></h5>
30043
30044 <h5><a name="K.3.7.1.1" href="#K.3.7.1.1">K.3.7.1.1 The memcpy_s function</a></h5>
30045 <h6>Synopsis</h6>
30046 <p><!--para 1 -->
30047 <pre>
30048         #define __STDC_WANT_LIB_EXT1__ 1
30049         #include <a href="#7.23">&lt;string.h&gt;</a>
30050         errno_t memcpy_s(void * restrict s1, rsize_t s1max,
30051              const void * restrict s2, rsize_t n);
30052 </pre>
30053  Runtime-constraints
30054 <p><!--para 2 -->
30055  Neither s1 nor s2 shall be a null pointer. Neither s1max nor n shall be greater than
30056  RSIZE_MAX. n shall not be greater than s1max. Copying shall not take place between
30057  objects that overlap.
30058 <p><!--para 3 -->
30059  If there is a runtime-constraint violation, the memcpy_s function stores zeros in the first
30060  s1max characters of the object pointed to by s1 if s1 is not a null pointer and s1max is
30061  not greater than RSIZE_MAX.
30062 <h6>Description</h6>
30063 <p><!--para 4 -->
30064  The memcpy_s function copies n characters from the object pointed to by s2 into the
30065  object pointed to by s1.
30066 <h6>Returns</h6>
30067 <p><!--para 5 -->
30068  The memcpy_s function returns zero if there was no runtime-constraint violation.
30069  Otherwise, a nonzero value is returned.
30070 <!--page 629 -->
30071
30072 <h5><a name="K.3.7.1.2" href="#K.3.7.1.2">K.3.7.1.2 The memmove_s function</a></h5>
30073 <h6>Synopsis</h6>
30074 <p><!--para 1 -->
30075 <pre>
30076          #define __STDC_WANT_LIB_EXT1__ 1
30077          #include <a href="#7.23">&lt;string.h&gt;</a>
30078          errno_t memmove_s(void *s1, rsize_t s1max,
30079               const void *s2, rsize_t n);
30080 </pre>
30081  Runtime-constraints
30082 <p><!--para 2 -->
30083  Neither s1 nor s2 shall be a null pointer. Neither s1max nor n shall be greater than
30084  RSIZE_MAX. n shall not be greater than s1max.
30085 <p><!--para 3 -->
30086  If there is a runtime-constraint violation, the memmove_s function stores zeros in the
30087  first s1max characters of the object pointed to by s1 if s1 is not a null pointer and
30088  s1max is not greater than RSIZE_MAX.
30089 <h6>Description</h6>
30090 <p><!--para 4 -->
30091  The memmove_s function copies n characters from the object pointed to by s2 into the
30092  object pointed to by s1. This copying takes place as if the n characters from the object
30093  pointed to by s2 are first copied into a temporary array of n characters that does not
30094  overlap the objects pointed to by s1 or s2, and then the n characters from the temporary
30095  array are copied into the object pointed to by s1.
30096 <h6>Returns</h6>
30097 <p><!--para 5 -->
30098  The memmove_s function returns zero if there was no runtime-constraint violation.
30099  Otherwise, a nonzero value is returned.
30100
30101 <h5><a name="K.3.7.1.3" href="#K.3.7.1.3">K.3.7.1.3 The strcpy_s function</a></h5>
30102 <h6>Synopsis</h6>
30103 <p><!--para 1 -->
30104 <pre>
30105          #define __STDC_WANT_LIB_EXT1__ 1
30106          #include <a href="#7.23">&lt;string.h&gt;</a>
30107          errno_t strcpy_s(char * restrict s1,
30108               rsize_t s1max,
30109               const char * restrict s2);
30110 </pre>
30111  Runtime-constraints
30112 <p><!--para 2 -->
30113  Neither s1 nor s2 shall be a null pointer. s1max shall not be greater than RSIZE_MAX.
30114  s1max shall not equal zero. s1max shall be greater than strnlen_s(s2, s1max).
30115  Copying shall not take place between objects that overlap.
30116 <p><!--para 3 -->
30117  If there is a runtime-constraint violation, then if s1 is not a null pointer and s1max is
30118  greater than zero and not greater than RSIZE_MAX, then strcpy_s sets s1[0] to the
30119  null character.
30120 <!--page 630 -->
30121 <h6>Description</h6>
30122 <p><!--para 4 -->
30123  The strcpy_s function copies the string pointed to by s2 (including the terminating
30124  null character) into the array pointed to by s1.
30125 <p><!--para 5 -->
30126  All elements following the terminating null character (if any) written by strcpy_s in
30127  the array of s1max characters pointed to by s1 take unspecified values when
30128  strcpy_s returns.<sup><a href="#note404"><b>404)</b></a></sup>
30129 <h6>Returns</h6>
30130 <p><!--para 6 -->
30131  The strcpy_s function returns zero<sup><a href="#note405"><b>405)</b></a></sup> if there was no runtime-constraint violation.
30132  Otherwise, a nonzero value is returned.
30133
30134 <h6>footnotes</h6>
30135 <p><small><a name="note404" href="#note404">404)</a> This allows an implementation to copy characters from s2 to s1 while simultaneously checking if
30136  any of those characters are null. Such an approach might write a character to every element of s1
30137  before discovering that the first element should be set to the null character.
30138 </small>
30139 <p><small><a name="note405" href="#note405">405)</a> A zero return value implies that all of the requested characters from the string pointed to by s2 fit
30140  within the array pointed to by s1 and that the result in s1 is null terminated.
30141 </small>
30142
30143 <h5><a name="K.3.7.1.4" href="#K.3.7.1.4">K.3.7.1.4 The strncpy_s function</a></h5>
30144 <h6>Synopsis</h6>
30145 <p><!--para 1 -->
30146 <pre>
30147          #define __STDC_WANT_LIB_EXT1__ 1
30148          #include <a href="#7.23">&lt;string.h&gt;</a>
30149          errno_t strncpy_s(char * restrict s1,
30150               rsize_t s1max,
30151               const char * restrict s2,
30152               rsize_t n);
30153 </pre>
30154  Runtime-constraints
30155 <p><!--para 2 -->
30156  Neither s1 nor s2 shall be a null pointer. Neither s1max nor n shall be greater than
30157  RSIZE_MAX. s1max shall not equal zero. If n is not less than s1max, then s1max
30158  shall be greater than strnlen_s(s2, s1max). Copying shall not take place between
30159  objects that overlap.
30160 <p><!--para 3 -->
30161  If there is a runtime-constraint violation, then if s1 is not a null pointer and s1max is
30162  greater than zero and not greater than RSIZE_MAX, then strncpy_s sets s1[0] to the
30163  null character.
30164 <h6>Description</h6>
30165 <p><!--para 4 -->
30166  The strncpy_s function copies not more than n successive characters (characters that
30167  follow a null character are not copied) from the array pointed to by s2 to the array
30168  pointed to by s1. If no null character was copied from s2, then s1[n] is set to a null
30169  character.
30170  
30171  
30172 <!--page 631 -->
30173 <p><!--para 5 -->
30174  All elements following the terminating null character (if any) written by strncpy_s in
30175  the array of s1max characters pointed to by s1 take unspecified values when
30176  strncpy_s returns.<sup><a href="#note406"><b>406)</b></a></sup>
30177 <h6>Returns</h6>
30178 <p><!--para 6 -->
30179  The strncpy_s function returns zero<sup><a href="#note407"><b>407)</b></a></sup> if there was no runtime-constraint violation.
30180  Otherwise, a nonzero value is returned.
30181 <p><!--para 7 -->
30182  EXAMPLE 1 The strncpy_s function can be used to copy a string without the danger that the result
30183  will not be null terminated or that characters will be written past the end of the destination array.
30184 <pre>
30185          #define __STDC_WANT_LIB_EXT1__ 1
30186          #include <a href="#7.23">&lt;string.h&gt;</a>
30187          /* ... */
30188          char src1[100] = "hello";
30189          char src2[7] = {'g', 'o', 'o', 'd', 'b', 'y', 'e'};
30190          char dst1[6], dst2[5], dst3[5];
30191          int r1, r2, r3;
30192          r1 = strncpy_s(dst1, 6, src1, 100);
30193          r2 = strncpy_s(dst2, 5, src2, 7);
30194          r3 = strncpy_s(dst3, 5, src2, 4);
30195 </pre>
30196  The first call will assign to r1 the value zero and to dst1 the sequence hello\0.
30197  The second call will assign to r2 a nonzero value and to dst2 the sequence \0.
30198  The third call will assign to r3 the value zero and to dst3 the sequence good\0.
30199  
30200
30201 <h6>footnotes</h6>
30202 <p><small><a name="note406" href="#note406">406)</a> This allows an implementation to copy characters from s2 to s1 while simultaneously checking if
30203  any of those characters are null. Such an approach might write a character to every element of s1
30204  before discovering that the first element should be set to the null character.
30205 </small>
30206 <p><small><a name="note407" href="#note407">407)</a> A zero return value implies that all of the requested characters from the string pointed to by s2 fit
30207  within the array pointed to by s1 and that the result in s1 is null terminated.
30208 </small>
30209
30210 <h5><a name="K.3.7.2" href="#K.3.7.2">K.3.7.2 Concatenation functions</a></h5>
30211
30212 <h5><a name="K.3.7.2.1" href="#K.3.7.2.1">K.3.7.2.1 The strcat_s function</a></h5>
30213 <h6>Synopsis</h6>
30214 <p><!--para 1 -->
30215 <pre>
30216          #define __STDC_WANT_LIB_EXT1__ 1
30217          #include <a href="#7.23">&lt;string.h&gt;</a>
30218          errno_t strcat_s(char * restrict s1,
30219               rsize_t s1max,
30220               const char * restrict s2);
30221 </pre>
30222  Runtime-constraints
30223 <p><!--para 2 -->
30224  Let m denote the value s1max - strnlen_s(s1, s1max) upon entry to
30225  strcat_s.
30226  
30227  
30228  
30229  
30230 <!--page 632 -->
30231 <p><!--para 3 -->
30232  Neither s1 nor s2 shall be a null pointer. s1max shall not be greater than RSIZE_MAX.
30233  s1max shall not equal zero. m shall not equal zero.<sup><a href="#note408"><b>408)</b></a></sup> m shall be greater than
30234  strnlen_s(s2, m). Copying shall not take place between objects that overlap.
30235 <p><!--para 4 -->
30236  If there is a runtime-constraint violation, then if s1 is not a null pointer and s1max is
30237  greater than zero and not greater than RSIZE_MAX, then strcat_s sets s1[0] to the
30238  null character.
30239 <h6>Description</h6>
30240 <p><!--para 5 -->
30241  The strcat_s function appends a copy of the string pointed to by s2 (including the
30242  terminating null character) to the end of the string pointed to by s1. The initial character
30243  from s2 overwrites the null character at the end of s1.
30244 <p><!--para 6 -->
30245  All elements following the terminating null character (if any) written by strcat_s in
30246  the array of s1max characters pointed to by s1 take unspecified values when
30247  strcat_s returns.<sup><a href="#note409"><b>409)</b></a></sup>
30248 <h6>Returns</h6>
30249 <p><!--para 7 -->
30250  The strcat_s function returns zero<sup><a href="#note410"><b>410)</b></a></sup> if there was no runtime-constraint violation.
30251  Otherwise, a nonzero value is returned.
30252
30253 <h6>footnotes</h6>
30254 <p><small><a name="note408" href="#note408">408)</a> Zero means that s1 was not null terminated upon entry to strcat_s.
30255 </small>
30256 <p><small><a name="note409" href="#note409">409)</a> This allows an implementation to append characters from s2 to s1 while simultaneously checking if
30257  any of those characters are null. Such an approach might write a character to every element of s1
30258  before discovering that the first element should be set to the null character.
30259 </small>
30260 <p><small><a name="note410" href="#note410">410)</a> A zero return value implies that all of the requested characters from the string pointed to by s2 were
30261  appended to the string pointed to by s1 and that the result in s1 is null terminated.
30262 </small>
30263
30264 <h5><a name="K.3.7.2.2" href="#K.3.7.2.2">K.3.7.2.2 The strncat_s function</a></h5>
30265 <h6>Synopsis</h6>
30266 <p><!--para 1 -->
30267 <pre>
30268          #define __STDC_WANT_LIB_EXT1__ 1
30269          #include <a href="#7.23">&lt;string.h&gt;</a>
30270          errno_t strncat_s(char * restrict s1,
30271               rsize_t s1max,
30272               const char * restrict s2,
30273               rsize_t n);
30274 </pre>
30275  Runtime-constraints
30276 <p><!--para 2 -->
30277  Let m denote the value s1max - strnlen_s(s1, s1max) upon entry to
30278  strncat_s.
30279 <p><!--para 3 -->
30280  Neither s1 nor s2 shall be a null pointer. Neither s1max nor n shall be greater than
30281  RSIZE_MAX. s1max shall not equal zero. m shall not equal zero.<sup><a href="#note411"><b>411)</b></a></sup> If n is not less
30282  
30283  
30284 <!--page 633 -->
30285  than m, then m shall be greater than strnlen_s(s2, m). Copying shall not take
30286  place between objects that overlap.
30287 <p><!--para 4 -->
30288  If there is a runtime-constraint violation, then if s1 is not a null pointer and s1max is
30289  greater than zero and not greater than RSIZE_MAX, then strncat_s sets s1[0] to the
30290  null character.
30291 <h6>Description</h6>
30292 <p><!--para 5 -->
30293  The strncat_s function appends not more than n successive characters (characters
30294  that follow a null character are not copied) from the array pointed to by s2 to the end of
30295  the string pointed to by s1. The initial character from s2 overwrites the null character at
30296  the end of s1. If no null character was copied from s2, then s1[s1max-m+n] is set to
30297  a null character.
30298 <p><!--para 6 -->
30299  All elements following the terminating null character (if any) written by strncat_s in
30300  the array of s1max characters pointed to by s1 take unspecified values when
30301  strncat_s returns.<sup><a href="#note412"><b>412)</b></a></sup>
30302 <h6>Returns</h6>
30303 <p><!--para 7 -->
30304  The strncat_s function returns zero<sup><a href="#note413"><b>413)</b></a></sup> if there was no runtime-constraint violation.
30305  Otherwise, a nonzero value is returned.
30306 <p><!--para 8 -->
30307  EXAMPLE 1 The strncat_s function can be used to copy a string without the danger that the result
30308  will not be null terminated or that characters will be written past the end of the destination array.
30309 <pre>
30310          #define __STDC_WANT_LIB_EXT1__ 1
30311          #include <a href="#7.23">&lt;string.h&gt;</a>
30312          /* ... */
30313          char s1[100] = "good";
30314          char s2[6] = "hello";
30315          char s3[6] = "hello";
30316          char s4[7] = "abc";
30317          char s5[1000] = "bye";
30318          int r1, r2, r3, r4;
30319          r1 = strncat_s(s1, 100, s5, 1000);
30320          r2 = strncat_s(s2, 6, "", 1);
30321          r3 = strncat_s(s3, 6, "X", 2);
30322          r4 = strncat_s(s4, 7, "defghijklmn", 3);
30323 </pre>
30324  After the first call r1 will have the value zero and s1 will contain the sequence goodbye\0.
30325  
30326  
30327  
30328 <!--page 634 -->
30329  After the second call r2 will have the value zero and s2 will contain the sequence hello\0.
30330  After the third call r3 will have a nonzero value and s3 will contain the sequence \0.
30331  After the fourth call r4 will have the value zero and s4 will contain the sequence abcdef\0.
30332  
30333
30334 <h6>footnotes</h6>
30335 <p><small><a name="note411" href="#note411">411)</a> Zero means that s1 was not null terminated upon entry to strncat_s.
30336 </small>
30337 <p><small><a name="note412" href="#note412">412)</a> This allows an implementation to append characters from s2 to s1 while simultaneously checking if
30338  any of those characters are null. Such an approach might write a character to every element of s1
30339  before discovering that the first element should be set to the null character.
30340 </small>
30341 <p><small><a name="note413" href="#note413">413)</a> A zero return value implies that all of the requested characters from the string pointed to by s2 were
30342  appended to the string pointed to by s1 and that the result in s1 is null terminated.
30343 </small>
30344
30345 <h5><a name="K.3.7.3" href="#K.3.7.3">K.3.7.3 Search functions</a></h5>
30346
30347 <h5><a name="K.3.7.3.1" href="#K.3.7.3.1">K.3.7.3.1 The strtok_s function</a></h5>
30348 <h6>Synopsis</h6>
30349 <p><!--para 1 -->
30350 <pre>
30351          #define __STDC_WANT_LIB_EXT1__ 1
30352          #include <a href="#7.23">&lt;string.h&gt;</a>
30353          char *strtok_s(char * restrict s1,
30354               rsize_t * restrict s1max,
30355               const char * restrict s2,
30356               char ** restrict ptr);
30357 </pre>
30358  Runtime-constraints
30359 <p><!--para 2 -->
30360  None of s1max, s2, or ptr shall be a null pointer. If s1 is a null pointer, then *ptr
30361  shall not be a null pointer. The value of *s1max shall not be greater than RSIZE_MAX.
30362  The end of the token found shall occur within the first *s1max characters of s1 for the
30363  first call, and shall occur within the first *s1max characters of where searching resumes
30364  on subsequent calls.
30365 <p><!--para 3 -->
30366  If there is a runtime-constraint violation, the strtok_s function does not indirect
30367  through the s1 or s2 pointers, and does not store a value in the object pointed to by ptr.
30368 <h6>Description</h6>
30369 <p><!--para 4 -->
30370  A sequence of calls to the strtok_s function breaks the string pointed to by s1 into a
30371  sequence of tokens, each of which is delimited by a character from the string pointed to
30372  by s2. The fourth argument points to a caller-provided char pointer into which the
30373  strtok_s function stores information necessary for it to continue scanning the same
30374  string.
30375 <p><!--para 5 -->
30376  The first call in a sequence has a non-null first argument and s1max points to an object
30377  whose value is the number of elements in the character array pointed to by the first
30378  argument. The first call stores an initial value in the object pointed to by ptr and
30379  updates the value pointed to by s1max to reflect the number of elements that remain in
30380  relation to ptr. Subsequent calls in the sequence have a null first argument and the
30381  objects pointed to by s1max and ptr are required to have the values stored by the
30382  previous call in the sequence, which are then updated. The separator string pointed to by
30383  s2 may be different from call to call.
30384 <p><!--para 6 -->
30385  The first call in the sequence searches the string pointed to by s1 for the first character
30386  that is not contained in the current separator string pointed to by s2. If no such character
30387  is found, then there are no tokens in the string pointed to by s1 and the strtok_s
30388  function returns a null pointer. If such a character is found, it is the start of the first token.
30389 <!--page 635 -->
30390 <p><!--para 7 -->
30391  The strtok_s function then searches from there for the first character in s1 that is
30392  contained in the current separator string. If no such character is found, the current token
30393  extends to the end of the string pointed to by s1, and subsequent searches in the same
30394  string for a token return a null pointer. If such a character is found, it is overwritten by a
30395  null character, which terminates the current token.
30396 <p><!--para 8 -->
30397  In all cases, the strtok_s function stores sufficient information in the pointer pointed
30398  to by ptr so that subsequent calls, with a null pointer for s1 and the unmodified pointer
30399  value for ptr, shall start searching just past the element overwritten by a null character
30400  (if any).
30401 <h6>Returns</h6>
30402 <p><!--para 9 -->
30403  The strtok_s function returns a pointer to the first character of a token, or a null
30404  pointer if there is no token or there is a runtime-constraint violation.
30405 <p><!--para 10 -->
30406  EXAMPLE
30407 <pre>
30408          #define __STDC_WANT_LIB_EXT1__ 1
30409          #include <a href="#7.23">&lt;string.h&gt;</a>
30410          static char str1[] = "?a???b,,,#c";
30411          static char str2[] = "\t \t";
30412          char *t, *ptr1, *ptr2;
30413          rsize_t max1 = sizeof(str1);
30414          rsize_t max2 = sizeof(str2);
30415          t   =   strtok_s(str1,   &amp;max1,   "?", &amp;ptr1);        //   t   points to the token "a"
30416          t   =   strtok_s(NULL,   &amp;max1,   ",", &amp;ptr1);        //   t   points to the token "??b"
30417          t   =   strtok_s(str2,   &amp;max2,   " \t", &amp;ptr2);      //   t   is a null pointer
30418          t   =   strtok_s(NULL,   &amp;max1,   "#,", &amp;ptr1);       //   t   points to the token "c"
30419          t   =   strtok_s(NULL,   &amp;max1,   "?", &amp;ptr1);        //   t   is a null pointer
30420 </pre>
30421  
30422
30423 <h5><a name="K.3.7.4" href="#K.3.7.4">K.3.7.4 Miscellaneous functions</a></h5>
30424
30425 <h5><a name="K.3.7.4.1" href="#K.3.7.4.1">K.3.7.4.1 The memset_s function</a></h5>
30426 <h6>Synopsis</h6>
30427 <p><!--para 1 -->
30428 <pre>
30429          #define __STDC_WANT_LIB_EXT1__ 1
30430          #include <a href="#7.23">&lt;string.h&gt;</a>
30431          errno_t memset_s(void *s, rsize_t smax, int c, rsize_t n)
30432 </pre>
30433  Runtime-constraints
30434 <p><!--para 2 -->
30435  s shall not be a null pointer. Neither smax nor n shall be greater than RSIZE_MAX. n
30436  shall not be greater than smax.
30437 <p><!--para 3 -->
30438  If there is a runtime-constraint violation, then if s is not a null pointer and smax is not
30439  greater than RSIZE_MAX, the memset_s function stores the value of c (converted to an
30440  unsigned char) into each of the first smax characters of the object pointed to by s.
30441 <!--page 636 -->
30442 <h6>Description</h6>
30443 <p><!--para 4 -->
30444  The memset_s function copies the value of c (converted to an unsigned char) into
30445  each of the first n characters of the object pointed to by s. Unlike memset, any call to
30446  the memset_s function shall be evaluated strictly according to the rules of the abstract
30447  machine as described in (<a href="#5.1.2.3">5.1.2.3</a>). That is, any call to the memset_s function shall
30448  assume that the memory indicated by s and n may be accessible in the future and thus
30449  must contain the values indicated by c.
30450 <h6>Returns</h6>
30451 <p><!--para 5 -->
30452  The memset_s function returns zero if there was no runtime-constraint violation.
30453  Otherwise, a nonzero value is returned.
30454
30455 <h5><a name="K.3.7.4.2" href="#K.3.7.4.2">K.3.7.4.2 The strerror_s function</a></h5>
30456 <h6>Synopsis</h6>
30457 <p><!--para 1 -->
30458 <pre>
30459         #define __STDC_WANT_LIB_EXT1__ 1
30460         #include <a href="#7.23">&lt;string.h&gt;</a>
30461         errno_t strerror_s(char *s, rsize_t maxsize,
30462              errno_t errnum);
30463 </pre>
30464  Runtime-constraints
30465 <p><!--para 2 -->
30466  s shall not be a null pointer. maxsize shall not be greater than RSIZE_MAX.
30467  maxsize shall not equal zero.
30468 <p><!--para 3 -->
30469  If there is a runtime-constraint violation, then the array (if any) pointed to by s is not
30470  modified.
30471 <h6>Description</h6>
30472 <p><!--para 4 -->
30473  The strerror_s function maps the number in errnum to a locale-specific message
30474  string. Typically, the values for errnum come from errno, but strerror_s shall
30475  map any value of type int to a message.
30476 <p><!--para 5 -->
30477  If the length of the desired string is less than maxsize, then the string is copied to the
30478  array pointed to by s.
30479 <p><!--para 6 -->
30480  Otherwise, if maxsize is greater than zero, then maxsize-1 characters are copied
30481  from the string to the array pointed to by s and then s[maxsize-1] is set to the null
30482  character. Then, if maxsize is greater than 3, then s[maxsize-2],
30483  s[maxsize-3], and s[maxsize-4] are set to the character period (.).
30484 <h6>Returns</h6>
30485 <p><!--para 7 -->
30486  The strerror_s function returns zero if the length of the desired string was less than
30487  maxsize and there was no runtime-constraint violation. Otherwise, the strerror_s
30488  function returns a nonzero value.
30489 <!--page 637 -->
30490
30491 <h5><a name="K.3.7.4.3" href="#K.3.7.4.3">K.3.7.4.3 The strerrorlen_s function</a></h5>
30492 <h6>Synopsis</h6>
30493 <p><!--para 1 -->
30494 <pre>
30495          #define __STDC_WANT_LIB_EXT1__ 1
30496          #include <a href="#7.23">&lt;string.h&gt;</a>
30497          size_t strerrorlen_s(errno_t errnum);
30498 </pre>
30499 <h6>Description</h6>
30500 <p><!--para 2 -->
30501  The strerrorlen_s function calculates the length of the (untruncated) locale-specific
30502  message string that the strerror_s function maps to errnum.
30503 <h6>Returns</h6>
30504 <p><!--para 3 -->
30505  The strerrorlen_s function returns the number of characters (not including the null
30506  character) in the full message string.
30507
30508 <h5><a name="K.3.7.4.4" href="#K.3.7.4.4">K.3.7.4.4 The strnlen_s function</a></h5>
30509 <h6>Synopsis</h6>
30510 <p><!--para 1 -->
30511 <pre>
30512          #define __STDC_WANT_LIB_EXT1__ 1
30513          #include <a href="#7.23">&lt;string.h&gt;</a>
30514          size_t strnlen_s(const char *s, size_t maxsize);
30515 </pre>
30516 <h6>Description</h6>
30517 <p><!--para 2 -->
30518  The strnlen_s function computes the length of the string pointed to by s.
30519 <h6>Returns</h6>
30520 <p><!--para 3 -->
30521  If s is a null pointer,<sup><a href="#note414"><b>414)</b></a></sup> then the strnlen_s function returns zero.
30522 <p><!--para 4 -->
30523  Otherwise, the strnlen_s function returns the number of characters that precede the
30524  terminating null character. If there is no null character in the first maxsize characters of
30525  s then strnlen_s returns maxsize. At most the first maxsize characters of s shall
30526  be accessed by strnlen_s.
30527  
30528  
30529  
30530  
30531 <!--page 638 -->
30532
30533 <h6>footnotes</h6>
30534 <p><small><a name="note414" href="#note414">414)</a> Note that the strnlen_s function has no runtime-constraints. This lack of runtime-constraints
30535  along with the values returned for a null pointer or an unterminated string argument make
30536  strnlen_s useful in algorithms that gracefully handle such exceptional data.
30537 </small>
30538
30539 <h4><a name="K.3.8" href="#K.3.8">K.3.8 Date and time <time.h></a></h4>
30540 <p><!--para 1 -->
30541  The header <a href="#7.26">&lt;time.h&gt;</a> defines two types.
30542 <p><!--para 2 -->
30543  The types are
30544 <pre>
30545          errno_t
30546 </pre>
30547  which is type int; and
30548 <pre>
30549          rsize_t
30550 </pre>
30551  which is the type size_t.
30552
30553 <h5><a name="K.3.8.1" href="#K.3.8.1">K.3.8.1 Components of time</a></h5>
30554 <p><!--para 1 -->
30555  A broken-down time is normalized if the values of the members of the tm structure are in
30556  their normal rages.<sup><a href="#note415"><b>415)</b></a></sup>
30557
30558 <h6>footnotes</h6>
30559 <p><small><a name="note415" href="#note415">415)</a> The normal ranges are defined in <a href="#7.26.1">7.26.1</a>.
30560 </small>
30561
30562 <h5><a name="K.3.8.2" href="#K.3.8.2">K.3.8.2 Time conversion functions</a></h5>
30563 <p><!--para 1 -->
30564  Like the strftime function, the asctime_s and ctime_s functions do not return a
30565  pointer to a static object, and other library functions are permitted to call them.
30566
30567 <h5><a name="K.3.8.2.1" href="#K.3.8.2.1">K.3.8.2.1 The asctime_s function</a></h5>
30568 <h6>Synopsis</h6>
30569 <p><!--para 1 -->
30570 <pre>
30571          #define __STDC_WANT_LIB_EXT1__ 1
30572          #include <a href="#7.26">&lt;time.h&gt;</a>
30573          errno_t asctime_s(char *s, rsize_t maxsize,
30574               const struct tm *timeptr);
30575 </pre>
30576  Runtime-constraints
30577 <p><!--para 2 -->
30578  Neither s nor timeptr shall be a null pointer. maxsize shall not be less than 26 and
30579  shall not be greater than RSIZE_MAX. The broken-down time pointed to by timeptr
30580  shall be normalized. The calendar year represented by the broken-down time pointed to
30581  by timeptr shall not be less than calendar year 0 and shall not be greater than calendar
30582  year 9999.
30583 <p><!--para 3 -->
30584  If there is a runtime-constraint violation, there is no attempt to convert the time, and
30585  s[0] is set to a null character if s is not a null pointer and maxsize is not zero and is
30586  not greater than RSIZE_MAX.
30587 <h6>Description</h6>
30588 <p><!--para 4 -->
30589  The asctime_s function converts the normalized broken-down time in the structure
30590  pointed to by timeptr into a 26 character (including the null character) string in the
30591  
30592  
30593 <!--page 639 -->
30594  form
30595 <pre>
30596          Sun Sep 16 01:03:52 1973\n\0
30597 </pre>
30598  The fields making up this string are (in order):
30599 <ol>
30600 <li>  The name of the day of the week represented by timeptr-&gt;tm_wday using the
30601  following three character weekday names: Sun, Mon, Tue, Wed, Thu, Fri, and Sat.
30602 <li>  The character space.
30603 <li>  The name of the month represented by timeptr-&gt;tm_mon using the following
30604  three character month names: Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct,
30605  Nov, and Dec.
30606 <li>  The character space.
30607 <li>  The value of timeptr-&gt;tm_mday as if printed using the fprintf format
30608  "%2d".
30609 <li>  The character space.
30610 <li>  The value of timeptr-&gt;tm_hour as if printed using the fprintf format
30611  "%.2d".
30612 <li>  The character colon.
30613 <li>  The value of timeptr-&gt;tm_min as if printed using the fprintf format
30614  "%.2d".
30615 <li>  The character colon.
30616 <li>  The value of timeptr-&gt;tm_sec as if printed using the fprintf format
30617  "%.2d".
30618 <li>  The character space.
30619 <li>  The value of timeptr-&gt;tm_year + 1900 as if printed using the fprintf
30620  format "%4d".
30621 <li>  The character new line.
30622 <li>  The null character.
30623 </ol>
30624 <h6>Recommended practice</h6>
30625  The strftime function allows more flexible formatting and supports locale-specific
30626  behavior. If you do not require the exact form of the result string produced by the
30627  asctime_s function, consider using the strftime function instead.
30628 <h6>Returns</h6>
30629 <p><!--para 5 -->
30630  The asctime_s function returns zero if the time was successfully converted and stored
30631  into the array pointed to by s. Otherwise, it returns a nonzero value.
30632 <!--page 640 -->
30633
30634 <h5><a name="K.3.8.2.2" href="#K.3.8.2.2">K.3.8.2.2 The ctime_s function</a></h5>
30635 <h6>Synopsis</h6>
30636 <p><!--para 1 -->
30637 <pre>
30638         #define __STDC_WANT_LIB_EXT1__ 1
30639         #include <a href="#7.26">&lt;time.h&gt;</a>
30640         errno_t ctime_s(char *s, rsize_t maxsize,
30641              const time_t *timer);
30642 </pre>
30643  Runtime-constraints
30644 <p><!--para 2 -->
30645  Neither s nor timer shall be a null pointer. maxsize shall not be less than 26 and
30646  shall not be greater than RSIZE_MAX.
30647 <p><!--para 3 -->
30648  If there is a runtime-constraint violation, s[0] is set to a null character if s is not a null
30649  pointer and maxsize is not equal zero and is not greater than RSIZE_MAX.
30650 <h6>Description</h6>
30651 <p><!--para 4 -->
30652  The ctime_s function converts the calendar time pointed to by timer to local time in
30653  the form of a string. It is equivalent to
30654 <pre>
30655         asctime_s(s, maxsize, localtime_s(timer))
30656 </pre>
30657 <h6>Recommended practice</h6>
30658  The strftime function allows more flexible formatting and supports locale-specific
30659  behavior. If you do not require the exact form of the result string produced by the
30660  ctime_s function, consider using the strftime function instead.
30661 <h6>Returns</h6>
30662 <p><!--para 5 -->
30663  The ctime_s function returns zero if the time was successfully converted and stored
30664  into the array pointed to by s. Otherwise, it returns a nonzero value.
30665
30666 <h5><a name="K.3.8.2.3" href="#K.3.8.2.3">K.3.8.2.3 The gmtime_s function</a></h5>
30667 <h6>Synopsis</h6>
30668 <p><!--para 1 -->
30669 <pre>
30670         #define __STDC_WANT_LIB_EXT1__ 1
30671         #include <a href="#7.26">&lt;time.h&gt;</a>
30672         struct tm *gmtime_s(const time_t * restrict timer,
30673              struct tm * restrict result);
30674 </pre>
30675  Runtime-constraints
30676 <p><!--para 2 -->
30677  Neither timer nor result shall be a null pointer.
30678 <p><!--para 3 -->
30679  If there is a runtime-constraint violation, there is no attempt to convert the time.
30680 <h6>Description</h6>
30681 <p><!--para 4 -->
30682  The gmtime_s function converts the calendar time pointed to by timer into a broken-
30683  down time, expressed as UTC. The broken-down time is stored in the structure pointed
30684 <!--page 641 -->
30685  to by result.
30686 <h6>Returns</h6>
30687 <p><!--para 5 -->
30688  The gmtime_s function returns result, or a null pointer if the specified time cannot
30689  be converted to UTC or there is a runtime-constraint violation.
30690
30691 <h5><a name="K.3.8.2.4" href="#K.3.8.2.4">K.3.8.2.4 The localtime_s function</a></h5>
30692 <h6>Synopsis</h6>
30693 <p><!--para 1 -->
30694 <pre>
30695           #define __STDC_WANT_LIB_EXT1__ 1
30696           #include <a href="#7.26">&lt;time.h&gt;</a>
30697           struct tm *localtime_s(const time_t * restrict timer,
30698                struct tm * restrict result);
30699 </pre>
30700  Runtime-constraints
30701 <p><!--para 2 -->
30702  Neither timer nor result shall be a null pointer.
30703 <p><!--para 3 -->
30704  If there is a runtime-constraint violation, there is no attempt to convert the time.
30705 <h6>Description</h6>
30706 <p><!--para 4 -->
30707  The localtime_s function converts the calendar time pointed to by timer into a
30708  broken-down time, expressed as local time. The broken-down time is stored in the
30709  structure pointed to by result.
30710 <h6>Returns</h6>
30711 <p><!--para 5 -->
30712  The localtime_s function returns result, or a null pointer if the specified time
30713  cannot be converted to local time or there is a runtime-constraint violation.
30714
30715 <h4><a name="K.3.9" href="#K.3.9">K.3.9 Extended multibyte and wide character utilities <wchar.h></a></h4>
30716 <p><!--para 1 -->
30717  The header <a href="#7.28">&lt;wchar.h&gt;</a> defines two types.
30718 <p><!--para 2 -->
30719  The types are
30720 <pre>
30721           errno_t
30722 </pre>
30723  which is type int; and
30724 <pre>
30725           rsize_t
30726 </pre>
30727  which is the type size_t.
30728 <p><!--para 3 -->
30729  Unless explicitly stated otherwise, if the execution of a function described in this
30730  subclause causes copying to take place between objects that overlap, the objects take on
30731  unspecified values.
30732 <!--page 642 -->
30733
30734 <h5><a name="K.3.9.1" href="#K.3.9.1">K.3.9.1 Formatted wide character input/output functions</a></h5>
30735
30736 <h5><a name="K.3.9.1.1" href="#K.3.9.1.1">K.3.9.1.1 The fwprintf_s function</a></h5>
30737 <h6>Synopsis</h6>
30738 <p><!--para 1 -->
30739 <pre>
30740          #define __STDC_WANT_LIB_EXT1__ 1
30741          #include <a href="#7.28">&lt;wchar.h&gt;</a>
30742          int fwprintf_s(FILE * restrict stream,
30743               const wchar_t * restrict format, ...);
30744 </pre>
30745  Runtime-constraints
30746 <p><!--para 2 -->
30747  Neither stream nor format shall be a null pointer. The %n specifier<sup><a href="#note416"><b>416)</b></a></sup> (modified or
30748  not by flags, field width, or precision) shall not appear in the wide string pointed to by
30749  format. Any argument to fwprintf_s corresponding to a %s specifier shall not be a
30750  null pointer.
30751 <p><!--para 3 -->
30752  If there is a runtime-constraint violation, the fwprintf_s function does not attempt to
30753  produce further output, and it is unspecified to what extent fwprintf_s produced
30754  output before discovering the runtime-constraint violation.
30755 <h6>Description</h6>
30756 <p><!--para 4 -->
30757  The fwprintf_s function is equivalent to the fwprintf function except for the
30758  explicit runtime-constraints listed above.
30759 <h6>Returns</h6>
30760 <p><!--para 5 -->
30761  The fwprintf_s function returns the number of wide characters transmitted, or a
30762  negative value if an output error, encoding error, or runtime-constraint violation occurred.
30763
30764 <h6>footnotes</h6>
30765 <p><small><a name="note416" href="#note416">416)</a> It is not a runtime-constraint violation for the wide characters %n to appear in sequence in the wide
30766  string pointed at by format when those wide characters are not a interpreted as a %n specifier. For
30767  example, if the entire format string was L"%%n".
30768 </small>
30769
30770 <h5><a name="K.3.9.1.2" href="#K.3.9.1.2">K.3.9.1.2 The fwscanf_s function</a></h5>
30771 <h6>Synopsis</h6>
30772 <p><!--para 1 -->
30773 <pre>
30774          #define __STDC_WANT_LIB_EXT1__ 1
30775          #include <a href="#7.21">&lt;stdio.h&gt;</a>
30776          #include <a href="#7.28">&lt;wchar.h&gt;</a>
30777          int fwscanf_s(FILE * restrict stream,
30778               const wchar_t * restrict format, ...);
30779 </pre>
30780  Runtime-constraints
30781 <p><!--para 2 -->
30782  Neither stream nor format shall be a null pointer. Any argument indirected though in
30783  order to store converted input shall not be a null pointer.
30784  
30785  
30786 <!--page 643 -->
30787 <p><!--para 3 -->
30788  If there is a runtime-constraint violation, the fwscanf_s function does not attempt to
30789  perform further input, and it is unspecified to what extent fwscanf_s performed input
30790  before discovering the runtime-constraint violation.
30791 <h6>Description</h6>
30792 <p><!--para 4 -->
30793  The fwscanf_s function is equivalent to fwscanf except that the c, s, and [
30794  conversion specifiers apply to a pair of arguments (unless assignment suppression is
30795  indicated by a *). The first of these arguments is the same as for fwscanf. That
30796  argument is immediately followed in the argument list by the second argument, which has
30797  type size_t and gives the number of elements in the array pointed to by the first
30798  argument of the pair. If the first argument points to a scalar object, it is considered to be
30799  an array of one element.<sup><a href="#note417"><b>417)</b></a></sup>
30800 <p><!--para 5 -->
30801  A matching failure occurs if the number of elements in a receiving object is insufficient to
30802  hold the converted input (including any trailing null character).
30803 <h6>Returns</h6>
30804 <p><!--para 6 -->
30805  The fwscanf_s function returns the value of the macro EOF if an input failure occurs
30806  before any conversion or if there is a runtime-constraint violation. Otherwise, the
30807  fwscanf_s function returns the number of input items assigned, which can be fewer
30808  than provided for, or even zero, in the event of an early matching failure.
30809
30810 <h6>footnotes</h6>
30811 <p><small><a name="note417" href="#note417">417)</a> If the format is known at translation time, an implementation may issue a diagnostic for any argument
30812  used to store the result from a c, s, or [ conversion specifier if that argument is not followed by an
30813  argument of a type compatible with rsize_t. A limited amount of checking may be done if even if
30814  the format is not known at translation time. For example, an implementation may issue a diagnostic
30815  for each argument after format that has of type pointer to one of char, signed char,
30816  unsigned char, or void that is not followed by an argument of a type compatible with
30817  rsize_t. The diagnostic could warn that unless the pointer is being used with a conversion specifier
30818  using the hh length modifier, a length argument must follow the pointer argument. Another useful
30819  diagnostic could flag any non-pointer argument following format that did not have a type
30820  compatible with rsize_t.
30821 </small>
30822
30823 <h5><a name="K.3.9.1.3" href="#K.3.9.1.3">K.3.9.1.3 The snwprintf_s function</a></h5>
30824 <h6>Synopsis</h6>
30825 <p><!--para 1 -->
30826 <pre>
30827          #define __STDC_WANT_LIB_EXT1__ 1
30828          #include <a href="#7.28">&lt;wchar.h&gt;</a>
30829          int snwprintf_s(wchar_t * restrict s,
30830               rsize_t n,
30831               const wchar_t * restrict format, ...);
30832 </pre>
30833  Runtime-constraints
30834 <p><!--para 2 -->
30835  Neither s nor format shall be a null pointer. n shall neither equal zero nor be greater
30836  than RSIZE_MAX. The %n specifier<sup><a href="#note418"><b>418)</b></a></sup> (modified or not by flags, field width, or
30837  
30838 <!--page 644 -->
30839  precision) shall not appear in the wide string pointed to by format. Any argument to
30840  snwprintf_s corresponding to a %s specifier shall not be a null pointer. No encoding
30841  error shall occur.
30842 <p><!--para 3 -->
30843  If there is a runtime-constraint violation, then if s is not a null pointer and n is greater
30844  than zero and less than RSIZE_MAX, then the snwprintf_s function sets s[0] to the
30845  null wide character.
30846 <h6>Description</h6>
30847 <p><!--para 4 -->
30848  The snwprintf_s function is equivalent to the swprintf function except for the
30849  explicit runtime-constraints listed above.
30850 <p><!--para 5 -->
30851  The snwprintf_s function, unlike swprintf_s, will truncate the result to fit within
30852  the array pointed to by s.
30853 <h6>Returns</h6>
30854 <p><!--para 6 -->
30855  The snwprintf_s function returns the number of wide characters that would have
30856  been written had n been sufficiently large, not counting the terminating wide null
30857  character, or a negative value if a runtime-constraint violation occurred. Thus, the null-
30858  terminated output has been completely written if and only if the returned value is
30859  nonnegative and less than n.
30860
30861 <h6>footnotes</h6>
30862 <p><small><a name="note418" href="#note418">418)</a> It is not a runtime-constraint violation for the wide characters %n to appear in sequence in the wide
30863  string pointed at by format when those wide characters are not a interpreted as a %n specifier. For
30864  example, if the entire format string was L"%%n".
30865 </small>
30866
30867 <h5><a name="K.3.9.1.4" href="#K.3.9.1.4">K.3.9.1.4 The swprintf_s function</a></h5>
30868 <h6>Synopsis</h6>
30869 <p><!--para 1 -->
30870 <pre>
30871          #define __STDC_WANT_LIB_EXT1__ 1
30872          #include <a href="#7.28">&lt;wchar.h&gt;</a>
30873          int swprintf_s(wchar_t * restrict s, rsize_t n,
30874               const wchar_t * restrict format, ...);
30875 </pre>
30876  Runtime-constraints
30877 <p><!--para 2 -->
30878  Neither s nor format shall be a null pointer. n shall neither equal zero nor be greater
30879  than RSIZE_MAX. The number of wide characters (including the trailing null) required
30880  for the result to be written to the array pointed to by s shall not be greater than n. The %n
30881  specifier<sup><a href="#note419"><b>419)</b></a></sup> (modified or not by flags, field width, or precision) shall not appear in the
30882  wide string pointed to by format. Any argument to swprintf_s corresponding to a
30883  %s specifier shall not be a null pointer. No encoding error shall occur.
30884  
30885  
30886 <!--page 645 -->
30887 <p><!--para 3 -->
30888  If there is a runtime-constraint violation, then if s is not a null pointer and n is greater
30889  than zero and less than RSIZE_MAX, then the swprintf_s function sets s[0] to the
30890  null wide character.
30891 <h6>Description</h6>
30892 <p><!--para 4 -->
30893  The swprintf_s function is equivalent to the swprintf function except for the
30894  explicit runtime-constraints listed above.
30895 <p><!--para 5 -->
30896  The swprintf_s function, unlike snwprintf_s, treats a result too big for the array
30897  pointed to by s as a runtime-constraint violation.
30898 <h6>Returns</h6>
30899 <p><!--para 6 -->
30900  If no runtime-constraint violation occurred, the swprintf_s function returns the
30901  number of wide characters written in the array, not counting the terminating null wide
30902  character. If an encoding error occurred or if n or more wide characters are requested to
30903  be written, swprintf_s returns a negative value. If any other runtime-constraint
30904  violation occurred, swprintf_s returns zero.
30905
30906 <h6>footnotes</h6>
30907 <p><small><a name="note419" href="#note419">419)</a> It is not a runtime-constraint violation for the wide characters %n to appear in sequence in the wide
30908  string pointed at by format when those wide characters are not a interpreted as a %n specifier. For
30909  example, if the entire format string was L"%%n".
30910 </small>
30911
30912 <h5><a name="K.3.9.1.5" href="#K.3.9.1.5">K.3.9.1.5 The swscanf_s function</a></h5>
30913 <h6>Synopsis</h6>
30914 <p><!--para 1 -->
30915 <pre>
30916          #define __STDC_WANT_LIB_EXT1__ 1
30917          #include <a href="#7.28">&lt;wchar.h&gt;</a>
30918          int swscanf_s(const wchar_t * restrict s,
30919               const wchar_t * restrict format, ...);
30920 </pre>
30921  Runtime-constraints
30922 <p><!--para 2 -->
30923  Neither s nor format shall be a null pointer. Any argument indirected though in order
30924  to store converted input shall not be a null pointer.
30925 <p><!--para 3 -->
30926  If there is a runtime-constraint violation, the swscanf_s function does not attempt to
30927  perform further input, and it is unspecified to what extent swscanf_s performed input
30928  before discovering the runtime-constraint violation.
30929 <h6>Description</h6>
30930 <p><!--para 4 -->
30931  The swscanf_s function is equivalent to fwscanf_s, except that the argument s
30932  specifies a wide string from which the input is to be obtained, rather than from a stream.
30933  Reaching the end of the wide string is equivalent to encountering end-of-file for the
30934  fwscanf_s function.
30935 <h6>Returns</h6>
30936 <p><!--para 5 -->
30937  The swscanf_s function returns the value of the macro EOF if an input failure occurs
30938  before any conversion or if there is a runtime-constraint violation. Otherwise, the
30939  swscanf_s function returns the number of input items assigned, which can be fewer
30940  than provided for, or even zero, in the event of an early matching failure.
30941 <!--page 646 -->
30942
30943 <h5><a name="K.3.9.1.6" href="#K.3.9.1.6">K.3.9.1.6 The vfwprintf_s function</a></h5>
30944 <h6>Synopsis</h6>
30945 <p><!--para 1 -->
30946 <pre>
30947          #define __STDC_WANT_LIB_EXT1__ 1
30948          #include <a href="#7.16">&lt;stdarg.h&gt;</a>
30949          #include <a href="#7.21">&lt;stdio.h&gt;</a>
30950          #include <a href="#7.28">&lt;wchar.h&gt;</a>
30951          int vfwprintf_s(FILE * restrict stream,
30952               const wchar_t * restrict format,
30953               va_list arg);
30954 </pre>
30955  Runtime-constraints
30956 <p><!--para 2 -->
30957  Neither stream nor format shall be a null pointer. The %n specifier<sup><a href="#note420"><b>420)</b></a></sup> (modified or
30958  not by flags, field width, or precision) shall not appear in the wide string pointed to by
30959  format. Any argument to vfwprintf_s corresponding to a %s specifier shall not be
30960  a null pointer.
30961 <p><!--para 3 -->
30962  If there is a runtime-constraint violation, the vfwprintf_s function does not attempt
30963  to produce further output, and it is unspecified to what extent vfwprintf_s produced
30964  output before discovering the runtime-constraint violation.
30965 <h6>Description</h6>
30966 <p><!--para 4 -->
30967  The vfwprintf_s function is equivalent to the vfwprintf function except for the
30968  explicit runtime-constraints listed above.
30969 <h6>Returns</h6>
30970 <p><!--para 5 -->
30971  The vfwprintf_s function returns the number of wide characters transmitted, or a
30972  negative value if an output error, encoding error, or runtime-constraint violation occurred.
30973
30974 <h6>footnotes</h6>
30975 <p><small><a name="note420" href="#note420">420)</a> It is not a runtime-constraint violation for the wide characters %n to appear in sequence in the wide
30976  string pointed at by format when those wide characters are not a interpreted as a %n specifier. For
30977  example, if the entire format string was L"%%n".
30978 </small>
30979
30980 <h5><a name="K.3.9.1.7" href="#K.3.9.1.7">K.3.9.1.7 The vfwscanf_s function</a></h5>
30981 <h6>Synopsis</h6>
30982 <p><!--para 1 -->
30983 <pre>
30984          #define __STDC_WANT_LIB_EXT1__ 1
30985          #include <a href="#7.16">&lt;stdarg.h&gt;</a>
30986          #include <a href="#7.21">&lt;stdio.h&gt;</a>
30987          #include <a href="#7.28">&lt;wchar.h&gt;</a>
30988          int vfwscanf_s(FILE * restrict stream,
30989               const wchar_t * restrict format, va_list arg);
30990 </pre>
30991  
30992  
30993  
30994 <!--page 647 -->
30995  Runtime-constraints
30996 <p><!--para 2 -->
30997  Neither stream nor format shall be a null pointer. Any argument indirected though in
30998  order to store converted input shall not be a null pointer.
30999 <p><!--para 3 -->
31000  If there is a runtime-constraint violation, the vfwscanf_s function does not attempt to
31001  perform further input, and it is unspecified to what extent vfwscanf_s performed input
31002  before discovering the runtime-constraint violation.
31003 <h6>Description</h6>
31004 <p><!--para 4 -->
31005  The vfwscanf_s function is equivalent to fwscanf_s, with the variable argument
31006  list replaced by arg, which shall have been initialized by the va_start macro (and
31007  possibly subsequent va_arg calls). The vfwscanf_s function does not invoke the
31008  va_end macro.<sup><a href="#note421"><b>421)</b></a></sup>
31009 <h6>Returns</h6>
31010 <p><!--para 5 -->
31011  The vfwscanf_s function returns the value of the macro EOF if an input failure occurs
31012  before any conversion or if there is a runtime-constraint violation. Otherwise, the
31013  vfwscanf_s function returns the number of input items assigned, which can be fewer
31014  than provided for, or even zero, in the event of an early matching failure.
31015
31016 <h6>footnotes</h6>
31017 <p><small><a name="note421" href="#note421">421)</a> As the functions vfwscanf_s, vwscanf_s, and vswscanf_s invoke the va_arg macro, the
31018  value of arg after the return is indeterminate.
31019 </small>
31020
31021 <h5><a name="K.3.9.1.8" href="#K.3.9.1.8">K.3.9.1.8 The vsnwprintf_s function</a></h5>
31022 <h6>Synopsis</h6>
31023 <p><!--para 1 -->
31024 <pre>
31025          #define __STDC_WANT_LIB_EXT1__ 1
31026          #include <a href="#7.16">&lt;stdarg.h&gt;</a>
31027          #include <a href="#7.28">&lt;wchar.h&gt;</a>
31028          int vsnwprintf_s(wchar_t * restrict s,
31029               rsize_t n,
31030               const wchar_t * restrict format,
31031               va_list arg);
31032 </pre>
31033  Runtime-constraints
31034 <p><!--para 2 -->
31035  Neither s nor format shall be a null pointer. n shall neither equal zero nor be greater
31036  than RSIZE_MAX. The %n specifier<sup><a href="#note422"><b>422)</b></a></sup> (modified or not by flags, field width, or
31037  precision) shall not appear in the wide string pointed to by format. Any argument to
31038  vsnwprintf_s corresponding to a %s specifier shall not be a null pointer. No
31039  encoding error shall occur.
31040  
31041 <!--page 648 -->
31042 <p><!--para 3 -->
31043  If there is a runtime-constraint violation, then if s is not a null pointer and n is greater
31044  than zero and less than RSIZE_MAX, then the vsnwprintf_s function sets s[0] to
31045  the null wide character.
31046 <h6>Description</h6>
31047 <p><!--para 4 -->
31048  The vsnwprintf_s function is equivalent to the vswprintf function except for the
31049  explicit runtime-constraints listed above.
31050 <p><!--para 5 -->
31051  The vsnwprintf_s function, unlike vswprintf_s, will truncate the result to fit
31052  within the array pointed to by s.
31053 <h6>Returns</h6>
31054 <p><!--para 6 -->
31055  The vsnwprintf_s function returns the number of wide characters that would have
31056  been written had n been sufficiently large, not counting the terminating null character, or
31057  a negative value if a runtime-constraint violation occurred. Thus, the null-terminated
31058  output has been completely written if and only if the returned value is nonnegative and
31059  less than n.
31060
31061 <h6>footnotes</h6>
31062 <p><small><a name="note422" href="#note422">422)</a> It is not a runtime-constraint violation for the wide characters %n to appear in sequence in the wide
31063  string pointed at by format when those wide characters are not a interpreted as a %n specifier. For
31064  example, if the entire format string was L"%%n".
31065 </small>
31066
31067 <h5><a name="K.3.9.1.9" href="#K.3.9.1.9">K.3.9.1.9 The vswprintf_s function</a></h5>
31068 <h6>Synopsis</h6>
31069 <p><!--para 1 -->
31070 <pre>
31071          #define __STDC_WANT_LIB_EXT1__ 1
31072          #include <a href="#7.16">&lt;stdarg.h&gt;</a>
31073          #include <a href="#7.28">&lt;wchar.h&gt;</a>
31074          int vswprintf_s(wchar_t * restrict s,
31075               rsize_t n,
31076               const wchar_t * restrict format,
31077               va_list arg);
31078 </pre>
31079  Runtime-constraints
31080 <p><!--para 2 -->
31081  Neither s nor format shall be a null pointer. n shall neither equal zero nor be greater
31082  than RSIZE_MAX. The number of wide characters (including the trailing null) required
31083  for the result to be written to the array pointed to by s shall not be greater than n. The %n
31084  specifier<sup><a href="#note423"><b>423)</b></a></sup> (modified or not by flags, field width, or precision) shall not appear in the
31085  wide string pointed to by format. Any argument to vswprintf_s corresponding to a
31086  %s specifier shall not be a null pointer. No encoding error shall occur.
31087 <p><!--para 3 -->
31088  If there is a runtime-constraint violation, then if s is not a null pointer and n is greater
31089  than zero and less than RSIZE_MAX, then the vswprintf_s function sets s[0] to the
31090  null wide character.
31091  
31092 <!--page 649 -->
31093 <h6>Description</h6>
31094 <p><!--para 4 -->
31095  The vswprintf_s function is equivalent to the vswprintf function except for the
31096  explicit runtime-constraints listed above.
31097 <p><!--para 5 -->
31098  The vswprintf_s function, unlike vsnwprintf_s, treats a result too big for the
31099  array pointed to by s as a runtime-constraint violation.
31100 <h6>Returns</h6>
31101 <p><!--para 6 -->
31102  If no runtime-constraint violation occurred, the vswprintf_s function returns the
31103  number of wide characters written in the array, not counting the terminating null wide
31104  character. If an encoding error occurred or if n or more wide characters are requested to
31105  be written, vswprintf_s returns a negative value. If any other runtime-constraint
31106  violation occurred, vswprintf_s returns zero.
31107
31108 <h6>footnotes</h6>
31109 <p><small><a name="note423" href="#note423">423)</a> It is not a runtime-constraint violation for the wide characters %n to appear in sequence in the wide
31110  string pointed at by format when those wide characters are not a interpreted as a %n specifier. For
31111  example, if the entire format string was L"%%n".
31112 </small>
31113
31114 <h5><a name="K.3.9.1.10" href="#K.3.9.1.10">K.3.9.1.10 The vswscanf_s function</a></h5>
31115 <h6>Synopsis</h6>
31116 <p><!--para 1 -->
31117 <pre>
31118          #define __STDC_WANT_LIB_EXT1__ 1
31119          #include <a href="#7.16">&lt;stdarg.h&gt;</a>
31120          #include <a href="#7.28">&lt;wchar.h&gt;</a>
31121          int vswscanf_s(const wchar_t * restrict s,
31122               const wchar_t * restrict format,
31123               va_list arg);
31124 </pre>
31125  Runtime-constraints
31126 <p><!--para 2 -->
31127  Neither s nor format shall be a null pointer. Any argument indirected though in order
31128  to store converted input shall not be a null pointer.
31129 <p><!--para 3 -->
31130  If there is a runtime-constraint violation, the vswscanf_s function does not attempt to
31131  perform further input, and it is unspecified to what extent vswscanf_s performed input
31132  before discovering the runtime-constraint violation.
31133 <h6>Description</h6>
31134 <p><!--para 4 -->
31135  The vswscanf_s function is equivalent to swscanf_s, with the variable argument
31136  list replaced by arg, which shall have been initialized by the va_start macro (and
31137  possibly subsequent va_arg calls). The vswscanf_s function does not invoke the
31138  va_end macro.<sup><a href="#note424"><b>424)</b></a></sup>
31139  
31140  
31141  
31142  
31143 <!--page 650 -->
31144 <h6>Returns</h6>
31145 <p><!--para 5 -->
31146  The vswscanf_s function returns the value of the macro EOF if an input failure occurs
31147  before any conversion or if there is a runtime-constraint violation. Otherwise, the
31148  vswscanf_s function returns the number of input items assigned, which can be fewer
31149  than provided for, or even zero, in the event of an early matching failure.
31150
31151 <h6>footnotes</h6>
31152 <p><small><a name="note424" href="#note424">424)</a> As the functions vfwscanf_s, vwscanf_s, and vswscanf_s invoke the va_arg macro, the
31153  value of arg after the return is indeterminate.
31154 </small>
31155
31156 <h5><a name="K.3.9.1.11" href="#K.3.9.1.11">K.3.9.1.11 The vwprintf_s function</a></h5>
31157 <h6>Synopsis</h6>
31158 <p><!--para 1 -->
31159 <pre>
31160          #define __STDC_WANT_LIB_EXT1__ 1
31161          #include <a href="#7.16">&lt;stdarg.h&gt;</a>
31162          #include <a href="#7.28">&lt;wchar.h&gt;</a>
31163          int vwprintf_s(const wchar_t * restrict format,
31164               va_list arg);
31165 </pre>
31166  Runtime-constraints
31167 <p><!--para 2 -->
31168  format shall not be a null pointer. The %n specifier<sup><a href="#note425"><b>425)</b></a></sup> (modified or not by flags, field
31169  width, or precision) shall not appear in the wide string pointed to by format. Any
31170  argument to vwprintf_s corresponding to a %s specifier shall not be a null pointer.
31171 <p><!--para 3 -->
31172  If there is a runtime-constraint violation, the vwprintf_s function does not attempt to
31173  produce further output, and it is unspecified to what extent vwprintf_s produced
31174  output before discovering the runtime-constraint violation.
31175 <h6>Description</h6>
31176 <p><!--para 4 -->
31177  The vwprintf_s function is equivalent to the vwprintf function except for the
31178  explicit runtime-constraints listed above.
31179 <h6>Returns</h6>
31180 <p><!--para 5 -->
31181  The vwprintf_s function returns the number of wide characters transmitted, or a
31182  negative value if an output error, encoding error, or runtime-constraint violation occurred.
31183  
31184  
31185  
31186  
31187 <!--page 651 -->
31188
31189 <h6>footnotes</h6>
31190 <p><small><a name="note425" href="#note425">425)</a> It is not a runtime-constraint violation for the wide characters %n to appear in sequence in the wide
31191  string pointed at by format when those wide characters are not a interpreted as a %n specifier. For
31192  example, if the entire format string was L"%%n".
31193 </small>
31194
31195 <h5><a name="K.3.9.1.12" href="#K.3.9.1.12">K.3.9.1.12 The vwscanf_s function</a></h5>
31196 <h6>Synopsis</h6>
31197 <p><!--para 1 -->
31198 <pre>
31199          #define __STDC_WANT_LIB_EXT1__ 1
31200          #include <a href="#7.16">&lt;stdarg.h&gt;</a>
31201          #include <a href="#7.28">&lt;wchar.h&gt;</a>
31202          int vwscanf_s(const wchar_t * restrict format,
31203               va_list arg);
31204 </pre>
31205  Runtime-constraints
31206 <p><!--para 2 -->
31207  format shall not be a null pointer. Any argument indirected though in order to store
31208  converted input shall not be a null pointer.
31209 <p><!--para 3 -->
31210  If there is a runtime-constraint violation, the vwscanf_s function does not attempt to
31211  perform further input, and it is unspecified to what extent vwscanf_s performed input
31212  before discovering the runtime-constraint violation.
31213 <h6>Description</h6>
31214 <p><!--para 4 -->
31215  The vwscanf_s function is equivalent to wscanf_s, with the variable argument list
31216  replaced by arg, which shall have been initialized by the va_start macro (and
31217  possibly subsequent va_arg calls). The vwscanf_s function does not invoke the
31218  va_end macro.<sup><a href="#note426"><b>426)</b></a></sup>
31219 <h6>Returns</h6>
31220 <p><!--para 5 -->
31221  The vwscanf_s function returns the value of the macro EOF if an input failure occurs
31222  before any conversion or if there is a runtime-constraint violation. Otherwise, the
31223  vwscanf_s function returns the number of input items assigned, which can be fewer
31224  than provided for, or even zero, in the event of an early matching failure.
31225
31226 <h6>footnotes</h6>
31227 <p><small><a name="note426" href="#note426">426)</a> As the functions vfwscanf_s, vwscanf_s, and vswscanf_s invoke the va_arg macro, the
31228  value of arg after the return is indeterminate.
31229 </small>
31230
31231 <h5><a name="K.3.9.1.13" href="#K.3.9.1.13">K.3.9.1.13 The wprintf_s function</a></h5>
31232 <h6>Synopsis</h6>
31233 <p><!--para 1 -->
31234 <pre>
31235          #define __STDC_WANT_LIB_EXT1__ 1
31236          #include <a href="#7.28">&lt;wchar.h&gt;</a>
31237          int wprintf_s(const wchar_t * restrict format, ...);
31238 </pre>
31239  Runtime-constraints
31240 <p><!--para 2 -->
31241  format shall not be a null pointer. The %n specifier<sup><a href="#note427"><b>427)</b></a></sup> (modified or not by flags, field
31242  
31243 <!--page 652 -->
31244  width, or precision) shall not appear in the wide string pointed to by format. Any
31245  argument to wprintf_s corresponding to a %s specifier shall not be a null pointer.
31246 <p><!--para 3 -->
31247  If there is a runtime-constraint violation, the wprintf_s function does not attempt to
31248  produce further output, and it is unspecified to what extent wprintf_s produced output
31249  before discovering the runtime-constraint violation.
31250 <h6>Description</h6>
31251 <p><!--para 4 -->
31252  The wprintf_s function is equivalent to the wprintf function except for the explicit
31253  runtime-constraints listed above.
31254 <h6>Returns</h6>
31255 <p><!--para 5 -->
31256  The wprintf_s function returns the number of wide characters transmitted, or a
31257  negative value if an output error, encoding error, or runtime-constraint violation occurred.
31258
31259 <h6>footnotes</h6>
31260 <p><small><a name="note427" href="#note427">427)</a> It is not a runtime-constraint violation for the wide characters %n to appear in sequence in the wide
31261  string pointed at by format when those wide characters are not a interpreted as a %n specifier. For
31262  example, if the entire format string was L"%%n".
31263 </small>
31264
31265 <h5><a name="K.3.9.1.14" href="#K.3.9.1.14">K.3.9.1.14 The wscanf_s function</a></h5>
31266 <h6>Synopsis</h6>
31267 <p><!--para 1 -->
31268 <pre>
31269         #define __STDC_WANT_LIB_EXT1__ 1
31270         #include <a href="#7.28">&lt;wchar.h&gt;</a>
31271         int wscanf_s(const wchar_t * restrict format, ...);
31272 </pre>
31273  Runtime-constraints
31274 <p><!--para 2 -->
31275  format shall not be a null pointer. Any argument indirected though in order to store
31276  converted input shall not be a null pointer.
31277 <p><!--para 3 -->
31278  If there is a runtime-constraint violation, the wscanf_s function does not attempt to
31279  perform further input, and it is unspecified to what extent wscanf_s performed input
31280  before discovering the runtime-constraint violation.
31281 <h6>Description</h6>
31282 <p><!--para 4 -->
31283  The wscanf_s function is equivalent to fwscanf_s with the argument stdin
31284  interposed before the arguments to wscanf_s.
31285 <h6>Returns</h6>
31286 <p><!--para 5 -->
31287  The wscanf_s function returns the value of the macro EOF if an input failure occurs
31288  before any conversion or if there is a runtime-constraint violation. Otherwise, the
31289  wscanf_s function returns the number of input items assigned, which can be fewer than
31290  provided for, or even zero, in the event of an early matching failure.
31291 <!--page 653 -->
31292
31293 <h5><a name="K.3.9.2" href="#K.3.9.2">K.3.9.2 General wide string utilities</a></h5>
31294
31295 <h5><a name="K.3.9.2.1" href="#K.3.9.2.1">K.3.9.2.1 Wide string copying functions</a></h5>
31296
31297 <h5><a name="K.3.9.2.1.1" href="#K.3.9.2.1.1">K.3.9.2.1.1 The wcscpy_s function</a></h5>
31298 <h6>Synopsis</h6>
31299 <p><!--para 1 -->
31300 <pre>
31301          #define __STDC_WANT_LIB_EXT1__ 1
31302          #include <a href="#7.28">&lt;wchar.h&gt;</a>
31303          errno_t wcscpy_s(wchar_t * restrict s1,
31304               rsize_t s1max,
31305               const wchar_t * restrict s2);
31306 </pre>
31307  Runtime-constraints
31308 <p><!--para 2 -->
31309  Neither s1 nor s2 shall be a null pointer. s1max shall not be greater than RSIZE_MAX.
31310  s1max shall not equal zero. s1max shall be greater than wcsnlen_s(s2, s1max).
31311  Copying shall not take place between objects that overlap.
31312 <p><!--para 3 -->
31313  If there is a runtime-constraint violation, then if s1 is not a null pointer and s1max is
31314  greater than zero and not greater than RSIZE_MAX, then wcscpy_s sets s1[0] to the
31315  null wide character.
31316 <h6>Description</h6>
31317 <p><!--para 4 -->
31318  The wcscpy_s function copies the wide string pointed to by s2 (including the
31319  terminating null wide character) into the array pointed to by s1.
31320 <p><!--para 5 -->
31321  All elements following the terminating null wide character (if any) written by
31322  wcscpy_s in the array of s1max wide characters pointed to by s1 take unspecified
31323  values when wcscpy_s returns.<sup><a href="#note428"><b>428)</b></a></sup>
31324 <h6>Returns</h6>
31325 <p><!--para 6 -->
31326  The wcscpy_s function returns zero<sup><a href="#note429"><b>429)</b></a></sup> if there was no runtime-constraint violation.
31327  Otherwise, a nonzero value is returned.
31328  
31329  
31330  
31331  
31332 <!--page 654 -->
31333
31334 <h6>footnotes</h6>
31335 <p><small><a name="note428" href="#note428">428)</a> This allows an implementation to copy wide characters from s2 to s1 while simultaneously checking
31336  if any of those wide characters are null. Such an approach might write a wide character to every
31337  element of s1 before discovering that the first element should be set to the null wide character.
31338 </small>
31339 <p><small><a name="note429" href="#note429">429)</a> A zero return value implies that all of the requested wide characters from the string pointed to by s2
31340  fit within the array pointed to by s1 and that the result in s1 is null terminated.
31341 </small>
31342
31343 <h5><a name="K.3.9.2.1.2" href="#K.3.9.2.1.2">K.3.9.2.1.2 The wcsncpy_s function</a></h5>
31344 <h6>Synopsis</h6>
31345 <p><!--para 7 -->
31346 <pre>
31347          #define __STDC_WANT_LIB_EXT1__ 1
31348          #include <a href="#7.28">&lt;wchar.h&gt;</a>
31349          errno_t wcsncpy_s(wchar_t * restrict s1,
31350               rsize_t s1max,
31351               const wchar_t * restrict s2,
31352               rsize_t n);
31353 </pre>
31354  Runtime-constraints
31355 <p><!--para 8 -->
31356  Neither s1 nor s2 shall be a null pointer. Neither s1max nor n shall be greater than
31357  RSIZE_MAX. s1max shall not equal zero. If n is not less than s1max, then s1max
31358  shall be greater than wcsnlen_s(s2, s1max). Copying shall not take place between
31359  objects that overlap.
31360 <p><!--para 9 -->
31361  If there is a runtime-constraint violation, then if s1 is not a null pointer and s1max is
31362  greater than zero and not greater than RSIZE_MAX, then wcsncpy_s sets s1[0] to the
31363  null wide character.
31364 <h6>Description</h6>
31365 <p><!--para 10 -->
31366  The wcsncpy_s function copies not more than n successive wide characters (wide
31367  characters that follow a null wide character are not copied) from the array pointed to by
31368  s2 to the array pointed to by s1. If no null wide character was copied from s2, then
31369  s1[n] is set to a null wide character.
31370 <p><!--para 11 -->
31371  All elements following the terminating null wide character (if any) written by
31372  wcsncpy_s in the array of s1max wide characters pointed to by s1 take unspecified
31373  values when wcsncpy_s returns.<sup><a href="#note430"><b>430)</b></a></sup>
31374 <h6>Returns</h6>
31375 <p><!--para 12 -->
31376  The wcsncpy_s function returns zero<sup><a href="#note431"><b>431)</b></a></sup> if there was no runtime-constraint violation.
31377  Otherwise, a nonzero value is returned.
31378 <p><!--para 13 -->
31379  EXAMPLE 1 The wcsncpy_s function can be used to copy a wide string without the danger that the
31380  result will not be null terminated or that wide characters will be written past the end of the destination
31381  array.
31382  
31383  
31384  
31385  
31386 <!--page 655 -->
31387 <pre>
31388          #define __STDC_WANT_LIB_EXT1__ 1
31389          #include <a href="#7.28">&lt;wchar.h&gt;</a>
31390          /* ... */
31391          wchar_t src1[100] = L"hello";
31392          wchar_t src2[7] = {L'g', L'o', L'o', L'd', L'b', L'y', L'e'};
31393          wchar_t dst1[6], dst2[5], dst3[5];
31394          int r1, r2, r3;
31395          r1 = wcsncpy_s(dst1, 6, src1, 100);
31396          r2 = wcsncpy_s(dst2, 5, src2, 7);
31397          r3 = wcsncpy_s(dst3, 5, src2, 4);
31398 </pre>
31399  The first call will assign to r1 the value zero and to dst1 the sequence of wide characters hello\0.
31400  The second call will assign to r2 a nonzero value and to dst2 the sequence of wide characters \0.
31401  The third call will assign to r3 the value zero and to dst3 the sequence of wide characters good\0.
31402  
31403
31404 <h6>footnotes</h6>
31405 <p><small><a name="note430" href="#note430">430)</a> This allows an implementation to copy wide characters from s2 to s1 while simultaneously checking
31406  if any of those wide characters are null. Such an approach might write a wide character to every
31407  element of s1 before discovering that the first element should be set to the null wide character.
31408 </small>
31409 <p><small><a name="note431" href="#note431">431)</a> A zero return value implies that all of the requested wide characters from the string pointed to by s2
31410  fit within the array pointed to by s1 and that the result in s1 is null terminated.
31411 </small>
31412
31413 <h5><a name="K.3.9.2.1.3" href="#K.3.9.2.1.3">K.3.9.2.1.3 The wmemcpy_s function</a></h5>
31414 <h6>Synopsis</h6>
31415 <p><!--para 14 -->
31416 <pre>
31417          #define __STDC_WANT_LIB_EXT1__ 1
31418          #include <a href="#7.28">&lt;wchar.h&gt;</a>
31419          errno_t wmemcpy_s(wchar_t * restrict s1,
31420               rsize_t s1max,
31421               const wchar_t * restrict s2,
31422               rsize_t n);
31423 </pre>
31424  Runtime-constraints
31425 <p><!--para 15 -->
31426  Neither s1 nor s2 shall be a null pointer. Neither s1max nor n shall be greater than
31427  RSIZE_MAX. n shall not be greater than s1max. Copying shall not take place between
31428  objects that overlap.
31429 <p><!--para 16 -->
31430  If there is a runtime-constraint violation, the wmemcpy_s function stores zeros in the
31431  first s1max wide characters of the object pointed to by s1 if s1 is not a null pointer and
31432  s1max is not greater than RSIZE_MAX.
31433 <h6>Description</h6>
31434 <p><!--para 17 -->
31435  The wmemcpy_s function copies n successive wide characters from the object pointed
31436  to by s2 into the object pointed to by s1.
31437 <h6>Returns</h6>
31438 <p><!--para 18 -->
31439  The wmemcpy_s function returns zero if there was no runtime-constraint violation.
31440  Otherwise, a nonzero value is returned.
31441 <!--page 656 -->
31442
31443 <h5><a name="K.3.9.2.1.4" href="#K.3.9.2.1.4">K.3.9.2.1.4 The wmemmove_s function</a></h5>
31444 <h6>Synopsis</h6>
31445 <p><!--para 19 -->
31446 <pre>
31447         #define __STDC_WANT_LIB_EXT1__ 1
31448         #include <a href="#7.28">&lt;wchar.h&gt;</a>
31449         errno_t wmemmove_s(wchar_t *s1, rsize_t s1max,
31450              const wchar_t *s2, rsize_t n);
31451 </pre>
31452  Runtime-constraints
31453 <p><!--para 20 -->
31454  Neither s1 nor s2 shall be a null pointer. Neither s1max nor n shall be greater than
31455  RSIZE_MAX. n shall not be greater than s1max.
31456 <p><!--para 21 -->
31457  If there is a runtime-constraint violation, the wmemmove_s function stores zeros in the
31458  first s1max wide characters of the object pointed to by s1 if s1 is not a null pointer and
31459  s1max is not greater than RSIZE_MAX.
31460 <h6>Description</h6>
31461 <p><!--para 22 -->
31462  The wmemmove_s function copies n successive wide characters from the object pointed
31463  to by s2 into the object pointed to by s1. This copying takes place as if the n wide
31464  characters from the object pointed to by s2 are first copied into a temporary array of n
31465  wide characters that does not overlap the objects pointed to by s1 or s2, and then the n
31466  wide characters from the temporary array are copied into the object pointed to by s1.
31467 <h6>Returns</h6>
31468 <p><!--para 23 -->
31469  The wmemmove_s function returns zero if there was no runtime-constraint violation.
31470  Otherwise, a nonzero value is returned.
31471
31472 <h5><a name="K.3.9.2.2" href="#K.3.9.2.2">K.3.9.2.2 Wide string concatenation functions</a></h5>
31473
31474 <h5><a name="K.3.9.2.2.1" href="#K.3.9.2.2.1">K.3.9.2.2.1 The wcscat_s function</a></h5>
31475 <h6>Synopsis</h6>
31476 <p><!--para 1 -->
31477 <pre>
31478         #define __STDC_WANT_LIB_EXT1__ 1
31479         #include <a href="#7.28">&lt;wchar.h&gt;</a>
31480         errno_t wcscat_s(wchar_t * restrict s1,
31481              rsize_t s1max,
31482              const wchar_t * restrict s2);
31483 </pre>
31484  Runtime-constraints
31485 <p><!--para 2 -->
31486  Let m denote the value s1max - wcsnlen_s(s1, s1max) upon entry to
31487  wcscat_s.
31488 <p><!--para 3 -->
31489  Neither s1 nor s2 shall be a null pointer. s1max shall not be greater than RSIZE_MAX.
31490  s1max shall not equal zero. m shall not equal zero.<sup><a href="#note432"><b>432)</b></a></sup> m shall be greater than
31491  wcsnlen_s(s2, m). Copying shall not take place between objects that overlap.
31492 <!--page 657 -->
31493 <p><!--para 4 -->
31494  If there is a runtime-constraint violation, then if s1 is not a null pointer and s1max is
31495  greater than zero and not greater than RSIZE_MAX, then wcscat_s sets s1[0] to the
31496  null wide character.
31497 <h6>Description</h6>
31498 <p><!--para 5 -->
31499  The wcscat_s function appends a copy of the wide string pointed to by s2 (including
31500  the terminating null wide character) to the end of the wide string pointed to by s1. The
31501  initial wide character from s2 overwrites the null wide character at the end of s1.
31502 <p><!--para 6 -->
31503  All elements following the terminating null wide character (if any) written by
31504  wcscat_s in the array of s1max wide characters pointed to by s1 take unspecified
31505  values when wcscat_s returns.<sup><a href="#note433"><b>433)</b></a></sup>
31506 <h6>Returns</h6>
31507 <p><!--para 7 -->
31508  The wcscat_s function returns zero<sup><a href="#note434"><b>434)</b></a></sup> if there was no runtime-constraint violation.
31509  Otherwise, a nonzero value is returned.
31510
31511 <h6>footnotes</h6>
31512 <p><small><a name="note432" href="#note432">432)</a> Zero means that s1 was not null terminated upon entry to wcscat_s.
31513 </small>
31514 <p><small><a name="note433" href="#note433">433)</a> This allows an implementation to append wide characters from s2 to s1 while simultaneously
31515  checking if any of those wide characters are null. Such an approach might write a wide character to
31516  every element of s1 before discovering that the first element should be set to the null wide character.
31517 </small>
31518 <p><small><a name="note434" href="#note434">434)</a> A zero return value implies that all of the requested wide characters from the wide string pointed to by
31519  s2 were appended to the wide string pointed to by s1 and that the result in s1 is null terminated.
31520 </small>
31521
31522 <h5><a name="K.3.9.2.2.2" href="#K.3.9.2.2.2">K.3.9.2.2.2 The wcsncat_s function</a></h5>
31523 <h6>Synopsis</h6>
31524 <p><!--para 8 -->
31525 <pre>
31526           #define __STDC_WANT_LIB_EXT1__ 1
31527           #include <a href="#7.28">&lt;wchar.h&gt;</a>
31528           errno_t wcsncat_s(wchar_t * restrict s1,
31529                rsize_t s1max,
31530                const wchar_t * restrict s2,
31531                rsize_t n);
31532 </pre>
31533  Runtime-constraints
31534 <p><!--para 9 -->
31535  Let m denote the value s1max - wcsnlen_s(s1, s1max) upon entry to
31536  wcsncat_s.
31537 <p><!--para 10 -->
31538  Neither s1 nor s2 shall be a null pointer. Neither s1max nor n shall be greater than
31539  RSIZE_MAX. s1max shall not equal zero. m shall not equal zero.<sup><a href="#note435"><b>435)</b></a></sup> If n is not less
31540  than m, then m shall be greater than wcsnlen_s(s2, m). Copying shall not take
31541  place between objects that overlap.
31542  
31543  
31544 <!--page 658 -->
31545 <p><!--para 11 -->
31546  If there is a runtime-constraint violation, then if s1 is not a null pointer and s1max is
31547  greater than zero and not greater than RSIZE_MAX, then wcsncat_s sets s1[0] to the
31548  null wide character.
31549 <h6>Description</h6>
31550 <p><!--para 12 -->
31551  The wcsncat_s function appends not more than n successive wide characters (wide
31552  characters that follow a null wide character are not copied) from the array pointed to by
31553  s2 to the end of the wide string pointed to by s1. The initial wide character from s2
31554  overwrites the null wide character at the end of s1. If no null wide character was copied
31555  from s2, then s1[s1max-m+n] is set to a null wide character.
31556 <p><!--para 13 -->
31557  All elements following the terminating null wide character (if any) written by
31558  wcsncat_s in the array of s1max wide characters pointed to by s1 take unspecified
31559  values when wcsncat_s returns.<sup><a href="#note436"><b>436)</b></a></sup>
31560 <h6>Returns</h6>
31561 <p><!--para 14 -->
31562  The wcsncat_s function returns zero<sup><a href="#note437"><b>437)</b></a></sup> if there was no runtime-constraint violation.
31563  Otherwise, a nonzero value is returned.
31564 <p><!--para 15 -->
31565  EXAMPLE 1 The wcsncat_s function can be used to copy a wide string without the danger that the
31566  result will not be null terminated or that wide characters will be written past the end of the destination
31567  array.
31568 <pre>
31569           #define __STDC_WANT_LIB_EXT1__ 1
31570           #include <a href="#7.28">&lt;wchar.h&gt;</a>
31571           /* ... */
31572           wchar_t s1[100] = L"good";
31573           wchar_t s2[6] = L"hello";
31574           wchar_t s3[6] = L"hello";
31575           wchar_t s4[7] = L"abc";
31576           wchar_t s5[1000] = L"bye";
31577           int r1, r2, r3, r4;
31578           r1 = wcsncat_s(s1, 100, s5, 1000);
31579           r2 = wcsncat_s(s2, 6, L"", 1);
31580           r3 = wcsncat_s(s3, 6, L"X", 2);
31581           r4 = wcsncat_s(s4, 7, L"defghijklmn", 3);
31582 </pre>
31583  After the first call r1 will have the value zero and s1 will be the wide character sequence goodbye\0.
31584  After the second call r2 will have the value zero and s2 will be the wide character sequence hello\0.
31585  After the third call r3 will have a nonzero value and s3 will be the wide character sequence \0.
31586  After the fourth call r4 will have the value zero and s4 will be the wide character sequence abcdef\0.
31587  
31588  
31589  
31590  
31591 <!--page 659 -->
31592
31593 <h6>footnotes</h6>
31594 <p><small><a name="note435" href="#note435">435)</a> Zero means that s1 was not null terminated upon entry to wcsncat_s.
31595 </small>
31596 <p><small><a name="note436" href="#note436">436)</a> This allows an implementation to append wide characters from s2 to s1 while simultaneously
31597  checking if any of those wide characters are null. Such an approach might write a wide character to
31598  every element of s1 before discovering that the first element should be set to the null wide character.
31599 </small>
31600 <p><small><a name="note437" href="#note437">437)</a> A zero return value implies that all of the requested wide characters from the wide string pointed to by
31601  s2 were appended to the wide string pointed to by s1 and that the result in s1 is null terminated.
31602 </small>
31603
31604 <h5><a name="K.3.9.2.3" href="#K.3.9.2.3">K.3.9.2.3 Wide string search functions</a></h5>
31605
31606 <h5><a name="K.3.9.2.3.1" href="#K.3.9.2.3.1">K.3.9.2.3.1 The wcstok_s function</a></h5>
31607 <h6>Synopsis</h6>
31608 <p><!--para 1 -->
31609 <pre>
31610          #define __STDC_WANT_LIB_EXT1__ 1
31611          #include <a href="#7.28">&lt;wchar.h&gt;</a>
31612          wchar_t *wcstok_s(wchar_t * restrict s1,
31613               rsize_t * restrict s1max,
31614               const wchar_t * restrict s2,
31615               wchar_t ** restrict ptr);
31616 </pre>
31617  Runtime-constraints
31618 <p><!--para 2 -->
31619  None of s1max, s2, or ptr shall be a null pointer. If s1 is a null pointer, then *ptr
31620  shall not be a null pointer. The value of *s1max shall not be greater than RSIZE_MAX.
31621  The end of the token found shall occur within the first *s1max wide characters of s1 for
31622  the first call, and shall occur within the first *s1max wide characters of where searching
31623  resumes on subsequent calls.
31624 <p><!--para 3 -->
31625  If there is a runtime-constraint violation, the wcstok_s function does not indirect
31626  through the s1 or s2 pointers, and does not store a value in the object pointed to by ptr.
31627 <h6>Description</h6>
31628 <p><!--para 4 -->
31629  A sequence of calls to the wcstok_s function breaks the wide string pointed to by s1
31630  into a sequence of tokens, each of which is delimited by a wide character from the wide
31631  string pointed to by s2. The fourth argument points to a caller-provided wchar_t
31632  pointer into which the wcstok_s function stores information necessary for it to
31633  continue scanning the same wide string.
31634 <p><!--para 5 -->
31635  The first call in a sequence has a non-null first argument and s1max points to an object
31636  whose value is the number of elements in the wide character array pointed to by the first
31637  argument. The first call stores an initial value in the object pointed to by ptr and
31638  updates the value pointed to by s1max to reflect the number of elements that remain in
31639  relation to ptr. Subsequent calls in the sequence have a null first argument and the
31640  objects pointed to by s1max and ptr are required to have the values stored by the
31641  previous call in the sequence, which are then updated. The separator wide string pointed
31642  to by s2 may be different from call to call.
31643 <p><!--para 6 -->
31644  The first call in the sequence searches the wide string pointed to by s1 for the first wide
31645  character that is not contained in the current separator wide string pointed to by s2. If no
31646  such wide character is found, then there are no tokens in the wide string pointed to by s1
31647  and the wcstok_s function returns a null pointer. If such a wide character is found, it is
31648  the start of the first token.
31649 <!--page 660 -->
31650 <p><!--para 7 -->
31651  The wcstok_s function then searches from there for the first wide character in s1 that
31652  is contained in the current separator wide string. If no such wide character is found, the
31653  current token extends to the end of the wide string pointed to by s1, and subsequent
31654  searches in the same wide string for a token return a null pointer. If such a wide character
31655  is found, it is overwritten by a null wide character, which terminates the current token.
31656 <p><!--para 8 -->
31657  In all cases, the wcstok_s function stores sufficient information in the pointer pointed
31658  to by ptr so that subsequent calls, with a null pointer for s1 and the unmodified pointer
31659  value for ptr, shall start searching just past the element overwritten by a null wide
31660  character (if any).
31661 <h6>Returns</h6>
31662 <p><!--para 9 -->
31663  The wcstok_s function returns a pointer to the first wide character of a token, or a null
31664  pointer if there is no token or there is a runtime-constraint violation.
31665 <p><!--para 10 -->
31666  EXAMPLE
31667 <pre>
31668         #define __STDC_WANT_LIB_EXT1__ 1
31669         #include <a href="#7.28">&lt;wchar.h&gt;</a>
31670         static wchar_t str1[] = L"?a???b,,,#c";
31671         static wchar_t str2[] = L"\t \t";
31672         wchar_t *t, *ptr1, *ptr2;
31673         rsize_t max1 = wcslen(str1)+1;
31674         rsize_t max2 = wcslen(str2)+1;
31675         t   =   wcstok_s(str1,   &amp;max1,   "?", &amp;ptr1);        //   t   points to the token "a"
31676         t   =   wcstok_s(NULL,   &amp;max1,   ",", &amp;ptr1);        //   t   points to the token "??b"
31677         t   =   wcstok_s(str2,   &amp;max2,   " \t", &amp;ptr2);      //   t   is a null pointer
31678         t   =   wcstok_s(NULL,   &amp;max1,   "#,", &amp;ptr1);       //   t   points to the token "c"
31679         t   =   wcstok_s(NULL,   &amp;max1,   "?", &amp;ptr1);        //   t   is a null pointer
31680 </pre>
31681  
31682
31683 <h5><a name="K.3.9.2.4" href="#K.3.9.2.4">K.3.9.2.4 Miscellaneous functions</a></h5>
31684
31685 <h5><a name="K.3.9.2.4.1" href="#K.3.9.2.4.1">K.3.9.2.4.1 The wcsnlen_s function</a></h5>
31686 <h6>Synopsis</h6>
31687 <p><!--para 1 -->
31688 <pre>
31689         #define __STDC_WANT_LIB_EXT1__ 1
31690         #include <a href="#7.28">&lt;wchar.h&gt;</a>
31691         size_t wcsnlen_s(const wchar_t *s, size_t maxsize);
31692 </pre>
31693 <h6>Description</h6>
31694 <p><!--para 2 -->
31695  The wcsnlen_s function computes the length of the wide string pointed to by s.
31696 <h6>Returns</h6>
31697 <p><!--para 3 -->
31698  If s is a null pointer,<sup><a href="#note438"><b>438)</b></a></sup> then the wcsnlen_s function returns zero.
31699 <p><!--para 4 -->
31700  Otherwise, the wcsnlen_s function returns the number of wide characters that precede
31701  the terminating null wide character. If there is no null wide character in the first
31702  maxsize wide characters of s then wcsnlen_s returns maxsize. At most the first
31703 <!--page 661 -->
31704  maxsize wide characters of s shall be accessed by wcsnlen_s.
31705
31706 <h6>footnotes</h6>
31707 <p><small><a name="note438" href="#note438">438)</a> Note that the wcsnlen_s function has no runtime-constraints. This lack of runtime-constraints
31708  along with the values returned for a null pointer or an unterminated wide string argument make
31709  wcsnlen_s useful in algorithms that gracefully handle such exceptional data.
31710 </small>
31711
31712 <h5><a name="K.3.9.3" href="#K.3.9.3">K.3.9.3 Extended multibyte/wide character conversion utilities</a></h5>
31713
31714 <h5><a name="K.3.9.3.1" href="#K.3.9.3.1">K.3.9.3.1 Restartable multibyte/wide character conversion functions</a></h5>
31715 <p><!--para 1 -->
31716  Unlike wcrtomb, wcrtomb_s does not permit the ps parameter (the pointer to the
31717  conversion state) to be a null pointer.
31718
31719 <h5><a name="K.3.9.3.1.1" href="#K.3.9.3.1.1">K.3.9.3.1.1 The wcrtomb_s function</a></h5>
31720 <h6>Synopsis</h6>
31721 <p><!--para 2 -->
31722 <pre>
31723          #include <a href="#7.28">&lt;wchar.h&gt;</a>
31724          errno_t wcrtomb_s(size_t * restrict retval,
31725               char * restrict s, rsize_t smax,
31726               wchar_t wc, mbstate_t * restrict ps);
31727 </pre>
31728  Runtime-constraints
31729 <p><!--para 3 -->
31730  Neither retval nor ps shall be a null pointer. If s is not a null pointer, then smax
31731  shall not equal zero and shall not be greater than RSIZE_MAX. If s is not a null pointer,
31732  then smax shall be not be less than the number of bytes to be stored in the array pointed
31733  to by s. If s is a null pointer, then smax shall equal zero.
31734 <p><!--para 4 -->
31735  If there is a runtime-constraint violation, then wcrtomb_s does the following. If s is
31736  not a null pointer and smax is greater than zero and not greater than RSIZE_MAX, then
31737  wcrtomb_s sets s[0] to the null character. If retval is not a null pointer, then
31738  wcrtomb_s sets *retval to (size_t)(-1).
31739 <h6>Description</h6>
31740 <p><!--para 5 -->
31741  If s is a null pointer, the wcrtomb_s function is equivalent to the call
31742 <pre>
31743                  wcrtomb_s(&amp;retval, buf, sizeof buf, L'\0', ps)
31744 </pre>
31745  where retval and buf are internal variables of the appropriate types, and the size of
31746  buf is greater than MB_CUR_MAX.
31747 <p><!--para 6 -->
31748  If s is not a null pointer, the wcrtomb_s function determines the number of bytes
31749  needed to represent the multibyte character that corresponds to the wide character given
31750  by wc (including any shift sequences), and stores the multibyte character representation
31751  in the array whose first element is pointed to by s. At most MB_CUR_MAX bytes are
31752  stored. If wc is a null wide character, a null byte is stored, preceded by any shift
31753  sequence needed to restore the initial shift state; the resulting state described is the initial
31754  conversion state.
31755  
31756 <!--page 662 -->
31757 <p><!--para 7 -->
31758  If wc does not correspond to a valid multibyte character, an encoding error occurs: the
31759  wcrtomb_s function stores the value (size_t)(-1) into *retval and the
31760  conversion state is unspecified. Otherwise, the wcrtomb_s function stores into
31761  *retval the number of bytes (including any shift sequences) stored in the array pointed
31762  to by s.
31763 <h6>Returns</h6>
31764 <p><!--para 8 -->
31765  The wcrtomb_s function returns zero if no runtime-constraint violation and no
31766  encoding error occurred. Otherwise, a nonzero value is returned.
31767
31768 <h5><a name="K.3.9.3.2" href="#K.3.9.3.2">K.3.9.3.2 Restartable multibyte/wide string conversion functions</a></h5>
31769 <p><!--para 1 -->
31770  Unlike mbsrtowcs and wcsrtombs, mbsrtowcs_s and wcsrtombs_s do not
31771  permit the ps parameter (the pointer to the conversion state) to be a null pointer.
31772
31773 <h5><a name="K.3.9.3.2.1" href="#K.3.9.3.2.1">K.3.9.3.2.1 The mbsrtowcs_s function</a></h5>
31774 <h6>Synopsis</h6>
31775 <p><!--para 2 -->
31776 <pre>
31777         #include <a href="#7.28">&lt;wchar.h&gt;</a>
31778         errno_t mbsrtowcs_s(size_t * restrict retval,
31779              wchar_t * restrict dst, rsize_t dstmax,
31780              const char ** restrict src, rsize_t len,
31781              mbstate_t * restrict ps);
31782 </pre>
31783  Runtime-constraints
31784 <p><!--para 3 -->
31785  None of retval, src, *src, or ps shall be null pointers. If dst is not a null pointer,
31786  then neither len nor dstmax shall be greater than RSIZE_MAX. If dst is a null
31787  pointer, then dstmax shall equal zero. If dst is not a null pointer, then dstmax shall
31788  not equal zero. If dst is not a null pointer and len is not less than dstmax, then a null
31789  character shall occur within the first dstmax multibyte characters of the array pointed to
31790  by *src.
31791 <p><!--para 4 -->
31792  If there is a runtime-constraint violation, then mbsrtowcs_s does the following. If
31793  retval is not a null pointer, then mbsrtowcs_s sets *retval to (size_t)(-1).
31794  If dst is not a null pointer and dstmax is greater than zero and less than RSIZE_MAX,
31795  then mbsrtowcs_s sets dst[0] to the null wide character.
31796 <h6>Description</h6>
31797 <p><!--para 5 -->
31798  The mbsrtowcs_s function converts a sequence of multibyte characters that begins in
31799  the conversion state described by the object pointed to by ps, from the array indirectly
31800  pointed to by src into a sequence of corresponding wide characters. If dst is not a null
31801  pointer, the converted characters are stored into the array pointed to by dst. Conversion
31802  continues up to and including a terminating null character, which is also stored.
31803  Conversion stops earlier in two cases: when a sequence of bytes is encountered that does
31804  not form a valid multibyte character, or (if dst is not a null pointer) when len wide
31805 <!--page 663 -->
31806  characters have been stored into the array pointed to by dst.<sup><a href="#note439"><b>439)</b></a></sup> If dst is not a null
31807  pointer and no null wide character was stored into the array pointed to by dst, then
31808  dst[len] is set to the null wide character. Each conversion takes place as if by a call
31809  to the mbrtowc function.
31810 <p><!--para 6 -->
31811  If dst is not a null pointer, the pointer object pointed to by src is assigned either a null
31812  pointer (if conversion stopped due to reaching a terminating null character) or the address
31813  just past the last multibyte character converted (if any). If conversion stopped due to
31814  reaching a terminating null character and if dst is not a null pointer, the resulting state
31815  described is the initial conversion state.
31816 <p><!--para 7 -->
31817  Regardless of whether dst is or is not a null pointer, if the input conversion encounters a
31818  sequence of bytes that do not form a valid multibyte character, an encoding error occurs:
31819  the mbsrtowcs_s function stores the value (size_t)(-1) into *retval and the
31820  conversion state is unspecified. Otherwise, the mbsrtowcs_s function stores into
31821  *retval the number of multibyte characters successfully converted, not including the
31822  terminating null character (if any).
31823 <p><!--para 8 -->
31824  All elements following the terminating null wide character (if any) written by
31825  mbsrtowcs_s in the array of dstmax wide characters pointed to by dst take
31826  unspecified values when mbsrtowcs_s returns.<sup><a href="#note440"><b>440)</b></a></sup>
31827 <p><!--para 9 -->
31828  If copying takes place between objects that overlap, the objects take on unspecified
31829  values.
31830 <h6>Returns</h6>
31831 <p><!--para 10 -->
31832  The mbsrtowcs_s function returns zero if no runtime-constraint violation and no
31833  encoding error occurred. Otherwise, a nonzero value is returned.
31834
31835 <h6>footnotes</h6>
31836 <p><small><a name="note439" href="#note439">439)</a> Thus, the value of len is ignored if dst is a null pointer.
31837 </small>
31838 <p><small><a name="note440" href="#note440">440)</a> This allows an implementation to attempt converting the multibyte string before discovering a
31839  terminating null character did not occur where required.
31840 </small>
31841
31842 <h5><a name="K.3.9.3.2.2" href="#K.3.9.3.2.2">K.3.9.3.2.2 The wcsrtombs_s function</a></h5>
31843 <h6>Synopsis</h6>
31844 <p><!--para 11 -->
31845 <pre>
31846           #include <a href="#7.28">&lt;wchar.h&gt;</a>
31847           errno_t wcsrtombs_s(size_t * restrict retval,
31848                char * restrict dst, rsize_t dstmax,
31849                const wchar_t ** restrict src, rsize_t len,
31850                mbstate_t * restrict ps);
31851 </pre>
31852  
31853  
31854  
31855  
31856 <!--page 664 -->
31857  Runtime-constraints
31858 <p><!--para 12 -->
31859  None of retval, src, *src, or ps shall be null pointers. If dst is not a null pointer,
31860  then neither len nor dstmax shall be greater than RSIZE_MAX. If dst is a null
31861  pointer, then dstmax shall equal zero. If dst is not a null pointer, then dstmax shall
31862  not equal zero. If dst is not a null pointer and len is not less than dstmax, then the
31863  conversion shall have been stopped (see below) because a terminating null wide character
31864  was reached or because an encoding error occurred.
31865 <p><!--para 13 -->
31866  If there is a runtime-constraint violation, then wcsrtombs_s does the following. If
31867  retval is not a null pointer, then wcsrtombs_s sets *retval to (size_t)(-1).
31868  If dst is not a null pointer and dstmax is greater than zero and less than RSIZE_MAX,
31869  then wcsrtombs_s sets dst[0] to the null character.
31870 <h6>Description</h6>
31871 <p><!--para 14 -->
31872  The wcsrtombs_s function converts a sequence of wide characters from the array
31873  indirectly pointed to by src into a sequence of corresponding multibyte characters that
31874  begins in the conversion state described by the object pointed to by ps. If dst is not a
31875  null pointer, the converted characters are then stored into the array pointed to by dst.
31876  Conversion continues up to and including a terminating null wide character, which is also
31877  stored. Conversion stops earlier in two cases:
31878 <ul>
31879 <li>  when a wide character is reached that does not correspond to a valid multibyte
31880  character;
31881 <li>  (if dst is not a null pointer) when the next multibyte character would exceed the
31882    limit of n total bytes to be stored into the array pointed to by dst. If the wide
31883    character being converted is the null wide character, then n is the lesser of len or
31884    dstmax. Otherwise, n is the lesser of len or dstmax-1.
31885 </ul>
31886  If the conversion stops without converting a null wide character and dst is not a null
31887  pointer, then a null character is stored into the array pointed to by dst immediately
31888  following any multibyte characters already stored. Each conversion takes place as if by a
31889  call to the wcrtomb function.<sup><a href="#note441"><b>441)</b></a></sup>
31890 <p><!--para 15 -->
31891  If dst is not a null pointer, the pointer object pointed to by src is assigned either a null
31892  pointer (if conversion stopped due to reaching a terminating null wide character) or the
31893  address just past the last wide character converted (if any). If conversion stopped due to
31894  reaching a terminating null wide character, the resulting state described is the initial
31895  conversion state.
31896  
31897  
31898 <!--page 665 -->
31899 <p><!--para 16 -->
31900  Regardless of whether dst is or is not a null pointer, if the input conversion encounters a
31901  wide character that does not correspond to a valid multibyte character, an encoding error
31902  occurs: the wcsrtombs_s function stores the value (size_t)(-1) into *retval
31903  and the conversion state is unspecified. Otherwise, the wcsrtombs_s function stores
31904  into *retval the number of bytes in the resulting multibyte character sequence, not
31905  including the terminating null character (if any).
31906 <p><!--para 17 -->
31907  All elements following the terminating null character (if any) written by wcsrtombs_s
31908  in the array of dstmax elements pointed to by dst take unspecified values when
31909  wcsrtombs_s returns.<sup><a href="#note442"><b>442)</b></a></sup>
31910 <p><!--para 18 -->
31911  If copying takes place between objects that overlap, the objects take on unspecified
31912  values.
31913 <h6>Returns</h6>
31914 <p><!--para 19 -->
31915  The wcsrtombs_s function returns zero if no runtime-constraint violation and no
31916  encoding error occurred. Otherwise, a nonzero value is returned.
31917  
31918  
31919  
31920  
31921 <!--page 666 -->
31922
31923 <h6>footnotes</h6>
31924 <p><small><a name="note441" href="#note441">441)</a> If conversion stops because a terminating null wide character has been reached, the bytes stored
31925  include those necessary to reach the initial shift state immediately before the null byte. However, if
31926  the conversion stops before a terminating null wide character has been reached, the result will be null
31927  terminated, but might not end in the initial shift state.
31928 </small>
31929 <p><small><a name="note442" href="#note442">442)</a> When len is not less than dstmax, the implementation might fill the array before discovering a
31930  runtime-constraint violation.
31931 </small>
31932
31933 <h2><a name="L" href="#L">Annex L</a></h2>
31934 <pre>
31935                                             (normative)
31936                                          Analyzability
31937 </pre>
31938
31939 <h3><a name="L.1" href="#L.1">L.1 Scope</a></h3>
31940 <p><!--para 1 -->
31941  This annex specifies optional behavior that can aid in the analyzability of C programs.
31942 <p><!--para 2 -->
31943  An implementation that defines __STDC_ANALYZABLE__ shall conform to the
31944  specifications in this annex.<sup><a href="#note443"><b>443)</b></a></sup>
31945
31946 <h6>footnotes</h6>
31947 <p><small><a name="note443" href="#note443">443)</a> Implementations that do not define __STDC_ANALYZABLE__ are not required to conform to these
31948  specifications.
31949 </small>
31950
31951 <h3><a name="L.2" href="#L.2">L.2 Definitions</a></h3>
31952
31953 <h4><a name="L.2.1" href="#L.2.1">L.2.1</a></h4>
31954 <p><!--para 1 -->
31955  out-of-bounds store
31956  an (attempted) access (<a href="#3.1">3.1</a>) that, at run time, for a given computational state, would
31957  modify (or, for an object declared volatile, fetch) one or more bytes that lie outside
31958  the bounds permitted by this Standard.
31959
31960 <h4><a name="L.2.2" href="#L.2.2">L.2.2</a></h4>
31961 <p><!--para 1 -->
31962  bounded undefined behavior
31963  undefined behavior (<a href="#3.4.3">3.4.3</a>) that does not perform an out-of-bounds store.
31964 <p><!--para 2 -->
31965  NOTE 1    The behavior might perform a trap.
31966  
31967 <p><!--para 3 -->
31968  NOTE 2    Any values produced or stored might be indeterminate values.
31969  
31970
31971 <h4><a name="L.2.3" href="#L.2.3">L.2.3</a></h4>
31972 <p><!--para 1 -->
31973  critical undefined behavior
31974  undefined behavior that is not bounded undefined behavior.
31975 <p><!--para 2 -->
31976  NOTE     The behavior might perform an out-of-bounds store or perform a trap.
31977  
31978  
31979  
31980  
31981 <!--page 667 -->
31982
31983 <h3><a name="L.3" href="#L.3">L.3 Requirements</a></h3>
31984 <p><!--para 1 -->
31985  If the program performs a trap (<a href="#3.19.5">3.19.5</a>), the implementation is permitted to invoke a
31986  runtime-constraint handler. Any such semantics are implementation-defined.
31987 <p><!--para 2 -->
31988  All undefined behavior shall be limited to bounded undefined behavior, except for the
31989  following which are permitted to result in critical undefined behavior:
31990 <ul>
31991 <li>  An object is referred to outside of its lifetime (<a href="#6.2.4">6.2.4</a>).
31992 <li>  An lvalue does not designate an object when evaluated (<a href="#6.3.2.1">6.3.2.1</a>).
31993 <li>  A pointer is used to call a function whose type is not compatible with the referenced
31994  type (<a href="#6.3.2.3">6.3.2.3</a>).
31995 <li>  The operand of the unary * operator has an invalid value (<a href="#6.5.3.2">6.5.3.2</a>).
31996 <li>  Addition or subtraction of a pointer into, or just beyond, an array object and an
31997  integer type produces a result that points just beyond the array object and is used as
31998  the operand of a unary * operator that is evaluated (<a href="#6.5.6">6.5.6</a>).
31999 <li>  An argument to a library function has an invalid value or a type not expected by a
32000  function with variable number of arguments (<a href="#7.1.4">7.1.4</a>).
32001 <li>  The value of a pointer that refers to space deallocated by a call to the free or realloc
32002  function is used (<a href="#7.22.3">7.22.3</a>).
32003 <li>  A string or wide string utility function is instructed to access an array beyond the end
32004  of an object (<a href="#7.23.1">7.23.1</a>, <a href="#7.28.4">7.28.4</a>).
32005 <!--page 668 -->
32006 </ul>
32007
32008 <h2><a name="Bibliography" href="#Bibliography">Bibliography</a></h2>
32009 <ol>
32010 <li>  ''The C Reference Manual'' by Dennis M. Ritchie, a version of which was
32011  published in The C Programming Language by Brian W. Kernighan and Dennis
32012  M. Ritchie, Prentice-Hall, Inc., (1978). Copyright owned by AT&amp;T.
32013 <li>  1984 /usr/group Standard by the /usr/group Standards Committee, Santa Clara,
32014  California, USA, November 1984.
32015 <li>  ANSI X3/TR-1-82 (1982), American National Dictionary for Information
32016  Processing Systems, Information Processing Systems Technical Report.
32017 <li>  ANSI/IEEE 754-1985, American National Standard for Binary Floating-Point
32018  Arithmetic.
32019 <li>  ANSI/IEEE 854-1988, American National Standard for Radix-Independent
32020  Floating-Point Arithmetic.
32021 <li>  IEC 60559:1989, Binary floating-point arithmetic for microprocessor systems,
32022  second edition (previously designated IEC 559:1989).
32023 <li>  ISO 31-11:1992, Quantities and units -- Part 11: Mathematical signs and
32024  symbols for use in the physical sciences and technology.
32025 <li>  ISO/IEC 646:1991, Information technology -- ISO 7-bit coded character set for
32026  information interchange.
32027 <li>  ISO/IEC 2382-1:1993, Information technology -- Vocabulary -- Part 1:
32028  Fundamental terms.
32029 <li>  ISO 4217:1995, Codes for the representation of currencies and funds.
32030 <li>  ISO 8601:1988, Data elements and interchange formats -- Information
32031  interchange -- Representation of dates and times.
32032 <li>  ISO/IEC 9899:1990, Programming languages -- C.
32033 <li>  ISO/IEC 9899/COR1:1994, Technical Corrigendum 1.
32034 <li>  ISO/IEC 9899/COR2:1996, Technical Corrigendum 2.
32035 <li>  ISO/IEC 9899/AMD1:1995, Amendment 1 to ISO/IEC 9899:1990 C Integrity.
32036 <li>  ISO/IEC 9899:1999, Programming languages -- C.
32037 <li>  ISO/IEC 9899:1999/Cor.1:2001, Technical Corrigendum 1.
32038 <li>  ISO/IEC 9899:1999/Cor.2:2004, Technical Corrigendum 2.
32039 <li>  ISO/IEC 9899:1999/Cor.3:2007, Technical Corrigendum 3.
32040 <!--page 669 -->
32041 <li>  ISO/IEC 9945-2:1993, Information technology -- Portable Operating System
32042  Interface (POSIX) -- Part 2: Shell and Utilities.
32043 <li>  ISO/IEC TR 10176:1998, Information technology -- Guidelines for the
32044  preparation of programming language standards.
32045 <li>  ISO/IEC 10646-1:1993, Information technology -- Universal Multiple-Octet
32046  Coded Character Set (UCS) -- Part 1: Architecture and Basic Multilingual Plane.
32047 <li>  ISO/IEC 10646-1/COR1:1996,         Technical       Corrigendum       1      to
32048  ISO/IEC 10646-1:1993.
32049 <li>  ISO/IEC 10646-1/COR2:1998,         Technical       Corrigendum       2      to
32050  ISO/IEC 10646-1:1993.
32051 <li>  ISO/IEC 10646-1/AMD1:1996, Amendment 1 to ISO/IEC 10646-1:1993
32052  Transformation Format for 16 planes of group 00 (UTF-16).
32053 <li>  ISO/IEC 10646-1/AMD2:1996, Amendment 2 to ISO/IEC 10646-1:1993 UCS
32054  Transformation Format 8 (UTF-8).
32055 <li>  ISO/IEC 10646-1/AMD3:1996, Amendment 3 to ISO/IEC 10646-1:1993.
32056 <li>  ISO/IEC 10646-1/AMD4:1996, Amendment 4 to ISO/IEC 10646-1:1993.
32057 <li>  ISO/IEC 10646-1/AMD5:1998, Amendment 5 to ISO/IEC 10646-1:1993 Hangul
32058  syllables.
32059 <li>  ISO/IEC 10646-1/AMD6:1997,       Amendment     6   to   ISO/IEC 10646-1:1993
32060  Tibetan.
32061 <li>  ISO/IEC 10646-1/AMD7:1997, Amendment 7 to ISO/IEC 10646-1:1993 33
32062  additional characters.
32063 <li>  ISO/IEC 10646-1/AMD8:1997, Amendment 8 to ISO/IEC 10646-1:1993.
32064 <li>  ISO/IEC 10646-1/AMD9:1997,       Amendment     9   to   ISO/IEC 10646-1:1993
32065  Identifiers for characters.
32066 <li>  ISO/IEC 10646-1/AMD10:1998, Amendment 10 to ISO/IEC 10646-1:1993
32067  Ethiopic.
32068 <li>  ISO/IEC 10646-1/AMD11:1998, Amendment 11 to ISO/IEC 10646-1:1993
32069  Unified Canadian Aboriginal Syllabics.
32070 <li>  ISO/IEC 10646-1/AMD12:1998, Amendment 12 to ISO/IEC 10646-1:1993
32071  Cherokee.
32072 <li>  ISO/IEC 10967-1:1994, Information technology -- Language independent
32073  arithmetic -- Part 1: Integer and floating point arithmetic.
32074 <!--page 670 -->
32075 <li>  ISO/IEC TR 19769:2004, Information technology -- Programming languages,
32076  their environments and system software interfaces -- Extensions for the
32077  programming language C to support new character data types.
32078 <li>  ISO/IEC TR 24731-1:2007, Information technology -- Programming languages,
32079  their environments and system software interfaces -- Extensions to the C library
32080  -- Part 1: Bounds-checking interfaces.
32081 <!--page 671 -->
32082 </ol>
32083
32084 <h2><a name="Index" href="#Index">Index</a></h2>
32085 <pre>
32086  [^ x ^], <a href="#3.20">3.20</a>                                                    , (comma operator), <a href="#5.1.2.4">5.1.2.4</a>, <a href="#6.5.17">6.5.17</a>
32087                                                                 , (comma punctuator), <a href="#6.5.2">6.5.2</a>, <a href="#6.7">6.7</a>, <a href="#6.7.2.1">6.7.2.1</a>, <a href="#6.7.2.2">6.7.2.2</a>,
32088  [_ x _], <a href="#3.21">3.21</a>                                                         <a href="#6.7.2.3">6.7.2.3</a>, <a href="#6.7.9">6.7.9</a>
32089  ! (logical negation operator), <a href="#6.5.3.3">6.5.3.3</a>                         - (subtraction operator), <a href="#6.2.6.2">6.2.6.2</a>, <a href="#6.5.6">6.5.6</a>, <a href="#F.3">F.3</a>, <a href="#G.5.2">G.5.2</a>
32090  != (inequality operator), <a href="#6.5.9">6.5.9</a>                                - (unary minus operator), <a href="#6.5.3.3">6.5.3.3</a>, <a href="#F.3">F.3</a>
32091  # operator, <a href="#6.10.3.2">6.10.3.2</a>                                           -- (postfix decrement operator), <a href="#6.3.2.1">6.3.2.1</a>, <a href="#6.5.2.4">6.5.2.4</a>
32092  # preprocessing directive, <a href="#6.10.7">6.10.7</a>                              -- (prefix decrement operator), <a href="#6.3.2.1">6.3.2.1</a>, <a href="#6.5.3.1">6.5.3.1</a>
32093  # punctuator, <a href="#6.10">6.10</a>                                             -= (subtraction assignment operator), <a href="#6.5.16.2">6.5.16.2</a>
32094  ## operator, <a href="#6.10.3.3">6.10.3.3</a>                                          -&gt; (structure/union pointer operator), <a href="#6.5.2.3">6.5.2.3</a>
32095  #define preprocessing directive, <a href="#6.10.3">6.10.3</a>                        . (structure/union member operator), <a href="#6.3.2.1">6.3.2.1</a>,
32096  #elif preprocessing directive, <a href="#6.10.1">6.10.1</a>                               <a href="#6.5.2.3">6.5.2.3</a>
32097  #else preprocessing directive, <a href="#6.10.1">6.10.1</a>                          . punctuator, <a href="#6.7.9">6.7.9</a>
32098  #endif preprocessing directive, <a href="#6.10.1">6.10.1</a>                         ... (ellipsis punctuator), <a href="#6.5.2.2">6.5.2.2</a>, <a href="#6.7.6.3">6.7.6.3</a>, <a href="#6.10.3">6.10.3</a>
32099  #error preprocessing directive, <a href="#4">4</a>, <a href="#6.10.5">6.10.5</a>                      / (division operator), <a href="#6.2.6.2">6.2.6.2</a>, <a href="#6.5.5">6.5.5</a>, <a href="#F.3">F.3</a>, <a href="#G.5.1">G.5.1</a>
32100  #if preprocessing directive, <a href="#5.2.4.2.1">5.2.4.2.1</a>, <a href="#5.2.4.2.2">5.2.4.2.2</a>,             /* */ (comment delimiters), <a href="#6.4.9">6.4.9</a>
32101       <a href="#6.10.1">6.10.1</a>, <a href="#7.1.4">7.1.4</a>                                             // (comment delimiter), <a href="#6.4.9">6.4.9</a>
32102  #ifdef preprocessing directive, <a href="#6.10.1">6.10.1</a>                         /= (division assignment operator), <a href="#6.5.16.2">6.5.16.2</a>
32103  #ifndef preprocessing directive, <a href="#6.10.1">6.10.1</a>                        : (colon punctuator), <a href="#6.7.2.1">6.7.2.1</a>
32104  #include preprocessing directive, <a href="#5.1.1.2">5.1.1.2</a>,                     :&gt; (alternative spelling of ]), <a href="#6.4.6">6.4.6</a>
32105       <a href="#6.10.2">6.10.2</a>                                                    ; (semicolon punctuator), <a href="#6.7">6.7</a>, <a href="#6.7.2.1">6.7.2.1</a>, <a href="#6.8.3">6.8.3</a>,
32106  #line preprocessing directive, <a href="#6.10.4">6.10.4</a>                               <a href="#6.8.5">6.8.5</a>, <a href="#6.8.6">6.8.6</a>
32107  #pragma preprocessing directive, <a href="#6.10.6">6.10.6</a>                        &lt; (less-than operator), <a href="#6.5.8">6.5.8</a>
32108  #undef preprocessing directive, <a href="#6.10.3.5">6.10.3.5</a>, <a href="#7.1.3">7.1.3</a>,               &lt;% (alternative spelling of {), <a href="#6.4.6">6.4.6</a>
32109       <a href="#7.1.4">7.1.4</a>                                                     &lt;: (alternative spelling of [), <a href="#6.4.6">6.4.6</a>
32110  % (remainder operator), <a href="#6.2.6.2">6.2.6.2</a>, <a href="#6.5.5">6.5.5</a>                         &lt;&lt; (left-shift operator), <a href="#6.2.6.2">6.2.6.2</a>, <a href="#6.5.7">6.5.7</a>
32111  %: (alternative spelling of #), <a href="#6.4.6">6.4.6</a>                          &lt;&lt;= (left-shift assignment operator), <a href="#6.5.16.2">6.5.16.2</a>
32112  %:%: (alternative spelling of ##), <a href="#6.4.6">6.4.6</a>                       &lt;= (less-than-or-equal-to operator), <a href="#6.5.8">6.5.8</a>
32113  %= (remainder assignment operator), <a href="#6.5.16.2">6.5.16.2</a>                   <a href="#7.2">&lt;assert.h&gt;</a> header, <a href="#7.2">7.2</a>
32114  %&gt; (alternative spelling of }), <a href="#6.4.6">6.4.6</a>                          <a href="#7.3">&lt;complex.h&gt;</a> header, <a href="#5.2.4.2.2">5.2.4.2.2</a>, <a href="#6.10.8.3">6.10.8.3</a>, <a href="#7.1.2">7.1.2</a>,
32115  &amp; (address operator), <a href="#6.3.2.1">6.3.2.1</a>, <a href="#6.5.3.2">6.5.3.2</a>                              <a href="#7.3">7.3</a>, <a href="#7.24">7.24</a>, <a href="#7.30.1">7.30.1</a>, <a href="#G.6">G.6</a>, <a href="#J.5.17">J.5.17</a>
32116  &amp; (bitwise AND operator), <a href="#6.2.6.2">6.2.6.2</a>, <a href="#6.5.10">6.5.10</a>                      <a href="#7.4">&lt;ctype.h&gt;</a> header, <a href="#7.4">7.4</a>, <a href="#7.30.2">7.30.2</a>
32117  &amp;&amp; (logical AND operator), <a href="#5.1.2.4">5.1.2.4</a>, <a href="#6.5.13">6.5.13</a>                     <a href="#7.5">&lt;errno.h&gt;</a> header, <a href="#7.5">7.5</a>, <a href="#7.30.3">7.30.3</a>, <a href="#K.3.2">K.3.2</a>
32118  &amp;= (bitwise AND assignment operator), <a href="#6.5.16.2">6.5.16.2</a>                 <a href="#7.6">&lt;fenv.h&gt;</a> header, <a href="#5.1.2.3">5.1.2.3</a>, <a href="#5.2.4.2.2">5.2.4.2.2</a>, <a href="#7.6">7.6</a>, <a href="#7.12">7.12</a>, <a href="#F">F</a>,
32119  ' ' (space character), <a href="#5.1.1.2">5.1.1.2</a>, <a href="#5.2.1">5.2.1</a>, <a href="#6.4">6.4</a>, <a href="#7.4.1.3">7.4.1.3</a>,                <a href="#H">H</a>
32120       <a href="#7.4.1.10">7.4.1.10</a>, <a href="#7.29.2.1.3">7.29.2.1.3</a>                                      <a href="#7.7">&lt;float.h&gt;</a> header, <a href="#4">4</a>, <a href="#5.2.4.2.2">5.2.4.2.2</a>, <a href="#7.7">7.7</a>, <a href="#7.22.1.3">7.22.1.3</a>,
32121  ( ) (cast operator), <a href="#6.5.4">6.5.4</a>                                          <a href="#7.28.4.1.1">7.28.4.1.1</a>
32122  ( ) (function-call operator), <a href="#6.5.2.2">6.5.2.2</a>                          <a href="#7.8">&lt;inttypes.h&gt;</a> header, <a href="#7.8">7.8</a>, <a href="#7.30.4">7.30.4</a>
32123  ( ) (parentheses punctuator), <a href="#6.7.6.3">6.7.6.3</a>, <a href="#6.8.4">6.8.4</a>, <a href="#6.8.5">6.8.5</a>            <a href="#7.9">&lt;iso646.h&gt;</a> header, <a href="#4">4</a>, <a href="#7.9">7.9</a>
32124  ( ){ } (compound-literal operator), <a href="#6.5.2.5">6.5.2.5</a>                    <a href="#7.10">&lt;limits.h&gt;</a> header, <a href="#4">4</a>, <a href="#5.2.4.2.1">5.2.4.2.1</a>, <a href="#6.2.5">6.2.5</a>, <a href="#7.10">7.10</a>
32125  * (asterisk punctuator), <a href="#6.7.6.1">6.7.6.1</a>, <a href="#6.7.6.2">6.7.6.2</a>                      <a href="#7.11">&lt;locale.h&gt;</a> header, <a href="#7.11">7.11</a>, <a href="#7.30.5">7.30.5</a>
32126  * (indirection operator), <a href="#6.5.2.1">6.5.2.1</a>, <a href="#6.5.3.2">6.5.3.2</a>                     <a href="#7.12">&lt;math.h&gt;</a> header, <a href="#5.2.4.2.2">5.2.4.2.2</a>, <a href="#6.5">6.5</a>, <a href="#7.12">7.12</a>, <a href="#7.24">7.24</a>, <a href="#F">F</a>,
32127  * (multiplication operator), <a href="#6.2.6.2">6.2.6.2</a>, <a href="#6.5.5">6.5.5</a>, <a href="#F.3">F.3</a>,                   <a href="#F.10">F.10</a>, <a href="#J.5.17">J.5.17</a>
32128       <a href="#G.5.1">G.5.1</a>                                                     <a href="#7.13">&lt;setjmp.h&gt;</a> header, <a href="#7.13">7.13</a>
32129  *= (multiplication assignment operator), <a href="#6.5.16.2">6.5.16.2</a>              <a href="#7.14">&lt;signal.h&gt;</a> header, <a href="#7.14">7.14</a>, <a href="#7.30.6">7.30.6</a>
32130  + (addition operator), <a href="#6.2.6.2">6.2.6.2</a>, <a href="#6.5.2.1">6.5.2.1</a>, <a href="#6.5.3.2">6.5.3.2</a>,              <a href="#7.15">&lt;stdalign.h&gt;</a> header, <a href="#4">4</a>, <a href="#7.15">7.15</a>
32131       <a href="#6.5.6">6.5.6</a>, <a href="#F.3">F.3</a>, <a href="#G.5.2">G.5.2</a>                                         <a href="#7.16">&lt;stdarg.h&gt;</a> header, <a href="#4">4</a>, <a href="#6.7.6.3">6.7.6.3</a>, <a href="#7.16">7.16</a>
32132  + (unary plus operator), <a href="#6.5.3.3">6.5.3.3</a>                               <a href="#7.17">&lt;stdatomic.h&gt;</a> header, <a href="#6.10.8.3">6.10.8.3</a>, <a href="#7.1.2">7.1.2</a>, <a href="#7.17">7.17</a>
32133  ++ (postfix increment operator), <a href="#6.3.2.1">6.3.2.1</a>, <a href="#6.5.2.4">6.5.2.4</a>               <a href="#7.18">&lt;stdbool.h&gt;</a> header, <a href="#4">4</a>, <a href="#7.18">7.18</a>, <a href="#7.30.7">7.30.7</a>, <a href="#H">H</a>
32134  ++ (prefix increment operator), <a href="#6.3.2.1">6.3.2.1</a>, <a href="#6.5.3.1">6.5.3.1</a>                <a href="#7.19">&lt;stddef.h&gt;</a> header, <a href="#4">4</a>, <a href="#6.3.2.1">6.3.2.1</a>, <a href="#6.3.2.3">6.3.2.3</a>, <a href="#6.4.4.4">6.4.4.4</a>,
32135  += (addition assignment operator), <a href="#6.5.16.2">6.5.16.2</a>
32136 <!--page 672 -->
32137       <a href="#6.4.5">6.4.5</a>, <a href="#6.5.3.4">6.5.3.4</a>, <a href="#6.5.6">6.5.6</a>, <a href="#7.19">7.19</a>, <a href="#K.3.3">K.3.3</a>                      \x hexadecimal digits (hexadecimal-character
32138  <a href="#7.20">&lt;stdint.h&gt;</a> header, <a href="#4">4</a>, <a href="#5.2.4.2">5.2.4.2</a>, <a href="#6.10.1">6.10.1</a>, <a href="#7.8">7.8</a>,                       escape sequence), <a href="#6.4.4.4">6.4.4.4</a>
32139       <a href="#7.20">7.20</a>, <a href="#7.30.8">7.30.8</a>, <a href="#K.3.3">K.3.3</a>, <a href="#K.3.4">K.3.4</a>                              ^ (bitwise exclusive OR operator), <a href="#6.2.6.2">6.2.6.2</a>, <a href="#6.5.11">6.5.11</a>
32140  <a href="#7.21">&lt;stdio.h&gt;</a> header, <a href="#5.2.4.2.2">5.2.4.2.2</a>, <a href="#7.21">7.21</a>, <a href="#7.30.9">7.30.9</a>, <a href="#F">F</a>,                ^= (bitwise exclusive OR assignment operator),
32141       <a href="#K.3.5">K.3.5</a>                                                        <a href="#6.5.16.2">6.5.16.2</a>
32142  <a href="#7.22">&lt;stdlib.h&gt;</a> header, <a href="#5.2.4.2.2">5.2.4.2.2</a>, <a href="#7.22">7.22</a>, <a href="#7.30.10">7.30.10</a>, <a href="#F">F</a>,              __alignas_is_defined macro, <a href="#7.15">7.15</a>
32143       <a href="#K.3.1.4">K.3.1.4</a>, <a href="#K.3.6">K.3.6</a>                                          __bool_true_false_are_defined
32144  <a href="#7.23">&lt;string.h&gt;</a> header, <a href="#7.23">7.23</a>, <a href="#7.30.11">7.30.11</a>, <a href="#K.3.7">K.3.7</a>                           macro, <a href="#7.18">7.18</a>
32145  <a href="#7.24">&lt;tgmath.h&gt;</a> header, <a href="#7.24">7.24</a>, <a href="#G.7">G.7</a>                                 __cplusplus macro, <a href="#6.10.8">6.10.8</a>
32146  <a href="#7.25">&lt;threads.h&gt;</a> header, <a href="#6.10.8.3">6.10.8.3</a>, <a href="#7.1.2">7.1.2</a>, <a href="#7.25">7.25</a>                    __DATE__ macro, <a href="#6.10.8.1">6.10.8.1</a>
32147  <a href="#7.26">&lt;time.h&gt;</a> header, <a href="#7.26">7.26</a>, <a href="#K.3.8">K.3.8</a>                                 __FILE__ macro, <a href="#6.10.8.1">6.10.8.1</a>, <a href="#7.2.1.1">7.2.1.1</a>
32148  <a href="#7.27">&lt;uchar.h&gt;</a> header, <a href="#6.4.4.4">6.4.4.4</a>, <a href="#6.4.5">6.4.5</a>, <a href="#7.27">7.27</a>                       __func__ identifier, <a href="#6.4.2.2">6.4.2.2</a>, <a href="#7.2.1.1">7.2.1.1</a>
32149  <a href="#7.28">&lt;wchar.h&gt;</a> header, <a href="#5.2.4.2.2">5.2.4.2.2</a>, <a href="#7.21.1">7.21.1</a>, <a href="#7.28">7.28</a>,                   __LINE__ macro, <a href="#6.10.8.1">6.10.8.1</a>, <a href="#7.2.1.1">7.2.1.1</a>
32150       <a href="#7.30.12">7.30.12</a>, <a href="#F">F</a>, <a href="#K.3.9">K.3.9</a>                                       __STDC_, <a href="#6.11.9">6.11.9</a>
32151  <a href="#7.29">&lt;wctype.h&gt;</a> header, <a href="#7.29">7.29</a>, <a href="#7.30.13">7.30.13</a>                             __STDC__ macro, <a href="#6.10.8.1">6.10.8.1</a>
32152  = (equal-sign punctuator), <a href="#6.7">6.7</a>, <a href="#6.7.2.2">6.7.2.2</a>, <a href="#6.7.9">6.7.9</a>               __STDC_ANALYZABLE__ macro, <a href="#6.10.8.3">6.10.8.3</a>, <a href="#L.1">L.1</a>
32153  = (simple assignment operator), <a href="#6.5.16.1">6.5.16.1</a>                     __STDC_HOSTED__ macro, <a href="#6.10.8.1">6.10.8.1</a>
32154  == (equality operator), <a href="#6.5.9">6.5.9</a>                                __STDC_IEC_559__ macro, <a href="#6.10.8.3">6.10.8.3</a>, <a href="#F.1">F.1</a>
32155  &gt; (greater-than operator), <a href="#6.5.8">6.5.8</a>                             __STDC_IEC_559_COMPLEX__ macro,
32156  &gt;= (greater-than-or-equal-to operator), <a href="#6.5.8">6.5.8</a>                     <a href="#6.10.8.3">6.10.8.3</a>, <a href="#G.1">G.1</a>
32157  &gt;&gt; (right-shift operator), <a href="#6.2.6.2">6.2.6.2</a>, <a href="#6.5.7">6.5.7</a>                    __STDC_ISO_10646__ macro, <a href="#6.10.8.2">6.10.8.2</a>
32158  &gt;&gt;= (right-shift assignment operator), <a href="#6.5.16.2">6.5.16.2</a>              __STDC_LIB_EXT1__ macro, <a href="#6.10.8.3">6.10.8.3</a>, <a href="#K.2">K.2</a>
32159  ? : (conditional operator), <a href="#5.1.2.4">5.1.2.4</a>, <a href="#6.5.15">6.5.15</a>                  __STDC_MB_MIGHT_NEQ_WC__ macro,
32160  ?? (trigraph sequences), <a href="#5.2.1.1">5.2.1.1</a>                                  <a href="#6.10.8.2">6.10.8.2</a>, <a href="#7.19">7.19</a>
32161  [ ] (array subscript operator), <a href="#6.5.2.1">6.5.2.1</a>, <a href="#6.5.3.2">6.5.3.2</a>             __STDC_NO_COMPLEX__ macro, <a href="#6.10.8.3">6.10.8.3</a>,
32162  [ ] (brackets punctuator), <a href="#6.7.6.2">6.7.6.2</a>, <a href="#6.7.9">6.7.9</a>                         <a href="#7.3.1">7.3.1</a>
32163  \ (backslash character), <a href="#5.1.1.2">5.1.1.2</a>, <a href="#5.2.1">5.2.1</a>, <a href="#6.4.4.4">6.4.4.4</a>             __STDC_NO_THREADS__ macro, <a href="#6.10.8.3">6.10.8.3</a>,
32164  \ (escape character), <a href="#6.4.4.4">6.4.4.4</a>                                     <a href="#7.17.1">7.17.1</a>, <a href="#7.25.1">7.25.1</a>
32165  \" (double-quote escape sequence), <a href="#6.4.4.4">6.4.4.4</a>,                  __STDC_NO_VLA__ macro, <a href="#6.10.8.3">6.10.8.3</a>
32166       <a href="#6.4.5">6.4.5</a>, <a href="#6.10.9">6.10.9</a>                                           __STDC_UTF_16__ macro, <a href="#6.10.8.2">6.10.8.2</a>
32167  \\ (backslash escape sequence), <a href="#6.4.4.4">6.4.4.4</a>, <a href="#6.10.9">6.10.9</a>              __STDC_UTF_32__ macro, <a href="#6.10.8.2">6.10.8.2</a>
32168  \' (single-quote escape sequence), <a href="#6.4.4.4">6.4.4.4</a>, <a href="#6.4.5">6.4.5</a>            __STDC_VERSION__ macro, <a href="#6.10.8.1">6.10.8.1</a>
32169  \0 (null character), <a href="#5.2.1">5.2.1</a>, <a href="#6.4.4.4">6.4.4.4</a>, <a href="#6.4.5">6.4.5</a>                   __STDC_WANT_LIB_EXT1__ macro, <a href="#K.3.1.1">K.3.1.1</a>
32170    padding of binary stream, <a href="#7.21.2">7.21.2</a>                           __TIME__ macro, <a href="#6.10.8.1">6.10.8.1</a>
32171  \? (question-mark escape sequence), <a href="#6.4.4.4">6.4.4.4</a>                  __VA_ARGS__ identifier, <a href="#6.10.3">6.10.3</a>, <a href="#6.10.3.1">6.10.3.1</a>
32172  \a (alert escape sequence), <a href="#5.2.2">5.2.2</a>, <a href="#6.4.4.4">6.4.4.4</a>                   _Alignas, <a href="#6.7.5">6.7.5</a>
32173  \b (backspace escape sequence), <a href="#5.2.2">5.2.2</a>, <a href="#6.4.4.4">6.4.4.4</a>               _Atomic type qualifier, <a href="#6.7.3">6.7.3</a>
32174  \f (form-feed escape sequence), <a href="#5.2.2">5.2.2</a>, <a href="#6.4.4.4">6.4.4.4</a>,              _Bool type, <a href="#6.2.5">6.2.5</a>, <a href="#6.3.1.1">6.3.1.1</a>, <a href="#6.3.1.2">6.3.1.2</a>, <a href="#6.7.2">6.7.2</a>, <a href="#7.17.1">7.17.1</a>,
32175       <a href="#7.4.1.10">7.4.1.10</a>                                                     <a href="#F.4">F.4</a>
32176  \n (new-line escape sequence), <a href="#5.2.2">5.2.2</a>, <a href="#6.4.4.4">6.4.4.4</a>,               _Bool type conversions, <a href="#6.3.1.2">6.3.1.2</a>
32177       <a href="#7.4.1.10">7.4.1.10</a>                                                _Complex types, <a href="#6.2.5">6.2.5</a>, <a href="#6.7.2">6.7.2</a>, <a href="#7.3.1">7.3.1</a>, <a href="#G">G</a>
32178  \octal digits (octal-character escape sequence),             _Complex_I macro, <a href="#7.3.1">7.3.1</a>
32179       <a href="#6.4.4.4">6.4.4.4</a>                                                 _Exit function, <a href="#7.22.4.5">7.22.4.5</a>, <a href="#7.22.4.7">7.22.4.7</a>
32180  \r (carriage-return escape sequence), <a href="#5.2.2">5.2.2</a>,                 _Imaginary keyword, <a href="#G.2">G.2</a>
32181       <a href="#6.4.4.4">6.4.4.4</a>, <a href="#7.4.1.10">7.4.1.10</a>                                       _Imaginary types, <a href="#7.3.1">7.3.1</a>, <a href="#G">G</a>
32182  \t (horizontal-tab escape sequence), <a href="#5.2.2">5.2.2</a>,                  _Imaginary_I macro, <a href="#7.3.1">7.3.1</a>, <a href="#G.6">G.6</a>
32183       <a href="#6.4.4.4">6.4.4.4</a>, <a href="#7.4.1.3">7.4.1.3</a>, <a href="#7.4.1.10">7.4.1.10</a>, <a href="#7.29.2.1.3">7.29.2.1.3</a>                  _IOFBF macro, <a href="#7.21.1">7.21.1</a>, <a href="#7.21.5.5">7.21.5.5</a>, <a href="#7.21.5.6">7.21.5.6</a>
32184  \U (universal character names), <a href="#6.4.3">6.4.3</a>                        _IOLBF macro, <a href="#7.21.1">7.21.1</a>, <a href="#7.21.5.6">7.21.5.6</a>
32185  \u (universal character names), <a href="#6.4.3">6.4.3</a>                        _IONBF macro, <a href="#7.21.1">7.21.1</a>, <a href="#7.21.5.5">7.21.5.5</a>, <a href="#7.21.5.6">7.21.5.6</a>
32186  \v (vertical-tab escape sequence), <a href="#5.2.2">5.2.2</a>, <a href="#6.4.4.4">6.4.4.4</a>,           _Noreturn, <a href="#6.7.4">6.7.4</a>
32187       <a href="#7.4.1.10">7.4.1.10</a>                                                _Pragma operator, <a href="#5.1.1.2">5.1.1.2</a>, <a href="#6.10.9">6.10.9</a>
32188 <!--page 673 -->
32189  _Static_assert, <a href="#6.7.10">6.7.10</a>, <a href="#7.2">7.2</a>                                  allocated storage, order and contiguity, <a href="#7.22.3">7.22.3</a>
32190  _Thread_local storage-class specifier, <a href="#6.2.4">6.2.4</a>,                 and macro, <a href="#7.9">7.9</a>
32191       <a href="#6.7.1">6.7.1</a>                                                   AND operators
32192  { } (braces punctuator), <a href="#6.7.2.2">6.7.2.2</a>, <a href="#6.7.2.3">6.7.2.3</a>, <a href="#6.7.9">6.7.9</a>,               bitwise (&amp;), <a href="#6.2.6.2">6.2.6.2</a>, <a href="#6.5.10">6.5.10</a>
32193       <a href="#6.8.2">6.8.2</a>                                                      bitwise assignment (&amp;=), <a href="#6.5.16.2">6.5.16.2</a>
32194  { } (compound-literal operator), <a href="#6.5.2.5">6.5.2.5</a>                        logical (&amp;&amp;), <a href="#5.1.2.4">5.1.2.4</a>, <a href="#6.5.13">6.5.13</a>
32195  | (bitwise inclusive OR operator), <a href="#6.2.6.2">6.2.6.2</a>, <a href="#6.5.12">6.5.12</a>           and_eq macro, <a href="#7.9">7.9</a>
32196  |= (bitwise inclusive OR assignment operator),               anonymous structure, <a href="#6.7.2.1">6.7.2.1</a>
32197       <a href="#6.5.16.2">6.5.16.2</a>                                                anonymous union, <a href="#6.7.2.1">6.7.2.1</a>
32198  || (logical OR operator), <a href="#5.1.2.4">5.1.2.4</a>, <a href="#6.5.14">6.5.14</a>                    ANSI/IEEE 754, <a href="#F.1">F.1</a>
32199  ~ (bitwise complement operator), <a href="#6.2.6.2">6.2.6.2</a>, <a href="#6.5.3.3">6.5.3.3</a>            ANSI/IEEE 854, <a href="#F.1">F.1</a>
32200                                                               argc (main function parameter), <a href="#5.1.2.2.1">5.1.2.2.1</a>
32201  abort function, <a href="#7.2.1.1">7.2.1.1</a>, <a href="#7.14.1.1">7.14.1.1</a>, <a href="#7.21.3">7.21.3</a>,                   argument, <a href="#3.3">3.3</a>
32202        <a href="#7.22.4.1">7.22.4.1</a>, <a href="#7.25.3.6">7.25.3.6</a>, <a href="#K.3.6.1.2">K.3.6.1.2</a>                             array, <a href="#6.9.1">6.9.1</a>
32203  abort_handler_s function, <a href="#K.3.6.1.2">K.3.6.1.2</a>                             default promotions, <a href="#6.5.2.2">6.5.2.2</a>
32204  abs function, <a href="#7.22.6.1">7.22.6.1</a>                                          function, <a href="#6.5.2.2">6.5.2.2</a>, <a href="#6.9.1">6.9.1</a>
32205  absolute-value functions                                        macro, substitution, <a href="#6.10.3.1">6.10.3.1</a>
32206     complex, <a href="#7.3.8">7.3.8</a>, <a href="#G.6.4">G.6.4</a>                                     argument, complex, <a href="#7.3.9.1">7.3.9.1</a>
32207     integer, <a href="#7.8.2.1">7.8.2.1</a>, <a href="#7.22.6.1">7.22.6.1</a>                                argv (main function parameter), <a href="#5.1.2.2.1">5.1.2.2.1</a>
32208     real, <a href="#7.12.7">7.12.7</a>, <a href="#F.10.4">F.10.4</a>                                      arithmetic constant expression, <a href="#6.6">6.6</a>
32209  abstract declarator, <a href="#6.7.7">6.7.7</a>                                   arithmetic conversions, usual, see usual arithmetic
32210  abstract machine, <a href="#5.1.2.3">5.1.2.3</a>                                          conversions
32211  access, <a href="#3.1">3.1</a>, <a href="#6.7.3">6.7.3</a>, <a href="#L.2.1">L.2.1</a>                                    arithmetic operators
32212  accuracy, see floating-point accuracy                            additive, <a href="#6.2.6.2">6.2.6.2</a>, <a href="#6.5.6">6.5.6</a>, <a href="#G.5.2">G.5.2</a>
32213  acos functions, <a href="#7.12.4.1">7.12.4.1</a>, <a href="#F.10.1.1">F.10.1.1</a>                              bitwise, <a href="#6.2.6.2">6.2.6.2</a>, <a href="#6.5.3.3">6.5.3.3</a>, <a href="#6.5.10">6.5.10</a>, <a href="#6.5.11">6.5.11</a>, <a href="#6.5.12">6.5.12</a>
32214  acos type-generic macro, <a href="#7.24">7.24</a>                                   increment and decrement, <a href="#6.5.2.4">6.5.2.4</a>, <a href="#6.5.3.1">6.5.3.1</a>
32215  acosh functions, <a href="#7.12.5.1">7.12.5.1</a>, <a href="#F.10.2.1">F.10.2.1</a>                             multiplicative, <a href="#6.2.6.2">6.2.6.2</a>, <a href="#6.5.5">6.5.5</a>, <a href="#G.5.1">G.5.1</a>
32216  acosh type-generic macro, <a href="#7.24">7.24</a>                                  shift, <a href="#6.2.6.2">6.2.6.2</a>, <a href="#6.5.7">6.5.7</a>
32217  acquire fence, <a href="#7.17.4">7.17.4</a>                                           unary, <a href="#6.5.3.3">6.5.3.3</a>
32218  acquire operation, <a href="#5.1.2.4">5.1.2.4</a>                                   arithmetic types, <a href="#6.2.5">6.2.5</a>
32219  active position, <a href="#5.2.2">5.2.2</a>                                       arithmetic, pointer, <a href="#6.5.6">6.5.6</a>
32220  actual argument, <a href="#3.3">3.3</a>                                         array
32221  actual parameter (deprecated), <a href="#3.3">3.3</a>                              argument, <a href="#6.9.1">6.9.1</a>
32222  addition assignment operator (+=), <a href="#6.5.16.2">6.5.16.2</a>                     declarator, <a href="#6.7.6.2">6.7.6.2</a>
32223  addition operator (+), <a href="#6.2.6.2">6.2.6.2</a>, <a href="#6.5.2.1">6.5.2.1</a>, <a href="#6.5.3.2">6.5.3.2</a>,               initialization, <a href="#6.7.9">6.7.9</a>
32224        <a href="#6.5.6">6.5.6</a>, <a href="#F.3">F.3</a>, <a href="#G.5.2">G.5.2</a>                                         multidimensional, <a href="#6.5.2.1">6.5.2.1</a>
32225  additive expressions, <a href="#6.5.6">6.5.6</a>, <a href="#G.5.2">G.5.2</a>                              parameter, <a href="#6.9.1">6.9.1</a>
32226  address constant, <a href="#6.6">6.6</a>                                           storage order, <a href="#6.5.2.1">6.5.2.1</a>
32227  address operator (&amp;), <a href="#6.3.2.1">6.3.2.1</a>, <a href="#6.5.3.2">6.5.3.2</a>                          subscript operator ([ ]), <a href="#6.5.2.1">6.5.2.1</a>, <a href="#6.5.3.2">6.5.3.2</a>
32228  address-free, <a href="#7.17.5">7.17.5</a>                                            subscripting, <a href="#6.5.2.1">6.5.2.1</a>
32229  aggregate initialization, <a href="#6.7.9">6.7.9</a>                                 type, <a href="#6.2.5">6.2.5</a>
32230  aggregate types, <a href="#6.2.5">6.2.5</a>                                          type conversion, <a href="#6.3.2.1">6.3.2.1</a>
32231  alert escape sequence (\a), <a href="#5.2.2">5.2.2</a>, <a href="#6.4.4.4">6.4.4.4</a>                      variable length, <a href="#6.7.6">6.7.6</a>, <a href="#6.7.6.2">6.7.6.2</a>, <a href="#6.10.8.3">6.10.8.3</a>
32232  aliasing, <a href="#6.5">6.5</a>                                                arrow operator (-&gt;), <a href="#6.5.2.3">6.5.2.3</a>
32233  alignas macro, <a href="#7.15">7.15</a>                                          as-if rule, <a href="#5.1.2.3">5.1.2.3</a>
32234  aligned_alloc function, <a href="#7.22.3">7.22.3</a>, <a href="#7.22.3.1">7.22.3.1</a>                     ASCII code set, <a href="#5.2.1.1">5.2.1.1</a>
32235  alignment, <a href="#3.2">3.2</a>, <a href="#6.2.8">6.2.8</a>, <a href="#7.22.3.1">7.22.3.1</a>                              asctime function, <a href="#7.26.3.1">7.26.3.1</a>
32236     pointer, <a href="#6.2.5">6.2.5</a>, <a href="#6.3.2.3">6.3.2.3</a>                                   asctime_s function, <a href="#K.3.8.2">K.3.8.2</a>, <a href="#K.3.8.2.1">K.3.8.2.1</a>
32237     structure/union member, <a href="#6.7.2.1">6.7.2.1</a>                           asin functions, <a href="#7.12.4.2">7.12.4.2</a>, <a href="#F.10.1.2">F.10.1.2</a>
32238  alignment specifier, <a href="#6.7.5">6.7.5</a>                                    asin type-generic macro, <a href="#7.24">7.24</a>, <a href="#G.7">G.7</a>
32239  alignof operator, <a href="#6.5.3">6.5.3</a>, <a href="#6.5.3.4">6.5.3.4</a>                             asinh functions, <a href="#7.12.5.2">7.12.5.2</a>, <a href="#F.10.2.2">F.10.2.2</a>
32240 <!--page 674 -->
32241  asinh type-generic macro, <a href="#7.24">7.24</a>, <a href="#G.7">G.7</a>                           atomic_is_lock_free generic function,
32242  asm keyword, <a href="#J.5.10">J.5.10</a>                                               <a href="#7.17.5.1">7.17.5.1</a>
32243  assert macro, <a href="#7.2.1.1">7.2.1.1</a>                                         ATOMIC_LLONG_LOCK_FREE macro, <a href="#7.17.1">7.17.1</a>
32244  assert.h header, <a href="#7.2">7.2</a>                                          atomic_load generic functions, <a href="#7.17.7.2">7.17.7.2</a>
32245  assignment                                                    ATOMIC_LONG_LOCK_FREE macro, <a href="#7.17.1">7.17.1</a>
32246     compound, <a href="#6.5.16.2">6.5.16.2</a>                                         ATOMIC_SHORT_LOCK_FREE macro, <a href="#7.17.1">7.17.1</a>
32247     conversion, <a href="#6.5.16.1">6.5.16.1</a>                                       atomic_signal_fence function, <a href="#7.17.4.2">7.17.4.2</a>
32248     expression, <a href="#6.5.16">6.5.16</a>                                         atomic_store generic functions, <a href="#7.17.7.1">7.17.7.1</a>
32249     operators, <a href="#6.3.2.1">6.3.2.1</a>, <a href="#6.5.16">6.5.16</a>                                 atomic_thread_fence function, <a href="#7.17.4.1">7.17.4.1</a>
32250     simple, <a href="#6.5.16.1">6.5.16.1</a>                                           ATOMIC_VAR_INIT macro, <a href="#7.17.2.1">7.17.2.1</a>
32251  associativity of operators, <a href="#6.5">6.5</a>                               ATOMIC_WCHAR_T_LOCK_FREE macro, <a href="#7.17.1">7.17.1</a>
32252  asterisk punctuator (*), <a href="#6.7.6.1">6.7.6.1</a>, <a href="#6.7.6.2">6.7.6.2</a>                     atomics header, <a href="#7.17">7.17</a>
32253  at_quick_exit function, <a href="#7.22.4.2">7.22.4.2</a>, <a href="#7.22.4.3">7.22.4.3</a>,                   auto storage-class specifier, <a href="#6.7.1">6.7.1</a>, <a href="#6.9">6.9</a>
32254       <a href="#7.22.4.4">7.22.4.4</a>, <a href="#7.22.4.5">7.22.4.5</a>, <a href="#7.22.4.7">7.22.4.7</a>                             automatic storage duration, <a href="#5.2.3">5.2.3</a>, <a href="#6.2.4">6.2.4</a>
32255  atan functions, <a href="#7.12.4.3">7.12.4.3</a>, <a href="#F.10.1.3">F.10.1.3</a>
32256  atan type-generic macro, <a href="#7.24">7.24</a>, <a href="#G.7">G.7</a>                            backslash character (\), <a href="#5.1.1.2">5.1.1.2</a>, <a href="#5.2.1">5.2.1</a>, <a href="#6.4.4.4">6.4.4.4</a>
32257  atan2 functions, <a href="#7.12.4.4">7.12.4.4</a>, <a href="#F.10.1.4">F.10.1.4</a>                           backslash escape sequence (\\), <a href="#6.4.4.4">6.4.4.4</a>, <a href="#6.10.9">6.10.9</a>
32258  atan2 type-generic macro, <a href="#7.24">7.24</a>                                backspace escape sequence (\b), <a href="#5.2.2">5.2.2</a>, <a href="#6.4.4.4">6.4.4.4</a>
32259  atanh functions, <a href="#7.12.5.3">7.12.5.3</a>, <a href="#F.10.2.3">F.10.2.3</a>                           basic character set, <a href="#3.6">3.6</a>, <a href="#3.7.2">3.7.2</a>, <a href="#5.2.1">5.2.1</a>
32260  atanh type-generic macro, <a href="#7.24">7.24</a>, <a href="#G.7">G.7</a>                           basic types, <a href="#6.2.5">6.2.5</a>
32261  atexit function, <a href="#7.22.4.2">7.22.4.2</a>, <a href="#7.22.4.3">7.22.4.3</a>, <a href="#7.22.4.4">7.22.4.4</a>,                behavior, <a href="#3.4">3.4</a>
32262       <a href="#7.22.4.5">7.22.4.5</a>, <a href="#7.22.4.7">7.22.4.7</a>, <a href="#J.5.13">J.5.13</a>                               binary streams, <a href="#7.21.2">7.21.2</a>, <a href="#7.21.7.10">7.21.7.10</a>, <a href="#7.21.9.2">7.21.9.2</a>,
32263  atof function, <a href="#7.22.1">7.22.1</a>, <a href="#7.22.1.1">7.22.1.1</a>                                     <a href="#7.21.9.4">7.21.9.4</a>
32264  atoi function, <a href="#7.22.1">7.22.1</a>, <a href="#7.22.1.2">7.22.1.2</a>                               bit, <a href="#3.5">3.5</a>
32265  atol function, <a href="#7.22.1">7.22.1</a>, <a href="#7.22.1.2">7.22.1.2</a>                                  high order, <a href="#3.6">3.6</a>
32266  atoll function, <a href="#7.22.1">7.22.1</a>, <a href="#7.22.1.2">7.22.1.2</a>                                 low order, <a href="#3.6">3.6</a>
32267  atomic lock-free macros, <a href="#7.17.1">7.17.1</a>, <a href="#7.17.5">7.17.5</a>                       bit-field, <a href="#6.7.2.1">6.7.2.1</a>
32268  atomic operations, <a href="#5.1.2.4">5.1.2.4</a>                                    bitand macro, <a href="#7.9">7.9</a>
32269  atomic types, <a href="#5.1.2.3">5.1.2.3</a>, <a href="#6.2.5">6.2.5</a>, <a href="#6.2.6.1">6.2.6.1</a>, <a href="#6.3.2.1">6.3.2.1</a>,               bitor macro, <a href="#7.9">7.9</a>
32270       <a href="#6.5.2.3">6.5.2.3</a>, <a href="#6.5.2.4">6.5.2.4</a>, <a href="#6.5.16.2">6.5.16.2</a>, <a href="#6.7.2.4">6.7.2.4</a>, <a href="#6.10.8.3">6.10.8.3</a>,           bitwise operators, <a href="#6.5">6.5</a>
32271       <a href="#7.17.6">7.17.6</a>                                                      AND, <a href="#6.2.6.2">6.2.6.2</a>, <a href="#6.5.10">6.5.10</a>
32272  atomic_address type, <a href="#7.17.1">7.17.1</a>, <a href="#7.17.6">7.17.6</a>                              AND assignment (&amp;=), <a href="#6.5.16.2">6.5.16.2</a>
32273  ATOMIC_ADDRESS_LOCK_FREE macro, <a href="#7.17.1">7.17.1</a>                           complement (~), <a href="#6.2.6.2">6.2.6.2</a>, <a href="#6.5.3.3">6.5.3.3</a>
32274  atomic_bool type, <a href="#7.17.1">7.17.1</a>, <a href="#7.17.6">7.17.6</a>                                 exclusive OR, <a href="#6.2.6.2">6.2.6.2</a>, <a href="#6.5.11">6.5.11</a>
32275  ATOMIC_CHAR16_T_LOCK_FREE macro,                                 exclusive OR assignment (^=), <a href="#6.5.16.2">6.5.16.2</a>
32276       <a href="#7.17.1">7.17.1</a>                                                      inclusive OR, <a href="#6.2.6.2">6.2.6.2</a>, <a href="#6.5.12">6.5.12</a>
32277  ATOMIC_CHAR32_T_LOCK_FREE macro,                                 inclusive OR assignment (|=), <a href="#6.5.16.2">6.5.16.2</a>
32278       <a href="#7.17.1">7.17.1</a>                                                      shift, <a href="#6.2.6.2">6.2.6.2</a>, <a href="#6.5.7">6.5.7</a>
32279  ATOMIC_CHAR_LOCK_FREE macro, <a href="#7.17.1">7.17.1</a>                           blank character, <a href="#7.4.1.3">7.4.1.3</a>
32280  atomic_compare_exchange generic                               block, <a href="#6.8">6.8</a>, <a href="#6.8.2">6.8.2</a>, <a href="#6.8.4">6.8.4</a>, <a href="#6.8.5">6.8.5</a>
32281       functions, <a href="#7.17.7.4">7.17.7.4</a>                                      block scope, <a href="#6.2.1">6.2.1</a>
32282  atomic_exchange generic functions, <a href="#7.17.7.3">7.17.7.3</a>                   block structure, <a href="#6.2.1">6.2.1</a>
32283  atomic_fetch and modify generic functions,                    bold type convention, <a href="#6.1">6.1</a>
32284       <a href="#7.17.7.5">7.17.7.5</a>                                                 bool macro, <a href="#7.18">7.18</a>
32285  atomic_flag type, <a href="#7.17.1">7.17.1</a>, <a href="#7.17.8">7.17.8</a>                              boolean type, <a href="#6.3.1.2">6.3.1.2</a>
32286  atomic_flag_clear functions, <a href="#7.17.8.2">7.17.8.2</a>                         boolean type conversion, <a href="#6.3.1.1">6.3.1.1</a>, <a href="#6.3.1.2">6.3.1.2</a>
32287  ATOMIC_FLAG_INIT macro, <a href="#7.17.1">7.17.1</a>, <a href="#7.17.8">7.17.8</a>                        bounded undefined behavior, <a href="#L.2.2">L.2.2</a>
32288  atomic_flag_test_and_set functions,                           braces punctuator ({ }), <a href="#6.7.2.2">6.7.2.2</a>, <a href="#6.7.2.3">6.7.2.3</a>, <a href="#6.7.9">6.7.9</a>,
32289       <a href="#7.17.8.1">7.17.8.1</a>                                                       <a href="#6.8.2">6.8.2</a>
32290  atomic_init generic function, <a href="#7.17.2.2">7.17.2.2</a>                        brackets operator ([ ]), <a href="#6.5.2.1">6.5.2.1</a>, <a href="#6.5.3.2">6.5.3.2</a>
32291  ATOMIC_INT_LOCK_FREE macro, <a href="#7.17.1">7.17.1</a>                            brackets punctuator ([ ]), <a href="#6.7.6.2">6.7.6.2</a>, <a href="#6.7.9">6.7.9</a>
32292 <!--page 675 -->
32293  branch cuts, <a href="#7.3.3">7.3.3</a>                                                type-generic macro for, <a href="#7.24">7.24</a>
32294  break statement, <a href="#6.8.6.3">6.8.6.3</a>                                       ccosh functions, <a href="#7.3.6.4">7.3.6.4</a>, <a href="#G.6.2.4">G.6.2.4</a>
32295  broken-down time, <a href="#7.26.1">7.26.1</a>, <a href="#7.26.2.3">7.26.2.3</a>, <a href="#7.26.3">7.26.3</a>,                       type-generic macro for, <a href="#7.24">7.24</a>
32296       <a href="#7.26.3.1">7.26.3.1</a>, <a href="#7.26.3.3">7.26.3.3</a>, <a href="#7.26.3.4">7.26.3.4</a>, <a href="#7.26.3.5">7.26.3.5</a>,                   ceil functions, <a href="#7.12.9.1">7.12.9.1</a>, <a href="#F.10.6.1">F.10.6.1</a>
32297       <a href="#K.3.8.2.1">K.3.8.2.1</a>, <a href="#K.3.8.2.3">K.3.8.2.3</a>, <a href="#K.3.8.2.4">K.3.8.2.4</a>                           ceil type-generic macro, <a href="#7.24">7.24</a>
32298  bsearch function, <a href="#7.22.5">7.22.5</a>, <a href="#7.22.5.1">7.22.5.1</a>                             cerf function, <a href="#7.30.1">7.30.1</a>
32299  bsearch_s function, <a href="#K.3.6.3">K.3.6.3</a>, <a href="#K.3.6.3.1">K.3.6.3.1</a>                         cerfc function, <a href="#7.30.1">7.30.1</a>
32300  btowc function, <a href="#7.28.6.1.1">7.28.6.1.1</a>                                     cexp functions, <a href="#7.3.7.1">7.3.7.1</a>, <a href="#G.6.3.1">G.6.3.1</a>
32301  BUFSIZ macro, <a href="#7.21.1">7.21.1</a>, <a href="#7.21.2">7.21.2</a>, <a href="#7.21.5.5">7.21.5.5</a>                            type-generic macro for, <a href="#7.24">7.24</a>
32302  byte, <a href="#3.6">3.6</a>, <a href="#6.5.3.4">6.5.3.4</a>                                             cexp2 function, <a href="#7.30.1">7.30.1</a>
32303  byte input/output functions, <a href="#7.21.1">7.21.1</a>                            cexpm1 function, <a href="#7.30.1">7.30.1</a>
32304  byte-oriented stream, <a href="#7.21.2">7.21.2</a>                                   char type, <a href="#6.2.5">6.2.5</a>, <a href="#6.3.1.1">6.3.1.1</a>, <a href="#6.7.2">6.7.2</a>, <a href="#K.3.5.3.2">K.3.5.3.2</a>,
32305                                                                       <a href="#K.3.9.1.2">K.3.9.1.2</a>
32306  <a href="#C">C</a> program, <a href="#5.1.1.1">5.1.1.1</a>                                             char type conversion, <a href="#6.3.1.1">6.3.1.1</a>, <a href="#6.3.1.3">6.3.1.3</a>, <a href="#6.3.1.4">6.3.1.4</a>,
32307  c16rtomb function, <a href="#7.27.1.2">7.27.1.2</a>                                          <a href="#6.3.1.8">6.3.1.8</a>
32308  c32rtomb function, <a href="#7.27.1.4">7.27.1.4</a>                                    char16_t type, <a href="#6.4.4.4">6.4.4.4</a>, <a href="#6.4.5">6.4.5</a>, <a href="#6.10.8.2">6.10.8.2</a>, <a href="#7.27">7.27</a>
32309  cabs functions, <a href="#7.3.8.1">7.3.8.1</a>, <a href="#G.6">G.6</a>                                   char32_t type, <a href="#6.4.4.4">6.4.4.4</a>, <a href="#6.4.5">6.4.5</a>, <a href="#6.10.8.2">6.10.8.2</a>, <a href="#7.27">7.27</a>
32310    type-generic macro for, <a href="#7.24">7.24</a>                                 CHAR_BIT macro, <a href="#5.2.4.2.1">5.2.4.2.1</a>, <a href="#6.7.2.1">6.7.2.1</a>
32311  cacos functions, <a href="#7.3.5.1">7.3.5.1</a>, <a href="#G.6.1.1">G.6.1.1</a>                              CHAR_MAX macro, <a href="#5.2.4.2.1">5.2.4.2.1</a>, <a href="#7.11.2.1">7.11.2.1</a>
32312    type-generic macro for, <a href="#7.24">7.24</a>                                 CHAR_MIN macro, <a href="#5.2.4.2.1">5.2.4.2.1</a>
32313  cacosh functions, <a href="#7.3.6.1">7.3.6.1</a>, <a href="#G.6.2.1">G.6.2.1</a>                             character, <a href="#3.7">3.7</a>, <a href="#3.7.1">3.7.1</a>
32314    type-generic macro for, <a href="#7.24">7.24</a>                                 character array initialization, <a href="#6.7.9">6.7.9</a>
32315  calendar time, <a href="#7.26.1">7.26.1</a>, <a href="#7.26.2.2">7.26.2.2</a>, <a href="#7.26.2.3">7.26.2.3</a>, <a href="#7.26.2.4">7.26.2.4</a>,           character case mapping functions, <a href="#7.4.2">7.4.2</a>
32316        <a href="#7.26.3.2">7.26.3.2</a>, <a href="#7.26.3.3">7.26.3.3</a>, <a href="#7.26.3.4">7.26.3.4</a>, <a href="#K.3.8.2.2">K.3.8.2.2</a>,                    wide character, <a href="#7.29.3.1">7.29.3.1</a>
32317        <a href="#K.3.8.2.3">K.3.8.2.3</a>, <a href="#K.3.8.2.4">K.3.8.2.4</a>                                           extensible, <a href="#7.29.3.2">7.29.3.2</a>
32318  call by value, <a href="#6.5.2.2">6.5.2.2</a>                                         character classification functions, <a href="#7.4.1">7.4.1</a>
32319  call_once function, <a href="#7.25.1">7.25.1</a>, <a href="#7.25.2.1">7.25.2.1</a>                              wide character, <a href="#7.29.2.1">7.29.2.1</a>
32320  calloc function, <a href="#7.22.3">7.22.3</a>, <a href="#7.22.3.2">7.22.3.2</a>                                    extensible, <a href="#7.29.2.2">7.29.2.2</a>
32321  carg functions, <a href="#7.3.9.1">7.3.9.1</a>, <a href="#G.6">G.6</a>                                   character constant, <a href="#5.1.1.2">5.1.1.2</a>, <a href="#5.2.1">5.2.1</a>, <a href="#6.4.4.4">6.4.4.4</a>
32322  carg type-generic macro, <a href="#7.24">7.24</a>, <a href="#G.7">G.7</a>                             character display semantics, <a href="#5.2.2">5.2.2</a>
32323  carriage-return escape sequence (\r), <a href="#5.2.2">5.2.2</a>,                   character handling header, <a href="#7.4">7.4</a>, <a href="#7.11.1.1">7.11.1.1</a>
32324        <a href="#6.4.4.4">6.4.4.4</a>, <a href="#7.4.1.10">7.4.1.10</a>                                        character input/output functions, <a href="#7.21.7">7.21.7</a>, <a href="#K.3.5.4">K.3.5.4</a>
32325  carries a dependency, <a href="#5.1.2.4">5.1.2.4</a>                                     wide character, <a href="#7.28.3">7.28.3</a>
32326  case label, <a href="#6.8.1">6.8.1</a>, <a href="#6.8.4.2">6.8.4.2</a>                                     character sets, <a href="#5.2.1">5.2.1</a>
32327  case mapping functions                                         character string literal, see string literal
32328    character, <a href="#7.4.2">7.4.2</a>                                             character type conversion, <a href="#6.3.1.1">6.3.1.1</a>
32329    wide character, <a href="#7.29.3.1">7.29.3.1</a>                                     character types, <a href="#6.2.5">6.2.5</a>, <a href="#6.7.9">6.7.9</a>
32330        extensible, <a href="#7.29.3.2">7.29.3.2</a>                                     cimag functions, <a href="#7.3.9.2">7.3.9.2</a>, <a href="#7.3.9.5">7.3.9.5</a>, <a href="#G.6">G.6</a>
32331  casin functions, <a href="#7.3.5.2">7.3.5.2</a>, <a href="#G.6">G.6</a>                                  cimag type-generic macro, <a href="#7.24">7.24</a>, <a href="#G.7">G.7</a>
32332    type-generic macro for, <a href="#7.24">7.24</a>                                 cis function, <a href="#G.6">G.6</a>
32333  casinh functions, <a href="#7.3.6.2">7.3.6.2</a>, <a href="#G.6.2.2">G.6.2.2</a>                             classification functions
32334    type-generic macro for, <a href="#7.24">7.24</a>                                    character, <a href="#7.4.1">7.4.1</a>
32335  cast expression, <a href="#6.5.4">6.5.4</a>                                            floating-point, <a href="#7.12.3">7.12.3</a>
32336  cast operator (( )), <a href="#6.5.4">6.5.4</a>                                        wide character, <a href="#7.29.2.1">7.29.2.1</a>
32337  catan functions, <a href="#7.3.5.3">7.3.5.3</a>, <a href="#G.6">G.6</a>                                        extensible, <a href="#7.29.2.2">7.29.2.2</a>
32338    type-generic macro for, <a href="#7.24">7.24</a>                                 clearerr function, <a href="#7.21.10.1">7.21.10.1</a>
32339  catanh functions, <a href="#7.3.6.3">7.3.6.3</a>, <a href="#G.6.2.3">G.6.2.3</a>                             clgamma function, <a href="#7.30.1">7.30.1</a>
32340    type-generic macro for, <a href="#7.24">7.24</a>                                 clock function, <a href="#7.26.2.1">7.26.2.1</a>
32341  cbrt functions, <a href="#7.12.7.1">7.12.7.1</a>, <a href="#F.10.4.1">F.10.4.1</a>                             clock_t type, <a href="#7.26.1">7.26.1</a>, <a href="#7.26.2.1">7.26.2.1</a>
32342  cbrt type-generic macro, <a href="#7.24">7.24</a>                                  CLOCKS_PER_SEC macro, <a href="#7.26.1">7.26.1</a>, <a href="#7.26.2.1">7.26.2.1</a>
32343  ccos functions, <a href="#7.3.5.4">7.3.5.4</a>, <a href="#G.6">G.6</a>                                   clog functions, <a href="#7.3.7.2">7.3.7.2</a>, <a href="#G.6.3.2">G.6.3.2</a>
32344 <!--page 676 -->
32345    type-generic macro for, <a href="#7.24">7.24</a>                                  string, <a href="#7.23.3">7.23.3</a>, <a href="#K.3.7.2">K.3.7.2</a>
32346  clog10 function, <a href="#7.30.1">7.30.1</a>                                         wide string, <a href="#7.28.4.3">7.28.4.3</a>, <a href="#K.3.9.2.2">K.3.9.2.2</a>
32347  clog1p function, <a href="#7.30.1">7.30.1</a>                                       concatenation, preprocessing, see preprocessing
32348  clog2 function, <a href="#7.30.1">7.30.1</a>                                             concatenation
32349  CMPLX macros, <a href="#7.3.9.3">7.3.9.3</a>                                         conceptual models, <a href="#5.1">5.1</a>
32350  cnd_broadcast function, <a href="#7.25.3.1">7.25.3.1</a>, <a href="#7.25.3.5">7.25.3.5</a>,                   conditional features, <a href="#4">4</a>, <a href="#6.2.5">6.2.5</a>, <a href="#6.7.6.2">6.7.6.2</a>, <a href="#6.10.8.3">6.10.8.3</a>,
32351       <a href="#7.25.3.6">7.25.3.6</a>                                                      <a href="#7.1.2">7.1.2</a>, <a href="#F.1">F.1</a>, <a href="#G.1">G.1</a>, <a href="#K.2">K.2</a>, <a href="#L.1">L.1</a>
32352  cnd_destroy function, <a href="#7.25.3.2">7.25.3.2</a>                                conditional inclusion, <a href="#6.10.1">6.10.1</a>
32353  cnd_init function, <a href="#7.25.3.3">7.25.3.3</a>                                   conditional operator (? :), <a href="#5.1.2.4">5.1.2.4</a>, <a href="#6.5.15">6.5.15</a>
32354  cnd_signal function, <a href="#7.25.3.4">7.25.3.4</a>, <a href="#7.25.3.5">7.25.3.5</a>,                      conflict, <a href="#5.1.2.4">5.1.2.4</a>
32355       <a href="#7.25.3.6">7.25.3.6</a>                                                 conformance, <a href="#4">4</a>
32356  cnd_t type, <a href="#7.25.1">7.25.1</a>                                            conj functions, <a href="#7.3.9.4">7.3.9.4</a>, <a href="#G.6">G.6</a>
32357  cnd_timedwait function, <a href="#7.25.3.5">7.25.3.5</a>                              conj type-generic macro, <a href="#7.24">7.24</a>
32358  cnd_wait function, <a href="#7.25.3.3">7.25.3.3</a>, <a href="#7.25.3.6">7.25.3.6</a>                         const type qualifier, <a href="#6.7.3">6.7.3</a>
32359  collating sequences, <a href="#5.2.1">5.2.1</a>                                    const-qualified type, <a href="#6.2.5">6.2.5</a>, <a href="#6.3.2.1">6.3.2.1</a>, <a href="#6.7.3">6.7.3</a>
32360  colon punctuator (:), <a href="#6.7.2.1">6.7.2.1</a>                                 constant expression, <a href="#6.6">6.6</a>, <a href="#F.8.4">F.8.4</a>
32361  comma operator (,), <a href="#5.1.2.4">5.1.2.4</a>, <a href="#6.5.17">6.5.17</a>                           constants, <a href="#6.4.4">6.4.4</a>
32362  comma punctuator (,), <a href="#6.5.2">6.5.2</a>, <a href="#6.7">6.7</a>, <a href="#6.7.2.1">6.7.2.1</a>, <a href="#6.7.2.2">6.7.2.2</a>,             as primary expression, <a href="#6.5.1">6.5.1</a>
32363       <a href="#6.7.2.3">6.7.2.3</a>, <a href="#6.7.9">6.7.9</a>                                             character, <a href="#6.4.4.4">6.4.4.4</a>
32364  command processor, <a href="#7.22.4.8">7.22.4.8</a>                                     enumeration, <a href="#6.2.1">6.2.1</a>, <a href="#6.4.4.3">6.4.4.3</a>
32365  comment delimiters (/* */ and //), <a href="#6.4.9">6.4.9</a>                        floating, <a href="#6.4.4.2">6.4.4.2</a>
32366  comments, <a href="#5.1.1.2">5.1.1.2</a>, <a href="#6.4">6.4</a>, <a href="#6.4.9">6.4.9</a>                                   hexadecimal, <a href="#6.4.4.1">6.4.4.1</a>
32367  common extensions, <a href="#J.5">J.5</a>                                          integer, <a href="#6.4.4.1">6.4.4.1</a>
32368  common initial sequence, <a href="#6.5.2.3">6.5.2.3</a>                                octal, <a href="#6.4.4.1">6.4.4.1</a>
32369  common real type, <a href="#6.3.1.8">6.3.1.8</a>                                     constraint, <a href="#3.8">3.8</a>, <a href="#4">4</a>
32370  common warnings, <a href="#I">I</a>                                            constraint_handler_t type, <a href="#K.3.6">K.3.6</a>
32371  comparison functions, <a href="#7.22.5">7.22.5</a>, <a href="#7.22.5.1">7.22.5.1</a>, <a href="#7.22.5.2">7.22.5.2</a>,             consume operation, <a href="#5.1.2.4">5.1.2.4</a>
32372       <a href="#K.3.6.3">K.3.6.3</a>, <a href="#K.3.6.3.1">K.3.6.3.1</a>, <a href="#K.3.6.3.2">K.3.6.3.2</a>                            content of structure/union/enumeration, <a href="#6.7.2.3">6.7.2.3</a>
32373    string, <a href="#7.23.4">7.23.4</a>                                              contiguity of allocated storage, <a href="#7.22.3">7.22.3</a>
32374    wide string, <a href="#7.28.4.4">7.28.4.4</a>                                       continue statement, <a href="#6.8.6.2">6.8.6.2</a>
32375  comparison macros, <a href="#7.12.14">7.12.14</a>                                    contracted expression, <a href="#6.5">6.5</a>, <a href="#7.12.2">7.12.2</a>, <a href="#F.7">F.7</a>
32376  comparison, pointer, <a href="#6.5.8">6.5.8</a>                                    control character, <a href="#5.2.1">5.2.1</a>, <a href="#7.4">7.4</a>
32377  compatible type, <a href="#6.2.7">6.2.7</a>, <a href="#6.7.2">6.7.2</a>, <a href="#6.7.3">6.7.3</a>, <a href="#6.7.6">6.7.6</a>                   control wide character, <a href="#7.29.2">7.29.2</a>
32378  compl macro, <a href="#7.9">7.9</a>                                              conversion, <a href="#6.3">6.3</a>
32379  complement operator (~), <a href="#6.2.6.2">6.2.6.2</a>, <a href="#6.5.3.3">6.5.3.3</a>                       arithmetic operands, <a href="#6.3.1">6.3.1</a>
32380  complete type, <a href="#6.2.5">6.2.5</a>                                            array argument, <a href="#6.9.1">6.9.1</a>
32381  complex macro, <a href="#7.3.1">7.3.1</a>                                            array parameter, <a href="#6.9.1">6.9.1</a>
32382  complex numbers, <a href="#6.2.5">6.2.5</a>, <a href="#G">G</a>                                       arrays, <a href="#6.3.2.1">6.3.2.1</a>
32383  complex type conversion, <a href="#6.3.1.6">6.3.1.6</a>, <a href="#6.3.1.7">6.3.1.7</a>                       boolean, <a href="#6.3.1.2">6.3.1.2</a>
32384  complex type domain, <a href="#6.2.5">6.2.5</a>                                      boolean, characters, and integers, <a href="#6.3.1.1">6.3.1.1</a>
32385  complex types, <a href="#6.2.5">6.2.5</a>, <a href="#6.7.2">6.7.2</a>, <a href="#6.10.8.3">6.10.8.3</a>, <a href="#G">G</a>                        by assignment, <a href="#6.5.16.1">6.5.16.1</a>
32386  complex.h header, <a href="#5.2.4.2.2">5.2.4.2.2</a>, <a href="#6.10.8.3">6.10.8.3</a>, <a href="#7.1.2">7.1.2</a>,                   by return statement, <a href="#6.8.6.4">6.8.6.4</a>
32387       <a href="#7.3">7.3</a>, <a href="#7.24">7.24</a>, <a href="#7.30.1">7.30.1</a>, <a href="#G.6">G.6</a>, <a href="#J.5.17">J.5.17</a>                             complex types, <a href="#6.3.1.6">6.3.1.6</a>
32388  compliance, see conformance                                     explicit, <a href="#6.3">6.3</a>
32389  components of time, <a href="#7.26.1">7.26.1</a>, <a href="#K.3.8.1">K.3.8.1</a>                             function, <a href="#6.3.2.1">6.3.2.1</a>
32390  composite type, <a href="#6.2.7">6.2.7</a>                                           function argument, <a href="#6.5.2.2">6.5.2.2</a>, <a href="#6.9.1">6.9.1</a>
32391  compound assignment, <a href="#6.5.16.2">6.5.16.2</a>                                   function designators, <a href="#6.3.2.1">6.3.2.1</a>
32392  compound literals, <a href="#6.5.2.5">6.5.2.5</a>                                      function parameter, <a href="#6.9.1">6.9.1</a>
32393  compound statement, <a href="#6.8.2">6.8.2</a>                                       imaginary, <a href="#G.4.1">G.4.1</a>
32394  compound-literal operator (( ){ }), <a href="#6.5.2.5">6.5.2.5</a>                     imaginary and complex, <a href="#G.4.3">G.4.3</a>
32395  concatenation functions                                         implicit, <a href="#6.3">6.3</a>
32396 <!--page 677 -->
32397     lvalues, <a href="#6.3.2.1">6.3.2.1</a>                                             csinh functions, <a href="#7.3.6.5">7.3.6.5</a>, <a href="#G.6.2.5">G.6.2.5</a>
32398     pointer, <a href="#6.3.2.1">6.3.2.1</a>, <a href="#6.3.2.3">6.3.2.3</a>                                      type-generic macro for, <a href="#7.24">7.24</a>
32399     real and complex, <a href="#6.3.1.7">6.3.1.7</a>                                    csqrt functions, <a href="#7.3.8.3">7.3.8.3</a>, <a href="#G.6.4.2">G.6.4.2</a>
32400     real and imaginary, <a href="#G.4.2">G.4.2</a>                                      type-generic macro for, <a href="#7.24">7.24</a>
32401     real floating and integer, <a href="#6.3.1.4">6.3.1.4</a>, <a href="#F.3">F.3</a>, <a href="#F.4">F.4</a>                  ctan functions, <a href="#7.3.5.6">7.3.5.6</a>, <a href="#G.6">G.6</a>
32402     real floating types, <a href="#6.3.1.5">6.3.1.5</a>, <a href="#F.3">F.3</a>                               type-generic macro for, <a href="#7.24">7.24</a>
32403     signed and unsigned integers, <a href="#6.3.1.3">6.3.1.3</a>                        ctanh functions, <a href="#7.3.6.6">7.3.6.6</a>, <a href="#G.6.2.6">G.6.2.6</a>
32404     usual arithmetic, see usual arithmetic                         type-generic macro for, <a href="#7.24">7.24</a>
32405           conversions                                            ctgamma function, <a href="#7.30.1">7.30.1</a>
32406     void type, <a href="#6.3.2.2">6.3.2.2</a>                                           ctime function, <a href="#7.26.3.2">7.26.3.2</a>
32407  conversion functions                                            ctime_s function, <a href="#K.3.8.2">K.3.8.2</a>, <a href="#K.3.8.2.2">K.3.8.2.2</a>
32408     multibyte/wide character, <a href="#7.22.7">7.22.7</a>, <a href="#K.3.6.4">K.3.6.4</a>                    ctype.h header, <a href="#7.4">7.4</a>, <a href="#7.30.2">7.30.2</a>
32409        extended, <a href="#7.28.6">7.28.6</a>, <a href="#K.3.9.3">K.3.9.3</a>                                 current object, <a href="#6.7.9">6.7.9</a>
32410        restartable, <a href="#7.27.1">7.27.1</a>, <a href="#7.28.6.3">7.28.6.3</a>, <a href="#K.3.9.3.1">K.3.9.3.1</a>                  CX_LIMITED_RANGE pragma, <a href="#6.10.6">6.10.6</a>, <a href="#7.3.4">7.3.4</a>
32411     multibyte/wide string, <a href="#7.22.8">7.22.8</a>, <a href="#K.3.6.5">K.3.6.5</a>
32412        restartable, <a href="#7.28.6.4">7.28.6.4</a>, <a href="#K.3.9.3.2">K.3.9.3.2</a>                          data race, <a href="#5.1.2.4">5.1.2.4</a>, <a href="#7.1.4">7.1.4</a>, <a href="#7.22.2.1">7.22.2.1</a>, <a href="#7.22.4.6">7.22.4.6</a>,
32413     numeric, <a href="#7.8.2.3">7.8.2.3</a>, <a href="#7.22.1">7.22.1</a>                                          <a href="#7.23.5.8">7.23.5.8</a>, <a href="#7.23.6.2">7.23.6.2</a>, <a href="#7.26.3">7.26.3</a>, <a href="#7.27.1">7.27.1</a>, <a href="#7.28.6.3">7.28.6.3</a>,
32414        wide string, <a href="#7.8.2.4">7.8.2.4</a>, <a href="#7.28.4.1">7.28.4.1</a>                                 <a href="#7.28.6.4">7.28.6.4</a>
32415     single byte/wide character, <a href="#7.28.6.1">7.28.6.1</a>                         data stream, see streams
32416     time, <a href="#7.26.3">7.26.3</a>, <a href="#K.3.8.2">K.3.8.2</a>                                        date and time header, <a href="#7.26">7.26</a>, <a href="#K.3.8">K.3.8</a>
32417        wide character, <a href="#7.28.5">7.28.5</a>                                    Daylight Saving Time, <a href="#7.26.1">7.26.1</a>
32418  conversion specifier, <a href="#7.21.6.1">7.21.6.1</a>, <a href="#7.21.6.2">7.21.6.2</a>, <a href="#7.28.2.1">7.28.2.1</a>,              DBL_DECIMAL_DIG macro, <a href="#5.2.4.2.2">5.2.4.2.2</a>
32419        <a href="#7.28.2.2">7.28.2.2</a>                                                  DBL_DIG macro, <a href="#5.2.4.2.2">5.2.4.2.2</a>
32420  conversion state, <a href="#7.22.7">7.22.7</a>, <a href="#7.27.1">7.27.1</a>, <a href="#7.27.1.1">7.27.1.1</a>,                     DBL_EPSILON macro, <a href="#5.2.4.2.2">5.2.4.2.2</a>
32421        <a href="#7.27.1.2">7.27.1.2</a>, <a href="#7.27.1.3">7.27.1.3</a>, <a href="#7.27.1.4">7.27.1.4</a>, <a href="#7.28.6">7.28.6</a>,                     DBL_HAS_SUBNORM macro, <a href="#5.2.4.2.2">5.2.4.2.2</a>
32422        <a href="#7.28.6.2.1">7.28.6.2.1</a>, <a href="#7.28.6.3">7.28.6.3</a>, <a href="#7.28.6.3.2">7.28.6.3.2</a>, <a href="#7.28.6.3.3">7.28.6.3.3</a>,             DBL_MANT_DIG macro, <a href="#5.2.4.2.2">5.2.4.2.2</a>
32423        <a href="#7.28.6.4">7.28.6.4</a>, <a href="#7.28.6.4.1">7.28.6.4.1</a>, <a href="#7.28.6.4.2">7.28.6.4.2</a>, <a href="#K.3.6.4">K.3.6.4</a>,                DBL_MAX macro, <a href="#5.2.4.2.2">5.2.4.2.2</a>
32424        <a href="#K.3.9.3.1">K.3.9.3.1</a>, <a href="#K.3.9.3.1.1">K.3.9.3.1.1</a>, <a href="#K.3.9.3.2">K.3.9.3.2</a>, <a href="#K.3.9.3.2.1">K.3.9.3.2.1</a>,           DBL_MAX_10_EXP macro, <a href="#5.2.4.2.2">5.2.4.2.2</a>
32425        <a href="#K.3.9.3.2.2">K.3.9.3.2.2</a>                                               DBL_MAX_EXP macro, <a href="#5.2.4.2.2">5.2.4.2.2</a>
32426  conversion state functions, <a href="#7.28.6.2">7.28.6.2</a>                            DBL_MIN macro, <a href="#5.2.4.2.2">5.2.4.2.2</a>
32427  copying functions                                               DBL_MIN_10_EXP macro, <a href="#5.2.4.2.2">5.2.4.2.2</a>
32428     string, <a href="#7.23.2">7.23.2</a>, <a href="#K.3.7.1">K.3.7.1</a>                                      DBL_MIN_EXP macro, <a href="#5.2.4.2.2">5.2.4.2.2</a>
32429     wide string, <a href="#7.28.4.2">7.28.4.2</a>, <a href="#K.3.9.2.1">K.3.9.2.1</a>                             DBL_TRUE_MIN macro, <a href="#5.2.4.2.2">5.2.4.2.2</a>
32430  copysign functions, <a href="#7.3.9.5">7.3.9.5</a>, <a href="#7.12.11.1">7.12.11.1</a>, <a href="#F.3">F.3</a>,                    decimal constant, <a href="#6.4.4.1">6.4.4.1</a>
32431        <a href="#F.10.8.1">F.10.8.1</a>                                                  decimal digit, <a href="#5.2.1">5.2.1</a>
32432  copysign type-generic macro, <a href="#7.24">7.24</a>                               decimal-point character, <a href="#7.1.1">7.1.1</a>, <a href="#7.11.2.1">7.11.2.1</a>
32433  correctly rounded result, <a href="#3.9">3.9</a>                                   DECIMAL_DIG macro, <a href="#5.2.4.2.2">5.2.4.2.2</a>, <a href="#7.21.6.1">7.21.6.1</a>,
32434  corresponding real type, <a href="#6.2.5">6.2.5</a>                                       <a href="#7.22.1.3">7.22.1.3</a>, <a href="#7.28.2.1">7.28.2.1</a>, <a href="#7.28.4.1.1">7.28.4.1.1</a>, <a href="#F.5">F.5</a>
32435  cos functions, <a href="#7.12.4.5">7.12.4.5</a>, <a href="#F.10.1.5">F.10.1.5</a>                               declaration specifiers, <a href="#6.7">6.7</a>
32436  cos type-generic macro, <a href="#7.24">7.24</a>, <a href="#G.7">G.7</a>                               declarations, <a href="#6.7">6.7</a>
32437  cosh functions, <a href="#7.12.5.4">7.12.5.4</a>, <a href="#F.10.2.4">F.10.2.4</a>                                function, <a href="#6.7.6.3">6.7.6.3</a>
32438  cosh type-generic macro, <a href="#7.24">7.24</a>, <a href="#G.7">G.7</a>                                pointer, <a href="#6.7.6.1">6.7.6.1</a>
32439  cpow functions, <a href="#7.3.8.2">7.3.8.2</a>, <a href="#G.6.4.1">G.6.4.1</a>                                  structure/union, <a href="#6.7.2.1">6.7.2.1</a>
32440     type-generic macro for, <a href="#7.24">7.24</a>                                   typedef, <a href="#6.7.8">6.7.8</a>
32441  cproj functions, <a href="#7.3.9.5">7.3.9.5</a>, <a href="#G.6">G.6</a>                                   declarator, <a href="#6.7.6">6.7.6</a>
32442  cproj type-generic macro, <a href="#7.24">7.24</a>                                    abstract, <a href="#6.7.7">6.7.7</a>
32443  creal functions, <a href="#7.3.9.6">7.3.9.6</a>, <a href="#G.6">G.6</a>                                   declarator type derivation, <a href="#6.2.5">6.2.5</a>, <a href="#6.7.6">6.7.6</a>
32444  creal type-generic macro, <a href="#7.24">7.24</a>, <a href="#G.7">G.7</a>                             decrement operators, see arithmetic operators,
32445  critical undefined behavior, <a href="#L.2.3">L.2.3</a>                                    increment and decrement
32446  csin functions, <a href="#7.3.5.5">7.3.5.5</a>, <a href="#G.6">G.6</a>                                    default argument promotions, <a href="#6.5.2.2">6.5.2.2</a>
32447     type-generic macro for, <a href="#7.24">7.24</a>                                 default initialization, <a href="#6.7.9">6.7.9</a>
32448 <!--page 678 -->
32449  default label, <a href="#6.8.1">6.8.1</a>, <a href="#6.8.4.2">6.8.4.2</a>                                  elif preprocessing directive, <a href="#6.10.1">6.10.1</a>
32450  define preprocessing directive, <a href="#6.10.3">6.10.3</a>                         ellipsis punctuator (...), <a href="#6.5.2.2">6.5.2.2</a>, <a href="#6.7.6.3">6.7.6.3</a>, <a href="#6.10.3">6.10.3</a>
32451  defined operator, <a href="#6.10.1">6.10.1</a>, <a href="#6.10.8">6.10.8</a>                               else preprocessing directive, <a href="#6.10.1">6.10.1</a>
32452  definition, <a href="#6.7">6.7</a>                                                 else statement, <a href="#6.8.4.1">6.8.4.1</a>
32453     function, <a href="#6.9.1">6.9.1</a>                                             empty statement, <a href="#6.8.3">6.8.3</a>
32454  dependency-ordered before, <a href="#5.1.2.4">5.1.2.4</a>                             encoding error, <a href="#7.21.3">7.21.3</a>, <a href="#7.27.1.1">7.27.1.1</a>, <a href="#7.27.1.2">7.27.1.2</a>,
32455  derived declarator types, <a href="#6.2.5">6.2.5</a>                                      <a href="#7.27.1.3">7.27.1.3</a>, <a href="#7.27.1.4">7.27.1.4</a>, <a href="#7.28.3.1">7.28.3.1</a>, <a href="#7.28.3.3">7.28.3.3</a>,
32456  derived types, <a href="#6.2.5">6.2.5</a>                                                 <a href="#7.28.6.3.2">7.28.6.3.2</a>, <a href="#7.28.6.3.3">7.28.6.3.3</a>, <a href="#7.28.6.4.1">7.28.6.4.1</a>, <a href="#7.28.6.4.2">7.28.6.4.2</a>,
32457  designated initializer, <a href="#6.7.9">6.7.9</a>                                        <a href="#K.3.6.5.1">K.3.6.5.1</a>, <a href="#K.3.6.5.2">K.3.6.5.2</a>, <a href="#K.3.9.3.1.1">K.3.9.3.1.1</a>, <a href="#K.3.9.3.2.1">K.3.9.3.2.1</a>,
32458  destringizing, <a href="#6.10.9">6.10.9</a>                                                <a href="#K.3.9.3.2.2">K.3.9.3.2.2</a>
32459  device input/output, <a href="#5.1.2.3">5.1.2.3</a>                                   end-of-file, <a href="#7.28.1">7.28.1</a>
32460  diagnostic message, <a href="#3.10">3.10</a>, <a href="#5.1.1.3">5.1.1.3</a>                              end-of-file indicator, <a href="#7.21.1">7.21.1</a>, <a href="#7.21.5.3">7.21.5.3</a>, <a href="#7.21.7.1">7.21.7.1</a>,
32461  diagnostics, <a href="#5.1.1.3">5.1.1.3</a>                                                 <a href="#7.21.7.5">7.21.7.5</a>, <a href="#7.21.7.6">7.21.7.6</a>, <a href="#7.21.7.10">7.21.7.10</a>, <a href="#7.21.9.2">7.21.9.2</a>,
32462  diagnostics header, <a href="#7.2">7.2</a>                                              <a href="#7.21.9.3">7.21.9.3</a>, <a href="#7.21.10.1">7.21.10.1</a>, <a href="#7.21.10.2">7.21.10.2</a>, <a href="#7.28.3.1">7.28.3.1</a>,
32463  difftime function, <a href="#7.26.2.2">7.26.2.2</a>                                          <a href="#7.28.3.10">7.28.3.10</a>
32464  digit, <a href="#5.2.1">5.2.1</a>, <a href="#7.4">7.4</a>                                              end-of-file macro, see EOF macro
32465  digraphs, <a href="#6.4.6">6.4.6</a>                                                end-of-line indicator, <a href="#5.2.1">5.2.1</a>
32466  direct input/output functions, <a href="#7.21.8">7.21.8</a>                          endif preprocessing directive, <a href="#6.10.1">6.10.1</a>
32467  display device, <a href="#5.2.2">5.2.2</a>                                          enum type, <a href="#6.2.5">6.2.5</a>, <a href="#6.7.2">6.7.2</a>, <a href="#6.7.2.2">6.7.2.2</a>
32468  div function, <a href="#7.22.6.2">7.22.6.2</a>                                         enumerated type, <a href="#6.2.5">6.2.5</a>
32469  div_t type, <a href="#7.22">7.22</a>                                               enumeration, <a href="#6.2.5">6.2.5</a>, <a href="#6.7.2.2">6.7.2.2</a>
32470  division assignment operator (/=), <a href="#6.5.16.2">6.5.16.2</a>                    enumeration constant, <a href="#6.2.1">6.2.1</a>, <a href="#6.4.4.3">6.4.4.3</a>
32471  division operator (/), <a href="#6.2.6.2">6.2.6.2</a>, <a href="#6.5.5">6.5.5</a>, <a href="#F.3">F.3</a>, <a href="#G.5.1">G.5.1</a>              enumeration content, <a href="#6.7.2.3">6.7.2.3</a>
32472  do statement, <a href="#6.8.5.2">6.8.5.2</a>                                          enumeration members, <a href="#6.7.2.2">6.7.2.2</a>
32473  documentation of implementation, <a href="#4">4</a>                             enumeration specifiers, <a href="#6.7.2.2">6.7.2.2</a>
32474  domain error, <a href="#7.12.1">7.12.1</a>, <a href="#7.12.4.1">7.12.4.1</a>, <a href="#7.12.4.2">7.12.4.2</a>, <a href="#7.12.4.4">7.12.4.4</a>,            enumeration tag, <a href="#6.2.3">6.2.3</a>, <a href="#6.7.2.3">6.7.2.3</a>
32475        <a href="#7.12.5.1">7.12.5.1</a>, <a href="#7.12.5.3">7.12.5.3</a>, <a href="#7.12.6.5">7.12.6.5</a>, <a href="#7.12.6.7">7.12.6.7</a>,                  enumerator, <a href="#6.7.2.2">6.7.2.2</a>
32476        <a href="#7.12.6.8">7.12.6.8</a>, <a href="#7.12.6.9">7.12.6.9</a>, <a href="#7.12.6.10">7.12.6.10</a>, <a href="#7.12.6.11">7.12.6.11</a>,                environment, <a href="#5">5</a>
32477        <a href="#7.12.7.4">7.12.7.4</a>, <a href="#7.12.7.5">7.12.7.5</a>, <a href="#7.12.8.4">7.12.8.4</a>, <a href="#7.12.9.5">7.12.9.5</a>,                  environment functions, <a href="#7.22.4">7.22.4</a>, <a href="#K.3.6.2">K.3.6.2</a>
32478        <a href="#7.12.9.7">7.12.9.7</a>, <a href="#7.12.10.1">7.12.10.1</a>, <a href="#7.12.10.2">7.12.10.2</a>, <a href="#7.12.10.3">7.12.10.3</a>                environment list, <a href="#7.22.4.6">7.22.4.6</a>, <a href="#K.3.6.2.1">K.3.6.2.1</a>
32479  dot operator (.), <a href="#6.5.2.3">6.5.2.3</a>                                      environmental considerations, <a href="#5.2">5.2</a>
32480  double _Complex type, <a href="#6.2.5">6.2.5</a>                                    environmental limits, <a href="#5.2.4">5.2.4</a>, <a href="#7.13.1.1">7.13.1.1</a>, <a href="#7.21.2">7.21.2</a>,
32481  double _Complex type conversion, <a href="#6.3.1.6">6.3.1.6</a>,                            <a href="#7.21.3">7.21.3</a>, <a href="#7.21.4.4">7.21.4.4</a>, <a href="#7.21.6.1">7.21.6.1</a>, <a href="#7.22.2.1">7.22.2.1</a>, <a href="#7.22.4.2">7.22.4.2</a>,
32482        <a href="#6.3.1.7">6.3.1.7</a>, <a href="#6.3.1.8">6.3.1.8</a>                                               <a href="#7.22.4.3">7.22.4.3</a>, <a href="#7.28.2.1">7.28.2.1</a>, <a href="#K.3.5.1.2">K.3.5.1.2</a>
32483  double _Imaginary type, <a href="#G.2">G.2</a>                                    EOF macro, <a href="#7.4">7.4</a>, <a href="#7.21.1">7.21.1</a>, <a href="#7.21.5.1">7.21.5.1</a>, <a href="#7.21.5.2">7.21.5.2</a>,
32484  double type, <a href="#6.2.5">6.2.5</a>, <a href="#6.4.4.2">6.4.4.2</a>, <a href="#6.7.2">6.7.2</a>, <a href="#7.21.6.2">7.21.6.2</a>,                        <a href="#7.21.6.2">7.21.6.2</a>, <a href="#7.21.6.7">7.21.6.7</a>, <a href="#7.21.6.9">7.21.6.9</a>, <a href="#7.21.6.11">7.21.6.11</a>,
32485        <a href="#7.28.2.2">7.28.2.2</a>, <a href="#F.2">F.2</a>                                                  <a href="#7.21.6.14">7.21.6.14</a>, <a href="#7.21.7.1">7.21.7.1</a>, <a href="#7.21.7.3">7.21.7.3</a>, <a href="#7.21.7.4">7.21.7.4</a>,
32486  double type conversion, <a href="#6.3.1.4">6.3.1.4</a>, <a href="#6.3.1.5">6.3.1.5</a>, <a href="#6.3.1.7">6.3.1.7</a>,                   <a href="#7.21.7.5">7.21.7.5</a>, <a href="#7.21.7.6">7.21.7.6</a>, <a href="#7.21.7.8">7.21.7.8</a>, <a href="#7.21.7.9">7.21.7.9</a>,
32487        <a href="#6.3.1.8">6.3.1.8</a>                                                        <a href="#7.21.7.10">7.21.7.10</a>, <a href="#7.28.1">7.28.1</a>, <a href="#7.28.2.2">7.28.2.2</a>, <a href="#7.28.2.4">7.28.2.4</a>,
32488  double-precision arithmetic, <a href="#5.1.2.3">5.1.2.3</a>                                 <a href="#7.28.2.6">7.28.2.6</a>, <a href="#7.28.2.8">7.28.2.8</a>, <a href="#7.28.2.10">7.28.2.10</a>, <a href="#7.28.2.12">7.28.2.12</a>,
32489  double-quote escape sequence (\"), <a href="#6.4.4.4">6.4.4.4</a>,                          <a href="#7.28.3.4">7.28.3.4</a>, <a href="#7.28.6.1.1">7.28.6.1.1</a>, <a href="#7.28.6.1.2">7.28.6.1.2</a>, <a href="#K.3.5.3.7">K.3.5.3.7</a>,
32490        <a href="#6.4.5">6.4.5</a>, <a href="#6.10.9">6.10.9</a>                                                  <a href="#K.3.5.3.9">K.3.5.3.9</a>, <a href="#K.3.5.3.11">K.3.5.3.11</a>, <a href="#K.3.5.3.14">K.3.5.3.14</a>, <a href="#K.3.9.1.2">K.3.9.1.2</a>,
32491  double_t type, <a href="#7.12">7.12</a>, <a href="#J.5.6">J.5.6</a>                                           <a href="#K.3.9.1.5">K.3.9.1.5</a>, <a href="#K.3.9.1.7">K.3.9.1.7</a>, <a href="#K.3.9.1.10">K.3.9.1.10</a>, <a href="#K.3.9.1.12">K.3.9.1.12</a>,
32492                                                                       <a href="#K.3.9.1.14">K.3.9.1.14</a>
32493  EDOM macro, <a href="#7.5">7.5</a>, <a href="#7.12.1">7.12.1</a>, see also domain error                 equal-sign punctuator (=), <a href="#6.7">6.7</a>, <a href="#6.7.2.2">6.7.2.2</a>, <a href="#6.7.9">6.7.9</a>
32494  effective type, <a href="#6.5">6.5</a>                                            equal-to operator, see equality operator
32495  EILSEQ macro, <a href="#7.5">7.5</a>, <a href="#7.21.3">7.21.3</a>, <a href="#7.27.1.1">7.27.1.1</a>, <a href="#7.27.1.2">7.27.1.2</a>,                 equality expressions, <a href="#6.5.9">6.5.9</a>
32496       <a href="#7.27.1.3">7.27.1.3</a>, <a href="#7.27.1.4">7.27.1.4</a>, <a href="#7.28.3.1">7.28.3.1</a>, <a href="#7.28.3.3">7.28.3.3</a>,                   equality operator (==), <a href="#6.5.9">6.5.9</a>
32497       <a href="#7.28.6.3.2">7.28.6.3.2</a>, <a href="#7.28.6.3.3">7.28.6.3.3</a>, <a href="#7.28.6.4.1">7.28.6.4.1</a>, <a href="#7.28.6.4.2">7.28.6.4.2</a>,           ERANGE macro, <a href="#7.5">7.5</a>, <a href="#7.8.2.3">7.8.2.3</a>, <a href="#7.8.2.4">7.8.2.4</a>, <a href="#7.12.1">7.12.1</a>,
32498       see also encoding error                                         <a href="#7.22.1.3">7.22.1.3</a>, <a href="#7.22.1.4">7.22.1.4</a>, <a href="#7.28.4.1.1">7.28.4.1.1</a>, <a href="#7.28.4.1.2">7.28.4.1.2</a>, see
32499  element type, <a href="#6.2.5">6.2.5</a>                                                  also range error, pole error
32500 <!--page 679 -->
32501  erf functions, <a href="#7.12.8.1">7.12.8.1</a>, <a href="#F.10.5.1">F.10.5.1</a>                               exp2 functions, <a href="#7.12.6.2">7.12.6.2</a>, <a href="#F.10.3.2">F.10.3.2</a>
32502  erf type-generic macro, <a href="#7.24">7.24</a>                                    exp2 type-generic macro, <a href="#7.24">7.24</a>
32503  erfc functions, <a href="#7.12.8.2">7.12.8.2</a>, <a href="#F.10.5.2">F.10.5.2</a>                              explicit conversion, <a href="#6.3">6.3</a>
32504  erfc type-generic macro, <a href="#7.24">7.24</a>                                   expm1 functions, <a href="#7.12.6.3">7.12.6.3</a>, <a href="#F.10.3.3">F.10.3.3</a>
32505  errno macro, <a href="#7.1.3">7.1.3</a>, <a href="#7.3.2">7.3.2</a>, <a href="#7.5">7.5</a>, <a href="#7.8.2.3">7.8.2.3</a>, <a href="#7.8.2.4">7.8.2.4</a>,               expm1 type-generic macro, <a href="#7.24">7.24</a>
32506        <a href="#7.12.1">7.12.1</a>, <a href="#7.14.1.1">7.14.1.1</a>, <a href="#7.21.3">7.21.3</a>, <a href="#7.21.9.3">7.21.9.3</a>, <a href="#7.21.10.4">7.21.10.4</a>,            exponent part, <a href="#6.4.4.2">6.4.4.2</a>
32507        <a href="#7.22.1">7.22.1</a>, <a href="#7.22.1.3">7.22.1.3</a>, <a href="#7.22.1.4">7.22.1.4</a>, <a href="#7.23.6.2">7.23.6.2</a>, <a href="#7.27.1.1">7.27.1.1</a>,           exponential functions
32508        <a href="#7.27.1.2">7.27.1.2</a>, <a href="#7.27.1.3">7.27.1.3</a>, <a href="#7.27.1.4">7.27.1.4</a>, <a href="#7.28.3.1">7.28.3.1</a>,                     complex, <a href="#7.3.7">7.3.7</a>, <a href="#G.6.3">G.6.3</a>
32509        <a href="#7.28.3.3">7.28.3.3</a>, <a href="#7.28.4.1.1">7.28.4.1.1</a>, <a href="#7.28.4.1.2">7.28.4.1.2</a>, <a href="#7.28.6.3.2">7.28.6.3.2</a>,               real, <a href="#7.12.6">7.12.6</a>, <a href="#F.10.3">F.10.3</a>
32510        <a href="#7.28.6.3.3">7.28.6.3.3</a>, <a href="#7.28.6.4.1">7.28.6.4.1</a>, <a href="#7.28.6.4.2">7.28.6.4.2</a>, <a href="#J.5.17">J.5.17</a>,               expression, <a href="#6.5">6.5</a>
32511        <a href="#K.3.1.3">K.3.1.3</a>, <a href="#K.3.7.4.2">K.3.7.4.2</a>                                          assignment, <a href="#6.5.16">6.5.16</a>
32512  errno.h header, <a href="#7.5">7.5</a>, <a href="#7.30.3">7.30.3</a>, <a href="#K.3.2">K.3.2</a>                                cast, <a href="#6.5.4">6.5.4</a>
32513  errno_t type, <a href="#K.3.2">K.3.2</a>, <a href="#K.3.5">K.3.5</a>, <a href="#K.3.6">K.3.6</a>, <a href="#K.3.6.1.1">K.3.6.1.1</a>,                     constant, <a href="#6.6">6.6</a>
32514        <a href="#K.3.7">K.3.7</a>, <a href="#K.3.8">K.3.8</a>, <a href="#K.3.9">K.3.9</a>                                         evaluation, <a href="#5.1.2.3">5.1.2.3</a>
32515  error                                                             full, <a href="#6.8">6.8</a>
32516     domain, see domain error                                       order of evaluation, see order of evaluation
32517     encoding, see encoding error                                   parenthesized, <a href="#6.5.1">6.5.1</a>
32518     pole, see pole error                                           primary, <a href="#6.5.1">6.5.1</a>
32519     range, see range error                                         unary, <a href="#6.5.3">6.5.3</a>
32520  error conditions, <a href="#7.12.1">7.12.1</a>                                        expression statement, <a href="#6.8.3">6.8.3</a>
32521  error functions, <a href="#7.12.8">7.12.8</a>, <a href="#F.10.5">F.10.5</a>                                 extended alignment, <a href="#6.2.8">6.2.8</a>
32522  error indicator, <a href="#7.21.1">7.21.1</a>, <a href="#7.21.5.3">7.21.5.3</a>, <a href="#7.21.7.1">7.21.7.1</a>,                    extended character set, <a href="#3.7.2">3.7.2</a>, <a href="#5.2.1">5.2.1</a>, <a href="#5.2.1.2">5.2.1.2</a>
32523        <a href="#7.21.7.3">7.21.7.3</a>, <a href="#7.21.7.5">7.21.7.5</a>, <a href="#7.21.7.6">7.21.7.6</a>, <a href="#7.21.7.7">7.21.7.7</a>,                   extended characters, <a href="#5.2.1">5.2.1</a>
32524        <a href="#7.21.7.8">7.21.7.8</a>, <a href="#7.21.9.2">7.21.9.2</a>, <a href="#7.21.10.1">7.21.10.1</a>, <a href="#7.21.10.3">7.21.10.3</a>,                 extended integer types, <a href="#6.2.5">6.2.5</a>, <a href="#6.3.1.1">6.3.1.1</a>, <a href="#6.4.4.1">6.4.4.1</a>,
32525        <a href="#7.28.3.1">7.28.3.1</a>, <a href="#7.28.3.3">7.28.3.3</a>                                             <a href="#7.20">7.20</a>
32526  error preprocessing directive, <a href="#4">4</a>, <a href="#6.10.5">6.10.5</a>                        extended multibyte/wide character conversion
32527  error-handling functions, <a href="#7.21.10">7.21.10</a>, <a href="#7.23.6.2">7.23.6.2</a>,                         utilities, <a href="#7.28.6">7.28.6</a>, <a href="#K.3.9.3">K.3.9.3</a>
32528        <a href="#K.3.7.4.2">K.3.7.4.2</a>, <a href="#K.3.7.4.3">K.3.7.4.3</a>                                      extensible wide character case mapping functions,
32529  escape character (\), <a href="#6.4.4.4">6.4.4.4</a>                                        <a href="#7.29.3.2">7.29.3.2</a>
32530  escape sequences, <a href="#5.2.1">5.2.1</a>, <a href="#5.2.2">5.2.2</a>, <a href="#6.4.4.4">6.4.4.4</a>, <a href="#6.11.4">6.11.4</a>                 extensible wide character classification functions,
32531  evaluation format, <a href="#5.2.4.2.2">5.2.4.2.2</a>, <a href="#6.4.4.2">6.4.4.2</a>, <a href="#7.12">7.12</a>                          <a href="#7.29.2.2">7.29.2.2</a>
32532  evaluation method, <a href="#5.2.4.2.2">5.2.4.2.2</a>, <a href="#6.5">6.5</a>, <a href="#F.8.5">F.8.5</a>                        extern storage-class specifier, <a href="#6.2.2">6.2.2</a>, <a href="#6.7.1">6.7.1</a>
32533  evaluation of expression, <a href="#5.1.2.3">5.1.2.3</a>                               external definition, <a href="#6.9">6.9</a>
32534  evaluation order, see order of evaluation                       external identifiers, underscore, <a href="#7.1.3">7.1.3</a>
32535  exceptional condition, <a href="#6.5">6.5</a>                                      external linkage, <a href="#6.2.2">6.2.2</a>
32536  excess precision, <a href="#5.2.4.2.2">5.2.4.2.2</a>, <a href="#6.3.1.8">6.3.1.8</a>, <a href="#6.8.6.4">6.8.6.4</a>                   external name, <a href="#6.4.2.1">6.4.2.1</a>
32537  excess range, <a href="#5.2.4.2.2">5.2.4.2.2</a>, <a href="#6.3.1.8">6.3.1.8</a>, <a href="#6.8.6.4">6.8.6.4</a>                       external object definitions, <a href="#6.9.2">6.9.2</a>
32538  exclusive OR operators
32539     bitwise (^), <a href="#6.2.6.2">6.2.6.2</a>, <a href="#6.5.11">6.5.11</a>                                 fabs functions, <a href="#7.12.7.2">7.12.7.2</a>, <a href="#F.3">F.3</a>, <a href="#F.10.4.2">F.10.4.2</a>
32540     bitwise assignment (^=), <a href="#6.5.16.2">6.5.16.2</a>                            fabs type-generic macro, <a href="#7.24">7.24</a>, <a href="#G.7">G.7</a>
32541  executable program, <a href="#5.1.1.1">5.1.1.1</a>                                     false macro, <a href="#7.18">7.18</a>
32542  execution character set, <a href="#5.2.1">5.2.1</a>                                  fclose function, <a href="#7.21.5.1">7.21.5.1</a>
32543  execution environment, <a href="#5">5</a>, <a href="#5.1.2">5.1.2</a>, see also                       fdim functions, <a href="#7.12.12.1">7.12.12.1</a>, <a href="#F.10.9.1">F.10.9.1</a>
32544        environmental limits                                      fdim type-generic macro, <a href="#7.24">7.24</a>
32545  execution sequence, <a href="#5.1.2.3">5.1.2.3</a>, <a href="#6.8">6.8</a>                                FE_ALL_EXCEPT macro, <a href="#7.6">7.6</a>
32546  exit function, <a href="#5.1.2.2.3">5.1.2.2.3</a>, <a href="#7.21.3">7.21.3</a>, <a href="#7.22">7.22</a>, <a href="#7.22.4.4">7.22.4.4</a>,               FE_DFL_ENV macro, <a href="#7.6">7.6</a>
32547        <a href="#7.22.4.5">7.22.4.5</a>, <a href="#7.22.4.7">7.22.4.7</a>                                        FE_DIVBYZERO macro, <a href="#7.6">7.6</a>, <a href="#7.12">7.12</a>, <a href="#F.3">F.3</a>
32548  EXIT_FAILURE macro, <a href="#7.22">7.22</a>, <a href="#7.22.4.4">7.22.4.4</a>                              FE_DOWNWARD macro, <a href="#7.6">7.6</a>, <a href="#F.3">F.3</a>
32549  EXIT_SUCCESS macro, <a href="#7.22">7.22</a>, <a href="#7.22.4.4">7.22.4.4</a>                              FE_INEXACT macro, <a href="#7.6">7.6</a>, <a href="#F.3">F.3</a>
32550  exp functions, <a href="#7.12.6.1">7.12.6.1</a>, <a href="#F.10.3.1">F.10.3.1</a>                               FE_INVALID macro, <a href="#7.6">7.6</a>, <a href="#7.12">7.12</a>, <a href="#F.3">F.3</a>
32551  exp type-generic macro, <a href="#7.24">7.24</a>                                    FE_OVERFLOW macro, <a href="#7.6">7.6</a>, <a href="#7.12">7.12</a>, <a href="#F.3">F.3</a>
32552 <!--page 680 -->
32553  FE_TONEAREST macro, <a href="#7.6">7.6</a>, <a href="#F.3">F.3</a>                                 float _Complex type conversion, <a href="#6.3.1.6">6.3.1.6</a>,
32554  FE_TOWARDZERO macro, <a href="#7.6">7.6</a>, <a href="#F.3">F.3</a>                                     <a href="#6.3.1.7">6.3.1.7</a>, <a href="#6.3.1.8">6.3.1.8</a>
32555  FE_UNDERFLOW macro, <a href="#7.6">7.6</a>, <a href="#F.3">F.3</a>                                 float _Imaginary type, <a href="#G.2">G.2</a>
32556  FE_UPWARD macro, <a href="#7.6">7.6</a>, <a href="#F.3">F.3</a>                                    float type, <a href="#6.2.5">6.2.5</a>, <a href="#6.4.4.2">6.4.4.2</a>, <a href="#6.7.2">6.7.2</a>, <a href="#F.2">F.2</a>
32557  feclearexcept function, <a href="#7.6.2">7.6.2</a>, <a href="#7.6.2.1">7.6.2.1</a>, <a href="#F.3">F.3</a>                  float type conversion, <a href="#6.3.1.4">6.3.1.4</a>, <a href="#6.3.1.5">6.3.1.5</a>, <a href="#6.3.1.7">6.3.1.7</a>,
32558  fegetenv function, <a href="#7.6.4.1">7.6.4.1</a>, <a href="#7.6.4.3">7.6.4.3</a>, <a href="#7.6.4.4">7.6.4.4</a>, <a href="#F.3">F.3</a>                 <a href="#6.3.1.8">6.3.1.8</a>
32559  fegetexceptflag function, <a href="#7.6.2">7.6.2</a>, <a href="#7.6.2.2">7.6.2.2</a>, <a href="#F.3">F.3</a>                float.h header, <a href="#4">4</a>, <a href="#5.2.4.2.2">5.2.4.2.2</a>, <a href="#7.7">7.7</a>, <a href="#7.22.1.3">7.22.1.3</a>,
32560  fegetround function, <a href="#7.6">7.6</a>, <a href="#7.6.3.1">7.6.3.1</a>, <a href="#F.3">F.3</a>                            <a href="#7.28.4.1.1">7.28.4.1.1</a>
32561  feholdexcept function, <a href="#7.6.4.2">7.6.4.2</a>, <a href="#7.6.4.3">7.6.4.3</a>,                     float_t type, <a href="#7.12">7.12</a>, <a href="#J.5.6">J.5.6</a>
32562       <a href="#7.6.4.4">7.6.4.4</a>, <a href="#F.3">F.3</a>                                            floating constant, <a href="#6.4.4.2">6.4.4.2</a>
32563  fence, <a href="#5.1.2.4">5.1.2.4</a>                                               floating suffix, f or <a href="#F">F</a>, <a href="#6.4.4.2">6.4.4.2</a>
32564  fences, <a href="#7.17.4">7.17.4</a>                                               floating type conversion, <a href="#6.3.1.4">6.3.1.4</a>, <a href="#6.3.1.5">6.3.1.5</a>, <a href="#6.3.1.7">6.3.1.7</a>,
32565  fenv.h header, <a href="#5.1.2.3">5.1.2.3</a>, <a href="#5.2.4.2.2">5.2.4.2.2</a>, <a href="#7.6">7.6</a>, <a href="#7.12">7.12</a>, <a href="#F">F</a>, <a href="#H">H</a>                <a href="#F.3">F.3</a>, <a href="#F.4">F.4</a>
32566  FENV_ACCESS pragma, <a href="#6.10.6">6.10.6</a>, <a href="#7.6.1">7.6.1</a>, <a href="#F.8">F.8</a>, <a href="#F.9">F.9</a>,                 floating types, <a href="#6.2.5">6.2.5</a>, <a href="#6.11.1">6.11.1</a>
32567       <a href="#F.10">F.10</a>                                                    floating-point accuracy, <a href="#5.2.4.2.2">5.2.4.2.2</a>, <a href="#6.4.4.2">6.4.4.2</a>, <a href="#6.5">6.5</a>,
32568  fenv_t type, <a href="#7.6">7.6</a>                                                  <a href="#7.22.1.3">7.22.1.3</a>, <a href="#F.5">F.5</a>, see also contracted expression
32569  feof function, <a href="#7.21.10.2">7.21.10.2</a>                                     floating-point arithmetic functions, <a href="#7.12">7.12</a>, <a href="#F.10">F.10</a>
32570  feraiseexcept function, <a href="#7.6.2">7.6.2</a>, <a href="#7.6.2.3">7.6.2.3</a>, <a href="#F.3">F.3</a>                  floating-point classification functions, <a href="#7.12.3">7.12.3</a>
32571  ferror function, <a href="#7.21.10.3">7.21.10.3</a>                                   floating-point control mode, <a href="#7.6">7.6</a>, <a href="#F.8.6">F.8.6</a>
32572  fesetenv function, <a href="#7.6.4.3">7.6.4.3</a>, <a href="#F.3">F.3</a>                              floating-point environment, <a href="#7.6">7.6</a>, <a href="#F.8">F.8</a>, <a href="#F.8.6">F.8.6</a>
32573  fesetexceptflag function, <a href="#7.6.2">7.6.2</a>, <a href="#7.6.2.4">7.6.2.4</a>, <a href="#F.3">F.3</a>                floating-point exception, <a href="#7.6">7.6</a>, <a href="#7.6.2">7.6.2</a>, <a href="#F.10">F.10</a>
32574  fesetround function, <a href="#7.6">7.6</a>, <a href="#7.6.3.2">7.6.3.2</a>, <a href="#F.3">F.3</a>                       floating-point number, <a href="#5.2.4.2.2">5.2.4.2.2</a>, <a href="#6.2.5">6.2.5</a>
32575  fetestexcept function, <a href="#7.6.2">7.6.2</a>, <a href="#7.6.2.5">7.6.2.5</a>, <a href="#F.3">F.3</a>                   floating-point rounding mode, <a href="#5.2.4.2.2">5.2.4.2.2</a>
32576  feupdateenv function, <a href="#7.6.4.2">7.6.4.2</a>, <a href="#7.6.4.4">7.6.4.4</a>, <a href="#F.3">F.3</a>                  floating-point status flag, <a href="#7.6">7.6</a>, <a href="#F.8.6">F.8.6</a>
32577  fexcept_t type, <a href="#7.6">7.6</a>, <a href="#F.3">F.3</a>                                     floor functions, <a href="#7.12.9.2">7.12.9.2</a>, <a href="#F.10.6.2">F.10.6.2</a>
32578  fflush function, <a href="#7.21.5.2">7.21.5.2</a>, <a href="#7.21.5.3">7.21.5.3</a>                          floor type-generic macro, <a href="#7.24">7.24</a>
32579  fgetc function, <a href="#7.21.1">7.21.1</a>, <a href="#7.21.3">7.21.3</a>, <a href="#7.21.7.1">7.21.7.1</a>,                    FLT_DECIMAL_DIG macro, <a href="#5.2.4.2.2">5.2.4.2.2</a>
32580       <a href="#7.21.7.5">7.21.7.5</a>, <a href="#7.21.8.1">7.21.8.1</a>                                      FLT_DIG macro, <a href="#5.2.4.2.2">5.2.4.2.2</a>
32581  fgetpos function, <a href="#7.21.2">7.21.2</a>, <a href="#7.21.9.1">7.21.9.1</a>, <a href="#7.21.9.3">7.21.9.3</a>                 FLT_EPSILON macro, <a href="#5.2.4.2.2">5.2.4.2.2</a>
32582  fgets function, <a href="#7.21.1">7.21.1</a>, <a href="#7.21.7.2">7.21.7.2</a>, <a href="#K.3.5.4.1">K.3.5.4.1</a>                  FLT_EVAL_METHOD macro, <a href="#5.2.4.2.2">5.2.4.2.2</a>, <a href="#6.6">6.6</a>, <a href="#7.12">7.12</a>,
32583  fgetwc function, <a href="#7.21.1">7.21.1</a>, <a href="#7.21.3">7.21.3</a>, <a href="#7.28.3.1">7.28.3.1</a>,                        <a href="#F.10.11">F.10.11</a>
32584       <a href="#7.28.3.6">7.28.3.6</a>                                                FLT_HAS_SUBNORM macro, <a href="#5.2.4.2.2">5.2.4.2.2</a>
32585  fgetws function, <a href="#7.21.1">7.21.1</a>, <a href="#7.28.3.2">7.28.3.2</a>                            FLT_MANT_DIG macro, <a href="#5.2.4.2.2">5.2.4.2.2</a>
32586  field width, <a href="#7.21.6.1">7.21.6.1</a>, <a href="#7.28.2.1">7.28.2.1</a>                               FLT_MAX macro, <a href="#5.2.4.2.2">5.2.4.2.2</a>
32587  file, <a href="#7.21.3">7.21.3</a>                                                  FLT_MAX_10_EXP macro, <a href="#5.2.4.2.2">5.2.4.2.2</a>
32588    access functions, <a href="#7.21.5">7.21.5</a>, <a href="#K.3.5.2">K.3.5.2</a>                          FLT_MAX_EXP macro, <a href="#5.2.4.2.2">5.2.4.2.2</a>
32589    name, <a href="#7.21.3">7.21.3</a>                                               FLT_MIN macro, <a href="#5.2.4.2.2">5.2.4.2.2</a>
32590    operations, <a href="#7.21.4">7.21.4</a>, <a href="#K.3.5.1">K.3.5.1</a>                                FLT_MIN_10_EXP macro, <a href="#5.2.4.2.2">5.2.4.2.2</a>
32591    position indicator, <a href="#7.21.1">7.21.1</a>, <a href="#7.21.2">7.21.2</a>, <a href="#7.21.3">7.21.3</a>,                FLT_MIN_EXP macro, <a href="#5.2.4.2.2">5.2.4.2.2</a>
32592          <a href="#7.21.5.3">7.21.5.3</a>, <a href="#7.21.7.1">7.21.7.1</a>, <a href="#7.21.7.3">7.21.7.3</a>, <a href="#7.21.7.10">7.21.7.10</a>,             FLT_RADIX macro, <a href="#5.2.4.2.2">5.2.4.2.2</a>, <a href="#7.21.6.1">7.21.6.1</a>, <a href="#7.22.1.3">7.22.1.3</a>,
32593          <a href="#7.21.8.1">7.21.8.1</a>, <a href="#7.21.8.2">7.21.8.2</a>, <a href="#7.21.9.1">7.21.9.1</a>, <a href="#7.21.9.2">7.21.9.2</a>,                   <a href="#7.28.2.1">7.28.2.1</a>, <a href="#7.28.4.1.1">7.28.4.1.1</a>
32594          <a href="#7.21.9.3">7.21.9.3</a>, <a href="#7.21.9.4">7.21.9.4</a>, <a href="#7.21.9.5">7.21.9.5</a>, <a href="#7.28.3.1">7.28.3.1</a>,              FLT_ROUNDS macro, <a href="#5.2.4.2.2">5.2.4.2.2</a>, <a href="#7.6">7.6</a>, <a href="#F.3">F.3</a>
32595          <a href="#7.28.3.3">7.28.3.3</a>, <a href="#7.28.3.10">7.28.3.10</a>                                  FLT_TRUE_MIN macro, <a href="#5.2.4.2.2">5.2.4.2.2</a>
32596    positioning functions, <a href="#7.21.9">7.21.9</a>                              fma functions, <a href="#7.12">7.12</a>, <a href="#7.12.13.1">7.12.13.1</a>, <a href="#F.10.10.1">F.10.10.1</a>
32597  file scope, <a href="#6.2.1">6.2.1</a>, <a href="#6.9">6.9</a>                                        fma type-generic macro, <a href="#7.24">7.24</a>
32598  FILE type, <a href="#7.21.1">7.21.1</a>, <a href="#7.21.3">7.21.3</a>                                    fmax functions, <a href="#7.12.12.2">7.12.12.2</a>, <a href="#F.10.9.2">F.10.9.2</a>
32599  FILENAME_MAX macro, <a href="#7.21.1">7.21.1</a>                                   fmax type-generic macro, <a href="#7.24">7.24</a>
32600  flags, <a href="#7.21.6.1">7.21.6.1</a>, <a href="#7.28.2.1">7.28.2.1</a>, see also floating-point             fmin functions, <a href="#7.12.12.3">7.12.12.3</a>, <a href="#F.10.9.3">F.10.9.3</a>
32601       status flag                                              fmin type-generic macro, <a href="#7.24">7.24</a>
32602  flexible array member, <a href="#6.7.2.1">6.7.2.1</a>                                fmod functions, <a href="#7.12.10.1">7.12.10.1</a>, <a href="#F.10.7.1">F.10.7.1</a>
32603  float _Complex type, <a href="#6.2.5">6.2.5</a>                                   fmod type-generic macro, <a href="#7.24">7.24</a>
32604 <!--page 681 -->
32605  fopen function, <a href="#7.21.5.3">7.21.5.3</a>, <a href="#7.21.5.4">7.21.5.4</a>, <a href="#K.3.5.2.1">K.3.5.2.1</a>                       <a href="#K.3.5.3.7">K.3.5.3.7</a>, <a href="#K.3.5.3.9">K.3.5.3.9</a>
32606  FOPEN_MAX macro, <a href="#7.21.1">7.21.1</a>, <a href="#7.21.3">7.21.3</a>, <a href="#7.21.4.3">7.21.4.3</a>,                    fseek function, <a href="#7.21.1">7.21.1</a>, <a href="#7.21.5.3">7.21.5.3</a>, <a href="#7.21.7.10">7.21.7.10</a>,
32607       <a href="#K.3.5.1.1">K.3.5.1.1</a>                                                      <a href="#7.21.9.2">7.21.9.2</a>, <a href="#7.21.9.4">7.21.9.4</a>, <a href="#7.21.9.5">7.21.9.5</a>, <a href="#7.28.3.10">7.28.3.10</a>
32608  fopen_s function, <a href="#K.3.5.1.1">K.3.5.1.1</a>, <a href="#K.3.5.2.1">K.3.5.2.1</a>,                       fsetpos function, <a href="#7.21.2">7.21.2</a>, <a href="#7.21.5.3">7.21.5.3</a>, <a href="#7.21.7.10">7.21.7.10</a>,
32609       <a href="#K.3.5.2.2">K.3.5.2.2</a>                                                      <a href="#7.21.9.1">7.21.9.1</a>, <a href="#7.21.9.3">7.21.9.3</a>, <a href="#7.28.3.10">7.28.3.10</a>
32610  for statement, <a href="#6.8.5">6.8.5</a>, <a href="#6.8.5.3">6.8.5.3</a>                                 ftell function, <a href="#7.21.9.2">7.21.9.2</a>, <a href="#7.21.9.4">7.21.9.4</a>
32611  form-feed character, <a href="#5.2.1">5.2.1</a>, <a href="#6.4">6.4</a>                               full declarator, <a href="#6.7.6">6.7.6</a>
32612  form-feed escape sequence (\f), <a href="#5.2.2">5.2.2</a>, <a href="#6.4.4.4">6.4.4.4</a>,               full expression, <a href="#6.8">6.8</a>
32613       <a href="#7.4.1.10">7.4.1.10</a>                                                 fully buffered stream, <a href="#7.21.3">7.21.3</a>
32614  formal argument (deprecated), <a href="#3.16">3.16</a>                            function
32615  formal parameter, <a href="#3.16">3.16</a>                                           argument, <a href="#6.5.2.2">6.5.2.2</a>, <a href="#6.9.1">6.9.1</a>
32616  formatted input/output functions, <a href="#7.11.1.1">7.11.1.1</a>, <a href="#7.21.6">7.21.6</a>,              body, <a href="#6.9.1">6.9.1</a>
32617       <a href="#K.3.5.3">K.3.5.3</a>                                                     call, <a href="#6.5.2.2">6.5.2.2</a>
32618     wide character, <a href="#7.28.2">7.28.2</a>, <a href="#K.3.9.1">K.3.9.1</a>                                  library, <a href="#7.1.4">7.1.4</a>
32619  fortran keyword, <a href="#J.5.9">J.5.9</a>                                           declarator, <a href="#6.7.6.3">6.7.6.3</a>, <a href="#6.11.6">6.11.6</a>
32620  forward reference, <a href="#3.11">3.11</a>                                          definition, <a href="#6.7.6.3">6.7.6.3</a>, <a href="#6.9.1">6.9.1</a>, <a href="#6.11.7">6.11.7</a>
32621  FP_CONTRACT pragma, <a href="#6.5">6.5</a>, <a href="#6.10.6">6.10.6</a>, <a href="#7.12.2">7.12.2</a>, see                     designator, <a href="#6.3.2.1">6.3.2.1</a>
32622       also contracted expression                                  image, <a href="#5.2.3">5.2.3</a>
32623  FP_FAST_FMA macro, <a href="#7.12">7.12</a>                                          inline, <a href="#6.7.4">6.7.4</a>
32624  FP_FAST_FMAF macro, <a href="#7.12">7.12</a>                                         library, <a href="#5.1.1.1">5.1.1.1</a>, <a href="#7.1.4">7.1.4</a>
32625  FP_FAST_FMAL macro, <a href="#7.12">7.12</a>                                         name length, <a href="#5.2.4.1">5.2.4.1</a>, <a href="#6.4.2.1">6.4.2.1</a>, <a href="#6.11.3">6.11.3</a>
32626  FP_ILOGB0 macro, <a href="#7.12">7.12</a>, <a href="#7.12.6.5">7.12.6.5</a>                                  no-return, <a href="#6.7.4">6.7.4</a>
32627  FP_ILOGBNAN macro, <a href="#7.12">7.12</a>, <a href="#7.12.6.5">7.12.6.5</a>                                parameter, <a href="#5.1.2.2.1">5.1.2.2.1</a>, <a href="#6.5.2.2">6.5.2.2</a>, <a href="#6.7">6.7</a>, <a href="#6.9.1">6.9.1</a>
32628  FP_INFINITE macro, <a href="#7.12">7.12</a>, <a href="#F.3">F.3</a>                                     prototype, <a href="#5.1.2.2.1">5.1.2.2.1</a>, <a href="#6.2.1">6.2.1</a>, <a href="#6.2.7">6.2.7</a>, <a href="#6.5.2.2">6.5.2.2</a>, <a href="#6.7">6.7</a>,
32629  FP_NAN macro, <a href="#7.12">7.12</a>, <a href="#F.3">F.3</a>                                                <a href="#6.7.6.3">6.7.6.3</a>, <a href="#6.9.1">6.9.1</a>, <a href="#6.11.6">6.11.6</a>, <a href="#6.11.7">6.11.7</a>, <a href="#7.1.2">7.1.2</a>, <a href="#7.12">7.12</a>
32630  FP_NORMAL macro, <a href="#7.12">7.12</a>, <a href="#F.3">F.3</a>                                       prototype scope, <a href="#6.2.1">6.2.1</a>, <a href="#6.7.6.2">6.7.6.2</a>
32631  FP_SUBNORMAL macro, <a href="#7.12">7.12</a>, <a href="#F.3">F.3</a>                                    recursive call, <a href="#6.5.2.2">6.5.2.2</a>
32632  FP_ZERO macro, <a href="#7.12">7.12</a>, <a href="#F.3">F.3</a>                                         return, <a href="#6.8.6.4">6.8.6.4</a>, <a href="#F.6">F.6</a>
32633  fpclassify macro, <a href="#7.12.3.1">7.12.3.1</a>, <a href="#F.3">F.3</a>                                  scope, <a href="#6.2.1">6.2.1</a>
32634  fpos_t type, <a href="#7.21.1">7.21.1</a>, <a href="#7.21.2">7.21.2</a>                                      type, <a href="#6.2.5">6.2.5</a>
32635  fprintf function, <a href="#7.8.1">7.8.1</a>, <a href="#7.21.1">7.21.1</a>, <a href="#7.21.6.1">7.21.6.1</a>,                       type conversion, <a href="#6.3.2.1">6.3.2.1</a>
32636       <a href="#7.21.6.2">7.21.6.2</a>, <a href="#7.21.6.3">7.21.6.3</a>, <a href="#7.21.6.5">7.21.6.5</a>, <a href="#7.21.6.6">7.21.6.6</a>,                  function specifiers, <a href="#6.7.4">6.7.4</a>
32637       <a href="#7.21.6.8">7.21.6.8</a>, <a href="#7.28.2.2">7.28.2.2</a>, <a href="#F.3">F.3</a>, <a href="#K.3.5.3.1">K.3.5.3.1</a>                       function type, <a href="#6.2.5">6.2.5</a>
32638  fprintf_s function, <a href="#K.3.5.3.1">K.3.5.3.1</a>                                 function-call operator (( )), <a href="#6.5.2.2">6.5.2.2</a>
32639  fputc function, <a href="#5.2.2">5.2.2</a>, <a href="#7.21.1">7.21.1</a>, <a href="#7.21.3">7.21.3</a>, <a href="#7.21.7.3">7.21.7.3</a>,              function-like macro, <a href="#6.10.3">6.10.3</a>
32640       <a href="#7.21.7.7">7.21.7.7</a>, <a href="#7.21.8.2">7.21.8.2</a>                                       fundamental alignment, <a href="#6.2.8">6.2.8</a>
32641  fputs function, <a href="#7.21.1">7.21.1</a>, <a href="#7.21.7.4">7.21.7.4</a>                              future directions
32642  fputwc function, <a href="#7.21.1">7.21.1</a>, <a href="#7.21.3">7.21.3</a>, <a href="#7.28.3.3">7.28.3.3</a>,                       language, <a href="#6.11">6.11</a>
32643       <a href="#7.28.3.8">7.28.3.8</a>                                                    library, <a href="#7.30">7.30</a>
32644  fputws function, <a href="#7.21.1">7.21.1</a>, <a href="#7.28.3.4">7.28.3.4</a>                             fwide function, <a href="#7.21.2">7.21.2</a>, <a href="#7.28.3.5">7.28.3.5</a>
32645  fread function, <a href="#7.21.1">7.21.1</a>, <a href="#7.21.8.1">7.21.8.1</a>                              fwprintf function, <a href="#7.8.1">7.8.1</a>, <a href="#7.21.1">7.21.1</a>, <a href="#7.21.6.2">7.21.6.2</a>,
32646  free function, <a href="#7.22.3.3">7.22.3.3</a>, <a href="#7.22.3.5">7.22.3.5</a>                                   <a href="#7.28.2.1">7.28.2.1</a>, <a href="#7.28.2.2">7.28.2.2</a>, <a href="#7.28.2.3">7.28.2.3</a>, <a href="#7.28.2.5">7.28.2.5</a>,
32647  freestanding execution environment, <a href="#4">4</a>, <a href="#5.1.2">5.1.2</a>,                       <a href="#7.28.2.11">7.28.2.11</a>, <a href="#K.3.9.1.1">K.3.9.1.1</a>
32648       <a href="#5.1.2.1">5.1.2.1</a>                                                  fwprintf_s function, <a href="#K.3.9.1.1">K.3.9.1.1</a>
32649  freopen function, <a href="#7.21.2">7.21.2</a>, <a href="#7.21.5.4">7.21.5.4</a>                            fwrite function, <a href="#7.21.1">7.21.1</a>, <a href="#7.21.8.2">7.21.8.2</a>
32650  freopen_s function, <a href="#K.3.5.2.2">K.3.5.2.2</a>                                 fwscanf function, <a href="#7.8.1">7.8.1</a>, <a href="#7.21.1">7.21.1</a>, <a href="#7.28.2.2">7.28.2.2</a>,
32651  frexp functions, <a href="#7.12.6.4">7.12.6.4</a>, <a href="#F.10.3.4">F.10.3.4</a>                                 <a href="#7.28.2.4">7.28.2.4</a>, <a href="#7.28.2.6">7.28.2.6</a>, <a href="#7.28.2.12">7.28.2.12</a>, <a href="#7.28.3.10">7.28.3.10</a>,
32652  frexp type-generic macro, <a href="#7.24">7.24</a>                                      <a href="#K.3.9.1.2">K.3.9.1.2</a>
32653  fscanf function, <a href="#7.8.1">7.8.1</a>, <a href="#7.21.1">7.21.1</a>, <a href="#7.21.6.2">7.21.6.2</a>,                     fwscanf_s function, <a href="#K.3.9.1.2">K.3.9.1.2</a>, <a href="#K.3.9.1.5">K.3.9.1.5</a>,
32654       <a href="#7.21.6.4">7.21.6.4</a>, <a href="#7.21.6.7">7.21.6.7</a>, <a href="#7.21.6.9">7.21.6.9</a>, <a href="#F.3">F.3</a>, <a href="#K.3.5.3.2">K.3.5.3.2</a>                   <a href="#K.3.9.1.7">K.3.9.1.7</a>, <a href="#K.3.9.1.14">K.3.9.1.14</a>
32655  fscanf_s function, <a href="#K.3.5.3.2">K.3.5.3.2</a>, <a href="#K.3.5.3.4">K.3.5.3.4</a>,
32656 <!--page 682 -->
32657  gamma functions, <a href="#7.12.8">7.12.8</a>, <a href="#F.10.5">F.10.5</a>                               name spaces, <a href="#6.2.3">6.2.3</a>
32658  general utilities, <a href="#7.22">7.22</a>, <a href="#K.3.6">K.3.6</a>                                reserved, <a href="#6.4.1">6.4.1</a>, <a href="#7.1.3">7.1.3</a>, <a href="#K.3.1.2">K.3.1.2</a>
32659    wide string, <a href="#7.28.4">7.28.4</a>, <a href="#K.3.9.2">K.3.9.2</a>                                 scope, <a href="#6.2.1">6.2.1</a>
32660  general wide string utilities, <a href="#7.28.4">7.28.4</a>, <a href="#K.3.9.2">K.3.9.2</a>                 type, <a href="#6.2.5">6.2.5</a>
32661  generic parameters, <a href="#7.24">7.24</a>                                    identifier list, <a href="#6.7.6">6.7.6</a>
32662  generic selection, <a href="#6.5.1.1">6.5.1.1</a>                                  identifier nondigit, <a href="#6.4.2.1">6.4.2.1</a>
32663  getc function, <a href="#7.21.1">7.21.1</a>, <a href="#7.21.7.5">7.21.7.5</a>, <a href="#7.21.7.6">7.21.7.6</a>                   IEC 559, <a href="#F.1">F.1</a>
32664  getchar function, <a href="#7.21.1">7.21.1</a>, <a href="#7.21.7.6">7.21.7.6</a>                          IEC 60559, <a href="#2">2</a>, <a href="#5.1.2.3">5.1.2.3</a>, <a href="#5.2.4.2.2">5.2.4.2.2</a>, <a href="#6.10.8.3">6.10.8.3</a>, <a href="#7.3.3">7.3.3</a>,
32665  getenv function, <a href="#7.22.4.6">7.22.4.6</a>                                         <a href="#7.6">7.6</a>, <a href="#7.6.4.2">7.6.4.2</a>, <a href="#7.12.1">7.12.1</a>, <a href="#7.12.10.2">7.12.10.2</a>, <a href="#7.12.14">7.12.14</a>, <a href="#F">F</a>, <a href="#G">G</a>,
32666  getenv_s function, <a href="#K.3.6.2.1">K.3.6.2.1</a>                                      <a href="#H.1">H.1</a>
32667  gets function, <a href="#K.3.5.4.1">K.3.5.4.1</a>                                    IEEE 754, <a href="#F.1">F.1</a>
32668  gets_s function, <a href="#K.3.5.4.1">K.3.5.4.1</a>                                  IEEE 854, <a href="#F.1">F.1</a>
32669  getwc function, <a href="#7.21.1">7.21.1</a>, <a href="#7.28.3.6">7.28.3.6</a>, <a href="#7.28.3.7">7.28.3.7</a>                  IEEE floating-point arithmetic standard, see
32670  getwchar function, <a href="#7.21.1">7.21.1</a>, <a href="#7.28.3.7">7.28.3.7</a>                               IEC 60559, ANSI/IEEE 754,
32671  gmtime function, <a href="#7.26.3.3">7.26.3.3</a>                                         ANSI/IEEE 854
32672  gmtime_s function, <a href="#K.3.8.2.3">K.3.8.2.3</a>                                if preprocessing directive, <a href="#5.2.4.2.1">5.2.4.2.1</a>, <a href="#5.2.4.2.2">5.2.4.2.2</a>,
32673  goto statement, <a href="#6.2.1">6.2.1</a>, <a href="#6.8.1">6.8.1</a>, <a href="#6.8.6.1">6.8.6.1</a>                             <a href="#6.10.1">6.10.1</a>, <a href="#7.1.4">7.1.4</a>
32674  graphic characters, <a href="#5.2.1">5.2.1</a>                                   if statement, <a href="#6.8.4.1">6.8.4.1</a>
32675  greater-than operator (&gt;), <a href="#6.5.8">6.5.8</a>                            ifdef preprocessing directive, <a href="#6.10.1">6.10.1</a>
32676  greater-than-or-equal-to operator (&gt;=), <a href="#6.5.8">6.5.8</a>               ifndef preprocessing directive, <a href="#6.10.1">6.10.1</a>
32677                                                              ignore_handler_s function, <a href="#K.3.6.1.3">K.3.6.1.3</a>
32678  happens before, <a href="#5.1.2.4">5.1.2.4</a>                                     ilogb functions, <a href="#7.12">7.12</a>, <a href="#7.12.6.5">7.12.6.5</a>, <a href="#F.10.3.5">F.10.3.5</a>
32679  header, <a href="#5.1.1.1">5.1.1.1</a>, <a href="#7.1.2">7.1.2</a>, see also standard headers           ilogb type-generic macro, <a href="#7.24">7.24</a>
32680  header names, <a href="#6.4">6.4</a>, <a href="#6.4.7">6.4.7</a>, <a href="#6.10.2">6.10.2</a>                            imaginary macro, <a href="#7.3.1">7.3.1</a>, <a href="#G.6">G.6</a>
32681  hexadecimal constant, <a href="#6.4.4.1">6.4.4.1</a>                               imaginary numbers, <a href="#G">G</a>
32682  hexadecimal digit, <a href="#6.4.4.1">6.4.4.1</a>, <a href="#6.4.4.2">6.4.4.2</a>, <a href="#6.4.4.4">6.4.4.4</a>                imaginary type domain, <a href="#G.2">G.2</a>
32683  hexadecimal prefix, <a href="#6.4.4.1">6.4.4.1</a>                                  imaginary types, <a href="#G">G</a>
32684  hexadecimal-character escape sequence                       imaxabs function, <a href="#7.8.2.1">7.8.2.1</a>
32685       (\x hexadecimal digits), <a href="#6.4.4.4">6.4.4.4</a>                       imaxdiv function, <a href="#7.8">7.8</a>, <a href="#7.8.2.2">7.8.2.2</a>
32686  high-order bit, <a href="#3.6">3.6</a>                                         imaxdiv_t type, <a href="#7.8">7.8</a>
32687  horizontal-tab character, <a href="#5.2.1">5.2.1</a>, <a href="#6.4">6.4</a>                        implementation, <a href="#3.12">3.12</a>
32688  horizontal-tab escape sequence (\r), <a href="#7.29.2.1.3">7.29.2.1.3</a>             implementation limit, <a href="#3.13">3.13</a>, <a href="#4">4</a>, <a href="#5.2.4.2">5.2.4.2</a>, <a href="#6.4.2.1">6.4.2.1</a>,
32689  horizontal-tab escape sequence (\t), <a href="#5.2.2">5.2.2</a>,                       <a href="#6.7.6">6.7.6</a>, <a href="#6.8.4.2">6.8.4.2</a>, <a href="#E">E</a>, see also environmental
32690       <a href="#6.4.4.4">6.4.4.4</a>, <a href="#7.4.1.3">7.4.1.3</a>, <a href="#7.4.1.10">7.4.1.10</a>                                   limits
32691  hosted execution environment, <a href="#4">4</a>, <a href="#5.1.2">5.1.2</a>, <a href="#5.1.2.2">5.1.2.2</a>             implementation-defined behavior, <a href="#3.4.1">3.4.1</a>, <a href="#4">4</a>, <a href="#J.3">J.3</a>
32692  HUGE_VAL macro, <a href="#7.12">7.12</a>, <a href="#7.12.1">7.12.1</a>, <a href="#7.22.1.3">7.22.1.3</a>,                     implementation-defined value, <a href="#3.19.1">3.19.1</a>
32693       <a href="#7.28.4.1.1">7.28.4.1.1</a>, <a href="#F.10">F.10</a>                                       implicit conversion, <a href="#6.3">6.3</a>
32694  HUGE_VALF macro, <a href="#7.12">7.12</a>, <a href="#7.12.1">7.12.1</a>, <a href="#7.22.1.3">7.22.1.3</a>,                    implicit initialization, <a href="#6.7.9">6.7.9</a>
32695       <a href="#7.28.4.1.1">7.28.4.1.1</a>, <a href="#F.10">F.10</a>                                       include preprocessing directive, <a href="#5.1.1.2">5.1.1.2</a>, <a href="#6.10.2">6.10.2</a>
32696  HUGE_VALL macro, <a href="#7.12">7.12</a>, <a href="#7.12.1">7.12.1</a>, <a href="#7.22.1.3">7.22.1.3</a>,                    inclusive OR operators
32697       <a href="#7.28.4.1.1">7.28.4.1.1</a>, <a href="#F.10">F.10</a>                                         bitwise (|), <a href="#6.2.6.2">6.2.6.2</a>, <a href="#6.5.12">6.5.12</a>
32698  hyperbolic functions                                           bitwise assignment (|=), <a href="#6.5.16.2">6.5.16.2</a>
32699    complex, <a href="#7.3.6">7.3.6</a>, <a href="#G.6.2">G.6.2</a>                                     incomplete type, <a href="#6.2.5">6.2.5</a>
32700    real, <a href="#7.12.5">7.12.5</a>, <a href="#F.10.2">F.10.2</a>                                      increment operators, see arithmetic operators,
32701  hypot functions, <a href="#7.12.7.3">7.12.7.3</a>, <a href="#F.10.4.3">F.10.4.3</a>                               increment and decrement
32702  hypot type-generic macro, <a href="#7.24">7.24</a>                              indeterminate value, <a href="#3.19.2">3.19.2</a>
32703                                                              indeterminately sequenced, <a href="#5.1.2.3">5.1.2.3</a>, <a href="#6.5.2.2">6.5.2.2</a>,
32704  <a href="#I">I</a> macro, <a href="#7.3.1">7.3.1</a>, <a href="#7.3.9.5">7.3.9.5</a>, <a href="#G.6">G.6</a>                                      <a href="#6.5.2.4">6.5.2.4</a>, <a href="#6.5.16.2">6.5.16.2</a>, see also sequenced before,
32705  identifier, <a href="#6.4.2.1">6.4.2.1</a>, <a href="#6.5.1">6.5.1</a>                                         unsequenced
32706     linkage, see linkage                                     indirection operator (*), <a href="#6.5.2.1">6.5.2.1</a>, <a href="#6.5.3.2">6.5.3.2</a>
32707     maximum length, <a href="#6.4.2.1">6.4.2.1</a>                                  inequality operator (!=), <a href="#6.5.9">6.5.9</a>
32708 <!--page 683 -->
32709  infinitary, <a href="#7.12.1">7.12.1</a>                                                    extended, <a href="#6.2.5">6.2.5</a>, <a href="#6.3.1.1">6.3.1.1</a>, <a href="#6.4.4.1">6.4.4.1</a>, <a href="#7.20">7.20</a>
32710  INFINITY macro, <a href="#7.3.9.5">7.3.9.5</a>, <a href="#7.12">7.12</a>, <a href="#F.2.1">F.2.1</a>                              inter-thread happens before, <a href="#5.1.2.4">5.1.2.4</a>
32711  initial position, <a href="#5.2.2">5.2.2</a>                                           interactive device, <a href="#5.1.2.3">5.1.2.3</a>, <a href="#7.21.3">7.21.3</a>, <a href="#7.21.5.3">7.21.5.3</a>
32712  initial shift state, <a href="#5.2.1.2">5.2.1.2</a>                                      internal linkage, <a href="#6.2.2">6.2.2</a>
32713  initialization, <a href="#5.1.2">5.1.2</a>, <a href="#6.2.4">6.2.4</a>, <a href="#6.3.2.1">6.3.2.1</a>, <a href="#6.5.2.5">6.5.2.5</a>, <a href="#6.7.9">6.7.9</a>,            internal name, <a href="#6.4.2.1">6.4.2.1</a>
32714        <a href="#F.8.5">F.8.5</a>                                                       interrupt, <a href="#5.2.3">5.2.3</a>
32715     in blocks, <a href="#6.8">6.8</a>                                                 INTMAX_C macro, <a href="#7.20.4.2">7.20.4.2</a>
32716  initializer, <a href="#6.7.9">6.7.9</a>                                                INTMAX_MAX macro, <a href="#7.8.2.3">7.8.2.3</a>, <a href="#7.8.2.4">7.8.2.4</a>, <a href="#7.20.2.5">7.20.2.5</a>
32717     permitted form, <a href="#6.6">6.6</a>                                            INTMAX_MIN macro, <a href="#7.8.2.3">7.8.2.3</a>, <a href="#7.8.2.4">7.8.2.4</a>, <a href="#7.20.2.5">7.20.2.5</a>
32718     string literal, <a href="#6.3.2.1">6.3.2.1</a>                                        intmax_t type, <a href="#7.20.1.5">7.20.1.5</a>, <a href="#7.21.6.1">7.21.6.1</a>, <a href="#7.21.6.2">7.21.6.2</a>,
32719  inline, <a href="#6.7.4">6.7.4</a>                                                           <a href="#7.28.2.1">7.28.2.1</a>, <a href="#7.28.2.2">7.28.2.2</a>
32720  inner scope, <a href="#6.2.1">6.2.1</a>                                                INTN_C macros, <a href="#7.20.4.1">7.20.4.1</a>
32721  input failure, <a href="#7.28.2.6">7.28.2.6</a>, <a href="#7.28.2.8">7.28.2.8</a>, <a href="#7.28.2.10">7.28.2.10</a>,                     INTN_MAX macros, <a href="#7.20.2.1">7.20.2.1</a>
32722        <a href="#K.3.5.3.2">K.3.5.3.2</a>, <a href="#K.3.5.3.4">K.3.5.3.4</a>, <a href="#K.3.5.3.7">K.3.5.3.7</a>, <a href="#K.3.5.3.9">K.3.5.3.9</a>,                 INTN_MIN macros, <a href="#7.20.2.1">7.20.2.1</a>
32723        <a href="#K.3.5.3.11">K.3.5.3.11</a>, <a href="#K.3.5.3.14">K.3.5.3.14</a>, <a href="#K.3.9.1.2">K.3.9.1.2</a>, <a href="#K.3.9.1.5">K.3.9.1.5</a>,               intN_t types, <a href="#7.20.1.1">7.20.1.1</a>
32724        <a href="#K.3.9.1.7">K.3.9.1.7</a>, <a href="#K.3.9.1.10">K.3.9.1.10</a>, <a href="#K.3.9.1.12">K.3.9.1.12</a>, <a href="#K.3.9.1.14">K.3.9.1.14</a>               INTPTR_MAX macro, <a href="#7.20.2.4">7.20.2.4</a>
32725  input/output functions                                            INTPTR_MIN macro, <a href="#7.20.2.4">7.20.2.4</a>
32726     character, <a href="#7.21.7">7.21.7</a>, <a href="#K.3.5.4">K.3.5.4</a>                                     intptr_t type, <a href="#7.20.1.4">7.20.1.4</a>
32727     direct, <a href="#7.21.8">7.21.8</a>                                                 inttypes.h header, <a href="#7.8">7.8</a>, <a href="#7.30.4">7.30.4</a>
32728     formatted, <a href="#7.21.6">7.21.6</a>, <a href="#K.3.5.3">K.3.5.3</a>                                     isalnum function, <a href="#7.4.1.1">7.4.1.1</a>, <a href="#7.4.1.9">7.4.1.9</a>, <a href="#7.4.1.10">7.4.1.10</a>
32729        wide character, <a href="#7.28.2">7.28.2</a>, <a href="#K.3.9.1">K.3.9.1</a>                             isalpha function, <a href="#7.4.1.1">7.4.1.1</a>, <a href="#7.4.1.2">7.4.1.2</a>
32730     wide character, <a href="#7.28.3">7.28.3</a>                                         isblank function, <a href="#7.4.1.3">7.4.1.3</a>
32731        formatted, <a href="#7.28.2">7.28.2</a>, <a href="#K.3.9.1">K.3.9.1</a>                                  iscntrl function, <a href="#7.4.1.2">7.4.1.2</a>, <a href="#7.4.1.4">7.4.1.4</a>, <a href="#7.4.1.7">7.4.1.7</a>,
32732  input/output header, <a href="#7.21">7.21</a>, <a href="#K.3.5">K.3.5</a>                                        <a href="#7.4.1.11">7.4.1.11</a>
32733  input/output, device, <a href="#5.1.2.3">5.1.2.3</a>                                     isdigit function, <a href="#7.4.1.1">7.4.1.1</a>, <a href="#7.4.1.2">7.4.1.2</a>, <a href="#7.4.1.5">7.4.1.5</a>,
32734  int type, <a href="#6.2.5">6.2.5</a>, <a href="#6.3.1.1">6.3.1.1</a>, <a href="#6.3.1.3">6.3.1.3</a>, <a href="#6.4.4.1">6.4.4.1</a>, <a href="#6.7.2">6.7.2</a>                       <a href="#7.4.1.7">7.4.1.7</a>, <a href="#7.4.1.11">7.4.1.11</a>, <a href="#7.11.1.1">7.11.1.1</a>
32735  int type conversion, <a href="#6.3.1.1">6.3.1.1</a>, <a href="#6.3.1.3">6.3.1.3</a>, <a href="#6.3.1.4">6.3.1.4</a>,                   isfinite macro, <a href="#7.12.3.2">7.12.3.2</a>, <a href="#F.3">F.3</a>
32736        <a href="#6.3.1.8">6.3.1.8</a>                                                     isgraph function, <a href="#7.4.1.6">7.4.1.6</a>
32737  INT_FASTN_MAX macros, <a href="#7.20.2.3">7.20.2.3</a>                                    isgreater macro, <a href="#7.12.14.1">7.12.14.1</a>, <a href="#F.3">F.3</a>
32738  INT_FASTN_MIN macros, <a href="#7.20.2.3">7.20.2.3</a>                                    isgreaterequal macro, <a href="#7.12.14.2">7.12.14.2</a>, <a href="#F.3">F.3</a>
32739  int_fastN_t types, <a href="#7.20.1.3">7.20.1.3</a>                                       isinf macro, <a href="#7.12.3.3">7.12.3.3</a>
32740  INT_LEASTN_MAX macros, <a href="#7.20.2.2">7.20.2.2</a>                                   isless macro, <a href="#7.12.14.3">7.12.14.3</a>, <a href="#F.3">F.3</a>
32741  INT_LEASTN_MIN macros, <a href="#7.20.2.2">7.20.2.2</a>                                   islessequal macro, <a href="#7.12.14.4">7.12.14.4</a>, <a href="#F.3">F.3</a>
32742  int_leastN_t types, <a href="#7.20.1.2">7.20.1.2</a>                                      islessgreater macro, <a href="#7.12.14.5">7.12.14.5</a>, <a href="#F.3">F.3</a>
32743  INT_MAX macro, <a href="#5.2.4.2.1">5.2.4.2.1</a>, <a href="#7.12">7.12</a>, <a href="#7.12.6.5">7.12.6.5</a>                          islower function, <a href="#7.4.1.2">7.4.1.2</a>, <a href="#7.4.1.7">7.4.1.7</a>, <a href="#7.4.2.1">7.4.2.1</a>,
32744  INT_MIN macro, <a href="#5.2.4.2.1">5.2.4.2.1</a>, <a href="#7.12">7.12</a>                                          <a href="#7.4.2.2">7.4.2.2</a>
32745  integer arithmetic functions, <a href="#7.8.2.1">7.8.2.1</a>, <a href="#7.8.2.2">7.8.2.2</a>,                   isnan macro, <a href="#7.12.3.4">7.12.3.4</a>, <a href="#F.3">F.3</a>
32746        <a href="#7.22.6">7.22.6</a>                                                      isnormal macro, <a href="#7.12.3.5">7.12.3.5</a>
32747  integer character constant, <a href="#6.4.4.4">6.4.4.4</a>                               ISO 31-11, <a href="#2">2</a>, <a href="#3">3</a>
32748  integer constant, <a href="#6.4.4.1">6.4.4.1</a>                                         ISO 4217, <a href="#2">2</a>, <a href="#7.11.2.1">7.11.2.1</a>
32749  integer constant expression, <a href="#6.3.2.3">6.3.2.3</a>, <a href="#6.6">6.6</a>, <a href="#6.7.2.1">6.7.2.1</a>,               ISO 8601, <a href="#2">2</a>, <a href="#7.26.3.5">7.26.3.5</a>
32750        <a href="#6.7.2.2">6.7.2.2</a>, <a href="#6.7.6.2">6.7.6.2</a>, <a href="#6.7.9">6.7.9</a>, <a href="#6.7.10">6.7.10</a>, <a href="#6.8.4.2">6.8.4.2</a>, <a href="#6.10.1">6.10.1</a>,           ISO/IEC 10646, <a href="#2">2</a>, <a href="#6.4.2.1">6.4.2.1</a>, <a href="#6.4.3">6.4.3</a>, <a href="#6.10.8.2">6.10.8.2</a>
32751        <a href="#7.1.4">7.1.4</a>                                                       ISO/IEC 10976-1, <a href="#H.1">H.1</a>
32752  integer conversion rank, <a href="#6.3.1.1">6.3.1.1</a>                                  ISO/IEC 2382-1, <a href="#2">2</a>, <a href="#3">3</a>
32753  integer promotions, <a href="#5.1.2.3">5.1.2.3</a>, <a href="#5.2.4.2.1">5.2.4.2.1</a>, <a href="#6.3.1.1">6.3.1.1</a>,                  ISO/IEC 646, <a href="#2">2</a>, <a href="#5.2.1.1">5.2.1.1</a>
32754        <a href="#6.5.2.2">6.5.2.2</a>, <a href="#6.5.3.3">6.5.3.3</a>, <a href="#6.5.7">6.5.7</a>, <a href="#6.8.4.2">6.8.4.2</a>, <a href="#7.20.2">7.20.2</a>, <a href="#7.20.3">7.20.3</a>,           ISO/IEC 9945-2, <a href="#7.11">7.11</a>
32755        <a href="#7.21.6.1">7.21.6.1</a>, <a href="#7.28.2.1">7.28.2.1</a>                                          iso646.h header, <a href="#4">4</a>, <a href="#7.9">7.9</a>                          *
32756  integer suffix, <a href="#6.4.4.1">6.4.4.1</a>                                            isprint function, <a href="#5.2.2">5.2.2</a>, <a href="#7.4.1.8">7.4.1.8</a>
32757  integer type conversion, <a href="#6.3.1.1">6.3.1.1</a>, <a href="#6.3.1.3">6.3.1.3</a>, <a href="#6.3.1.4">6.3.1.4</a>,               ispunct function, <a href="#7.4.1.2">7.4.1.2</a>, <a href="#7.4.1.7">7.4.1.7</a>, <a href="#7.4.1.9">7.4.1.9</a>,
32758        <a href="#F.3">F.3</a>, <a href="#F.4">F.4</a>                                                          <a href="#7.4.1.11">7.4.1.11</a>
32759  integer types, <a href="#6.2.5">6.2.5</a>, <a href="#7.20">7.20</a>                                        isspace function, <a href="#7.4.1.2">7.4.1.2</a>, <a href="#7.4.1.7">7.4.1.7</a>, <a href="#7.4.1.9">7.4.1.9</a>,
32760 <!--page 684 -->
32761        <a href="#7.4.1.10">7.4.1.10</a>, <a href="#7.4.1.11">7.4.1.11</a>, <a href="#7.21.6.2">7.21.6.2</a>, <a href="#7.22.1.3">7.22.1.3</a>,                   LC_ALL macro, <a href="#7.11">7.11</a>, <a href="#7.11.1.1">7.11.1.1</a>, <a href="#7.11.2.1">7.11.2.1</a>
32762        <a href="#7.22.1.4">7.22.1.4</a>, <a href="#7.28.2.2">7.28.2.2</a>                                        LC_COLLATE macro, <a href="#7.11">7.11</a>, <a href="#7.11.1.1">7.11.1.1</a>, <a href="#7.23.4.3">7.23.4.3</a>,
32763  isunordered macro, <a href="#7.12.14.6">7.12.14.6</a>, <a href="#F.3">F.3</a>                                     <a href="#7.28.4.4.2">7.28.4.4.2</a>
32764  isupper function, <a href="#7.4.1.2">7.4.1.2</a>, <a href="#7.4.1.11">7.4.1.11</a>, <a href="#7.4.2.1">7.4.2.1</a>,                   LC_CTYPE macro, <a href="#7.11">7.11</a>, <a href="#7.11.1.1">7.11.1.1</a>, <a href="#7.22">7.22</a>, <a href="#7.22.7">7.22.7</a>,
32765        <a href="#7.4.2.2">7.4.2.2</a>                                                         <a href="#7.22.8">7.22.8</a>, <a href="#7.28.6">7.28.6</a>, <a href="#7.29.1">7.29.1</a>, <a href="#7.29.2.2.1">7.29.2.2.1</a>, <a href="#7.29.2.2.2">7.29.2.2.2</a>,
32766  iswalnum function, <a href="#7.29.2.1.1">7.29.2.1.1</a>, <a href="#7.29.2.1.9">7.29.2.1.9</a>,                            <a href="#7.29.3.2.1">7.29.3.2.1</a>, <a href="#7.29.3.2.2">7.29.3.2.2</a>, <a href="#K.3.6.4">K.3.6.4</a>, <a href="#K.3.6.5">K.3.6.5</a>
32767        <a href="#7.29.2.1.10">7.29.2.1.10</a>, <a href="#7.29.2.2.1">7.29.2.2.1</a>                                   LC_MONETARY macro, <a href="#7.11">7.11</a>, <a href="#7.11.1.1">7.11.1.1</a>, <a href="#7.11.2.1">7.11.2.1</a>
32768  iswalpha function, <a href="#7.29.2.1.1">7.29.2.1.1</a>, <a href="#7.29.2.1.2">7.29.2.1.2</a>,                      LC_NUMERIC macro, <a href="#7.11">7.11</a>, <a href="#7.11.1.1">7.11.1.1</a>, <a href="#7.11.2.1">7.11.2.1</a>
32769        <a href="#7.29.2.2.1">7.29.2.2.1</a>                                                LC_TIME macro, <a href="#7.11">7.11</a>, <a href="#7.11.1.1">7.11.1.1</a>, <a href="#7.26.3.5">7.26.3.5</a>
32770  iswblank function, <a href="#7.29.2.1.3">7.29.2.1.3</a>, <a href="#7.29.2.2.1">7.29.2.2.1</a>                       lconv structure type, <a href="#7.11">7.11</a>
32771  iswcntrl function, <a href="#7.29.2.1.2">7.29.2.1.2</a>, <a href="#7.29.2.1.4">7.29.2.1.4</a>,                      LDBL_DECIMAL_DIG macro, <a href="#5.2.4.2.2">5.2.4.2.2</a>
32772        <a href="#7.29.2.1.7">7.29.2.1.7</a>, <a href="#7.29.2.1.11">7.29.2.1.11</a>, <a href="#7.29.2.2.1">7.29.2.2.1</a>                       LDBL_DIG macro, <a href="#5.2.4.2.2">5.2.4.2.2</a>
32773  iswctype function, <a href="#7.29.2.2.1">7.29.2.2.1</a>, <a href="#7.29.2.2.2">7.29.2.2.2</a>                       LDBL_EPSILON macro, <a href="#5.2.4.2.2">5.2.4.2.2</a>
32774  iswdigit function, <a href="#7.29.2.1.1">7.29.2.1.1</a>, <a href="#7.29.2.1.2">7.29.2.1.2</a>,                      LDBL_HAS_SUBNORM macro, <a href="#5.2.4.2.2">5.2.4.2.2</a>
32775        <a href="#7.29.2.1.5">7.29.2.1.5</a>, <a href="#7.29.2.1.7">7.29.2.1.7</a>, <a href="#7.29.2.1.11">7.29.2.1.11</a>, <a href="#7.29.2.2.1">7.29.2.2.1</a>           LDBL_MANT_DIG macro, <a href="#5.2.4.2.2">5.2.4.2.2</a>
32776  iswgraph function, <a href="#7.29.2.1">7.29.2.1</a>, <a href="#7.29.2.1.6">7.29.2.1.6</a>,                        LDBL_MAX macro, <a href="#5.2.4.2.2">5.2.4.2.2</a>
32777        <a href="#7.29.2.1.10">7.29.2.1.10</a>, <a href="#7.29.2.2.1">7.29.2.2.1</a>                                   LDBL_MAX_10_EXP macro, <a href="#5.2.4.2.2">5.2.4.2.2</a>
32778  iswlower function, <a href="#7.29.2.1.2">7.29.2.1.2</a>, <a href="#7.29.2.1.7">7.29.2.1.7</a>,                      LDBL_MAX_EXP macro, <a href="#5.2.4.2.2">5.2.4.2.2</a>
32779        <a href="#7.29.2.2.1">7.29.2.2.1</a>, <a href="#7.29.3.1.1">7.29.3.1.1</a>, <a href="#7.29.3.1.2">7.29.3.1.2</a>                        LDBL_MIN macro, <a href="#5.2.4.2.2">5.2.4.2.2</a>
32780  iswprint function, <a href="#7.29.2.1.6">7.29.2.1.6</a>, <a href="#7.29.2.1.8">7.29.2.1.8</a>,                      LDBL_MIN_10_EXP macro, <a href="#5.2.4.2.2">5.2.4.2.2</a>
32781        <a href="#7.29.2.2.1">7.29.2.2.1</a>                                                LDBL_MIN_EXP macro, <a href="#5.2.4.2.2">5.2.4.2.2</a>
32782  iswpunct function, <a href="#7.29.2.1">7.29.2.1</a>, <a href="#7.29.2.1.2">7.29.2.1.2</a>,                        LDBL_TRUE_MIN macro, <a href="#5.2.4.2.2">5.2.4.2.2</a>
32783        <a href="#7.29.2.1.7">7.29.2.1.7</a>, <a href="#7.29.2.1.9">7.29.2.1.9</a>, <a href="#7.29.2.1.10">7.29.2.1.10</a>,                      ldexp functions, <a href="#7.12.6.6">7.12.6.6</a>, <a href="#F.10.3.6">F.10.3.6</a>
32784        <a href="#7.29.2.1.11">7.29.2.1.11</a>, <a href="#7.29.2.2.1">7.29.2.2.1</a>                                   ldexp type-generic macro, <a href="#7.24">7.24</a>
32785  iswspace function, <a href="#7.21.6.2">7.21.6.2</a>, <a href="#7.28.2.2">7.28.2.2</a>,                          ldiv function, <a href="#7.22.6.2">7.22.6.2</a>
32786        <a href="#7.28.4.1.1">7.28.4.1.1</a>, <a href="#7.28.4.1.2">7.28.4.1.2</a>, <a href="#7.29.2.1.2">7.29.2.1.2</a>, <a href="#7.29.2.1.6">7.29.2.1.6</a>,           ldiv_t type, <a href="#7.22">7.22</a>
32787        <a href="#7.29.2.1.7">7.29.2.1.7</a>, <a href="#7.29.2.1.9">7.29.2.1.9</a>, <a href="#7.29.2.1.10">7.29.2.1.10</a>,                      leading underscore in identifiers, <a href="#7.1.3">7.1.3</a>
32788        <a href="#7.29.2.1.11">7.29.2.1.11</a>, <a href="#7.29.2.2.1">7.29.2.2.1</a>                                   left-shift assignment operator (&lt;&lt;=), <a href="#6.5.16.2">6.5.16.2</a>
32789  iswupper function, <a href="#7.29.2.1.2">7.29.2.1.2</a>, <a href="#7.29.2.1.11">7.29.2.1.11</a>,                     left-shift operator (&lt;&lt;), <a href="#6.2.6.2">6.2.6.2</a>, <a href="#6.5.7">6.5.7</a>
32790        <a href="#7.29.2.2.1">7.29.2.2.1</a>, <a href="#7.29.3.1.1">7.29.3.1.1</a>, <a href="#7.29.3.1.2">7.29.3.1.2</a>                        length
32791  iswxdigit function, <a href="#7.29.2.1.12">7.29.2.1.12</a>, <a href="#7.29.2.2.1">7.29.2.2.1</a>                        external name, <a href="#5.2.4.1">5.2.4.1</a>, <a href="#6.4.2.1">6.4.2.1</a>, <a href="#6.11.3">6.11.3</a>
32792  isxdigit function, <a href="#7.4.1.12">7.4.1.12</a>, <a href="#7.11.1.1">7.11.1.1</a>                              function name, <a href="#5.2.4.1">5.2.4.1</a>, <a href="#6.4.2.1">6.4.2.1</a>, <a href="#6.11.3">6.11.3</a>
32793  italic type convention, <a href="#3">3</a>, <a href="#6.1">6.1</a>                                     identifier, <a href="#6.4.2.1">6.4.2.1</a>
32794  iteration statements, <a href="#6.8.5">6.8.5</a>                                        internal name, <a href="#5.2.4.1">5.2.4.1</a>, <a href="#6.4.2.1">6.4.2.1</a>
32795                                                                  length function, <a href="#7.22.7.1">7.22.7.1</a>, <a href="#7.23.6.3">7.23.6.3</a>, <a href="#7.28.4.6.1">7.28.4.6.1</a>,
32796  jmp_buf type, <a href="#7.13">7.13</a>                                                    <a href="#7.28.6.3.1">7.28.6.3.1</a>, <a href="#K.3.7.4.4">K.3.7.4.4</a>, <a href="#K.3.9.2.4.1">K.3.9.2.4.1</a>
32797  jump statements, <a href="#6.8.6">6.8.6</a>                                          length modifier, <a href="#7.21.6.1">7.21.6.1</a>, <a href="#7.21.6.2">7.21.6.2</a>, <a href="#7.28.2.1">7.28.2.1</a>,
32798                                                                        <a href="#7.28.2.2">7.28.2.2</a>
32799  keywords, <a href="#6.4.1">6.4.1</a>, <a href="#G.2">G.2</a>, <a href="#J.5.9">J.5.9</a>, <a href="#J.5.10">J.5.10</a>                             less-than operator (&lt;), <a href="#6.5.8">6.5.8</a>
32800  kill_dependency macro, <a href="#5.1.2.4">5.1.2.4</a>, <a href="#7.17.3.1">7.17.3.1</a>                        less-than-or-equal-to operator (&lt;=), <a href="#6.5.8">6.5.8</a>
32801  known constant size, <a href="#6.2.5">6.2.5</a>                                      letter, <a href="#5.2.1">5.2.1</a>, <a href="#7.4">7.4</a>
32802                                                                  lexical elements, <a href="#5.1.1.2">5.1.1.2</a>, <a href="#6.4">6.4</a>
32803  L_tmpnam macro, <a href="#7.21.1">7.21.1</a>, <a href="#7.21.4.4">7.21.4.4</a>                                lgamma functions, <a href="#7.12.8.3">7.12.8.3</a>, <a href="#F.10.5.3">F.10.5.3</a>
32804  L_tmpnam_s macro, <a href="#K.3.5">K.3.5</a>, <a href="#K.3.5.1.2">K.3.5.1.2</a>                              lgamma type-generic macro, <a href="#7.24">7.24</a>
32805  label name, <a href="#6.2.1">6.2.1</a>, <a href="#6.2.3">6.2.3</a>                                        library, <a href="#5.1.1.1">5.1.1.1</a>, <a href="#7">7</a>, <a href="#K.3">K.3</a>
32806  labeled statement, <a href="#6.8.1">6.8.1</a>                                           future directions, <a href="#7.30">7.30</a>
32807  labs function, <a href="#7.22.6.1">7.22.6.1</a>                                            summary, <a href="#B">B</a>
32808  language, <a href="#6">6</a>                                                        terms, <a href="#7.1.1">7.1.1</a>
32809     future directions, <a href="#6.11">6.11</a>                                         use of functions, <a href="#7.1.4">7.1.4</a>
32810     syntax summary, <a href="#A">A</a>                                            lifetime, <a href="#6.2.4">6.2.4</a>
32811  Latin alphabet, <a href="#5.2.1">5.2.1</a>, <a href="#6.4.2.1">6.4.2.1</a>                                  limits
32812 <!--page 685 -->
32813     environmental, see environmental limits                      <a href="#6.3.1.6">6.3.1.6</a>, <a href="#6.3.1.7">6.3.1.7</a>, <a href="#6.3.1.8">6.3.1.8</a>
32814     implementation, see implementation limits               long double _Imaginary type, <a href="#G.2">G.2</a>
32815     numerical, see numerical limits                         long double suffix, l or <a href="#L">L</a>, <a href="#6.4.4.2">6.4.4.2</a>
32816     translation, see translation limits                     long double type, <a href="#6.2.5">6.2.5</a>, <a href="#6.4.4.2">6.4.4.2</a>, <a href="#6.7.2">6.7.2</a>,
32817  limits.h header, <a href="#4">4</a>, <a href="#5.2.4.2.1">5.2.4.2.1</a>, <a href="#6.2.5">6.2.5</a>, <a href="#7.10">7.10</a>                      <a href="#7.21.6.1">7.21.6.1</a>, <a href="#7.21.6.2">7.21.6.2</a>, <a href="#7.28.2.1">7.28.2.1</a>, <a href="#7.28.2.2">7.28.2.2</a>, <a href="#F.2">F.2</a>
32818  line buffered stream, <a href="#7.21.3">7.21.3</a>                               long double type conversion, <a href="#6.3.1.4">6.3.1.4</a>, <a href="#6.3.1.5">6.3.1.5</a>,
32819  line number, <a href="#6.10.4">6.10.4</a>, <a href="#6.10.8.1">6.10.8.1</a>                                   <a href="#6.3.1.7">6.3.1.7</a>, <a href="#6.3.1.8">6.3.1.8</a>
32820  line preprocessing directive, <a href="#6.10.4">6.10.4</a>                       long int type, <a href="#6.2.5">6.2.5</a>, <a href="#6.3.1.1">6.3.1.1</a>, <a href="#6.7.2">6.7.2</a>, <a href="#7.21.6.1">7.21.6.1</a>,
32821  lines, <a href="#5.1.1.2">5.1.1.2</a>, <a href="#7.21.2">7.21.2</a>                                          <a href="#7.21.6.2">7.21.6.2</a>, <a href="#7.28.2.1">7.28.2.1</a>, <a href="#7.28.2.2">7.28.2.2</a>
32822     preprocessing directive, <a href="#6.10">6.10</a>                           long int type conversion, <a href="#6.3.1.1">6.3.1.1</a>, <a href="#6.3.1.3">6.3.1.3</a>,
32823  linkage, <a href="#6.2.2">6.2.2</a>, <a href="#6.7">6.7</a>, <a href="#6.7.4">6.7.4</a>, <a href="#6.7.6.2">6.7.6.2</a>, <a href="#6.9">6.9</a>, <a href="#6.9.2">6.9.2</a>,                <a href="#6.3.1.4">6.3.1.4</a>, <a href="#6.3.1.8">6.3.1.8</a>
32824        <a href="#6.11.2">6.11.2</a>                                               long integer suffix, l or <a href="#L">L</a>, <a href="#6.4.4.1">6.4.4.1</a>
32825  llabs function, <a href="#7.22.6.1">7.22.6.1</a>                                   long long int type, <a href="#6.2.5">6.2.5</a>, <a href="#6.3.1.1">6.3.1.1</a>, <a href="#6.7.2">6.7.2</a>,
32826  lldiv function, <a href="#7.22.6.2">7.22.6.2</a>                                        <a href="#7.21.6.1">7.21.6.1</a>, <a href="#7.21.6.2">7.21.6.2</a>, <a href="#7.28.2.1">7.28.2.1</a>, <a href="#7.28.2.2">7.28.2.2</a>
32827  lldiv_t type, <a href="#7.22">7.22</a>                                         long long int type conversion, <a href="#6.3.1.1">6.3.1.1</a>,
32828  LLONG_MAX macro, <a href="#5.2.4.2.1">5.2.4.2.1</a>, <a href="#7.22.1.4">7.22.1.4</a>,                           <a href="#6.3.1.3">6.3.1.3</a>, <a href="#6.3.1.4">6.3.1.4</a>, <a href="#6.3.1.8">6.3.1.8</a>
32829        <a href="#7.28.4.1.2">7.28.4.1.2</a>                                           long long integer suffix, ll or LL, <a href="#6.4.4.1">6.4.4.1</a>
32830  LLONG_MIN macro, <a href="#5.2.4.2.1">5.2.4.2.1</a>, <a href="#7.22.1.4">7.22.1.4</a>,                      LONG_MAX macro, <a href="#5.2.4.2.1">5.2.4.2.1</a>, <a href="#7.22.1.4">7.22.1.4</a>, <a href="#7.28.4.1.2">7.28.4.1.2</a>
32831        <a href="#7.28.4.1.2">7.28.4.1.2</a>                                           LONG_MIN macro, <a href="#5.2.4.2.1">5.2.4.2.1</a>, <a href="#7.22.1.4">7.22.1.4</a>, <a href="#7.28.4.1.2">7.28.4.1.2</a>
32832  llrint functions, <a href="#7.12.9.5">7.12.9.5</a>, <a href="#F.3">F.3</a>, <a href="#F.10.6.5">F.10.6.5</a>                  longjmp function, <a href="#7.13.1.1">7.13.1.1</a>, <a href="#7.13.2.1">7.13.2.1</a>, <a href="#7.22.4.4">7.22.4.4</a>,
32833  llrint type-generic macro, <a href="#7.24">7.24</a>                                 <a href="#7.22.4.7">7.22.4.7</a>
32834  llround functions, <a href="#7.12.9.7">7.12.9.7</a>, <a href="#F.10.6.7">F.10.6.7</a>                      loop body, <a href="#6.8.5">6.8.5</a>
32835  llround type-generic macro, <a href="#7.24">7.24</a>                           low-order bit, <a href="#3.6">3.6</a>
32836  local time, <a href="#7.26.1">7.26.1</a>                                         lowercase letter, <a href="#5.2.1">5.2.1</a>
32837  locale, <a href="#3.4.2">3.4.2</a>                                              lrint functions, <a href="#7.12.9.5">7.12.9.5</a>, <a href="#F.3">F.3</a>, <a href="#F.10.6.5">F.10.6.5</a>
32838  locale-specific behavior, <a href="#3.4.2">3.4.2</a>, <a href="#J.4">J.4</a>                        lrint type-generic macro, <a href="#7.24">7.24</a>
32839  locale.h header, <a href="#7.11">7.11</a>, <a href="#7.30.5">7.30.5</a>                              lround functions, <a href="#7.12.9.7">7.12.9.7</a>, <a href="#F.10.6.7">F.10.6.7</a>
32840  localeconv function, <a href="#7.11.1.1">7.11.1.1</a>, <a href="#7.11.2.1">7.11.2.1</a>                    lround type-generic macro, <a href="#7.24">7.24</a>
32841  localization, <a href="#7.11">7.11</a>                                         lvalue, <a href="#6.3.2.1">6.3.2.1</a>, <a href="#6.5.1">6.5.1</a>, <a href="#6.5.2.4">6.5.2.4</a>, <a href="#6.5.3.1">6.5.3.1</a>, <a href="#6.5.16">6.5.16</a>,
32842  localtime function, <a href="#7.26.3.4">7.26.3.4</a>                                    <a href="#6.7.2.4">6.7.2.4</a>
32843  localtime_s function, <a href="#K.3.8.2.4">K.3.8.2.4</a>                            lvalue conversion, <a href="#6.3.2.1">6.3.2.1</a>, <a href="#6.5.16">6.5.16</a>, <a href="#6.5.16.1">6.5.16.1</a>,
32844  log functions, <a href="#7.12.6.7">7.12.6.7</a>, <a href="#F.10.3.7">F.10.3.7</a>                               <a href="#6.5.16.2">6.5.16.2</a>
32845  log type-generic macro, <a href="#7.24">7.24</a>
32846  log10 functions, <a href="#7.12.6.8">7.12.6.8</a>, <a href="#F.10.3.8">F.10.3.8</a>                        macro argument substitution, <a href="#6.10.3.1">6.10.3.1</a>
32847  log10 type-generic macro, <a href="#7.24">7.24</a>                             macro definition
32848  log1p functions, <a href="#7.12.6.9">7.12.6.9</a>, <a href="#F.10.3.9">F.10.3.9</a>                          library function, <a href="#7.1.4">7.1.4</a>
32849  log1p type-generic macro, <a href="#7.24">7.24</a>                             macro invocation, <a href="#6.10.3">6.10.3</a>
32850  log2 functions, <a href="#7.12.6.10">7.12.6.10</a>, <a href="#F.10.3.10">F.10.3.10</a>                       macro name, <a href="#6.10.3">6.10.3</a>
32851  log2 type-generic macro, <a href="#7.24">7.24</a>                                length, <a href="#5.2.4.1">5.2.4.1</a>
32852  logarithmic functions                                        predefined, <a href="#6.10.8">6.10.8</a>, <a href="#6.11.9">6.11.9</a>
32853     complex, <a href="#7.3.7">7.3.7</a>, <a href="#G.6.3">G.6.3</a>                                     redefinition, <a href="#6.10.3">6.10.3</a>
32854     real, <a href="#7.12.6">7.12.6</a>, <a href="#F.10.3">F.10.3</a>                                      scope, <a href="#6.10.3.5">6.10.3.5</a>
32855  logb functions, <a href="#7.12.6.11">7.12.6.11</a>, <a href="#F.3">F.3</a>, <a href="#F.10.3.11">F.10.3.11</a>                  macro parameter, <a href="#6.10.3">6.10.3</a>
32856  logb type-generic macro, <a href="#7.24">7.24</a>                              macro preprocessor, <a href="#6.10">6.10</a>
32857  logical operators                                          macro replacement, <a href="#6.10.3">6.10.3</a>
32858     AND (&amp;&amp;), <a href="#5.1.2.4">5.1.2.4</a>, <a href="#6.5.13">6.5.13</a>                               magnitude, complex, <a href="#7.3.8.1">7.3.8.1</a>
32859     negation (!), <a href="#6.5.3.3">6.5.3.3</a>                                   main function, <a href="#5.1.2.2.1">5.1.2.2.1</a>, <a href="#5.1.2.2.3">5.1.2.2.3</a>, <a href="#6.7.3.1">6.7.3.1</a>, <a href="#6.7.4">6.7.4</a>,
32860     OR (||), <a href="#5.1.2.4">5.1.2.4</a>, <a href="#6.5.14">6.5.14</a>                                     <a href="#7.21.3">7.21.3</a>
32861  logical source lines, <a href="#5.1.1.2">5.1.1.2</a>                              malloc function, <a href="#7.22.3">7.22.3</a>, <a href="#7.22.3.4">7.22.3.4</a>, <a href="#7.22.3.5">7.22.3.5</a>
32862  long double _Complex type, <a href="#6.2.5">6.2.5</a>                           manipulation functions
32863  long double _Complex type conversion,                        complex, <a href="#7.3.9">7.3.9</a>
32864 <!--page 686 -->
32865    real, <a href="#7.12.11">7.12.11</a>, <a href="#F.10.8">F.10.8</a>                                    modf functions, <a href="#7.12.6.12">7.12.6.12</a>, <a href="#F.10.3.12">F.10.3.12</a>
32866  matching failure, <a href="#7.28.2.6">7.28.2.6</a>, <a href="#7.28.2.8">7.28.2.8</a>, <a href="#7.28.2.10">7.28.2.10</a>,           modifiable lvalue, <a href="#6.3.2.1">6.3.2.1</a>
32867       <a href="#K.3.9.1.7">K.3.9.1.7</a>, <a href="#K.3.9.1.10">K.3.9.1.10</a>, <a href="#K.3.9.1.12">K.3.9.1.12</a>                     modification order, <a href="#5.1.2.4">5.1.2.4</a>
32868  math.h header, <a href="#5.2.4.2.2">5.2.4.2.2</a>, <a href="#6.5">6.5</a>, <a href="#7.12">7.12</a>, <a href="#7.24">7.24</a>, <a href="#F">F</a>,              modulus functions, <a href="#7.12.6.12">7.12.6.12</a>
32869       <a href="#F.10">F.10</a>, <a href="#J.5.17">J.5.17</a>                                          modulus, complex, <a href="#7.3.8.1">7.3.8.1</a>
32870  MATH_ERREXCEPT macro, <a href="#7.12">7.12</a>, <a href="#F.10">F.10</a>                           mtx_destroy function, <a href="#7.25.4.1">7.25.4.1</a>
32871  math_errhandling macro, <a href="#7.1.3">7.1.3</a>, <a href="#7.12">7.12</a>, <a href="#F.10">F.10</a>                  mtx_init function, <a href="#7.25.1">7.25.1</a>, <a href="#7.25.4.2">7.25.4.2</a>
32872  MATH_ERRNO macro, <a href="#7.12">7.12</a>                                     mtx_lock function, <a href="#7.25.4.3">7.25.4.3</a>
32873  max_align_t type, <a href="#7.19">7.19</a>                                     mtx_t type, <a href="#7.25.1">7.25.1</a>
32874  maximum functions, <a href="#7.12.12">7.12.12</a>, <a href="#F.10.9">F.10.9</a>                         mtx_timedlock function, <a href="#7.25.4.4">7.25.4.4</a>
32875  MB_CUR_MAX macro, <a href="#7.1.1">7.1.1</a>, <a href="#7.22">7.22</a>, <a href="#7.22.7.2">7.22.7.2</a>,                   mtx_trylock function, <a href="#7.25.4.5">7.25.4.5</a>
32876       <a href="#7.22.7.3">7.22.7.3</a>, <a href="#7.27.1.2">7.27.1.2</a>, <a href="#7.27.1.4">7.27.1.4</a>, <a href="#7.28.6.3.3">7.28.6.3.3</a>,             mtx_unlock function, <a href="#7.25.4.3">7.25.4.3</a>, <a href="#7.25.4.4">7.25.4.4</a>,
32877       <a href="#K.3.6.4.1">K.3.6.4.1</a>, <a href="#K.3.9.3.1.1">K.3.9.3.1.1</a>                                     <a href="#7.25.4.5">7.25.4.5</a>, <a href="#7.25.4.6">7.25.4.6</a>
32878  MB_LEN_MAX macro, <a href="#5.2.4.2.1">5.2.4.2.1</a>, <a href="#7.1.1">7.1.1</a>, <a href="#7.22">7.22</a>                   multibyte character, <a href="#3.7.2">3.7.2</a>, <a href="#5.2.1.2">5.2.1.2</a>, <a href="#6.4.4.4">6.4.4.4</a>
32879  mblen function, <a href="#7.22.7.1">7.22.7.1</a>, <a href="#7.28.6.3">7.28.6.3</a>                         multibyte conversion functions
32880  mbrlen function, <a href="#7.28.6.3.1">7.28.6.3.1</a>                                  wide character, <a href="#7.22.7">7.22.7</a>, <a href="#K.3.6.4">K.3.6.4</a>
32881  mbrtoc16 function, <a href="#6.4.4.4">6.4.4.4</a>, <a href="#6.4.5">6.4.5</a>, <a href="#7.27.1.1">7.27.1.1</a>                     extended, <a href="#7.28.6">7.28.6</a>, <a href="#K.3.9.3">K.3.9.3</a>
32882  mbrtoc32 function, <a href="#6.4.4.4">6.4.4.4</a>, <a href="#6.4.5">6.4.5</a>, <a href="#7.27.1.3">7.27.1.3</a>                     restartable, <a href="#7.27.1">7.27.1</a>, <a href="#7.28.6.3">7.28.6.3</a>, <a href="#K.3.9.3.1">K.3.9.3.1</a>
32883  mbrtowc function, <a href="#7.21.3">7.21.3</a>, <a href="#7.21.6.1">7.21.6.1</a>, <a href="#7.21.6.2">7.21.6.2</a>,                wide string, <a href="#7.22.8">7.22.8</a>, <a href="#K.3.6.5">K.3.6.5</a>
32884       <a href="#7.28.2.1">7.28.2.1</a>, <a href="#7.28.2.2">7.28.2.2</a>, <a href="#7.28.6.3.1">7.28.6.3.1</a>, <a href="#7.28.6.3.2">7.28.6.3.2</a>,                restartable, <a href="#7.28.6.4">7.28.6.4</a>, <a href="#K.3.9.3.2">K.3.9.3.2</a>
32885       <a href="#7.28.6.4.1">7.28.6.4.1</a>, <a href="#K.3.6.5.1">K.3.6.5.1</a>, <a href="#K.3.9.3.2.1">K.3.9.3.2.1</a>                    multibyte string, <a href="#7.1.1">7.1.1</a>
32886  mbsinit function, <a href="#7.28.6.2.1">7.28.6.2.1</a>                               multibyte/wide character conversion functions,
32887  mbsrtowcs function, <a href="#7.28.6.4.1">7.28.6.4.1</a>, <a href="#K.3.9.3.2">K.3.9.3.2</a>                       <a href="#7.22.7">7.22.7</a>, <a href="#K.3.6.4">K.3.6.4</a>
32888  mbsrtowcs_s function, <a href="#K.3.9.3.2">K.3.9.3.2</a>, <a href="#K.3.9.3.2.1">K.3.9.3.2.1</a>                 extended, <a href="#7.28.6">7.28.6</a>, <a href="#K.3.9.3">K.3.9.3</a>
32889  mbstate_t type, <a href="#7.21.2">7.21.2</a>, <a href="#7.21.3">7.21.3</a>, <a href="#7.21.6.1">7.21.6.1</a>,                    restartable, <a href="#7.27.1">7.27.1</a>, <a href="#7.28.6.3">7.28.6.3</a>, <a href="#K.3.9.3.1">K.3.9.3.1</a>
32890       <a href="#7.21.6.2">7.21.6.2</a>, <a href="#7.27">7.27</a>, <a href="#7.27.1">7.27.1</a>, <a href="#7.28.1">7.28.1</a>, <a href="#7.28.2.1">7.28.2.1</a>,             multibyte/wide string conversion functions,
32891       <a href="#7.28.2.2">7.28.2.2</a>, <a href="#7.28.6">7.28.6</a>, <a href="#7.28.6.2.1">7.28.6.2.1</a>, <a href="#7.28.6.3">7.28.6.3</a>,                    <a href="#7.22.8">7.22.8</a>, <a href="#K.3.6.5">K.3.6.5</a>
32892       <a href="#7.28.6.3.1">7.28.6.3.1</a>, <a href="#7.28.6.4">7.28.6.4</a>                                    restartable, <a href="#7.28.6.4">7.28.6.4</a>, <a href="#K.3.9.3.2">K.3.9.3.2</a>
32893  mbstowcs function, <a href="#6.4.5">6.4.5</a>, <a href="#7.22.8.1">7.22.8.1</a>, <a href="#7.28.6.4">7.28.6.4</a>               multidimensional array, <a href="#6.5.2.1">6.5.2.1</a>
32894  mbstowcs_s function, <a href="#K.3.6.5.1">K.3.6.5.1</a>                             multiplication assignment operator (*=), <a href="#6.5.16.2">6.5.16.2</a>
32895  mbtowc function, <a href="#6.4.4.4">6.4.4.4</a>, <a href="#7.22.7.1">7.22.7.1</a>, <a href="#7.22.7.2">7.22.7.2</a>,              multiplication operator (*), <a href="#6.2.6.2">6.2.6.2</a>, <a href="#6.5.5">6.5.5</a>, <a href="#F.3">F.3</a>,
32896       <a href="#7.22.8.1">7.22.8.1</a>, <a href="#7.28.6.3">7.28.6.3</a>                                         <a href="#G.5.1">G.5.1</a>
32897  member access operators (. and -&gt;), <a href="#6.5.2.3">6.5.2.3</a>                multiplicative expressions, <a href="#6.5.5">6.5.5</a>, <a href="#G.5.1">G.5.1</a>
32898  member alignment, <a href="#6.7.2.1">6.7.2.1</a>
32899  memchr function, <a href="#7.23.5.1">7.23.5.1</a>                                  n-char sequence, <a href="#7.22.1.3">7.22.1.3</a>
32900  memcmp function, <a href="#7.23.4">7.23.4</a>, <a href="#7.23.4.1">7.23.4.1</a>                          n-wchar sequence, <a href="#7.28.4.1.1">7.28.4.1.1</a>
32901  memcpy function, <a href="#7.23.2.1">7.23.2.1</a>                                  name
32902  memcpy_s function, <a href="#K.3.7.1.1">K.3.7.1.1</a>                                 external, <a href="#5.2.4.1">5.2.4.1</a>, <a href="#6.4.2.1">6.4.2.1</a>, <a href="#6.11.3">6.11.3</a>
32903  memmove function, <a href="#7.23.2.2">7.23.2.2</a>                                   file, <a href="#7.21.3">7.21.3</a>
32904  memmove_s function, <a href="#K.3.7.1.2">K.3.7.1.2</a>                                internal, <a href="#5.2.4.1">5.2.4.1</a>, <a href="#6.4.2.1">6.4.2.1</a>
32905  memory location, <a href="#3.14">3.14</a>                                        label, <a href="#6.2.3">6.2.3</a>
32906  memory management functions, <a href="#7.22.3">7.22.3</a>                          structure/union member, <a href="#6.2.3">6.2.3</a>
32907  memory_order type, <a href="#7.17.1">7.17.1</a>, <a href="#7.17.3">7.17.3</a>                          name spaces, <a href="#6.2.3">6.2.3</a>
32908  memset function, <a href="#7.23.6.1">7.23.6.1</a>, <a href="#K.3.7.4.1">K.3.7.4.1</a>                       named label, <a href="#6.8.1">6.8.1</a>
32909  memset_s function, <a href="#K.3.7.4.1">K.3.7.4.1</a>                               NaN, <a href="#5.2.4.2.2">5.2.4.2.2</a>
32910  minimum functions, <a href="#7.12.12">7.12.12</a>, <a href="#F.10.9">F.10.9</a>                         nan functions, <a href="#7.12.11.2">7.12.11.2</a>, <a href="#F.2.1">F.2.1</a>, <a href="#F.10.8.2">F.10.8.2</a>
32911  minus operator, unary, <a href="#6.5.3.3">6.5.3.3</a>                             NAN macro, <a href="#7.12">7.12</a>, <a href="#F.2.1">F.2.1</a>
32912  miscellaneous functions                                    NDEBUG macro, <a href="#7.2">7.2</a>
32913    string, <a href="#7.23.6">7.23.6</a>, <a href="#K.3.7.4">K.3.7.4</a>                                  nearbyint functions, <a href="#7.12.9.3">7.12.9.3</a>, <a href="#7.12.9.4">7.12.9.4</a>, <a href="#F.3">F.3</a>,
32914    wide string, <a href="#7.28.4.6">7.28.4.6</a>, <a href="#K.3.9.2.4">K.3.9.2.4</a>                              <a href="#F.10.6.3">F.10.6.3</a>
32915  mktime function, <a href="#7.26.2.3">7.26.2.3</a>                                  nearbyint type-generic macro, <a href="#7.24">7.24</a>
32916 <!--page 687 -->
32917  nearest integer functions, <a href="#7.12.9">7.12.9</a>, <a href="#F.10.6">F.10.6</a>                       operating system, <a href="#5.1.2.1">5.1.2.1</a>, <a href="#7.22.4.8">7.22.4.8</a>
32918  negation operator (!), <a href="#6.5.3.3">6.5.3.3</a>                                  operations on files, <a href="#7.21.4">7.21.4</a>, <a href="#K.3.5.1">K.3.5.1</a>
32919  negative zero, <a href="#6.2.6.2">6.2.6.2</a>, <a href="#7.12.11.1">7.12.11.1</a>                               operator, <a href="#6.4.6">6.4.6</a>
32920  new-line character, <a href="#5.1.1.2">5.1.1.2</a>, <a href="#5.2.1">5.2.1</a>, <a href="#6.4">6.4</a>, <a href="#6.10">6.10</a>, <a href="#6.10.4">6.10.4</a>           operators, <a href="#6.5">6.5</a>
32921  new-line escape sequence (\n), <a href="#5.2.2">5.2.2</a>, <a href="#6.4.4.4">6.4.4.4</a>,                     additive, <a href="#6.2.6.2">6.2.6.2</a>, <a href="#6.5.6">6.5.6</a>
32922       <a href="#7.4.1.10">7.4.1.10</a>                                                      alignof, <a href="#6.5.3.4">6.5.3.4</a>
32923  nextafter functions, <a href="#7.12.11.3">7.12.11.3</a>, <a href="#7.12.11.4">7.12.11.4</a>, <a href="#F.3">F.3</a>,                    assignment, <a href="#6.5.16">6.5.16</a>
32924       <a href="#F.10.8.3">F.10.8.3</a>                                                      associativity, <a href="#6.5">6.5</a>
32925  nextafter type-generic macro, <a href="#7.24">7.24</a>                                 equality, <a href="#6.5.9">6.5.9</a>
32926  nexttoward functions, <a href="#7.12.11.4">7.12.11.4</a>, <a href="#F.3">F.3</a>, <a href="#F.10.8.4">F.10.8.4</a>                     multiplicative, <a href="#6.2.6.2">6.2.6.2</a>, <a href="#6.5.5">6.5.5</a>, <a href="#G.5.1">G.5.1</a>
32927  nexttoward type-generic macro, <a href="#7.24">7.24</a>                                postfix, <a href="#6.5.2">6.5.2</a>
32928  no linkage, <a href="#6.2.2">6.2.2</a>                                                  precedence, <a href="#6.5">6.5</a>
32929  no-return function, <a href="#6.7.4">6.7.4</a>                                          preprocessing, <a href="#6.10.1">6.10.1</a>, <a href="#6.10.3.2">6.10.3.2</a>, <a href="#6.10.3.3">6.10.3.3</a>, <a href="#6.10.9">6.10.9</a>
32930  non-stop floating-point control mode, <a href="#7.6.4.2">7.6.4.2</a>                       relational, <a href="#6.5.8">6.5.8</a>
32931  nongraphic characters, <a href="#5.2.2">5.2.2</a>, <a href="#6.4.4.4">6.4.4.4</a>                              shift, <a href="#6.5.7">6.5.7</a>
32932  nonlocal jumps header, <a href="#7.13">7.13</a>                                        sizeof, <a href="#6.5.3.4">6.5.3.4</a>
32933  norm, complex, <a href="#7.3.8.1">7.3.8.1</a>                                             unary, <a href="#6.5.3">6.5.3</a>
32934  normalized broken-down time, <a href="#K.3.8.1">K.3.8.1</a>, <a href="#K.3.8.2.1">K.3.8.2.1</a>                    unary arithmetic, <a href="#6.5.3.3">6.5.3.3</a>
32935  not macro, <a href="#7.9">7.9</a>                                                  optional features, see conditional features
32936  not-equal-to operator, see inequality operator                  or macro, <a href="#7.9">7.9</a>
32937  not_eq macro, <a href="#7.9">7.9</a>                                               OR operators
32938  null character (\0), <a href="#5.2.1">5.2.1</a>, <a href="#6.4.4.4">6.4.4.4</a>, <a href="#6.4.5">6.4.5</a>                         bitwise exclusive (^), <a href="#6.2.6.2">6.2.6.2</a>, <a href="#6.5.11">6.5.11</a>
32939    padding of binary stream, <a href="#7.21.2">7.21.2</a>                                 bitwise exclusive assignment (^=), <a href="#6.5.16.2">6.5.16.2</a>
32940  NULL macro, <a href="#7.11">7.11</a>, <a href="#7.19">7.19</a>, <a href="#7.21.1">7.21.1</a>, <a href="#7.22">7.22</a>, <a href="#7.23.1">7.23.1</a>,                      bitwise inclusive (|), <a href="#6.2.6.2">6.2.6.2</a>, <a href="#6.5.12">6.5.12</a>
32941       <a href="#7.26.1">7.26.1</a>, <a href="#7.28.1">7.28.1</a>                                                bitwise inclusive assignment (|=), <a href="#6.5.16.2">6.5.16.2</a>
32942  null pointer, <a href="#6.3.2.3">6.3.2.3</a>                                              logical (||), <a href="#5.1.2.4">5.1.2.4</a>, <a href="#6.5.14">6.5.14</a>
32943  null pointer constant, <a href="#6.3.2.3">6.3.2.3</a>                                  or_eq macro, <a href="#7.9">7.9</a>
32944  null preprocessing directive, <a href="#6.10.7">6.10.7</a>                            order of allocated storage, <a href="#7.22.3">7.22.3</a>
32945  null statement, <a href="#6.8.3">6.8.3</a>                                           order of evaluation, <a href="#6.5">6.5</a>, <a href="#6.5.16">6.5.16</a>, <a href="#6.10.3.2">6.10.3.2</a>, <a href="#6.10.3.3">6.10.3.3</a>,
32946  null wide character, <a href="#7.1.1">7.1.1</a>                                            see also sequence points
32947  number classification macros, <a href="#7.12">7.12</a>, <a href="#7.12.3.1">7.12.3.1</a>                     ordinary identifier name space, <a href="#6.2.3">6.2.3</a>
32948  numeric conversion functions, <a href="#7.8.2.3">7.8.2.3</a>, <a href="#7.22.1">7.22.1</a>                   orientation of stream, <a href="#7.21.2">7.21.2</a>, <a href="#7.28.3.5">7.28.3.5</a>
32949    wide string, <a href="#7.8.2.4">7.8.2.4</a>, <a href="#7.28.4.1">7.28.4.1</a>                                out-of-bounds store, <a href="#L.2.1">L.2.1</a>
32950  numerical limits, <a href="#5.2.4.2">5.2.4.2</a>                                       outer scope, <a href="#6.2.1">6.2.1</a>
32951                                                                  over-aligned, <a href="#6.2.8">6.2.8</a>
32952  object, <a href="#3.15">3.15</a>
32953  object representation, <a href="#6.2.6.1">6.2.6.1</a>                                  padding
32954  object type, <a href="#6.2.5">6.2.5</a>                                                binary stream, <a href="#7.21.2">7.21.2</a>
32955  object-like macro, <a href="#6.10.3">6.10.3</a>                                         bits, <a href="#6.2.6.2">6.2.6.2</a>, <a href="#7.20.1.1">7.20.1.1</a>
32956  observable behavior, <a href="#5.1.2.3">5.1.2.3</a>                                      structure/union, <a href="#6.2.6.1">6.2.6.1</a>, <a href="#6.7.2.1">6.7.2.1</a>
32957  obsolescence, <a href="#6.11">6.11</a>, <a href="#7.30">7.30</a>                                        parameter, <a href="#3.16">3.16</a>
32958  octal constant, <a href="#6.4.4.1">6.4.4.1</a>                                           array, <a href="#6.9.1">6.9.1</a>
32959  octal digit, <a href="#6.4.4.1">6.4.4.1</a>, <a href="#6.4.4.4">6.4.4.4</a>                                     ellipsis, <a href="#6.7.6.3">6.7.6.3</a>, <a href="#6.10.3">6.10.3</a>
32960  octal-character escape sequence (\octal digits),                  function, <a href="#6.5.2.2">6.5.2.2</a>, <a href="#6.7">6.7</a>, <a href="#6.9.1">6.9.1</a>
32961       <a href="#6.4.4.4">6.4.4.4</a>                                                      macro, <a href="#6.10.3">6.10.3</a>
32962  offsetof macro, <a href="#7.19">7.19</a>                                              main function, <a href="#5.1.2.2.1">5.1.2.2.1</a>
32963  on-off switch, <a href="#6.10.6">6.10.6</a>                                             program, <a href="#5.1.2.2.1">5.1.2.2.1</a>
32964  once_flag type, <a href="#7.25.1">7.25.1</a>                                          parameter type list, <a href="#6.7.6.3">6.7.6.3</a>
32965  ONCE_FLAG_INIT macro, <a href="#7.25.1">7.25.1</a>                                    parentheses punctuator (( )), <a href="#6.7.6.3">6.7.6.3</a>, <a href="#6.8.4">6.8.4</a>, <a href="#6.8.5">6.8.5</a>
32966  ones' complement, <a href="#6.2.6.2">6.2.6.2</a>                                       parenthesized expression, <a href="#6.5.1">6.5.1</a>
32967  operand, <a href="#6.4.6">6.4.6</a>, <a href="#6.5">6.5</a>                                             parse state, <a href="#7.21.2">7.21.2</a>
32968 <!--page 688 -->
32969  perform a trap, <a href="#3.19.5">3.19.5</a>                                        preprocessor, <a href="#6.10">6.10</a>
32970  permitted form of initializer, <a href="#6.6">6.6</a>                            PRIcFASTN macros, <a href="#7.8.1">7.8.1</a>
32971  perror function, <a href="#7.21.10.4">7.21.10.4</a>                                    PRIcLEASTN macros, <a href="#7.8.1">7.8.1</a>
32972  phase angle, complex, <a href="#7.3.9.1">7.3.9.1</a>                                 PRIcMAX macros, <a href="#7.8.1">7.8.1</a>
32973  physical source lines, <a href="#5.1.1.2">5.1.1.2</a>                                PRIcN macros, <a href="#7.8.1">7.8.1</a>
32974  placemarker, <a href="#6.10.3.3">6.10.3.3</a>                                         PRIcPTR macros, <a href="#7.8.1">7.8.1</a>
32975  plus operator, unary, <a href="#6.5.3.3">6.5.3.3</a>                                 primary expression, <a href="#6.5.1">6.5.1</a>
32976  pointer arithmetic, <a href="#6.5.6">6.5.6</a>                                     printf function, <a href="#7.21.1">7.21.1</a>, <a href="#7.21.6.3">7.21.6.3</a>, <a href="#7.21.6.10">7.21.6.10</a>,
32977  pointer comparison, <a href="#6.5.8">6.5.8</a>                                           <a href="#K.3.5.3.3">K.3.5.3.3</a>
32978  pointer declarator, <a href="#6.7.6.1">6.7.6.1</a>                                   printf_s function, <a href="#K.3.5.3.3">K.3.5.3.3</a>
32979  pointer operator (-&gt;), <a href="#6.5.2.3">6.5.2.3</a>                                printing character, <a href="#5.2.2">5.2.2</a>, <a href="#7.4">7.4</a>, <a href="#7.4.1.8">7.4.1.8</a>
32980  pointer to function, <a href="#6.5.2.2">6.5.2.2</a>                                  printing wide character, <a href="#7.29.2">7.29.2</a>
32981  pointer type, <a href="#6.2.5">6.2.5</a>                                           program diagnostics, <a href="#7.2.1">7.2.1</a>
32982  pointer type conversion, <a href="#6.3.2.1">6.3.2.1</a>, <a href="#6.3.2.3">6.3.2.3</a>                     program execution, <a href="#5.1.2.2.2">5.1.2.2.2</a>, <a href="#5.1.2.3">5.1.2.3</a>
32983  pointer, null, <a href="#6.3.2.3">6.3.2.3</a>                                        program file, <a href="#5.1.1.1">5.1.1.1</a>
32984  pole error, <a href="#7.12.1">7.12.1</a>, <a href="#7.12.5.3">7.12.5.3</a>, <a href="#7.12.6.7">7.12.6.7</a>, <a href="#7.12.6.8">7.12.6.8</a>,             program image, <a href="#5.1.1.2">5.1.1.2</a>
32985       <a href="#7.12.6.9">7.12.6.9</a>, <a href="#7.12.6.10">7.12.6.10</a>, <a href="#7.12.6.11">7.12.6.11</a>, <a href="#7.12.7.4">7.12.7.4</a>,                program name (argv[0]), <a href="#5.1.2.2.1">5.1.2.2.1</a>
32986       <a href="#7.12.8.3">7.12.8.3</a>, <a href="#7.12.8.4">7.12.8.4</a>                                       program parameters, <a href="#5.1.2.2.1">5.1.2.2.1</a>
32987  portability, <a href="#4">4</a>, <a href="#J">J</a>                                             program startup, <a href="#5.1.2">5.1.2</a>, <a href="#5.1.2.1">5.1.2.1</a>, <a href="#5.1.2.2.1">5.1.2.2.1</a>
32988  position indicator, file, see file position indicator           program structure, <a href="#5.1.1.1">5.1.1.1</a>
32989  positive difference, <a href="#7.12.12.1">7.12.12.1</a>                                program termination, <a href="#5.1.2">5.1.2</a>, <a href="#5.1.2.1">5.1.2.1</a>, <a href="#5.1.2.2.3">5.1.2.2.3</a>,
32990  positive difference functions, <a href="#7.12.12">7.12.12</a>, <a href="#F.10.9">F.10.9</a>                      <a href="#5.1.2.3">5.1.2.3</a>
32991  postfix decrement operator (--), <a href="#6.3.2.1">6.3.2.1</a>, <a href="#6.5.2.4">6.5.2.4</a>              program, conforming, <a href="#4">4</a>
32992  postfix expressions, <a href="#6.5.2">6.5.2</a>                                     program, strictly conforming, <a href="#4">4</a>
32993  postfix increment operator (++), <a href="#6.3.2.1">6.3.2.1</a>, <a href="#6.5.2.4">6.5.2.4</a>              promotions
32994  pow functions, <a href="#7.12.7.4">7.12.7.4</a>, <a href="#F.10.4.4">F.10.4.4</a>                                default argument, <a href="#6.5.2.2">6.5.2.2</a>
32995  pow type-generic macro, <a href="#7.24">7.24</a>                                     integer, <a href="#5.1.2.3">5.1.2.3</a>, <a href="#6.3.1.1">6.3.1.1</a>
32996  power functions                                               prototype, see function prototype
32997    complex, <a href="#7.3.8">7.3.8</a>, <a href="#G.6.4">G.6.4</a>                                       pseudo-random sequence functions, <a href="#7.22.2">7.22.2</a>
32998    real, <a href="#7.12.7">7.12.7</a>, <a href="#F.10.4">F.10.4</a>                                        PTRDIFF_MAX macro, <a href="#7.20.3">7.20.3</a>
32999  pp-number, <a href="#6.4.8">6.4.8</a>                                              PTRDIFF_MIN macro, <a href="#7.20.3">7.20.3</a>
33000  pragma operator, <a href="#6.10.9">6.10.9</a>                                       ptrdiff_t type, <a href="#7.17.1">7.17.1</a>, <a href="#7.19">7.19</a>, <a href="#7.20.3">7.20.3</a>, <a href="#7.21.6.1">7.21.6.1</a>,
33001  pragma preprocessing directive, <a href="#6.10.6">6.10.6</a>, <a href="#6.11.8">6.11.8</a>                      <a href="#7.21.6.2">7.21.6.2</a>, <a href="#7.28.2.1">7.28.2.1</a>, <a href="#7.28.2.2">7.28.2.2</a>
33002  precedence of operators, <a href="#6.5">6.5</a>                                  punctuators, <a href="#6.4.6">6.4.6</a>
33003  precedence of syntax rules, <a href="#5.1.1.2">5.1.1.2</a>                           putc function, <a href="#7.21.1">7.21.1</a>, <a href="#7.21.7.7">7.21.7.7</a>, <a href="#7.21.7.8">7.21.7.8</a>
33004  precision, <a href="#6.2.6.2">6.2.6.2</a>, <a href="#6.3.1.1">6.3.1.1</a>, <a href="#7.21.6.1">7.21.6.1</a>, <a href="#7.28.2.1">7.28.2.1</a>               putchar function, <a href="#7.21.1">7.21.1</a>, <a href="#7.21.7.8">7.21.7.8</a>
33005    excess, <a href="#5.2.4.2.2">5.2.4.2.2</a>, <a href="#6.3.1.8">6.3.1.8</a>, <a href="#6.8.6.4">6.8.6.4</a>                         puts function, <a href="#7.21.1">7.21.1</a>, <a href="#7.21.7.9">7.21.7.9</a>
33006  predefined macro names, <a href="#6.10.8">6.10.8</a>, <a href="#6.11.9">6.11.9</a>                         putwc function, <a href="#7.21.1">7.21.1</a>, <a href="#7.28.3.8">7.28.3.8</a>, <a href="#7.28.3.9">7.28.3.9</a>
33007  prefix decrement operator (--), <a href="#6.3.2.1">6.3.2.1</a>, <a href="#6.5.3.1">6.5.3.1</a>               putwchar function, <a href="#7.21.1">7.21.1</a>, <a href="#7.28.3.9">7.28.3.9</a>
33008  prefix increment operator (++), <a href="#6.3.2.1">6.3.2.1</a>, <a href="#6.5.3.1">6.5.3.1</a>
33009  preprocessing concatenation, <a href="#6.10.3.3">6.10.3.3</a>                         qsort function, <a href="#7.22.5">7.22.5</a>, <a href="#7.22.5.2">7.22.5.2</a>
33010  preprocessing directives, <a href="#5.1.1.2">5.1.1.2</a>, <a href="#6.10">6.10</a>                       qsort_s function, <a href="#K.3.6.3">K.3.6.3</a>, <a href="#K.3.6.3.2">K.3.6.3.2</a>
33011  preprocessing file, <a href="#5.1.1.1">5.1.1.1</a>, <a href="#6.10">6.10</a>                              qualified types, <a href="#6.2.5">6.2.5</a>
33012  preprocessing numbers, <a href="#6.4">6.4</a>, <a href="#6.4.8">6.4.8</a>                             qualified version of type, <a href="#6.2.5">6.2.5</a>
33013  preprocessing operators                                       question-mark escape sequence (\?), <a href="#6.4.4.4">6.4.4.4</a>
33014    #, <a href="#6.10.3.2">6.10.3.2</a>                                                 quick_exit function, <a href="#7.22.4.3">7.22.4.3</a>, <a href="#7.22.4.4">7.22.4.4</a>,
33015    ##, <a href="#6.10.3.3">6.10.3.3</a>                                                     <a href="#7.22.4.7">7.22.4.7</a>
33016    _Pragma, <a href="#5.1.1.2">5.1.1.2</a>, <a href="#6.10.9">6.10.9</a>                                    quiet NaN, <a href="#5.2.4.2.2">5.2.4.2.2</a>
33017    defined, <a href="#6.10.1">6.10.1</a>
33018  preprocessing tokens, <a href="#5.1.1.2">5.1.1.2</a>, <a href="#6.4">6.4</a>, <a href="#6.10">6.10</a>                      raise function, <a href="#7.14">7.14</a>, <a href="#7.14.1.1">7.14.1.1</a>, <a href="#7.14.2.1">7.14.2.1</a>, <a href="#7.22.4.1">7.22.4.1</a>
33019  preprocessing translation unit, <a href="#5.1.1.1">5.1.1.1</a>                       rand function, <a href="#7.22">7.22</a>, <a href="#7.22.2.1">7.22.2.1</a>, <a href="#7.22.2.2">7.22.2.2</a>
33020 <!--page 689 -->
33021  RAND_MAX macro, <a href="#7.22">7.22</a>, <a href="#7.22.2.1">7.22.2.1</a>                               restrict-qualified type, <a href="#6.2.5">6.2.5</a>, <a href="#6.7.3">6.7.3</a>
33022  range                                                        return statement, <a href="#6.8.6.4">6.8.6.4</a>, <a href="#F.6">F.6</a>
33023     excess, <a href="#5.2.4.2.2">5.2.4.2.2</a>, <a href="#6.3.1.8">6.3.1.8</a>, <a href="#6.8.6.4">6.8.6.4</a>                       rewind function, <a href="#7.21.5.3">7.21.5.3</a>, <a href="#7.21.7.10">7.21.7.10</a>, <a href="#7.21.9.5">7.21.9.5</a>,
33024  range error, <a href="#7.12.1">7.12.1</a>, <a href="#7.12.5.4">7.12.5.4</a>, <a href="#7.12.5.5">7.12.5.5</a>, <a href="#7.12.6.1">7.12.6.1</a>,                 <a href="#7.28.3.10">7.28.3.10</a>
33025        <a href="#7.12.6.2">7.12.6.2</a>, <a href="#7.12.6.3">7.12.6.3</a>, <a href="#7.12.6.5">7.12.6.5</a>, <a href="#7.12.6.6">7.12.6.6</a>,                right-shift assignment operator (&gt;&gt;=), <a href="#6.5.16.2">6.5.16.2</a>
33026        <a href="#7.12.6.13">7.12.6.13</a>, <a href="#7.12.7.3">7.12.7.3</a>, <a href="#7.12.7.4">7.12.7.4</a>, <a href="#7.12.8.2">7.12.8.2</a>,               right-shift operator (&gt;&gt;), <a href="#6.2.6.2">6.2.6.2</a>, <a href="#6.5.7">6.5.7</a>
33027        <a href="#7.12.8.3">7.12.8.3</a>, <a href="#7.12.8.4">7.12.8.4</a>, <a href="#7.12.9.5">7.12.9.5</a>, <a href="#7.12.9.7">7.12.9.7</a>,                rint functions, <a href="#7.12.9.4">7.12.9.4</a>, <a href="#F.3">F.3</a>, <a href="#F.10.6.4">F.10.6.4</a>
33028        <a href="#7.12.11.3">7.12.11.3</a>, <a href="#7.12.12.1">7.12.12.1</a>, <a href="#7.12.13.1">7.12.13.1</a>                        rint type-generic macro, <a href="#7.24">7.24</a>
33029  rank, see integer conversion rank                            round functions, <a href="#7.12.9.6">7.12.9.6</a>, <a href="#F.10.6.6">F.10.6.6</a>
33030  read-modify-write operations, <a href="#5.1.2.4">5.1.2.4</a>                        round type-generic macro, <a href="#7.24">7.24</a>
33031  real floating type conversion, <a href="#6.3.1.4">6.3.1.4</a>, <a href="#6.3.1.5">6.3.1.5</a>,              rounding mode, floating point, <a href="#5.2.4.2.2">5.2.4.2.2</a>
33032        <a href="#6.3.1.7">6.3.1.7</a>, <a href="#F.3">F.3</a>, <a href="#F.4">F.4</a>                                      RSIZE_MAX macro, <a href="#K.3.3">K.3.3</a>, <a href="#K.3.4">K.3.4</a>, <a href="#K.3.5.1.2">K.3.5.1.2</a>,
33033  real floating types, <a href="#6.2.5">6.2.5</a>                                          <a href="#K.3.5.3.5">K.3.5.3.5</a>, <a href="#K.3.5.3.6">K.3.5.3.6</a>, <a href="#K.3.5.3.12">K.3.5.3.12</a>, <a href="#K.3.5.3.13">K.3.5.3.13</a>,
33034  real type domain, <a href="#6.2.5">6.2.5</a>                                            <a href="#K.3.5.4.1">K.3.5.4.1</a>, <a href="#K.3.6.2.1">K.3.6.2.1</a>, <a href="#K.3.6.3.1">K.3.6.3.1</a>, <a href="#K.3.6.3.2">K.3.6.3.2</a>,
33035  real types, <a href="#6.2.5">6.2.5</a>                                                  <a href="#K.3.6.4.1">K.3.6.4.1</a>, <a href="#K.3.6.5.1">K.3.6.5.1</a>, <a href="#K.3.6.5.2">K.3.6.5.2</a>, <a href="#K.3.7.1.1">K.3.7.1.1</a>,
33036  real-floating, <a href="#7.12.3">7.12.3</a>                                               <a href="#K.3.7.1.2">K.3.7.1.2</a>, <a href="#K.3.7.1.3">K.3.7.1.3</a>, <a href="#K.3.7.1.4">K.3.7.1.4</a>, <a href="#K.3.7.2.1">K.3.7.2.1</a>,
33037  realloc function, <a href="#7.22.3">7.22.3</a>, <a href="#7.22.3.5">7.22.3.5</a>                                 <a href="#K.3.7.2.2">K.3.7.2.2</a>, <a href="#K.3.7.3.1">K.3.7.3.1</a>, <a href="#K.3.7.4.1">K.3.7.4.1</a>, <a href="#K.3.7.4.2">K.3.7.4.2</a>,
33038  recommended practice, <a href="#3.17">3.17</a>                                         <a href="#K.3.8.2.1">K.3.8.2.1</a>, <a href="#K.3.8.2.2">K.3.8.2.2</a>, <a href="#K.3.9.1.3">K.3.9.1.3</a>, <a href="#K.3.9.1.4">K.3.9.1.4</a>,
33039  recursion, <a href="#6.5.2.2">6.5.2.2</a>                                                 <a href="#K.3.9.1.8">K.3.9.1.8</a>, <a href="#K.3.9.1.9">K.3.9.1.9</a>, <a href="#K.3.9.2.1.1">K.3.9.2.1.1</a>, <a href="#K.3.9.2.1.2">K.3.9.2.1.2</a>,
33040  recursive function call, <a href="#6.5.2.2">6.5.2.2</a>                                   <a href="#K.3.9.2.1.3">K.3.9.2.1.3</a>, <a href="#K.3.9.2.1.4">K.3.9.2.1.4</a>, <a href="#K.3.9.2.2.1">K.3.9.2.2.1</a>,
33041  redefinition of macro, <a href="#6.10.3">6.10.3</a>                                       <a href="#K.3.9.2.2.2">K.3.9.2.2.2</a>, <a href="#K.3.9.2.3.1">K.3.9.2.3.1</a>, <a href="#K.3.9.3.1.1">K.3.9.3.1.1</a>,
33042  reentrancy, <a href="#5.1.2.3">5.1.2.3</a>, <a href="#5.2.3">5.2.3</a>                                         <a href="#K.3.9.3.2.1">K.3.9.3.2.1</a>, <a href="#K.3.9.3.2.2">K.3.9.3.2.2</a>
33043     library functions, <a href="#7.1.4">7.1.4</a>                                  rsize_t type, <a href="#K.3.3">K.3.3</a>, <a href="#K.3.4">K.3.4</a>, <a href="#K.3.5">K.3.5</a>, <a href="#K.3.5.3.2">K.3.5.3.2</a>,
33044  referenced type, <a href="#6.2.5">6.2.5</a>                                             <a href="#K.3.6">K.3.6</a>, <a href="#K.3.7">K.3.7</a>, <a href="#K.3.8">K.3.8</a>, <a href="#K.3.9">K.3.9</a>, <a href="#K.3.9.1.2">K.3.9.1.2</a>
33045  register storage-class specifier, <a href="#6.7.1">6.7.1</a>, <a href="#6.9">6.9</a>                  runtime-constraint, <a href="#3.18">3.18</a>
33046  relational expressions, <a href="#6.5.8">6.5.8</a>                                Runtime-constraint handling functions, <a href="#K.3.6.1">K.3.6.1</a>
33047  relaxed atomic operations, <a href="#5.1.2.4">5.1.2.4</a>                           rvalue, <a href="#6.3.2.1">6.3.2.1</a>
33048  release fence, <a href="#7.17.4">7.17.4</a>
33049  release operation, <a href="#5.1.2.4">5.1.2.4</a>                                   same scope, <a href="#6.2.1">6.2.1</a>
33050  release sequence, <a href="#5.1.2.4">5.1.2.4</a>                                    save calling environment function, <a href="#7.13.1">7.13.1</a>
33051  reliability of data, interrupted, <a href="#5.1.2.3">5.1.2.3</a>                    scalar types, <a href="#6.2.5">6.2.5</a>
33052  remainder assignment operator (%=), <a href="#6.5.16.2">6.5.16.2</a>                 scalbln function, <a href="#7.12.6.13">7.12.6.13</a>, <a href="#F.3">F.3</a>, <a href="#F.10.3.13">F.10.3.13</a>
33053  remainder functions, <a href="#7.12.10">7.12.10</a>, <a href="#F.10.7">F.10.7</a>                         scalbln type-generic macro, <a href="#7.24">7.24</a>
33054  remainder functions, <a href="#7.12.10.2">7.12.10.2</a>, <a href="#7.12.10.3">7.12.10.3</a>, <a href="#F.3">F.3</a>,              scalbn function, <a href="#7.12.6.13">7.12.6.13</a>, <a href="#F.3">F.3</a>, <a href="#F.10.3.13">F.10.3.13</a>
33055        <a href="#F.10.7.2">F.10.7.2</a>                                               scalbn type-generic macro, <a href="#7.24">7.24</a>
33056  remainder operator (%), <a href="#6.2.6.2">6.2.6.2</a>, <a href="#6.5.5">6.5.5</a>                       scanf function, <a href="#7.21.1">7.21.1</a>, <a href="#7.21.6.4">7.21.6.4</a>, <a href="#7.21.6.11">7.21.6.11</a>
33057  remainder type-generic macro, <a href="#7.24">7.24</a>                           scanf_s function, <a href="#K.3.5.3.4">K.3.5.3.4</a>, <a href="#K.3.5.3.11">K.3.5.3.11</a>
33058  remove function, <a href="#7.21.4.1">7.21.4.1</a>, <a href="#7.21.4.4">7.21.4.4</a>, <a href="#K.3.5.1.2">K.3.5.1.2</a>               scanlist, <a href="#7.21.6.2">7.21.6.2</a>, <a href="#7.28.2.2">7.28.2.2</a>
33059  remquo functions, <a href="#7.12.10.3">7.12.10.3</a>, <a href="#F.3">F.3</a>, <a href="#F.10.7.3">F.10.7.3</a>                   scanset, <a href="#7.21.6.2">7.21.6.2</a>, <a href="#7.28.2.2">7.28.2.2</a>
33060  remquo type-generic macro, <a href="#7.24">7.24</a>                              SCHAR_MAX macro, <a href="#5.2.4.2.1">5.2.4.2.1</a>
33061  rename function, <a href="#7.21.4.2">7.21.4.2</a>                                    SCHAR_MIN macro, <a href="#5.2.4.2.1">5.2.4.2.1</a>
33062  representations of types, <a href="#6.2.6">6.2.6</a>                              SCNcFASTN macros, <a href="#7.8.1">7.8.1</a>
33063     pointer, <a href="#6.2.5">6.2.5</a>                                            SCNcLEASTN macros, <a href="#7.8.1">7.8.1</a>
33064  rescanning and replacement, <a href="#6.10.3.4">6.10.3.4</a>                         SCNcMAX macros, <a href="#7.8.1">7.8.1</a>
33065  reserved identifiers, <a href="#6.4.1">6.4.1</a>, <a href="#7.1.3">7.1.3</a>, <a href="#K.3.1.2">K.3.1.2</a>                   SCNcN macros, <a href="#7.8.1">7.8.1</a>
33066  restartable multibyte/wide character conversion              SCNcPTR macros, <a href="#7.8.1">7.8.1</a>
33067        functions, <a href="#7.27.1">7.27.1</a>, <a href="#7.28.6.3">7.28.6.3</a>, <a href="#K.3.9.3.1">K.3.9.3.1</a>                 scope of identifier, <a href="#6.2.1">6.2.1</a>, <a href="#6.9.2">6.9.2</a>
33068  restartable multibyte/wide string conversion                 search functions
33069        functions, <a href="#7.28.6.4">7.28.6.4</a>, <a href="#K.3.9.3.2">K.3.9.3.2</a>                           string, <a href="#7.23.5">7.23.5</a>, <a href="#K.3.7.3">K.3.7.3</a>
33070  restore calling environment function, <a href="#7.13.2">7.13.2</a>                   utility, <a href="#7.22.5">7.22.5</a>, <a href="#K.3.6.3">K.3.6.3</a>
33071  restrict type qualifier, <a href="#6.7.3">6.7.3</a>, <a href="#6.7.3.1">6.7.3.1</a>                         wide string, <a href="#7.28.4.5">7.28.4.5</a>, <a href="#K.3.9.2.3">K.3.9.2.3</a>
33072 <!--page 690 -->
33073  SEEK_CUR macro, <a href="#7.21.1">7.21.1</a>, <a href="#7.21.9.2">7.21.9.2</a>                                 sign and magnitude, <a href="#6.2.6.2">6.2.6.2</a>
33074  SEEK_END macro, <a href="#7.21.1">7.21.1</a>, <a href="#7.21.9.2">7.21.9.2</a>                                 sign bit, <a href="#6.2.6.2">6.2.6.2</a>
33075  SEEK_SET macro, <a href="#7.21.1">7.21.1</a>, <a href="#7.21.9.2">7.21.9.2</a>                                 signal function, <a href="#7.14.1.1">7.14.1.1</a>, <a href="#7.22.4.5">7.22.4.5</a>, <a href="#7.22.4.7">7.22.4.7</a>
33076  selection statements, <a href="#6.8.4">6.8.4</a>                                      signal handler, <a href="#5.1.2.3">5.1.2.3</a>, <a href="#5.2.3">5.2.3</a>, <a href="#7.14.1.1">7.14.1.1</a>, <a href="#7.14.2.1">7.14.2.1</a>
33077  self-referential structure, <a href="#6.7.2.3">6.7.2.3</a>                              signal handling functions, <a href="#7.14.1">7.14.1</a>
33078  semicolon punctuator (;), <a href="#6.7">6.7</a>, <a href="#6.7.2.1">6.7.2.1</a>, <a href="#6.8.3">6.8.3</a>,                   signal.h header, <a href="#7.14">7.14</a>, <a href="#7.30.6">7.30.6</a>
33079        <a href="#6.8.5">6.8.5</a>, <a href="#6.8.6">6.8.6</a>                                               signaling NaN, <a href="#5.2.4.2.2">5.2.4.2.2</a>, <a href="#F.2.1">F.2.1</a>
33080  separate compilation, <a href="#5.1.1.1">5.1.1.1</a>                                    signals, <a href="#5.1.2.3">5.1.2.3</a>, <a href="#5.2.3">5.2.3</a>, <a href="#7.14.1">7.14.1</a>
33081  separate translation, <a href="#5.1.1.1">5.1.1.1</a>                                    signbit macro, <a href="#7.12.3.6">7.12.3.6</a>, <a href="#F.3">F.3</a>
33082  sequence points, <a href="#5.1.2.3">5.1.2.3</a>, <a href="#6.5.2.2">6.5.2.2</a>, <a href="#6.5.13">6.5.13</a>, <a href="#6.5.14">6.5.14</a>,               signed char type, <a href="#6.2.5">6.2.5</a>, <a href="#7.21.6.1">7.21.6.1</a>, <a href="#7.21.6.2">7.21.6.2</a>,
33083        <a href="#6.5.15">6.5.15</a>, <a href="#6.5.17">6.5.17</a>, <a href="#6.7.3">6.7.3</a>, <a href="#6.7.3.1">6.7.3.1</a>, <a href="#6.7.6">6.7.6</a>, <a href="#6.8">6.8</a>,                     <a href="#7.28.2.1">7.28.2.1</a>, <a href="#7.28.2.2">7.28.2.2</a>, <a href="#K.3.5.3.2">K.3.5.3.2</a>, <a href="#K.3.9.1.2">K.3.9.1.2</a>
33084        <a href="#7.1.4">7.1.4</a>, <a href="#7.21.6">7.21.6</a>, <a href="#7.22.5">7.22.5</a>, <a href="#7.28.2">7.28.2</a>, <a href="#C">C</a>, <a href="#K.3.6.3">K.3.6.3</a>                  signed character, <a href="#6.3.1.1">6.3.1.1</a>
33085  sequenced after, see sequenced before                            signed integer types, <a href="#6.2.5">6.2.5</a>, <a href="#6.3.1.3">6.3.1.3</a>, <a href="#6.4.4.1">6.4.4.1</a>
33086  sequenced before, <a href="#5.1.2.3">5.1.2.3</a>, <a href="#6.5">6.5</a>, <a href="#6.5.2.2">6.5.2.2</a>, <a href="#6.5.2.4">6.5.2.4</a>,                signed type conversion, <a href="#6.3.1.1">6.3.1.1</a>, <a href="#6.3.1.3">6.3.1.3</a>, <a href="#6.3.1.4">6.3.1.4</a>,
33087        <a href="#6.5.16">6.5.16</a>, see also indeterminately sequenced,                     <a href="#6.3.1.8">6.3.1.8</a>
33088        unsequenced                                                signed types, <a href="#6.2.5">6.2.5</a>, <a href="#6.7.2">6.7.2</a>
33089  sequencing of statements, <a href="#6.8">6.8</a>                                    significand part, <a href="#6.4.4.2">6.4.4.2</a>
33090  set_constraint_handler_s function,                               SIGSEGV macro, <a href="#7.14">7.14</a>, <a href="#7.14.1.1">7.14.1.1</a>
33091        <a href="#K.3.1.4">K.3.1.4</a>, <a href="#K.3.6.1.1">K.3.6.1.1</a>, <a href="#K.3.6.1.2">K.3.6.1.2</a>, <a href="#K.3.6.1.3">K.3.6.1.3</a>                   SIGTERM macro, <a href="#7.14">7.14</a>
33092  setbuf function, <a href="#7.21.3">7.21.3</a>, <a href="#7.21.5.1">7.21.5.1</a>, <a href="#7.21.5.5">7.21.5.5</a>                      simple assignment operator (=), <a href="#6.5.16.1">6.5.16.1</a>
33093  setjmp macro, <a href="#7.1.3">7.1.3</a>, <a href="#7.13.1.1">7.13.1.1</a>, <a href="#7.13.2.1">7.13.2.1</a>                          sin functions, <a href="#7.12.4.6">7.12.4.6</a>, <a href="#F.10.1.6">F.10.1.6</a>
33094  setjmp.h header, <a href="#7.13">7.13</a>                                            sin type-generic macro, <a href="#7.24">7.24</a>, <a href="#G.7">G.7</a>
33095  setlocale function, <a href="#7.11.1.1">7.11.1.1</a>, <a href="#7.11.2.1">7.11.2.1</a>                           single-byte character, <a href="#3.7.1">3.7.1</a>, <a href="#5.2.1.2">5.2.1.2</a>
33096  setvbuf function, <a href="#7.21.1">7.21.1</a>, <a href="#7.21.3">7.21.3</a>, <a href="#7.21.5.1">7.21.5.1</a>,                      single-byte/wide character conversion functions,
33097        <a href="#7.21.5.5">7.21.5.5</a>, <a href="#7.21.5.6">7.21.5.6</a>                                              <a href="#7.28.6.1">7.28.6.1</a>
33098  shall, <a href="#4">4</a>                                                         single-precision arithmetic, <a href="#5.1.2.3">5.1.2.3</a>
33099  shift expressions, <a href="#6.5.7">6.5.7</a>                                         single-quote escape sequence (\'), <a href="#6.4.4.4">6.4.4.4</a>, <a href="#6.4.5">6.4.5</a>
33100  shift sequence, <a href="#7.1.1">7.1.1</a>                                            singularity, <a href="#7.12.1">7.12.1</a>
33101  shift states, <a href="#5.2.1.2">5.2.1.2</a>                                            sinh functions, <a href="#7.12.5.5">7.12.5.5</a>, <a href="#F.10.2.5">F.10.2.5</a>
33102  short identifier, character, <a href="#5.2.4.1">5.2.4.1</a>, <a href="#6.4.3">6.4.3</a>                       sinh type-generic macro, <a href="#7.24">7.24</a>, <a href="#G.7">G.7</a>
33103  short int type, <a href="#6.2.5">6.2.5</a>, <a href="#6.3.1.1">6.3.1.1</a>, <a href="#6.7.2">6.7.2</a>, <a href="#7.21.6.1">7.21.6.1</a>,                 SIZE_MAX macro, <a href="#7.20.3">7.20.3</a>
33104        <a href="#7.21.6.2">7.21.6.2</a>, <a href="#7.28.2.1">7.28.2.1</a>, <a href="#7.28.2.2">7.28.2.2</a>                               size_t type, <a href="#6.2.8">6.2.8</a>, <a href="#6.5.3.4">6.5.3.4</a>, <a href="#7.19">7.19</a>, <a href="#7.20.3">7.20.3</a>, <a href="#7.21.1">7.21.1</a>,
33105  short int type conversion, <a href="#6.3.1.1">6.3.1.1</a>, <a href="#6.3.1.3">6.3.1.3</a>,                          <a href="#7.21.6.1">7.21.6.1</a>, <a href="#7.21.6.2">7.21.6.2</a>, <a href="#7.22">7.22</a>, <a href="#7.23.1">7.23.1</a>, <a href="#7.26.1">7.26.1</a>, <a href="#7.27">7.27</a>,
33106        <a href="#6.3.1.4">6.3.1.4</a>, <a href="#6.3.1.8">6.3.1.8</a>                                                <a href="#7.28.1">7.28.1</a>, <a href="#7.28.2.1">7.28.2.1</a>, <a href="#7.28.2.2">7.28.2.2</a>, <a href="#K.3.3">K.3.3</a>, <a href="#K.3.4">K.3.4</a>,
33107  SHRT_MAX macro, <a href="#5.2.4.2.1">5.2.4.2.1</a>                                             <a href="#K.3.5">K.3.5</a>, <a href="#K.3.6">K.3.6</a>, <a href="#K.3.7">K.3.7</a>, <a href="#K.3.8">K.3.8</a>, <a href="#K.3.9">K.3.9</a>, <a href="#K.3.9.1.2">K.3.9.1.2</a>
33108  SHRT_MIN macro, <a href="#5.2.4.2.1">5.2.4.2.1</a>                                        sizeof operator, <a href="#6.3.2.1">6.3.2.1</a>, <a href="#6.5.3">6.5.3</a>, <a href="#6.5.3.4">6.5.3.4</a>
33109  side effects, <a href="#5.1.2.3">5.1.2.3</a>, <a href="#6.2.6.1">6.2.6.1</a>, <a href="#6.3.2.2">6.3.2.2</a>, <a href="#6.5">6.5</a>, <a href="#6.5.2.4">6.5.2.4</a>,           snprintf function, <a href="#7.21.6.5">7.21.6.5</a>, <a href="#7.21.6.12">7.21.6.12</a>,
33110        <a href="#6.5.16">6.5.16</a>, <a href="#6.7.9">6.7.9</a>, <a href="#6.8.3">6.8.3</a>, <a href="#7.6">7.6</a>, <a href="#7.6.1">7.6.1</a>, <a href="#7.21.7.5">7.21.7.5</a>,                     <a href="#K.3.5.3.5">K.3.5.3.5</a>
33111        <a href="#7.21.7.7">7.21.7.7</a>, <a href="#7.28.3.6">7.28.3.6</a>, <a href="#7.28.3.8">7.28.3.8</a>, <a href="#F.8.1">F.8.1</a>, <a href="#F.9.1">F.9.1</a>,                snprintf_s function, <a href="#K.3.5.3.5">K.3.5.3.5</a>, <a href="#K.3.5.3.6">K.3.5.3.6</a>
33112        <a href="#F.9.3">F.9.3</a>                                                      snwprintf_s function, <a href="#K.3.9.1.3">K.3.9.1.3</a>, <a href="#K.3.9.1.4">K.3.9.1.4</a>
33113  SIG_ATOMIC_MAX macro, <a href="#7.20.3">7.20.3</a>                                     sorting utility functions, <a href="#7.22.5">7.22.5</a>, <a href="#K.3.6.3">K.3.6.3</a>
33114  SIG_ATOMIC_MIN macro, <a href="#7.20.3">7.20.3</a>                                     source character set, <a href="#5.1.1.2">5.1.1.2</a>, <a href="#5.2.1">5.2.1</a>
33115  sig_atomic_t type, <a href="#5.1.2.3">5.1.2.3</a>, <a href="#7.14">7.14</a>, <a href="#7.14.1.1">7.14.1.1</a>,                      source file, <a href="#5.1.1.1">5.1.1.1</a>
33116        <a href="#7.20.3">7.20.3</a>                                                        name, <a href="#6.10.4">6.10.4</a>, <a href="#6.10.8.1">6.10.8.1</a>
33117  SIG_DFL macro, <a href="#7.14">7.14</a>, <a href="#7.14.1.1">7.14.1.1</a>                                    source file inclusion, <a href="#6.10.2">6.10.2</a>
33118  SIG_ERR macro, <a href="#7.14">7.14</a>, <a href="#7.14.1.1">7.14.1.1</a>                                    source lines, <a href="#5.1.1.2">5.1.1.2</a>
33119  SIG_IGN macro, <a href="#7.14">7.14</a>, <a href="#7.14.1.1">7.14.1.1</a>                                    source text, <a href="#5.1.1.2">5.1.1.2</a>
33120  SIGABRT macro, <a href="#7.14">7.14</a>, <a href="#7.22.4.1">7.22.4.1</a>                                    space character (' '), <a href="#5.1.1.2">5.1.1.2</a>, <a href="#5.2.1">5.2.1</a>, <a href="#6.4">6.4</a>, <a href="#7.4.1.3">7.4.1.3</a>,
33121  SIGFPE macro, <a href="#7.12.1">7.12.1</a>, <a href="#7.14">7.14</a>, <a href="#7.14.1.1">7.14.1.1</a>, <a href="#J.5.17">J.5.17</a>                          <a href="#7.4.1.10">7.4.1.10</a>, <a href="#7.29.2.1.3">7.29.2.1.3</a>
33122  SIGILL macro, <a href="#7.14">7.14</a>, <a href="#7.14.1.1">7.14.1.1</a>                                     sprintf function, <a href="#7.21.6.6">7.21.6.6</a>, <a href="#7.21.6.13">7.21.6.13</a>, <a href="#K.3.5.3.6">K.3.5.3.6</a>
33123  SIGINT macro, <a href="#7.14">7.14</a>                                               sprintf_s function, <a href="#K.3.5.3.5">K.3.5.3.5</a>, <a href="#K.3.5.3.6">K.3.5.3.6</a>
33124 <!--page 691 -->
33125  sqrt functions, <a href="#7.12.7.5">7.12.7.5</a>, <a href="#F.3">F.3</a>, <a href="#F.10.4.5">F.10.4.5</a>                         do, <a href="#6.8.5.2">6.8.5.2</a>
33126  sqrt type-generic macro, <a href="#7.24">7.24</a>                                   else, <a href="#6.8.4.1">6.8.4.1</a>
33127  srand function, <a href="#7.22.2.2">7.22.2.2</a>                                        expression, <a href="#6.8.3">6.8.3</a>
33128  sscanf function, <a href="#7.21.6.7">7.21.6.7</a>, <a href="#7.21.6.14">7.21.6.14</a>                            for, <a href="#6.8.5.3">6.8.5.3</a>
33129  sscanf_s function, <a href="#K.3.5.3.7">K.3.5.3.7</a>, <a href="#K.3.5.3.14">K.3.5.3.14</a>                        goto, <a href="#6.8.6.1">6.8.6.1</a>
33130  standard error stream, <a href="#7.21.1">7.21.1</a>, <a href="#7.21.3">7.21.3</a>, <a href="#7.21.10.4">7.21.10.4</a>                if, <a href="#6.8.4.1">6.8.4.1</a>
33131  standard headers, <a href="#4">4</a>, <a href="#7.1.2">7.1.2</a>                                      iteration, <a href="#6.8.5">6.8.5</a>
33132     <a href="#7.2">&lt;assert.h&gt;</a>, <a href="#7.2">7.2</a>                                              jump, <a href="#6.8.6">6.8.6</a>
33133     <a href="#7.3">&lt;complex.h&gt;</a>, <a href="#5.2.4.2.2">5.2.4.2.2</a>, <a href="#6.10.8.3">6.10.8.3</a>, <a href="#7.1.2">7.1.2</a>, <a href="#7.3">7.3</a>,                labeled, <a href="#6.8.1">6.8.1</a>
33134          <a href="#7.24">7.24</a>, <a href="#7.30.1">7.30.1</a>, <a href="#G.6">G.6</a>, <a href="#J.5.17">J.5.17</a>                               null, <a href="#6.8.3">6.8.3</a>
33135     <a href="#7.4">&lt;ctype.h&gt;</a>, <a href="#7.4">7.4</a>, <a href="#7.30.2">7.30.2</a>                                       return, <a href="#6.8.6.4">6.8.6.4</a>, <a href="#F.6">F.6</a>
33136     <a href="#7.5">&lt;errno.h&gt;</a>, <a href="#7.5">7.5</a>, <a href="#7.30.3">7.30.3</a>, <a href="#K.3.2">K.3.2</a>                                selection, <a href="#6.8.4">6.8.4</a>
33137     <a href="#7.6">&lt;fenv.h&gt;</a>, <a href="#5.1.2.3">5.1.2.3</a>, <a href="#5.2.4.2.2">5.2.4.2.2</a>, <a href="#7.6">7.6</a>, <a href="#7.12">7.12</a>, <a href="#F">F</a>, <a href="#H">H</a>                sequencing, <a href="#6.8">6.8</a>
33138     <a href="#7.7">&lt;float.h&gt;</a>, <a href="#4">4</a>, <a href="#5.2.4.2.2">5.2.4.2.2</a>, <a href="#7.7">7.7</a>, <a href="#7.22.1.3">7.22.1.3</a>,                      switch, <a href="#6.8.4.2">6.8.4.2</a>
33139          <a href="#7.28.4.1.1">7.28.4.1.1</a>                                              while, <a href="#6.8.5.1">6.8.5.1</a>
33140     <a href="#7.8">&lt;inttypes.h&gt;</a>, <a href="#7.8">7.8</a>, <a href="#7.30.4">7.30.4</a>                                 static assertions, <a href="#6.7.10">6.7.10</a>
33141     <a href="#7.9">&lt;iso646.h&gt;</a>, <a href="#4">4</a>, <a href="#7.9">7.9</a>                                        static storage duration, <a href="#6.2.4">6.2.4</a>
33142     <a href="#7.10">&lt;limits.h&gt;</a>, <a href="#4">4</a>, <a href="#5.2.4.2.1">5.2.4.2.1</a>, <a href="#6.2.5">6.2.5</a>, <a href="#7.10">7.10</a>                     static storage-class specifier, <a href="#6.2.2">6.2.2</a>, <a href="#6.2.4">6.2.4</a>, <a href="#6.7.1">6.7.1</a>
33143     <a href="#7.11">&lt;locale.h&gt;</a>, <a href="#7.11">7.11</a>, <a href="#7.30.5">7.30.5</a>                                  static, in array declarators, <a href="#6.7.6.2">6.7.6.2</a>, <a href="#6.7.6.3">6.7.6.3</a>
33144     <a href="#7.12">&lt;math.h&gt;</a>, <a href="#5.2.4.2.2">5.2.4.2.2</a>, <a href="#6.5">6.5</a>, <a href="#7.12">7.12</a>, <a href="#7.24">7.24</a>, <a href="#F">F</a>, <a href="#F.10">F.10</a>,            static_assert declaration, <a href="#6.7.10">6.7.10</a>
33145          <a href="#J.5.17">J.5.17</a>                                               static_assert macro, <a href="#7.2">7.2</a>
33146     <a href="#7.13">&lt;setjmp.h&gt;</a>, <a href="#7.13">7.13</a>                                          stdalign.h header, <a href="#4">4</a>, <a href="#7.15">7.15</a>
33147     <a href="#7.14">&lt;signal.h&gt;</a>, <a href="#7.14">7.14</a>, <a href="#7.30.6">7.30.6</a>                                  stdarg.h header, <a href="#4">4</a>, <a href="#6.7.6.3">6.7.6.3</a>, <a href="#7.16">7.16</a>
33148     <a href="#7.15">&lt;stdalign.h&gt;</a>, <a href="#4">4</a>, <a href="#7.15">7.15</a>                                     stdatomic.h header, <a href="#6.10.8.3">6.10.8.3</a>, <a href="#7.1.2">7.1.2</a>, <a href="#7.17">7.17</a>
33149     <a href="#7.16">&lt;stdarg.h&gt;</a>, <a href="#4">4</a>, <a href="#6.7.6.3">6.7.6.3</a>, <a href="#7.16">7.16</a>                              stdbool.h header, <a href="#4">4</a>, <a href="#7.18">7.18</a>, <a href="#7.30.7">7.30.7</a>, <a href="#H">H</a>
33150     <a href="#7.17">&lt;stdatomic.h&gt;</a>, <a href="#6.10.8.3">6.10.8.3</a>, <a href="#7.1.2">7.1.2</a>, <a href="#7.17">7.17</a>                      STDC, <a href="#6.10.6">6.10.6</a>, <a href="#6.11.8">6.11.8</a>
33151     <a href="#7.18">&lt;stdbool.h&gt;</a>, <a href="#4">4</a>, <a href="#7.18">7.18</a>, <a href="#7.30.7">7.30.7</a>, <a href="#H">H</a>                           stddef.h header, <a href="#4">4</a>, <a href="#6.3.2.1">6.3.2.1</a>, <a href="#6.3.2.3">6.3.2.3</a>, <a href="#6.4.4.4">6.4.4.4</a>,
33152     <a href="#7.19">&lt;stddef.h&gt;</a>, <a href="#4">4</a>, <a href="#6.3.2.1">6.3.2.1</a>, <a href="#6.3.2.3">6.3.2.3</a>, <a href="#6.4.4.4">6.4.4.4</a>,                       <a href="#6.4.5">6.4.5</a>, <a href="#6.5.3.4">6.5.3.4</a>, <a href="#6.5.6">6.5.6</a>, <a href="#7.19">7.19</a>, <a href="#K.3.3">K.3.3</a>
33153          <a href="#6.4.5">6.4.5</a>, <a href="#6.5.3.4">6.5.3.4</a>, <a href="#6.5.6">6.5.6</a>, <a href="#7.19">7.19</a>, <a href="#K.3.3">K.3.3</a>                   stderr macro, <a href="#7.21.1">7.21.1</a>, <a href="#7.21.2">7.21.2</a>, <a href="#7.21.3">7.21.3</a>
33154     <a href="#7.20">&lt;stdint.h&gt;</a>, <a href="#4">4</a>, <a href="#5.2.4.2">5.2.4.2</a>, <a href="#6.10.1">6.10.1</a>, <a href="#7.8">7.8</a>, <a href="#7.20">7.20</a>,                stdin macro, <a href="#7.21.1">7.21.1</a>, <a href="#7.21.2">7.21.2</a>, <a href="#7.21.3">7.21.3</a>, <a href="#7.21.6.4">7.21.6.4</a>,
33155          <a href="#7.30.8">7.30.8</a>, <a href="#K.3.3">K.3.3</a>, <a href="#K.3.4">K.3.4</a>                                       <a href="#7.21.7.6">7.21.7.6</a>, <a href="#7.28.2.12">7.28.2.12</a>, <a href="#7.28.3.7">7.28.3.7</a>, <a href="#K.3.5.3.4">K.3.5.3.4</a>,
33156     <a href="#7.21">&lt;stdio.h&gt;</a>, <a href="#5.2.4.2.2">5.2.4.2.2</a>, <a href="#7.21">7.21</a>, <a href="#7.30.9">7.30.9</a>, <a href="#F">F</a>, <a href="#K.3.5">K.3.5</a>                    <a href="#K.3.5.4.1">K.3.5.4.1</a>, <a href="#K.3.9.1.14">K.3.9.1.14</a>
33157     <a href="#7.22">&lt;stdlib.h&gt;</a>, <a href="#5.2.4.2.2">5.2.4.2.2</a>, <a href="#7.22">7.22</a>, <a href="#7.30.10">7.30.10</a>, <a href="#F">F</a>,                  stdint.h header, <a href="#4">4</a>, <a href="#5.2.4.2">5.2.4.2</a>, <a href="#6.10.1">6.10.1</a>, <a href="#7.8">7.8</a>, <a href="#7.20">7.20</a>,
33158          <a href="#K.3.1.4">K.3.1.4</a>, <a href="#K.3.6">K.3.6</a>                                             <a href="#7.30.8">7.30.8</a>, <a href="#K.3.3">K.3.3</a>, <a href="#K.3.4">K.3.4</a>
33159     <a href="#7.23">&lt;string.h&gt;</a>, <a href="#7.23">7.23</a>, <a href="#7.30.11">7.30.11</a>, <a href="#K.3.7">K.3.7</a>                          stdio.h header, <a href="#5.2.4.2.2">5.2.4.2.2</a>, <a href="#7.21">7.21</a>, <a href="#7.30.9">7.30.9</a>, <a href="#F">F</a>, <a href="#K.3.5">K.3.5</a>
33160     <a href="#7.24">&lt;tgmath.h&gt;</a>, <a href="#7.24">7.24</a>, <a href="#G.7">G.7</a>                                     stdlib.h header, <a href="#5.2.4.2.2">5.2.4.2.2</a>, <a href="#7.22">7.22</a>, <a href="#7.30.10">7.30.10</a>, <a href="#F">F</a>,
33161     <a href="#7.25">&lt;threads.h&gt;</a>, <a href="#6.10.8.3">6.10.8.3</a>, <a href="#7.1.2">7.1.2</a>, <a href="#7.25">7.25</a>                              <a href="#K.3.1.4">K.3.1.4</a>, <a href="#K.3.6">K.3.6</a>
33162     <a href="#7.26">&lt;time.h&gt;</a>, <a href="#7.26">7.26</a>, <a href="#K.3.8">K.3.8</a>                                     stdout macro, <a href="#7.21.1">7.21.1</a>, <a href="#7.21.2">7.21.2</a>, <a href="#7.21.3">7.21.3</a>, <a href="#7.21.6.3">7.21.6.3</a>,
33163     <a href="#7.27">&lt;uchar.h&gt;</a>, <a href="#6.4.4.4">6.4.4.4</a>, <a href="#6.4.5">6.4.5</a>, <a href="#7.27">7.27</a>                                 <a href="#7.21.7.8">7.21.7.8</a>, <a href="#7.21.7.9">7.21.7.9</a>, <a href="#7.28.2.11">7.28.2.11</a>, <a href="#7.28.3.9">7.28.3.9</a>
33164     <a href="#7.28">&lt;wchar.h&gt;</a>, <a href="#5.2.4.2.2">5.2.4.2.2</a>, <a href="#7.21.1">7.21.1</a>, <a href="#7.28">7.28</a>, <a href="#7.30.12">7.30.12</a>,              storage duration, <a href="#6.2.4">6.2.4</a>
33165          <a href="#F">F</a>, <a href="#K.3.9">K.3.9</a>                                             storage order of array, <a href="#6.5.2.1">6.5.2.1</a>
33166     <a href="#7.29">&lt;wctype.h&gt;</a>, <a href="#7.29">7.29</a>, <a href="#7.30.13">7.30.13</a>                                 storage unit (bit-field), <a href="#6.2.6.1">6.2.6.1</a>, <a href="#6.7.2.1">6.7.2.1</a>
33167  standard input stream, <a href="#7.21.1">7.21.1</a>, <a href="#7.21.3">7.21.3</a>                        storage-class specifiers, <a href="#6.7.1">6.7.1</a>, <a href="#6.11.5">6.11.5</a>
33168  standard integer types, <a href="#6.2.5">6.2.5</a>                                strcat function, <a href="#7.23.3.1">7.23.3.1</a>
33169  standard output stream, <a href="#7.21.1">7.21.1</a>, <a href="#7.21.3">7.21.3</a>                       strcat_s function, <a href="#K.3.7.2.1">K.3.7.2.1</a>
33170  standard signed integer types, <a href="#6.2.5">6.2.5</a>                         strchr function, <a href="#7.23.5.2">7.23.5.2</a>
33171  state-dependent encoding, <a href="#5.2.1.2">5.2.1.2</a>, <a href="#7.22.7">7.22.7</a>, <a href="#K.3.6.4">K.3.6.4</a>           strcmp function, <a href="#7.23.4">7.23.4</a>, <a href="#7.23.4.2">7.23.4.2</a>
33172  statements, <a href="#6.8">6.8</a>                                              strcoll function, <a href="#7.11.1.1">7.11.1.1</a>, <a href="#7.23.4.3">7.23.4.3</a>, <a href="#7.23.4.5">7.23.4.5</a>
33173     break, <a href="#6.8.6.3">6.8.6.3</a>                                            strcpy function, <a href="#7.23.2.3">7.23.2.3</a>
33174     compound, <a href="#6.8.2">6.8.2</a>                                           strcpy_s function, <a href="#K.3.7.1.3">K.3.7.1.3</a>
33175     continue, <a href="#6.8.6.2">6.8.6.2</a>                                         strcspn function, <a href="#7.23.5.3">7.23.5.3</a>
33176 <!--page 692 -->
33177  streams, <a href="#7.21.2">7.21.2</a>, <a href="#7.22.4.4">7.22.4.4</a>                                                <a href="#7.22.1.4">7.22.1.4</a>, <a href="#7.28.2.2">7.28.2.2</a>
33178     fully buffered, <a href="#7.21.3">7.21.3</a>                                          strtoull function, <a href="#7.8.2.3">7.8.2.3</a>, <a href="#7.22.1.2">7.22.1.2</a>, <a href="#7.22.1.4">7.22.1.4</a>
33179     line buffered, <a href="#7.21.3">7.21.3</a>                                           strtoumax function, <a href="#7.8.2.3">7.8.2.3</a>
33180     orientation, <a href="#7.21.2">7.21.2</a>                                             struct hack, see flexible array member
33181     standard error, <a href="#7.21.1">7.21.1</a>, <a href="#7.21.3">7.21.3</a>                                  struct lconv, <a href="#7.11">7.11</a>
33182     standard input, <a href="#7.21.1">7.21.1</a>, <a href="#7.21.3">7.21.3</a>                                  struct tm, <a href="#7.26.1">7.26.1</a>
33183     standard output, <a href="#7.21.1">7.21.1</a>, <a href="#7.21.3">7.21.3</a>                                 structure
33184     unbuffered, <a href="#7.21.3">7.21.3</a>                                                 arrow operator (-&gt;), <a href="#6.5.2.3">6.5.2.3</a>
33185  strerror function, <a href="#7.21.10.4">7.21.10.4</a>, <a href="#7.23.6.2">7.23.6.2</a>                                content, <a href="#6.7.2.3">6.7.2.3</a>
33186  strerror_s function, <a href="#K.3.7.4.2">K.3.7.4.2</a>, <a href="#K.3.7.4.3">K.3.7.4.3</a>                             dot operator (.), <a href="#6.5.2.3">6.5.2.3</a>
33187  strerrorlen_s function, <a href="#K.3.7.4.3">K.3.7.4.3</a>                                     initialization, <a href="#6.7.9">6.7.9</a>
33188  strftime function, <a href="#7.11.1.1">7.11.1.1</a>, <a href="#7.26.3">7.26.3</a>, <a href="#7.26.3.5">7.26.3.5</a>,                        member alignment, <a href="#6.7.2.1">6.7.2.1</a>
33189        <a href="#7.28.5.1">7.28.5.1</a>, <a href="#K.3.8.2">K.3.8.2</a>, <a href="#K.3.8.2.1">K.3.8.2.1</a>, <a href="#K.3.8.2.2">K.3.8.2.2</a>                         member name space, <a href="#6.2.3">6.2.3</a>
33190  stricter, <a href="#6.2.8">6.2.8</a>                                                       member operator (.), <a href="#6.3.2.1">6.3.2.1</a>, <a href="#6.5.2.3">6.5.2.3</a>
33191  strictly conforming program, <a href="#4">4</a>                                        pointer operator (-&gt;), <a href="#6.5.2.3">6.5.2.3</a>
33192  string, <a href="#7.1.1">7.1.1</a>                                                         specifier, <a href="#6.7.2.1">6.7.2.1</a>
33193     comparison functions, <a href="#7.23.4">7.23.4</a>                                       tag, <a href="#6.2.3">6.2.3</a>, <a href="#6.7.2.3">6.7.2.3</a>
33194     concatenation functions, <a href="#7.23.3">7.23.3</a>, <a href="#K.3.7.2">K.3.7.2</a>                           type, <a href="#6.2.5">6.2.5</a>, <a href="#6.7.2.1">6.7.2.1</a>
33195     conversion functions, <a href="#7.11.1.1">7.11.1.1</a>                                  strxfrm function, <a href="#7.11.1.1">7.11.1.1</a>, <a href="#7.23.4.5">7.23.4.5</a>
33196     copying functions, <a href="#7.23.2">7.23.2</a>, <a href="#K.3.7.1">K.3.7.1</a>                              subnormal floating-point numbers, <a href="#5.2.4.2.2">5.2.4.2.2</a>
33197     library function conventions, <a href="#7.23.1">7.23.1</a>                            subscripting, <a href="#6.5.2.1">6.5.2.1</a>
33198     literal, <a href="#5.1.1.2">5.1.1.2</a>, <a href="#5.2.1">5.2.1</a>, <a href="#6.3.2.1">6.3.2.1</a>, <a href="#6.4.5">6.4.5</a>, <a href="#6.5.1">6.5.1</a>, <a href="#6.7.9">6.7.9</a>           subtraction assignment operator (-=), <a href="#6.5.16.2">6.5.16.2</a>
33199     miscellaneous functions, <a href="#7.23.6">7.23.6</a>, <a href="#K.3.7.4">K.3.7.4</a>                        subtraction operator (-), <a href="#6.2.6.2">6.2.6.2</a>, <a href="#6.5.6">6.5.6</a>, <a href="#F.3">F.3</a>, <a href="#G.5.2">G.5.2</a>
33200     numeric conversion functions, <a href="#7.8.2.3">7.8.2.3</a>, <a href="#7.22.1">7.22.1</a>                   suffix
33201     search functions, <a href="#7.23.5">7.23.5</a>, <a href="#K.3.7.3">K.3.7.3</a>                                  floating constant, <a href="#6.4.4.2">6.4.4.2</a>
33202  string handling header, <a href="#7.23">7.23</a>, <a href="#K.3.7">K.3.7</a>                                   integer constant, <a href="#6.4.4.1">6.4.4.1</a>
33203  string.h header, <a href="#7.23">7.23</a>, <a href="#7.30.11">7.30.11</a>, <a href="#K.3.7">K.3.7</a>                              switch body, <a href="#6.8.4.2">6.8.4.2</a>
33204  stringizing, <a href="#6.10.3.2">6.10.3.2</a>, <a href="#6.10.9">6.10.9</a>                                      switch case label, <a href="#6.8.1">6.8.1</a>, <a href="#6.8.4.2">6.8.4.2</a>
33205  strlen function, <a href="#7.23.6.3">7.23.6.3</a>                                          switch default label, <a href="#6.8.1">6.8.1</a>, <a href="#6.8.4.2">6.8.4.2</a>
33206  strncat function, <a href="#7.23.3.2">7.23.3.2</a>                                         switch statement, <a href="#6.8.1">6.8.1</a>, <a href="#6.8.4.2">6.8.4.2</a>
33207  strncat_s function, <a href="#K.3.7.2.2">K.3.7.2.2</a>                                      swprintf function, <a href="#7.28.2.3">7.28.2.3</a>, <a href="#7.28.2.7">7.28.2.7</a>,
33208  strncmp function, <a href="#7.23.4">7.23.4</a>, <a href="#7.23.4.4">7.23.4.4</a>                                       <a href="#K.3.9.1.3">K.3.9.1.3</a>, <a href="#K.3.9.1.4">K.3.9.1.4</a>
33209  strncpy function, <a href="#7.23.2.4">7.23.2.4</a>                                         swprintf_s function, <a href="#K.3.9.1.3">K.3.9.1.3</a>, <a href="#K.3.9.1.4">K.3.9.1.4</a>
33210  strncpy_s function, <a href="#K.3.7.1.4">K.3.7.1.4</a>                                      swscanf function, <a href="#7.28.2.4">7.28.2.4</a>, <a href="#7.28.2.8">7.28.2.8</a>
33211  strnlen_s function, <a href="#K.3.7.4.4">K.3.7.4.4</a>                                      swscanf_s function, <a href="#K.3.9.1.5">K.3.9.1.5</a>, <a href="#K.3.9.1.10">K.3.9.1.10</a>
33212  stronger, <a href="#6.2.8">6.2.8</a>                                                    symbols, <a href="#3">3</a>
33213  strpbrk function, <a href="#7.23.5.4">7.23.5.4</a>                                         synchronization operation, <a href="#5.1.2.4">5.1.2.4</a>
33214  strrchr function, <a href="#7.23.5.5">7.23.5.5</a>                                         synchronize with, <a href="#5.1.2.4">5.1.2.4</a>
33215  strspn function, <a href="#7.23.5.6">7.23.5.6</a>                                          syntactic categories, <a href="#6.1">6.1</a>
33216  strstr function, <a href="#7.23.5.7">7.23.5.7</a>                                          syntax notation, <a href="#6.1">6.1</a>
33217  strtod function, <a href="#7.12.11.2">7.12.11.2</a>, <a href="#7.21.6.2">7.21.6.2</a>, <a href="#7.22.1.3">7.22.1.3</a>,                    syntax rule precedence, <a href="#5.1.1.2">5.1.1.2</a>
33218        <a href="#7.28.2.2">7.28.2.2</a>, <a href="#F.3">F.3</a>                                                syntax summary, language, <a href="#A">A</a>
33219  strtof function, <a href="#7.12.11.2">7.12.11.2</a>, <a href="#7.22.1.3">7.22.1.3</a>, <a href="#F.3">F.3</a>                          system function, <a href="#7.22.4.8">7.22.4.8</a>
33220  strtoimax function, <a href="#7.8.2.3">7.8.2.3</a>
33221  strtok function, <a href="#7.23.5.8">7.23.5.8</a>                                          tab characters, <a href="#5.2.1">5.2.1</a>, <a href="#6.4">6.4</a>
33222  strtok_s function, <a href="#K.3.7.3.1">K.3.7.3.1</a>                                       tag compatibility, <a href="#6.2.7">6.2.7</a>
33223  strtol function, <a href="#7.8.2.3">7.8.2.3</a>, <a href="#7.21.6.2">7.21.6.2</a>, <a href="#7.22.1.2">7.22.1.2</a>,                      tag name space, <a href="#6.2.3">6.2.3</a>
33224        <a href="#7.22.1.4">7.22.1.4</a>, <a href="#7.28.2.2">7.28.2.2</a>                                           tags, <a href="#6.7.2.3">6.7.2.3</a>
33225  strtold function, <a href="#7.12.11.2">7.12.11.2</a>, <a href="#7.22.1.3">7.22.1.3</a>, <a href="#F.3">F.3</a>                         tan functions, <a href="#7.12.4.7">7.12.4.7</a>, <a href="#F.10.1.7">F.10.1.7</a>
33226  strtoll function, <a href="#7.8.2.3">7.8.2.3</a>, <a href="#7.22.1.2">7.22.1.2</a>, <a href="#7.22.1.4">7.22.1.4</a>                      tan type-generic macro, <a href="#7.24">7.24</a>, <a href="#G.7">G.7</a>
33227  strtoul function, <a href="#7.8.2.3">7.8.2.3</a>, <a href="#7.21.6.2">7.21.6.2</a>, <a href="#7.22.1.2">7.22.1.2</a>,                     tanh functions, <a href="#7.12.5.6">7.12.5.6</a>, <a href="#F.10.2.6">F.10.2.6</a>
33228 <!--page 693 -->
33229  tanh type-generic macro, <a href="#7.24">7.24</a>, <a href="#G.7">G.7</a>                            toupper function, <a href="#7.4.2.2">7.4.2.2</a>
33230  temporary lifetime, <a href="#6.2.4">6.2.4</a>                                     towctrans function, <a href="#7.29.3.2.1">7.29.3.2.1</a>, <a href="#7.29.3.2.2">7.29.3.2.2</a>
33231  tentative definition, <a href="#6.9.2">6.9.2</a>                                    towlower function, <a href="#7.29.3.1.1">7.29.3.1.1</a>, <a href="#7.29.3.2.1">7.29.3.2.1</a>
33232  terms, <a href="#3">3</a>                                                      towupper function, <a href="#7.29.3.1.2">7.29.3.1.2</a>, <a href="#7.29.3.2.1">7.29.3.2.1</a>
33233  text streams, <a href="#7.21.2">7.21.2</a>, <a href="#7.21.7.10">7.21.7.10</a>, <a href="#7.21.9.2">7.21.9.2</a>, <a href="#7.21.9.4">7.21.9.4</a>           translation environment, <a href="#5">5</a>, <a href="#5.1.1">5.1.1</a>
33234  tgamma functions, <a href="#7.12.8.4">7.12.8.4</a>, <a href="#F.10.5.4">F.10.5.4</a>                          translation limits, <a href="#5.2.4.1">5.2.4.1</a>
33235  tgamma type-generic macro, <a href="#7.24">7.24</a>                               translation phases, <a href="#5.1.1.2">5.1.1.2</a>
33236  tgmath.h header, <a href="#7.24">7.24</a>, <a href="#G.7">G.7</a>                                    translation unit, <a href="#5.1.1.1">5.1.1.1</a>, <a href="#6.9">6.9</a>
33237  thrd_create function, <a href="#7.25.1">7.25.1</a>, <a href="#7.25.5.1">7.25.5.1</a>                        trap, see perform a trap
33238  thrd_current function, <a href="#7.25.5.2">7.25.5.2</a>                               trap representation, <a href="#3.19.4">3.19.4</a>, <a href="#6.2.6.1">6.2.6.1</a>, <a href="#6.2.6.2">6.2.6.2</a>,
33239  thrd_detach function, <a href="#7.25.5.3">7.25.5.3</a>                                      <a href="#6.3.2.3">6.3.2.3</a>, <a href="#6.5.2.3">6.5.2.3</a>
33240  thrd_equal function, <a href="#7.25.5.4">7.25.5.4</a>                                 trigonometric functions
33241  thrd_exit function, <a href="#7.25.5.5">7.25.5.5</a>                                     complex, <a href="#7.3.5">7.3.5</a>, <a href="#G.6.1">G.6.1</a>
33242  thrd_join function, <a href="#7.25.5.6">7.25.5.6</a>                                     real, <a href="#7.12.4">7.12.4</a>, <a href="#F.10.1">F.10.1</a>
33243  thrd_sleep function, <a href="#7.25.5.7">7.25.5.7</a>                                 trigraph sequences, <a href="#5.1.1.2">5.1.1.2</a>, <a href="#5.2.1.1">5.2.1.1</a>
33244  thrd_start_t type, <a href="#7.25.1">7.25.1</a>                                     true macro, <a href="#7.18">7.18</a>
33245  thrd_t type, <a href="#7.25.1">7.25.1</a>                                           trunc functions, <a href="#7.12.9.8">7.12.9.8</a>, <a href="#F.10.6.8">F.10.6.8</a>
33246  thrd_yield function, <a href="#7.25.5.8">7.25.5.8</a>                                 trunc type-generic macro, <a href="#7.24">7.24</a>
33247  thread of execution, <a href="#5.1.2.4">5.1.2.4</a>, <a href="#7.1.4">7.1.4</a>, <a href="#7.6">7.6</a>, <a href="#7.22.4.6">7.22.4.6</a>            truncation, <a href="#6.3.1.4">6.3.1.4</a>, <a href="#7.12.9.8">7.12.9.8</a>, <a href="#7.21.3">7.21.3</a>, <a href="#7.21.5.3">7.21.5.3</a>
33248  thread storage duration, <a href="#6.2.4">6.2.4</a>, <a href="#7.6">7.6</a>                           truncation toward zero, <a href="#6.5.5">6.5.5</a>
33249  threads header, <a href="#7.25">7.25</a>                                          tss_create function, <a href="#7.25.6.1">7.25.6.1</a>
33250  threads.h header, <a href="#6.10.8.3">6.10.8.3</a>, <a href="#7.1.2">7.1.2</a>, <a href="#7.25">7.25</a>                       tss_delete function, <a href="#7.25.6.2">7.25.6.2</a>
33251  time                                                          TSS_DTOR_ITERATIONS macro, <a href="#7.25.1">7.25.1</a>
33252     broken down, <a href="#7.26.1">7.26.1</a>, <a href="#7.26.2.3">7.26.2.3</a>, <a href="#7.26.3">7.26.3</a>, <a href="#7.26.3.1">7.26.3.1</a>,           tss_dtor_t type, <a href="#7.25.1">7.25.1</a>
33253           <a href="#7.26.3.3">7.26.3.3</a>, <a href="#7.26.3.4">7.26.3.4</a>, <a href="#7.26.3.5">7.26.3.5</a>, <a href="#K.3.8.2.1">K.3.8.2.1</a>,             tss_get function, <a href="#7.25.6.3">7.25.6.3</a>
33254           <a href="#K.3.8.2.3">K.3.8.2.3</a>, <a href="#K.3.8.2.4">K.3.8.2.4</a>                                 tss_set function, <a href="#7.25.6.4">7.25.6.4</a>
33255     calendar, <a href="#7.26.1">7.26.1</a>, <a href="#7.26.2.2">7.26.2.2</a>, <a href="#7.26.2.3">7.26.2.3</a>, <a href="#7.26.2.4">7.26.2.4</a>,            tss_t type, <a href="#7.25.1">7.25.1</a>
33256           <a href="#7.26.3.2">7.26.3.2</a>, <a href="#7.26.3.3">7.26.3.3</a>, <a href="#7.26.3.4">7.26.3.4</a>, <a href="#K.3.8.2.2">K.3.8.2.2</a>,             two's complement, <a href="#6.2.6.2">6.2.6.2</a>, <a href="#7.20.1.1">7.20.1.1</a>
33257           <a href="#K.3.8.2.3">K.3.8.2.3</a>, <a href="#K.3.8.2.4">K.3.8.2.4</a>                                 type category, <a href="#6.2.5">6.2.5</a>
33258     components, <a href="#7.26.1">7.26.1</a>, <a href="#K.3.8.1">K.3.8.1</a>                                type conversion, <a href="#6.3">6.3</a>
33259     conversion functions, <a href="#7.26.3">7.26.3</a>, <a href="#K.3.8.2">K.3.8.2</a>                      type definitions, <a href="#6.7.8">6.7.8</a>
33260        wide character, <a href="#7.28.5">7.28.5</a>                                  type domain, <a href="#6.2.5">6.2.5</a>, <a href="#G.2">G.2</a>
33261     local, <a href="#7.26.1">7.26.1</a>                                              type names, <a href="#6.7.7">6.7.7</a>
33262     manipulation functions, <a href="#7.26.2">7.26.2</a>                             type punning, <a href="#6.5.2.3">6.5.2.3</a>
33263     normalized broken down, <a href="#K.3.8.1">K.3.8.1</a>, <a href="#K.3.8.2.1">K.3.8.2.1</a>                 type qualifiers, <a href="#6.7.3">6.7.3</a>
33264  time function, <a href="#7.26.2.4">7.26.2.4</a>                                       type specifiers, <a href="#6.7.2">6.7.2</a>
33265  time.h header, <a href="#7.26">7.26</a>, <a href="#K.3.8">K.3.8</a>                                    type-generic macro, <a href="#7.24">7.24</a>, <a href="#G.7">G.7</a>
33266  time_t type, <a href="#7.26.1">7.26.1</a>                                           typedef declaration, <a href="#6.7.8">6.7.8</a>
33267  TIME_UTC macro, <a href="#7.25.7.1">7.25.7.1</a>                                      typedef storage-class specifier, <a href="#6.7.1">6.7.1</a>, <a href="#6.7.8">6.7.8</a>
33268  tm structure type, <a href="#7.26.1">7.26.1</a>, <a href="#7.28.1">7.28.1</a>, <a href="#K.3.8.1">K.3.8.1</a>                    types, <a href="#6.2.5">6.2.5</a>
33269  TMP_MAX macro, <a href="#7.21.1">7.21.1</a>, <a href="#7.21.4.3">7.21.4.3</a>, <a href="#7.21.4.4">7.21.4.4</a>                        atomic, <a href="#5.1.2.3">5.1.2.3</a>, <a href="#6.2.5">6.2.5</a>, <a href="#6.2.6.1">6.2.6.1</a>, <a href="#6.3.2.1">6.3.2.1</a>, <a href="#6.5.2.3">6.5.2.3</a>,
33270  TMP_MAX_S macro, <a href="#K.3.5">K.3.5</a>, <a href="#K.3.5.1.1">K.3.5.1.1</a>, <a href="#K.3.5.1.2">K.3.5.1.2</a>                           <a href="#6.5.2.4">6.5.2.4</a>, <a href="#6.5.16.2">6.5.16.2</a>, <a href="#6.7.2.4">6.7.2.4</a>, <a href="#6.10.8.3">6.10.8.3</a>, <a href="#7.17.6">7.17.6</a>
33271  tmpfile function, <a href="#7.21.4.3">7.21.4.3</a>, <a href="#7.22.4.4">7.22.4.4</a>                             character, <a href="#6.7.9">6.7.9</a>
33272  tmpfile_s function, <a href="#K.3.5.1.1">K.3.5.1.1</a>, <a href="#K.3.5.1.2">K.3.5.1.2</a>                         compatible, <a href="#6.2.7">6.2.7</a>, <a href="#6.7.2">6.7.2</a>, <a href="#6.7.3">6.7.3</a>, <a href="#6.7.6">6.7.6</a>
33273  tmpnam function, <a href="#7.21.1">7.21.1</a>, <a href="#7.21.4.3">7.21.4.3</a>, <a href="#7.21.4.4">7.21.4.4</a>,                     complex, <a href="#6.2.5">6.2.5</a>, <a href="#G">G</a>
33274        <a href="#K.3.5.1.2">K.3.5.1.2</a>                                                  composite, <a href="#6.2.7">6.2.7</a>
33275  tmpnam_s function, <a href="#K.3.5">K.3.5</a>, <a href="#K.3.5.1.1">K.3.5.1.1</a>, <a href="#K.3.5.1.2">K.3.5.1.2</a>                   const qualified, <a href="#6.7.3">6.7.3</a>
33276  token, <a href="#5.1.1.2">5.1.1.2</a>, <a href="#6.4">6.4</a>, see also preprocessing tokens               conversions, <a href="#6.3">6.3</a>
33277  token concatenation, <a href="#6.10.3.3">6.10.3.3</a>                                    imaginary, <a href="#G">G</a>
33278  token pasting, <a href="#6.10.3.3">6.10.3.3</a>                                          restrict qualified, <a href="#6.7.3">6.7.3</a>
33279  tolower function, <a href="#7.4.2.1">7.4.2.1</a>                                        volatile qualified, <a href="#6.7.3">6.7.3</a>
33280 <!--page 694 -->
33281  uchar.h header, <a href="#6.4.4.4">6.4.4.4</a>, <a href="#6.4.5">6.4.5</a>, <a href="#7.27">7.27</a>                      universal character name, <a href="#6.4.3">6.4.3</a>
33282  UCHAR_MAX macro, <a href="#5.2.4.2.1">5.2.4.2.1</a>                                unnormalized floating-point numbers, <a href="#5.2.4.2.2">5.2.4.2.2</a>
33283  UINT_FASTN_MAX macros, <a href="#7.20.2.3">7.20.2.3</a>                           unqualified type, <a href="#6.2.5">6.2.5</a>
33284  uint_fastN_t types, <a href="#7.20.1.3">7.20.1.3</a>                              unqualified version of type, <a href="#6.2.5">6.2.5</a>
33285  uint_least16_t type, <a href="#7.27">7.27</a>                                 unsequenced, <a href="#5.1.2.3">5.1.2.3</a>, <a href="#6.5">6.5</a>, <a href="#6.5.16">6.5.16</a>, see also
33286  uint_least32_t type, <a href="#7.27">7.27</a>                                       indeterminately sequenced, sequenced
33287  UINT_LEASTN_MAX macros, <a href="#7.20.2.2">7.20.2.2</a>                                before
33288  uint_leastN_t types, <a href="#7.20.1.2">7.20.1.2</a>                             unsigned char type, <a href="#K.3.5.3.2">K.3.5.3.2</a>, <a href="#K.3.9.1.2">K.3.9.1.2</a>
33289  UINT_MAX macro, <a href="#5.2.4.2.1">5.2.4.2.1</a>                                 unsigned integer suffix, u or <a href="#U">U</a>, <a href="#6.4.4.1">6.4.4.1</a>
33290  UINTMAX_C macro, <a href="#7.20.4.2">7.20.4.2</a>                                 unsigned integer types, <a href="#6.2.5">6.2.5</a>, <a href="#6.3.1.3">6.3.1.3</a>, <a href="#6.4.4.1">6.4.4.1</a>
33291  UINTMAX_MAX macro, <a href="#7.8.2.3">7.8.2.3</a>, <a href="#7.8.2.4">7.8.2.4</a>, <a href="#7.20.2.5">7.20.2.5</a>             unsigned type conversion, <a href="#6.3.1.1">6.3.1.1</a>, <a href="#6.3.1.3">6.3.1.3</a>,
33292  uintmax_t type, <a href="#7.20.1.5">7.20.1.5</a>, <a href="#7.21.6.1">7.21.6.1</a>, <a href="#7.21.6.2">7.21.6.2</a>,                   <a href="#6.3.1.4">6.3.1.4</a>, <a href="#6.3.1.8">6.3.1.8</a>
33293       <a href="#7.28.2.1">7.28.2.1</a>, <a href="#7.28.2.2">7.28.2.2</a>                                   unsigned types, <a href="#6.2.5">6.2.5</a>, <a href="#6.7.2">6.7.2</a>, <a href="#7.21.6.1">7.21.6.1</a>, <a href="#7.21.6.2">7.21.6.2</a>,
33294  UINTN_C macros, <a href="#7.20.4.1">7.20.4.1</a>                                        <a href="#7.28.2.1">7.28.2.1</a>, <a href="#7.28.2.2">7.28.2.2</a>
33295  UINTN_MAX macros, <a href="#7.20.2.1">7.20.2.1</a>                                unspecified behavior, <a href="#3.4.4">3.4.4</a>, <a href="#4">4</a>, <a href="#J.1">J.1</a>
33296  uintN_t types, <a href="#7.20.1.1">7.20.1.1</a>                                   unspecified value, <a href="#3.19.3">3.19.3</a>
33297  UINTPTR_MAX macro, <a href="#7.20.2.4">7.20.2.4</a>                               uppercase letter, <a href="#5.2.1">5.2.1</a>
33298  uintptr_t type, <a href="#7.20.1.4">7.20.1.4</a>                                  use of library functions, <a href="#7.1.4">7.1.4</a>
33299  ULLONG_MAX macro, <a href="#5.2.4.2.1">5.2.4.2.1</a>, <a href="#7.22.1.4">7.22.1.4</a>,                    USHRT_MAX macro, <a href="#5.2.4.2.1">5.2.4.2.1</a>
33300       <a href="#7.28.4.1.2">7.28.4.1.2</a>                                           usual arithmetic conversions, <a href="#6.3.1.8">6.3.1.8</a>, <a href="#6.5.5">6.5.5</a>, <a href="#6.5.6">6.5.6</a>,
33301  ULONG_MAX macro, <a href="#5.2.4.2.1">5.2.4.2.1</a>, <a href="#7.22.1.4">7.22.1.4</a>,                           <a href="#6.5.8">6.5.8</a>, <a href="#6.5.9">6.5.9</a>, <a href="#6.5.10">6.5.10</a>, <a href="#6.5.11">6.5.11</a>, <a href="#6.5.12">6.5.12</a>, <a href="#6.5.15">6.5.15</a>
33302       <a href="#7.28.4.1.2">7.28.4.1.2</a>                                           UTF-16, <a href="#6.10.8.2">6.10.8.2</a>
33303  unary arithmetic operators, <a href="#6.5.3.3">6.5.3.3</a>                       UTF-32, <a href="#6.10.8.2">6.10.8.2</a>
33304  unary expression, <a href="#6.5.3">6.5.3</a>                                   UTF-8 string literal, see string literal
33305  unary minus operator (-), <a href="#6.5.3.3">6.5.3.3</a>, <a href="#F.3">F.3</a>                    utilities, general, <a href="#7.22">7.22</a>, <a href="#K.3.6">K.3.6</a>
33306  unary operators, <a href="#6.5.3">6.5.3</a>                                       wide string, <a href="#7.28.4">7.28.4</a>, <a href="#K.3.9.2">K.3.9.2</a>
33307  unary plus operator (+), <a href="#6.5.3.3">6.5.3.3</a>
33308  unbuffered stream, <a href="#7.21.3">7.21.3</a>                                 va_arg macro, <a href="#7.16">7.16</a>, <a href="#7.16.1">7.16.1</a>, <a href="#7.16.1.1">7.16.1.1</a>, <a href="#7.16.1.2">7.16.1.2</a>,
33309  undef preprocessing directive, <a href="#6.10.3.5">6.10.3.5</a>, <a href="#7.1.3">7.1.3</a>,                <a href="#7.16.1.4">7.16.1.4</a>, <a href="#7.21.6.8">7.21.6.8</a>, <a href="#7.21.6.9">7.21.6.9</a>, <a href="#7.21.6.10">7.21.6.10</a>,
33310       <a href="#7.1.4">7.1.4</a>                                                     <a href="#7.21.6.11">7.21.6.11</a>, <a href="#7.21.6.12">7.21.6.12</a>, <a href="#7.21.6.13">7.21.6.13</a>, <a href="#7.21.6.14">7.21.6.14</a>,
33311  undefined behavior, <a href="#3.4.3">3.4.3</a>, <a href="#4">4</a>, <a href="#J.2">J.2</a>                               <a href="#7.28.2.5">7.28.2.5</a>, <a href="#7.28.2.6">7.28.2.6</a>, <a href="#7.28.2.7">7.28.2.7</a>, <a href="#7.28.2.8">7.28.2.8</a>,
33312  underscore character, <a href="#6.4.2.1">6.4.2.1</a>                                  <a href="#7.28.2.9">7.28.2.9</a>, <a href="#7.28.2.10">7.28.2.10</a>, <a href="#K.3.5.3.9">K.3.5.3.9</a>, <a href="#K.3.5.3.11">K.3.5.3.11</a>,
33313  underscore, leading, in identifier, <a href="#7.1.3">7.1.3</a>                       <a href="#K.3.5.3.14">K.3.5.3.14</a>, <a href="#K.3.9.1.7">K.3.9.1.7</a>, <a href="#K.3.9.1.10">K.3.9.1.10</a>, <a href="#K.3.9.1.12">K.3.9.1.12</a>
33314  ungetc function, <a href="#7.21.1">7.21.1</a>, <a href="#7.21.7.10">7.21.7.10</a>, <a href="#7.21.9.2">7.21.9.2</a>,             va_copy macro, <a href="#7.1.3">7.1.3</a>, <a href="#7.16">7.16</a>, <a href="#7.16.1">7.16.1</a>, <a href="#7.16.1.1">7.16.1.1</a>,
33315       <a href="#7.21.9.3">7.21.9.3</a>                                                  <a href="#7.16.1.2">7.16.1.2</a>, <a href="#7.16.1.3">7.16.1.3</a>
33316  ungetwc function, <a href="#7.21.1">7.21.1</a>, <a href="#7.28.3.10">7.28.3.10</a>                       va_end macro, <a href="#7.1.3">7.1.3</a>, <a href="#7.16">7.16</a>, <a href="#7.16.1">7.16.1</a>, <a href="#7.16.1.3">7.16.1.3</a>,
33317  Unicode, <a href="#7.27">7.27</a>, see also char16_t type,                         <a href="#7.16.1.4">7.16.1.4</a>, <a href="#7.21.6.8">7.21.6.8</a>, <a href="#7.21.6.9">7.21.6.9</a>, <a href="#7.21.6.10">7.21.6.10</a>,
33318       char32_t type, wchar_t type                               <a href="#7.21.6.11">7.21.6.11</a>, <a href="#7.21.6.12">7.21.6.12</a>, <a href="#7.21.6.13">7.21.6.13</a>, <a href="#7.21.6.14">7.21.6.14</a>,
33319  Unicode required set, <a href="#6.10.8.2">6.10.8.2</a>                                 <a href="#7.28.2.5">7.28.2.5</a>, <a href="#7.28.2.6">7.28.2.6</a>, <a href="#7.28.2.7">7.28.2.7</a>, <a href="#7.28.2.8">7.28.2.8</a>,
33320  union                                                          <a href="#7.28.2.9">7.28.2.9</a>, <a href="#7.28.2.10">7.28.2.10</a>, <a href="#K.3.5.3.9">K.3.5.3.9</a>, <a href="#K.3.5.3.11">K.3.5.3.11</a>,
33321    arrow operator (-&gt;), <a href="#6.5.2.3">6.5.2.3</a>                                 <a href="#K.3.5.3.14">K.3.5.3.14</a>, <a href="#K.3.9.1.7">K.3.9.1.7</a>, <a href="#K.3.9.1.10">K.3.9.1.10</a>, <a href="#K.3.9.1.12">K.3.9.1.12</a>
33322    content, <a href="#6.7.2.3">6.7.2.3</a>                                        va_list type, <a href="#7.16">7.16</a>, <a href="#7.16.1.3">7.16.1.3</a>
33323    dot operator (.), <a href="#6.5.2.3">6.5.2.3</a>                               va_start macro, <a href="#7.16">7.16</a>, <a href="#7.16.1">7.16.1</a>, <a href="#7.16.1.1">7.16.1.1</a>,
33324    initialization, <a href="#6.7.9">6.7.9</a>                                        <a href="#7.16.1.2">7.16.1.2</a>, <a href="#7.16.1.3">7.16.1.3</a>, <a href="#7.16.1.4">7.16.1.4</a>, <a href="#7.21.6.8">7.21.6.8</a>,
33325    member alignment, <a href="#6.7.2.1">6.7.2.1</a>                                    <a href="#7.21.6.9">7.21.6.9</a>, <a href="#7.21.6.10">7.21.6.10</a>, <a href="#7.21.6.11">7.21.6.11</a>, <a href="#7.21.6.12">7.21.6.12</a>,
33326    member name space, <a href="#6.2.3">6.2.3</a>                                     <a href="#7.21.6.13">7.21.6.13</a>, <a href="#7.21.6.14">7.21.6.14</a>, <a href="#7.28.2.5">7.28.2.5</a>, <a href="#7.28.2.6">7.28.2.6</a>,
33327    member operator (.), <a href="#6.3.2.1">6.3.2.1</a>, <a href="#6.5.2.3">6.5.2.3</a>                        <a href="#7.28.2.7">7.28.2.7</a>, <a href="#7.28.2.8">7.28.2.8</a>, <a href="#7.28.2.9">7.28.2.9</a>, <a href="#7.28.2.10">7.28.2.10</a>,
33328    pointer operator (-&gt;), <a href="#6.5.2.3">6.5.2.3</a>                               <a href="#K.3.5.3.9">K.3.5.3.9</a>, <a href="#K.3.5.3.11">K.3.5.3.11</a>, <a href="#K.3.5.3.14">K.3.5.3.14</a>, <a href="#K.3.9.1.7">K.3.9.1.7</a>,
33329    specifier, <a href="#6.7.2.1">6.7.2.1</a>                                            <a href="#K.3.9.1.10">K.3.9.1.10</a>, <a href="#K.3.9.1.12">K.3.9.1.12</a>
33330    tag, <a href="#6.2.3">6.2.3</a>, <a href="#6.7.2.3">6.7.2.3</a>                                     value, <a href="#3.19">3.19</a>
33331    type, <a href="#6.2.5">6.2.5</a>, <a href="#6.7.2.1">6.7.2.1</a>                                    value bits, <a href="#6.2.6.2">6.2.6.2</a>
33332 <!--page 695 -->
33333  variable arguments, <a href="#6.10.3">6.10.3</a>, <a href="#7.16">7.16</a>                             vswscanf function, <a href="#7.28.2.8">7.28.2.8</a>
33334  variable arguments header, <a href="#7.16">7.16</a>                              vswscanf_s function, <a href="#K.3.9.1.10">K.3.9.1.10</a>
33335  variable length array, <a href="#6.7.6">6.7.6</a>, <a href="#6.7.6.2">6.7.6.2</a>, <a href="#6.10.8.3">6.10.8.3</a>              vwprintf function, <a href="#7.21.1">7.21.1</a>, <a href="#7.28.2.9">7.28.2.9</a>, <a href="#K.3.9.1.11">K.3.9.1.11</a>
33336  variably modified type, <a href="#6.7.6">6.7.6</a>, <a href="#6.7.6.2">6.7.6.2</a>, <a href="#6.10.8.3">6.10.8.3</a>              vwprintf_s function, <a href="#K.3.9.1.11">K.3.9.1.11</a>
33337  vertical-tab character, <a href="#5.2.1">5.2.1</a>, <a href="#6.4">6.4</a>                           vwscanf function, <a href="#7.21.1">7.21.1</a>, <a href="#7.28.2.10">7.28.2.10</a>, <a href="#7.28.3.10">7.28.3.10</a>
33338  vertical-tab escape sequence (\v), <a href="#5.2.2">5.2.2</a>, <a href="#6.4.4.4">6.4.4.4</a>,           vwscanf_s function, <a href="#K.3.9.1.12">K.3.9.1.12</a>
33339       <a href="#7.4.1.10">7.4.1.10</a>
33340  vfprintf function, <a href="#7.21.1">7.21.1</a>, <a href="#7.21.6.8">7.21.6.8</a>, <a href="#K.3.5.3.8">K.3.5.3.8</a>               warnings, <a href="#I">I</a>
33341  vfprintf_s function, <a href="#K.3.5.3.8">K.3.5.3.8</a>, <a href="#K.3.5.3.9">K.3.5.3.9</a>,                   wchar.h header, <a href="#5.2.4.2.2">5.2.4.2.2</a>, <a href="#7.21.1">7.21.1</a>, <a href="#7.28">7.28</a>, <a href="#7.30.12">7.30.12</a>,
33342       <a href="#K.3.5.3.11">K.3.5.3.11</a>, <a href="#K.3.5.3.14">K.3.5.3.14</a>                                      <a href="#F">F</a>, <a href="#K.3.9">K.3.9</a>
33343  vfscanf function, <a href="#7.21.1">7.21.1</a>, <a href="#7.21.6.8">7.21.6.8</a>, <a href="#7.21.6.9">7.21.6.9</a>                 WCHAR_MAX macro, <a href="#7.20.3">7.20.3</a>, <a href="#7.28.1">7.28.1</a>
33344  vfscanf_s function, <a href="#K.3.5.3.9">K.3.5.3.9</a>, <a href="#K.3.5.3.11">K.3.5.3.11</a>,                   WCHAR_MIN macro, <a href="#7.20.3">7.20.3</a>, <a href="#7.28.1">7.28.1</a>
33345       <a href="#K.3.5.3.14">K.3.5.3.14</a>                                              wchar_t type, <a href="#3.7.3">3.7.3</a>, <a href="#6.4.5">6.4.5</a>, <a href="#6.7.9">6.7.9</a>, <a href="#6.10.8.2">6.10.8.2</a>, <a href="#7.19">7.19</a>,
33346  vfwprintf function, <a href="#7.21.1">7.21.1</a>, <a href="#7.28.2.5">7.28.2.5</a>, <a href="#K.3.9.1.6">K.3.9.1.6</a>                  <a href="#7.20.3">7.20.3</a>, <a href="#7.21.6.1">7.21.6.1</a>, <a href="#7.21.6.2">7.21.6.2</a>, <a href="#7.22">7.22</a>, <a href="#7.28.1">7.28.1</a>,
33347  vfwprintf_s function, <a href="#K.3.9.1.6">K.3.9.1.6</a>                                  <a href="#7.28.2.1">7.28.2.1</a>, <a href="#7.28.2.2">7.28.2.2</a>
33348  vfwscanf function, <a href="#7.21.1">7.21.1</a>, <a href="#7.28.2.6">7.28.2.6</a>, <a href="#7.28.3.10">7.28.3.10</a>               wcrtomb function, <a href="#7.21.3">7.21.3</a>, <a href="#7.21.6.2">7.21.6.2</a>, <a href="#7.28.2.2">7.28.2.2</a>,
33349  vfwscanf_s function, <a href="#K.3.9.1.7">K.3.9.1.7</a>                                   <a href="#7.28.6.3.3">7.28.6.3.3</a>, <a href="#7.28.6.4.2">7.28.6.4.2</a>, <a href="#K.3.6.5.2">K.3.6.5.2</a>, <a href="#K.3.9.3.1">K.3.9.3.1</a>,
33350  visibility of identifier, <a href="#6.2.1">6.2.1</a>                                   <a href="#K.3.9.3.2.2">K.3.9.3.2.2</a>
33351  visible sequence of side effects, <a href="#5.1.2.4">5.1.2.4</a>                    wcrtomb_s function, <a href="#K.3.9.3.1">K.3.9.3.1</a>, <a href="#K.3.9.3.1.1">K.3.9.3.1.1</a>
33352  visible side effect, <a href="#5.1.2.4">5.1.2.4</a>                                 wcscat function, <a href="#7.28.4.3.1">7.28.4.3.1</a>
33353  VLA, see variable length array                               wcscat_s function, <a href="#K.3.9.2.2.1">K.3.9.2.2.1</a>
33354  void expression, <a href="#6.3.2.2">6.3.2.2</a>                                     wcschr function, <a href="#7.28.4.5.1">7.28.4.5.1</a>
33355  void function parameter, <a href="#6.7.6.3">6.7.6.3</a>                             wcscmp function, <a href="#7.28.4.4.1">7.28.4.4.1</a>, <a href="#7.28.4.4.4">7.28.4.4.4</a>
33356  void type, <a href="#6.2.5">6.2.5</a>, <a href="#6.3.2.2">6.3.2.2</a>, <a href="#6.7.2">6.7.2</a>, <a href="#K.3.5.3.2">K.3.5.3.2</a>,                 wcscoll function, <a href="#7.28.4.4.2">7.28.4.4.2</a>, <a href="#7.28.4.4.4">7.28.4.4.4</a>
33357       <a href="#K.3.9.1.2">K.3.9.1.2</a>                                               wcscpy function, <a href="#7.28.4.2.1">7.28.4.2.1</a>
33358  void type conversion, <a href="#6.3.2.2">6.3.2.2</a>                                wcscpy_s function, <a href="#K.3.9.2.1.1">K.3.9.2.1.1</a>
33359  volatile storage, <a href="#5.1.2.3">5.1.2.3</a>                                    wcscspn function, <a href="#7.28.4.5.2">7.28.4.5.2</a>
33360  volatile type qualifier, <a href="#6.7.3">6.7.3</a>                                wcsftime function, <a href="#7.11.1.1">7.11.1.1</a>, <a href="#7.28.5.1">7.28.5.1</a>
33361  volatile-qualified type, <a href="#6.2.5">6.2.5</a>, <a href="#6.7.3">6.7.3</a>                         wcslen function, <a href="#7.28.4.6.1">7.28.4.6.1</a>
33362  vprintf function, <a href="#7.21.1">7.21.1</a>, <a href="#7.21.6.8">7.21.6.8</a>, <a href="#7.21.6.10">7.21.6.10</a>,               wcsncat function, <a href="#7.28.4.3.2">7.28.4.3.2</a>
33363       <a href="#K.3.5.3.10">K.3.5.3.10</a>                                              wcsncat_s function, <a href="#K.3.9.2.2.2">K.3.9.2.2.2</a>
33364  vprintf_s function, <a href="#K.3.5.3.9">K.3.5.3.9</a>, <a href="#K.3.5.3.10">K.3.5.3.10</a>,                   wcsncmp function, <a href="#7.28.4.4.3">7.28.4.4.3</a>
33365       <a href="#K.3.5.3.11">K.3.5.3.11</a>, <a href="#K.3.5.3.14">K.3.5.3.14</a>                                  wcsncpy function, <a href="#7.28.4.2.2">7.28.4.2.2</a>
33366  vscanf function, <a href="#7.21.1">7.21.1</a>, <a href="#7.21.6.8">7.21.6.8</a>, <a href="#7.21.6.11">7.21.6.11</a>                 wcsncpy_s function, <a href="#K.3.9.2.1.2">K.3.9.2.1.2</a>
33367  vscanf_s function, <a href="#K.3.5.3.9">K.3.5.3.9</a>, <a href="#K.3.5.3.11">K.3.5.3.11</a>,                    wcsnlen_s function, <a href="#K.3.9.2.4.1">K.3.9.2.4.1</a>
33368       <a href="#K.3.5.3.14">K.3.5.3.14</a>                                              wcspbrk function, <a href="#7.28.4.5.3">7.28.4.5.3</a>
33369  vsnprintf function, <a href="#7.21.6.8">7.21.6.8</a>, <a href="#7.21.6.12">7.21.6.12</a>,                     wcsrchr function, <a href="#7.28.4.5.4">7.28.4.5.4</a>
33370       <a href="#K.3.5.3.12">K.3.5.3.12</a>                                              wcsrtombs function, <a href="#7.28.6.4.2">7.28.6.4.2</a>, <a href="#K.3.9.3.2">K.3.9.3.2</a>
33371  vsnprintf_s function, <a href="#K.3.5.3.9">K.3.5.3.9</a>, <a href="#K.3.5.3.11">K.3.5.3.11</a>,                 wcsrtombs_s function, <a href="#K.3.9.3.2">K.3.9.3.2</a>, <a href="#K.3.9.3.2.2">K.3.9.3.2.2</a>
33372       <a href="#K.3.5.3.12">K.3.5.3.12</a>, <a href="#K.3.5.3.13">K.3.5.3.13</a>, <a href="#K.3.5.3.14">K.3.5.3.14</a>                      wcsspn function, <a href="#7.28.4.5.5">7.28.4.5.5</a>
33373  vsnwprintf_s function, <a href="#K.3.9.1.8">K.3.9.1.8</a>, <a href="#K.3.9.1.9">K.3.9.1.9</a>                  wcsstr function, <a href="#7.28.4.5.6">7.28.4.5.6</a>
33374  vsprintf function, <a href="#7.21.6.8">7.21.6.8</a>, <a href="#7.21.6.13">7.21.6.13</a>,                      wcstod function, <a href="#7.21.6.2">7.21.6.2</a>, <a href="#7.28.2.2">7.28.2.2</a>
33375       <a href="#K.3.5.3.13">K.3.5.3.13</a>                                              wcstod function, <a href="#7.28.4.1.1">7.28.4.1.1</a>
33376  vsprintf_s function, <a href="#K.3.5.3.9">K.3.5.3.9</a>, <a href="#K.3.5.3.11">K.3.5.3.11</a>,                  wcstof function, <a href="#7.28.4.1.1">7.28.4.1.1</a>
33377       <a href="#K.3.5.3.12">K.3.5.3.12</a>, <a href="#K.3.5.3.13">K.3.5.3.13</a>, <a href="#K.3.5.3.14">K.3.5.3.14</a>                      wcstoimax function, <a href="#7.8.2.4">7.8.2.4</a>
33378  vsscanf function, <a href="#7.21.6.8">7.21.6.8</a>, <a href="#7.21.6.14">7.21.6.14</a>                        wcstok function, <a href="#7.28.4.5.7">7.28.4.5.7</a>
33379  vsscanf_s function, <a href="#K.3.5.3.9">K.3.5.3.9</a>, <a href="#K.3.5.3.11">K.3.5.3.11</a>,                   wcstok_s function, <a href="#K.3.9.2.3.1">K.3.9.2.3.1</a>
33380       <a href="#K.3.5.3.14">K.3.5.3.14</a>                                              wcstol function, <a href="#7.8.2.4">7.8.2.4</a>, <a href="#7.21.6.2">7.21.6.2</a>, <a href="#7.28.2.2">7.28.2.2</a>,
33381  vswprintf function, <a href="#7.28.2.7">7.28.2.7</a>, <a href="#K.3.9.1.8">K.3.9.1.8</a>,                         <a href="#7.28.4.1.2">7.28.4.1.2</a>
33382       <a href="#K.3.9.1.9">K.3.9.1.9</a>                                               wcstold function, <a href="#7.28.4.1.1">7.28.4.1.1</a>
33383  vswprintf_s function, <a href="#K.3.9.1.8">K.3.9.1.8</a>, <a href="#K.3.9.1.9">K.3.9.1.9</a>                   wcstoll function, <a href="#7.8.2.4">7.8.2.4</a>, <a href="#7.28.4.1.2">7.28.4.1.2</a>
33384 <!--page 696 -->
33385  wcstombs function, <a href="#7.22.8.2">7.22.8.2</a>, <a href="#7.28.6.4">7.28.6.4</a>                           <a href="#7.29.1">7.29.1</a>
33386  wcstombs_s function, <a href="#K.3.6.5.2">K.3.6.5.2</a>                               wmemchr function, <a href="#7.28.4.5.8">7.28.4.5.8</a>
33387  wcstoul function, <a href="#7.8.2.4">7.8.2.4</a>, <a href="#7.21.6.2">7.21.6.2</a>, <a href="#7.28.2.2">7.28.2.2</a>,               wmemcmp function, <a href="#7.28.4.4.5">7.28.4.4.5</a>
33388       <a href="#7.28.4.1.2">7.28.4.1.2</a>                                              wmemcpy function, <a href="#7.28.4.2.3">7.28.4.2.3</a>
33389  wcstoull function, <a href="#7.8.2.4">7.8.2.4</a>, <a href="#7.28.4.1.2">7.28.4.1.2</a>                       wmemcpy_s function, <a href="#K.3.9.2.1.3">K.3.9.2.1.3</a>
33390  wcstoumax function, <a href="#7.8.2.4">7.8.2.4</a>                                  wmemmove function, <a href="#7.28.4.2.4">7.28.4.2.4</a>
33391  wcsxfrm function, <a href="#7.28.4.4.4">7.28.4.4.4</a>                                 wmemmove_s function, <a href="#K.3.9.2.1.4">K.3.9.2.1.4</a>
33392  wctob function, <a href="#7.28.6.1.2">7.28.6.1.2</a>, <a href="#7.29.2.1">7.29.2.1</a>                         wmemset function, <a href="#7.28.4.6.2">7.28.4.6.2</a>
33393  wctomb function, <a href="#7.22.7.3">7.22.7.3</a>, <a href="#7.22.8.2">7.22.8.2</a>, <a href="#7.28.6.3">7.28.6.3</a>                wprintf function, <a href="#7.21.1">7.21.1</a>, <a href="#7.28.2.9">7.28.2.9</a>, <a href="#7.28.2.11">7.28.2.11</a>,
33394  wctomb_s function, <a href="#K.3.6.4.1">K.3.6.4.1</a>                                    <a href="#K.3.9.1.13">K.3.9.1.13</a>
33395  wctrans function, <a href="#7.29.3.2.1">7.29.3.2.1</a>, <a href="#7.29.3.2.2">7.29.3.2.2</a>                     wprintf_s function, <a href="#K.3.9.1.13">K.3.9.1.13</a>
33396  wctrans_t type, <a href="#7.29.1">7.29.1</a>, <a href="#7.29.3.2.2">7.29.3.2.2</a>                           wscanf function, <a href="#7.21.1">7.21.1</a>, <a href="#7.28.2.10">7.28.2.10</a>, <a href="#7.28.2.12">7.28.2.12</a>,
33397  wctype function, <a href="#7.29.2.2.1">7.29.2.2.1</a>, <a href="#7.29.2.2.2">7.29.2.2.2</a>                         <a href="#7.28.3.10">7.28.3.10</a>
33398  wctype.h header, <a href="#7.29">7.29</a>, <a href="#7.30.13">7.30.13</a>                               wscanf_s function, <a href="#K.3.9.1.12">K.3.9.1.12</a>, <a href="#K.3.9.1.14">K.3.9.1.14</a>
33399  wctype_t type, <a href="#7.29.1">7.29.1</a>, <a href="#7.29.2.2.2">7.29.2.2.2</a>
33400  weaker, <a href="#6.2.8">6.2.8</a>                                                xor macro, <a href="#7.9">7.9</a>
33401  WEOF macro, <a href="#7.28.1">7.28.1</a>, <a href="#7.28.3.1">7.28.3.1</a>, <a href="#7.28.3.3">7.28.3.3</a>, <a href="#7.28.3.6">7.28.3.6</a>,            xor_eq macro, <a href="#7.9">7.9</a>
33402       <a href="#7.28.3.7">7.28.3.7</a>, <a href="#7.28.3.8">7.28.3.8</a>, <a href="#7.28.3.9">7.28.3.9</a>, <a href="#7.28.3.10">7.28.3.10</a>,                xtime type, <a href="#7.25.1">7.25.1</a>, <a href="#7.25.3.5">7.25.3.5</a>, <a href="#7.25.4.4">7.25.4.4</a>, <a href="#7.25.5.7">7.25.5.7</a>,
33403       <a href="#7.28.6.1.1">7.28.6.1.1</a>, <a href="#7.29.1">7.29.1</a>                                          <a href="#7.25.7.1">7.25.7.1</a>
33404  while statement, <a href="#6.8.5.1">6.8.5.1</a>                                     xtime_get function, <a href="#7.25.7.1">7.25.7.1</a>
33405  white space, <a href="#5.1.1.2">5.1.1.2</a>, <a href="#6.4">6.4</a>, <a href="#6.10">6.10</a>, <a href="#7.4.1.10">7.4.1.10</a>,
33406       <a href="#7.29.2.1.10">7.29.2.1.10</a>
33407  white-space characters, <a href="#6.4">6.4</a>
33408  wide character, <a href="#3.7.3">3.7.3</a>
33409    case mapping functions, <a href="#7.29.3.1">7.29.3.1</a>
33410       extensible, <a href="#7.29.3.2">7.29.3.2</a>
33411    classification functions, <a href="#7.29.2.1">7.29.2.1</a>
33412       extensible, <a href="#7.29.2.2">7.29.2.2</a>
33413    constant, <a href="#6.4.4.4">6.4.4.4</a>
33414    formatted input/output functions, <a href="#7.28.2">7.28.2</a>,
33415          <a href="#K.3.9.1">K.3.9.1</a>
33416    input functions, <a href="#7.21.1">7.21.1</a>
33417    input/output functions, <a href="#7.21.1">7.21.1</a>, <a href="#7.28.3">7.28.3</a>
33418    output functions, <a href="#7.21.1">7.21.1</a>
33419    single-byte conversion functions, <a href="#7.28.6.1">7.28.6.1</a>
33420  wide string, <a href="#7.1.1">7.1.1</a>
33421  wide string comparison functions, <a href="#7.28.4.4">7.28.4.4</a>
33422  wide string concatenation functions, <a href="#7.28.4.3">7.28.4.3</a>,
33423       <a href="#K.3.9.2.2">K.3.9.2.2</a>
33424  wide string copying functions, <a href="#7.28.4.2">7.28.4.2</a>, <a href="#K.3.9.2.1">K.3.9.2.1</a>
33425  wide string literal, see string literal
33426  wide string miscellaneous functions, <a href="#7.28.4.6">7.28.4.6</a>,
33427       <a href="#K.3.9.2.4">K.3.9.2.4</a>
33428  wide string numeric conversion functions, <a href="#7.8.2.4">7.8.2.4</a>,
33429       <a href="#7.28.4.1">7.28.4.1</a>
33430  wide string search functions, <a href="#7.28.4.5">7.28.4.5</a>, <a href="#K.3.9.2.3">K.3.9.2.3</a>
33431  wide-oriented stream, <a href="#7.21.2">7.21.2</a>
33432  width, <a href="#6.2.6.2">6.2.6.2</a>
33433  WINT_MAX macro, <a href="#7.20.3">7.20.3</a>
33434  WINT_MIN macro, <a href="#7.20.3">7.20.3</a>
33435  wint_t type, <a href="#7.20.3">7.20.3</a>, <a href="#7.21.6.1">7.21.6.1</a>, <a href="#7.28.1">7.28.1</a>, <a href="#7.28.2.1">7.28.2.1</a>,
33436 </pre>
33437 </body></html>