Skip to content

Commit 25c4cf7

Browse files
committed
P2340R1 Clarifying the status of the "C headers"
1 parent 2360a59 commit 25c4cf7

File tree

5 files changed

+232
-195
lines changed

5 files changed

+232
-195
lines changed

source/compatibility.tex

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2098,7 +2098,7 @@
20982098
\effect
20992099
A valid ISO C expression utilizing the decrement operator on
21002100
a \tcode{bool} lvalue
2101-
(for instance, via the C typedef in \libdeprheaderref{stdbool.h})
2101+
(for instance, via the C typedef in \libheaderref{stdbool.h})
21022102
is ill-formed in \Cpp{}.
21032103

21042104
\diffref{expr.sizeof,expr.cast}
@@ -2726,7 +2726,7 @@
27262726
\pnum
27272727
For compatibility with the C standard library\indextext{library!C standard},
27282728
the \Cpp{} standard library provides the C headers enumerated
2729-
in~\ref{depr.c.headers}, but their use is deprecated in \Cpp{}.
2729+
in~\ref{support.c.headers}, but their use is deprecated in \Cpp{}.
27302730

27312731
\pnum
27322732
There are no \Cpp{} headers for the C standard library's headers
@@ -2789,15 +2789,15 @@
27892789
\tcode{xor_eq}
27902790
are keywords in \Cpp{}\iref{lex.key},
27912791
and are not introduced as macros
2792-
by \libdeprheaderref{iso646.h}.
2792+
by \libheaderref{iso646.h}.
27932793

27942794
\rSec3[diff.header.stdalign.h]{Header \tcode{<stdalign.h>}}
27952795
\indexhdr{stdalign.h}%
27962796

27972797
\pnum
27982798
The token \tcode{alignas} is a keyword in \Cpp{}\iref{lex.key},
27992799
and is not introduced as a macro
2800-
by \libdeprheaderref{stdalign.h}.
2800+
by \libheaderref{stdalign.h}.
28012801

28022802
\rSec3[diff.header.stdbool.h]{Header \tcode{<stdbool.h>}}
28032803
\indexhdr{stdbool.h}%
@@ -2806,7 +2806,7 @@
28062806
The tokens \tcode{bool}, \tcode{true}, and \tcode{false}
28072807
are keywords in \Cpp{}\iref{lex.key},
28082808
and are not introduced as macros
2809-
by \libdeprheaderref{stdbool.h}.
2809+
by \libheaderref{stdbool.h}.
28102810

28112811
\rSec3[diff.null]{Macro \tcode{NULL}}
28122812

@@ -2859,7 +2859,7 @@
28592859
declares the names \tcode{nullptr_t}, \tcode{byte}, and \tcode{to_integer},
28602860
and the operators and operator templates in \iref{support.types.byteops},
28612861
in addition to the names declared in
2862-
\libheaderrefx{stddef.h}{depr.c.headers} in the C standard library.
2862+
\libheaderrefx{stddef.h}{support.c.headers} in the C standard library.
28632863

28642864
\rSec2[diff.mods.to.behavior]{Modifications to behavior}
28652865

source/future.tex

Lines changed: 0 additions & 185 deletions
Original file line numberDiff line numberDiff line change
@@ -214,191 +214,6 @@
214214
before the qualified name of a class or alias template
215215
without a template argument list is deprecated.
216216

