From Jason Turner

[support.c.headers]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpab51ur0j/{from.md → to.md} +396 -0
tmp/tmpab51ur0j/{from.md → to.md} RENAMED
@@ -0,0 +1,396 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ## C headers <a id="support.c.headers">[[support.c.headers]]</a>
2
+
3
+ ### General <a id="support.c.headers.general">[[support.c.headers.general]]</a>
4
+
5
+ For compatibility with the C standard library, the C++ standard library
6
+ provides the *C headers* shown in [[c.headers]]. The intended use of
7
+ these headers is for interoperability only. It is possible that C++
8
+ source files need to include one of these headers in order to be valid
9
+ ISO C. Source files that are not intended to also be valid ISO C should
10
+ not use any of the C headers.
11
+
12
+ [*Note 1*: The C headers either have no effect, such as `<stdbool.h>`
13
+ and `<stdalign.h>`, or otherwise the corresponding header of the form
14
+ `<cname>` provides the same facilities and assuredly defines them in
15
+ namespace `std`. — *end note*]
16
+
17
+ [*Example 1*:
18
+
19
+ The following source file is both valid C++ and valid ISO C. Viewed as
20
+ C++, it declares a function with C language linkage; viewed as C it
21
+ simply declares a function (and provides a prototype).
22
+
23
+ ``` cpp
24
+ #include <stdbool.h> // for bool in C, no effect in C++{}
25
+ #include <stddef.h> // for size_t
26
+
27
+ #ifdef __cplusplus // see [cpp.predefined]
28
+ extern "C" // see [dcl.link]
29
+ #endif
30
+ void f(bool b[], size_t n);
31
+ ```
32
+
33
+ — *end example*]
34
+
35
+ ### Header `<complex.h>` synopsis <a id="complex.h.syn">[[complex.h.syn]]</a>
36
+
37
+ ``` cpp
38
+ #include <complex>
39
+ ```
40
+
41
+ The header `<complex.h>` behaves as if it simply includes the header
42
+ `<complex>`.
43
+
44
+ [*Note 1*: Names introduced by `<complex>` in namespace `std` are not
45
+ placed into the global namespace scope by `<complex.h>`. — *end note*]
46
+
47
+ ### Header `<iso646.h>` synopsis <a id="iso646.h.syn">[[iso646.h.syn]]</a>
48
+
49
+ The C++ header `<iso646.h>` is empty.
50
+
51
+ [*Note 1*: `and`, `and_eq`, `bitand`, `bitor`, `compl`, `not_eq`,
52
+ `not`, `or`, `or_eq`, `xor`, and `xor_eq` are keywords in C++
53
+ [[lex.key]]. — *end note*]
54
+
55
+ ### Header `<stdalign.h>` synopsis <a id="stdalign.h.syn">[[stdalign.h.syn]]</a>
56
+
57
+ The contents of the C++ header `<stdalign.h>` are the same as the C
58
+ standard library header `<stdalign.h>`, with the following changes: The
59
+ header `<stdalign.h>` does not define a macro named `alignas`.
60
+
61
+ See also: ISO C 7.15
62
+
63
+ ### Header `<stdbool.h>` synopsis <a id="stdbool.h.syn">[[stdbool.h.syn]]</a>
64
+
65
+ The contents of the C++ header `<stdbool.h>` are the same as the C
66
+ standard library header `<stdbool.h>`, with the following changes: The
67
+ header `<stdbool.h>` does not define macros named `bool`, `true`, or
68
+ `false`.
69
+
70
+ See also: ISO C 7.18
71
+
72
+ ### Header `<tgmath.h>` synopsis <a id="tgmath.h.syn">[[tgmath.h.syn]]</a>
73
+
74
+ ``` cpp
75
+ #include <cmath>
76
+ #include <complex>
77
+ ```
78
+
79
+ The header `<tgmath.h>` behaves as if it simply includes the headers
80
+ `<cmath>` and `<complex>`.
81
+
82
+ [*Note 1*: The overloads provided in C by type-generic macros are
83
+ already provided in `<complex>` and `<cmath>` by “sufficient” additional
84
+ overloads. — *end note*]
85
+
86
+ [*Note 2*: Names introduced by `<cmath>` or `<complex>` in namespace
87
+ `std` are not placed into the global namespace scope by
88
+ `<tgmath.h>`. — *end note*]
89
+
90
+ ### Other C headers <a id="support.c.headers.other">[[support.c.headers.other]]</a>
91
+
92
+ Every C header other than `<complex.h>`, `<iso646.h>`, `<stdalign.h>`,
93
+ `<stdatomic.h>`, `<stdbool.h>`, and `<tgmath.h>`, each of which has a
94
+ name of the form `<name.h>`, behaves as if each name placed in the
95
+ standard library namespace by the corresponding `<cname>` header is
96
+ placed within the global namespace scope, except for the functions
97
+ described in [[sf.cmath]], the `std::lerp` function overloads
98
+ [[c.math.lerp]], the declaration of `std::byte` [[cstddef.syn]], and the
99
+ functions and function templates described in [[support.types.byteops]].
100
+ It is unspecified whether these names are first declared or defined
101
+ within namespace scope [[basic.scope.namespace]] of the namespace `std`
102
+ and are then injected into the global namespace scope by explicit
103
+ *using-declaration*s [[namespace.udecl]].
104
+
105
+ [*Example 1*: The header `<cstdlib>` assuredly provides its
106
+ declarations and definitions within the namespace `std`. It may also
107
+ provide these names within the global namespace. The header `<stdlib.h>`
108
+ assuredly provides the same declarations and definitions within the
109
+ global namespace, much as in the C Standard. It may also provide these
110
+ names within the namespace `std`. — *end example*]
111
+
112
+ <!-- Link reference definitions -->
113
+ [alg.c.library]: algorithms.md#alg.c.library
114
+ [alloc.errors]: #alloc.errors
115
+ [atomics]: thread.md#atomics
116
+ [bad.alloc]: #bad.alloc
117
+ [bad.cast]: #bad.cast
118
+ [bad.exception]: #bad.exception
119
+ [bad.typeid]: #bad.typeid
120
+ [basic.align]: basic.md#basic.align
121
+ [basic.compound]: basic.md#basic.compound
122
+ [basic.extended.fp]: basic.md#basic.extended.fp
123
+ [basic.fundamental]: basic.md#basic.fundamental
124
+ [basic.life]: basic.md#basic.life
125
+ [basic.lookup.argdep]: basic.md#basic.lookup.argdep
126
+ [basic.scope.namespace]: basic.md#basic.scope.namespace
127
+ [basic.start.dynamic]: basic.md#basic.start.dynamic
128
+ [basic.start.term]: basic.md#basic.start.term
129
+ [basic.stc.dynamic]: basic.md#basic.stc.dynamic
130
+ [basic.stc.dynamic.allocation]: basic.md#basic.stc.dynamic.allocation
131
+ [basic.stc.dynamic.deallocation]: basic.md#basic.stc.dynamic.deallocation
132
+ [c.headers]: #c.headers
133
+ [c.locales]: localization.md#c.locales
134
+ [c.malloc]: mem.md#c.malloc
135
+ [c.math.abs]: numerics.md#c.math.abs
136
+ [c.math.lerp]: numerics.md#c.math.lerp
137
+ [c.math.rand]: numerics.md#c.math.rand
138
+ [c.mb.wcs]: strings.md#c.mb.wcs
139
+ [cfloat.syn]: #cfloat.syn
140
+ [class.mem]: class.md#class.mem
141
+ [class.prop]: class.md#class.prop
142
+ [class.spaceship]: class.md#class.spaceship
143
+ [climits.syn]: #climits.syn
144
+ [cmp]: #cmp
145
+ [cmp.alg]: #cmp.alg
146
+ [cmp.categories]: #cmp.categories
147
+ [cmp.categories.pre]: #cmp.categories.pre
148
+ [cmp.common]: #cmp.common
149
+ [cmp.concept]: #cmp.concept
150
+ [cmp.partialord]: #cmp.partialord
151
+ [cmp.result]: #cmp.result
152
+ [cmp.strongord]: #cmp.strongord
153
+ [cmp.weakord]: #cmp.weakord
154
+ [compare.syn]: #compare.syn
155
+ [complex]: numerics.md#complex
156
+ [complex.h.syn]: #complex.h.syn
157
+ [concept.totallyordered]: concepts.md#concept.totallyordered
158
+ [concepts.compare.general]: concepts.md#concepts.compare.general
159
+ [constraints]: library.md#constraints
160
+ [conv.prom]: expr.md#conv.prom
161
+ [conv.ptr]: expr.md#conv.ptr
162
+ [conv.qual]: expr.md#conv.qual
163
+ [conv.rank]: basic.md#conv.rank
164
+ [coroutine.handle]: #coroutine.handle
165
+ [coroutine.handle.compare]: #coroutine.handle.compare
166
+ [coroutine.handle.con]: #coroutine.handle.con
167
+ [coroutine.handle.conv]: #coroutine.handle.conv
168
+ [coroutine.handle.export.import]: #coroutine.handle.export.import
169
+ [coroutine.handle.general]: #coroutine.handle.general
170
+ [coroutine.handle.hash]: #coroutine.handle.hash
171
+ [coroutine.handle.noop]: #coroutine.handle.noop
172
+ [coroutine.handle.noop.address]: #coroutine.handle.noop.address
173
+ [coroutine.handle.noop.conv]: #coroutine.handle.noop.conv
174
+ [coroutine.handle.noop.observers]: #coroutine.handle.noop.observers
175
+ [coroutine.handle.noop.promise]: #coroutine.handle.noop.promise
176
+ [coroutine.handle.noop.resumption]: #coroutine.handle.noop.resumption
177
+ [coroutine.handle.observers]: #coroutine.handle.observers
178
+ [coroutine.handle.promise]: #coroutine.handle.promise
179
+ [coroutine.handle.resumption]: #coroutine.handle.resumption
180
+ [coroutine.noop]: #coroutine.noop
181
+ [coroutine.noop.coroutine]: #coroutine.noop.coroutine
182
+ [coroutine.promise.noop]: #coroutine.promise.noop
183
+ [coroutine.syn]: #coroutine.syn
184
+ [coroutine.traits]: #coroutine.traits
185
+ [coroutine.traits.general]: #coroutine.traits.general
186
+ [coroutine.traits.primary]: #coroutine.traits.primary
187
+ [coroutine.trivial.awaitables]: #coroutine.trivial.awaitables
188
+ [cpp.line]: cpp.md#cpp.line
189
+ [cpp17.nullablepointer]: #cpp17.nullablepointer
190
+ [csetjmp.syn]: #csetjmp.syn
191
+ [csignal.syn]: #csignal.syn
192
+ [cstdarg.syn]: #cstdarg.syn
193
+ [cstddef.syn]: #cstddef.syn
194
+ [cstdint.syn]: #cstdint.syn
195
+ [cstdlib.syn]: #cstdlib.syn
196
+ [customization.point.object]: library.md#customization.point.object
197
+ [dcl.fct.def.coroutine]: dcl.md#dcl.fct.def.coroutine
198
+ [dcl.fct.default]: dcl.md#dcl.fct.default
199
+ [dcl.init.list]: dcl.md#dcl.init.list
200
+ [defns.expression.equivalent]: intro.md#defns.expression.equivalent
201
+ [except.handle]: except.md#except.handle
202
+ [except.nested]: #except.nested
203
+ [except.spec]: except.md#except.spec
204
+ [except.terminate]: except.md#except.terminate
205
+ [except.uncaught]: except.md#except.uncaught
206
+ [exception]: #exception
207
+ [exception.syn]: #exception.syn
208
+ [exception.terminate]: #exception.terminate
209
+ [expr.add]: expr.md#expr.add
210
+ [expr.await]: expr.md#expr.await
211
+ [expr.call]: expr.md#expr.call
212
+ [expr.context]: expr.md#expr.context
213
+ [expr.delete]: expr.md#expr.delete
214
+ [expr.dynamic.cast]: expr.md#expr.dynamic.cast
215
+ [expr.eq]: expr.md#expr.eq
216
+ [expr.new]: expr.md#expr.new
217
+ [expr.prim.lambda]: expr.md#expr.prim.lambda
218
+ [expr.rel]: expr.md#expr.rel
219
+ [expr.sizeof]: expr.md#expr.sizeof
220
+ [expr.spaceship]: expr.md#expr.spaceship
221
+ [expr.typeid]: expr.md#expr.typeid
222
+ [get.new.handler]: #get.new.handler
223
+ [get.terminate]: #get.terminate
224
+ [hardware.interference]: #hardware.interference
225
+ [initializer.list.syn]: #initializer.list.syn
226
+ [intro.multithread]: basic.md#intro.multithread
227
+ [iso646.h.syn]: #iso646.h.syn
228
+ [lex.key]: lex.md#lex.key
229
+ [library.c]: library.md#library.c
230
+ [limits.syn]: #limits.syn
231
+ [locale.codecvt]: localization.md#locale.codecvt
232
+ [multibyte.strings]: library.md#multibyte.strings
233
+ [namespace.udecl]: dcl.md#namespace.udecl
234
+ [new.badlength]: #new.badlength
235
+ [new.delete]: #new.delete
236
+ [new.delete.array]: #new.delete.array
237
+ [new.delete.dataraces]: #new.delete.dataraces
238
+ [new.delete.general]: #new.delete.general
239
+ [new.delete.placement]: #new.delete.placement
240
+ [new.delete.single]: #new.delete.single
241
+ [new.handler]: #new.handler
242
+ [new.syn]: #new.syn
243
+ [numeric.limits]: #numeric.limits
244
+ [numeric.limits.general]: #numeric.limits.general
245
+ [numeric.limits.members]: #numeric.limits.members
246
+ [numeric.special]: #numeric.special
247
+ [propagation]: #propagation
248
+ [ptr.launder]: #ptr.launder
249
+ [res.on.data.races]: library.md#res.on.data.races
250
+ [round.style]: #round.style
251
+ [set.new.handler]: #set.new.handler
252
+ [set.terminate]: #set.terminate
253
+ [sf.cmath]: numerics.md#sf.cmath
254
+ [source.location.syn]: #source.location.syn
255
+ [stdalign.h.syn]: #stdalign.h.syn
256
+ [stdbool.h.syn]: #stdbool.h.syn
257
+ [stdfloat.syn]: #stdfloat.syn
258
+ [stmt.dcl]: stmt.md#stmt.dcl
259
+ [string.classes]: strings.md#string.classes
260
+ [support]: #support
261
+ [support.arith.types]: #support.arith.types
262
+ [support.c.headers]: #support.c.headers
263
+ [support.c.headers.general]: #support.c.headers.general
264
+ [support.c.headers.other]: #support.c.headers.other
265
+ [support.coroutine]: #support.coroutine
266
+ [support.coroutine.general]: #support.coroutine.general
267
+ [support.dynamic]: #support.dynamic
268
+ [support.dynamic.general]: #support.dynamic.general
269
+ [support.exception]: #support.exception
270
+ [support.exception.general]: #support.exception.general
271
+ [support.general]: #support.general
272
+ [support.initlist]: #support.initlist
273
+ [support.initlist.access]: #support.initlist.access
274
+ [support.initlist.cons]: #support.initlist.cons
275
+ [support.initlist.general]: #support.initlist.general
276
+ [support.initlist.range]: #support.initlist.range
277
+ [support.limits]: #support.limits
278
+ [support.limits.general]: #support.limits.general
279
+ [support.rtti]: #support.rtti
280
+ [support.rtti.general]: #support.rtti.general
281
+ [support.runtime]: #support.runtime
282
+ [support.runtime.general]: #support.runtime.general
283
+ [support.signal]: #support.signal
284
+ [support.srcloc]: #support.srcloc
285
+ [support.srcloc.class]: #support.srcloc.class
286
+ [support.srcloc.class.general]: #support.srcloc.class.general
287
+ [support.srcloc.cons]: #support.srcloc.cons
288
+ [support.srcloc.current]: #support.srcloc.current
289
+ [support.srcloc.obs]: #support.srcloc.obs
290
+ [support.start.term]: #support.start.term
291
+ [support.summary]: #support.summary
292
+ [support.types]: #support.types
293
+ [support.types.byteops]: #support.types.byteops
294
+ [support.types.layout]: #support.types.layout
295
+ [support.types.nullptr]: #support.types.nullptr
296
+ [swappable.requirements]: library.md#swappable.requirements
297
+ [temp.deduct]: temp.md#temp.deduct
298
+ [temp.dep.constexpr]: temp.md#temp.dep.constexpr
299
+ [temp.dep.expr]: temp.md#temp.dep.expr
300
+ [temp.variadic]: temp.md#temp.variadic
301
+ [term.odr.use]: basic.md#term.odr.use
302
+ [terminate]: #terminate
303
+ [terminate.handler]: #terminate.handler
304
+ [tgmath.h.syn]: #tgmath.h.syn
305
+ [type.info]: #type.info
306
+ [typeinfo.syn]: #typeinfo.syn
307
+ [uncaught.exceptions]: #uncaught.exceptions
308
+ [unord.hash]: utilities.md#unord.hash
309
+ [utility.arg.requirements]: library.md#utility.arg.requirements
310
+ [version.syn]: #version.syn
311
+
312
+ [^1]: Possible definitions include `0` and `0L`, but not `(void*)0`.
313
+
314
+ [^2]: Note that `offsetof` is required to work as specified even if
315
+ unary `operator&` is overloaded for any of the types involved.
316
+
317
+ [^3]: Equivalent to `CHAR_MIN`, `SHRT_MIN`, `FLT_MIN`, `DBL_MIN`, etc.
318
+
319
+ [^4]: Equivalent to `CHAR_MAX`, `SHRT_MAX`, `FLT_MAX`, `DBL_MAX`, etc.
320
+
321
+ [^5]: `lowest()` is necessary because not all floating-point
322
+ representations have a smallest (most negative) value that is the
323
+ negative of the largest (most positive) finite value.
324
+
325
+ [^6]: Equivalent to `FLT_MANT_DIG`, `DBL_MANT_DIG`, `LDBL_MANT_DIG`.
326
+
327
+ [^7]: Equivalent to `FLT_DIG`, `DBL_DIG`, `LDBL_DIG`.
328
+
329
+ [^8]: Equivalent to `FLT_RADIX`.
330
+
331
+ [^9]: Distinguishes types with bases other than 2 (e.g., BCD).
332
+
333
+ [^10]: Equivalent to `FLT_EPSILON`, `DBL_EPSILON`, `LDBL_EPSILON`.
334
+
335
+ [^11]: Rounding error is described in LIA-1 Section 5.2.4 and Annex C
336
+ Rationale Section C.5.2.4 — Rounding and rounding constants.
337
+
338
+ [^12]: Equivalent to `FLT_MIN_EXP`, `DBL_MIN_EXP`, `LDBL_MIN_EXP`.
339
+
340
+ [^13]: Equivalent to `FLT_MIN_10_EXP`, `DBL_MIN_10_EXP`,
341
+ `LDBL_MIN_10_EXP`.
342
+
343
+ [^14]: Equivalent to `FLT_MAX_EXP`, `DBL_MAX_EXP`, `LDBL_MAX_EXP`.
344
+
345
+ [^15]: Equivalent to `FLT_MAX_10_EXP`, `DBL_MAX_10_EXP`,
346
+ `LDBL_MAX_10_EXP`.
347
+
348
+ [^16]: Required by LIA-1.
349
+
350
+ [^17]: Required by LIA-1.
351
+
352
+ [^18]: Required by LIA-1.
353
+
354
+ [^19]: Required by LIA-1.
355
+
356
+ [^20]: Required by LIA-1.
357
+
358
+ [^21]: Required by LIA-1.
359
+
360
+ [^22]: ISO/IEC/IEEE 60559:2020 is the same as IEEE 754-2019.
361
+
362
+ [^23]: Required by LIA-1.
363
+
364
+ [^24]: Required by LIA-1.
365
+
366
+ [^25]: Required by LIA-1.
367
+
368
+ [^26]: Refer to ISO/IEC/IEEE 60559. Required by LIA-1.
369
+
370
+ [^27]: Equivalent to `FLT_ROUNDS`. Required by LIA-1.
371
+
372
+ [^28]: A function is called for every time it is registered.
373
+
374
+ [^29]: Objects with automatic storage duration are all destroyed in a
375
+ program whose `main` function [[basic.start.main]] contains no
376
+ objects with automatic storage duration and executes the call to
377
+ `exit()`. Control can be transferred directly to such a `main`
378
+ function by throwing an exception that is caught in `main`.
379
+
380
+ [^30]: The macros `EXIT_FAILURE` and `EXIT_SUCCESS` are defined in
381
+ `<cstdlib>`.
382
+
383
+ [^31]: It is not the direct responsibility of `operator new[]` or
384
+ `operator delete[]` to note the repetition count or element size of
385
+ the array. Those operations are performed elsewhere in the array
386
+ `new` and `delete` expressions. The array `new` expression, can,
387
+ however, increase the `size` argument to `operator new[]` to obtain
388
+ space to store supplemental information.
389
+
390
+ [^32]: That is, `a < b`, `a == b`, and `a > b` might all be `false`.
391
+
392
+ [^33]: Note that `va_start` is required to work as specified even if
393
+ unary `operator&` is overloaded for the type of `parmN`.
394
+
395
+ [^34]: Such initialization can occur because it is the first odr-use
396
+ [[term.odr.use]] of that variable.