217-
\rSec1[depr.c.headers]{C headers}
218-
219-
\rSec2[depr.c.headers.general]{General}
220-
221-
\pnum
222-
For compatibility with the
223-
\indextext{library!C standard}%
224-
C standard library, the \Cpp{} standard library provides
225-
the \defnx{C headers}{headers!C library} shown in \tref{depr.c.headers}.
226-
227-
\begin{multicolfloattable}{C headers}{depr.c.headers}
228-
{lllll}
229-
\libheaderdef{assert.h} \\
230-
\libheader{complex.h} \\
231-
\libheaderdef{ctype.h} \\
232-
\libheaderdef{errno.h} \\
233-
\libheaderdef{fenv.h} \\
234-
\libheaderdef{float.h} \\
235-
\columnbreak
236-
\libheaderdef{inttypes.h} \\
237-
\libheader{iso646.h} \\
238-
\libheaderdef{limits.h} \\
239-
\libheaderdef{locale.h} \\
240-
\libheaderdef{math.h} \\
241-
\libheaderdef{setjmp.h} \\
242-
\columnbreak
243-
\libheaderdef{signal.h} \\
244-
\libheader{stdalign.h} \\
245-
\libheaderdef{stdarg.h} \\
246-
\libheader{stdatomic.h} \\
247-
\libheader{stdbool.h} \\
248-
\libheaderdef{stddef.h} \\
249-
\columnbreak
250-
\libheaderdef{stdint.h} \\
251-
\libheaderdef{stdio.h} \\
252-
\libheaderdef{stdlib.h} \\
253-
\libheaderdef{string.h} \\
254-
\libheader{tgmath.h} \\
255-
\libheaderdef{time.h} \\
256-
\columnbreak
257-
\libheaderdef{uchar.h} \\
258-
\libheaderdef{wchar.h} \\
259-
\libheaderdef{wctype.h} \\
260-
\end{multicolfloattable}
261-
262-
\rSec2[depr.complex.h.syn]{Header \tcode{<complex.h>} synopsis}
263-
264-
\indexheader{complex.h}%
265-
\begin{codeblock}
266-
#include <complex>
267-
\end{codeblock}
268-
269-
\pnum
270-
The header \libheader{complex.h}
271-
behaves as if it simply includes the header
272-
\libheaderref{complex}.
273-
274-
\pnum
275-
\begin{note}
276-
Names introduced by \libheader{complex} in namespace \tcode{std}
277-
are not placed into the global namespace scope by \libheader{complex.h}.
278-
\end{note}
279-
280-
\rSec2[depr.iso646.h.syn]{Header \tcode{<iso646.h>} synopsis}
281-
282-
\indexheader{iso646.h}%
283-
\pnum
284-
The \Cpp{} header \libheader{iso646.h} is empty.
285-
\begin{note}
286-
\tcode{and},
287-
\tcode{and_eq},
288-
\tcode{bitand},
289-
\tcode{bitor},
290-
\tcode{compl},
291-
\tcode{not_eq},
292-
\tcode{not},
293-
\tcode{or},
294-
\tcode{or_eq},
295-
\tcode{xor}, and
296-
\tcode{xor_eq}
297-
are keywords in \Cpp{}\iref{lex.key}.
298-
\end{note}
299-
300-
\rSec2[depr.stdalign.h.syn]{Header \tcode{<stdalign.h>} synopsis}
301-
302-
\indexheader{stdalign.h}%
303-
\indexlibraryglobal{__alignas_is_defined}%
304-
\begin{codeblock}
305-
#define @\xname{alignas_is_defined}@ 1
306-
\end{codeblock}
307-
308-
\pnum
309-
The contents of the \Cpp{} header \libheader{stdalign.h} are the same as the C
310-
standard library header \libheader{stdalign.h}, with the following changes:
311-
The header \libheader{stdalign.h} does not
312-
define a macro named \tcode{alignas}.
313-
314-
\xrefc{7.15}
315-
316-
\rSec2[depr.stdbool.h.syn]{Header \tcode{<stdbool.h>} synopsis}
317-
318-
\indexheader{stdbool.h}%
319-
\indexhdr{stdbool.h}%
320-
\indexlibraryglobal{__bool_true_false_are_defined}%
321-
\begin{codeblock}
322-
#define @\xname{bool_true_false_are_defined}@ 1
323-
\end{codeblock}
324-
325-
\pnum
326-
The contents of the \Cpp{} header \libheader{stdbool.h} are the same as the C
327-
standard library header \libheader{stdbool.h}, with the following changes:
328-
The header \libheader{stdbool.h} does not
329-
define macros named \tcode{bool}, \tcode{true}, or \tcode{false}.
330-
331-
\xrefc{7.18}
332-
333-
\rSec2[depr.tgmath.h.syn]{Header \tcode{<tgmath.h>} synopsis}
334-
335-
\indexheader{tgmath.h}%
336-
\begin{codeblock}
337-
#include <cmath>
338-
#include <complex>
339-
\end{codeblock}
340-
341-
\pnum
342-
The header \libheader{tgmath.h}
343-
behaves as if it simply includes the headers
344-
\libheaderref{cmath} and
345-
\libheaderref{complex}.
346-
347-
\pnum
348-
\begin{note}
349-
The overloads provided in C by type-generic macros
350-
are already provided in \libheader{complex} and \libheader{cmath}
351-
by ``sufficient'' additional overloads.
352-
\end{note}
353-
354-
\pnum
355-
\begin{note}
356-
Names introduced by \libheader{cmath} or \libheader{complex}
357-
in namespace \tcode{std}
358-
are not placed into the global namespace scope by \libheader{tgmath.h}.
359-
\end{note}
360-
361-
\rSec2[depr.c.headers.other]{Other C headers}
362-
363-
\pnum
364-
Every C header
365-
other than
366-
\libdeprheaderref{complex.h},
367-
\libdeprheaderref{iso646.h},
368-
\libdeprheaderref{stdalign.h},\newline
369-
\libheaderref{stdatomic.h},
370-
\libdeprheaderref{stdbool.h}, and
371-
\libdeprheaderref{tgmath.h},
372-
each of
373-
which has a name of the form
374-
\indextext{header!C}%
375-
\tcode{<\placeholder{name}.h>},
376-
behaves as if each name placed in the standard library namespace by
377-
the corresponding
378-
\tcode{<c\placeholder{name}>}
379-
header is placed within
380-
the global namespace scope,
381-
except for the functions described in \ref{sf.cmath},
382-
the declaration of \tcode{std::byte}\iref{cstddef.syn}, and
383-
the functions and function templates described in \ref{support.types.byteops}.
384-
It is unspecified whether these names are first declared or defined within
385-
namespace scope\iref{basic.scope.namespace} of the namespace
386-
\tcode{std} and are then injected into the global namespace scope by
387-
explicit \grammarterm{using-declaration}{s}\iref{namespace.udecl}.
388-
389-
\pnum
390-
\begin{example}
391-
The header \libheader{cstdlib} assuredly
392-
provides its declarations and definitions within the namespace
393-
\tcode{std}. It may also provide these names within the
394-
global namespace.
395-
The header \libheader{stdlib.h}
396-
assuredly provides the same declarations and definitions within
397-
the global namespace,
398-
much as in the C Standard. It may also provide these names within
399-
the namespace \tcode{std}.
400-
\end{example}
401-
402217
\rSec1[depr.res.on.required]{Requires paragraph}
403218

404219
\pnum

source/lib-intro.tex

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -907,7 +907,7 @@
907907
or namespaces nested within namespace
908908
\tcode{std}.
909909
\begin{footnote}
910-
The C standard library headers\iref{depr.c.headers} also define
910+
The C standard library headers\iref{support.c.headers} also define
911911
names within the global namespace, while the \Cpp{} headers for C library
912912
facilities\iref{headers} can also define names within the global namespace.
913913
\end{footnote}
@@ -1144,7 +1144,7 @@
11441144
\end{footnote}
11451145

11461146
\pnum
1147-
\ref{depr.c.headers}, C standard library headers, describes the effects of using
1147+
\ref{support.c.headers}, C standard library headers, describes the effects of using
11481148
the \tcode{\placeholder{name}.h} (C header) form in a \Cpp{} program.
11491149
\begin{footnote}
11501150
The
@@ -1352,7 +1352,7 @@
13521352
\indextext{unit!translation}%
13531353
Each may be included more than once, with no effect different from
13541354
being included exactly once, except that the effect of including either
1355-
\libheaderref{cassert} or \libheaderrefx{assert.h}{depr.c.headers}
1355+
\libheaderref{cassert} or \libheaderrefx{assert.h}{support.c.headers}
13561356
depends each time on the lexically current definition of
13571357
\indextext{\idxcode{NDEBUG}}%
13581358
\indexlibraryglobal{NDEBUG}%
@@ -2892,7 +2892,7 @@
28922892
included after any other header that also defines it\iref{basic.def.odr}.
28932893

28942894
\pnum
2895-
The C standard library headers\iref{depr.c.headers}
2895+
The C standard library headers\iref{support.c.headers}
28962896
shall include only their corresponding \Cpp{} standard library header,
28972897
as described in~\ref{headers}.
28982898

0 commit comments

Comments
 (0)