Skip to content

Commit 24ccaf8

Browse files
jensmaurertkoeppe
authored andcommitted
P2340R1 Clarifying the status of the "C headers"
1 parent a8669d8 commit 24ccaf8

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
@@ -2166,7 +2166,7 @@
21662166
\effect
21672167
A valid ISO C expression utilizing the decrement operator on
21682168
a \tcode{bool} lvalue
2169-
(for instance, via the C typedef in \libdeprheaderref{stdbool.h})
2169+
(for instance, via the C typedef in \libheaderref{stdbool.h})
21702170
is ill-formed in \Cpp{}.
21712171

21722172
\diffref{expr.sizeof,expr.cast}
@@ -2794,7 +2794,7 @@
27942794
\pnum
27952795
For compatibility with the C standard library\indextext{library!C standard},
27962796
the \Cpp{} standard library provides the C headers enumerated
2797-
in~\ref{depr.c.headers}, but their use is deprecated in \Cpp{}.
2797+
in~\ref{support.c.headers}, but their use is deprecated in \Cpp{}.
27982798

27992799
\pnum
28002800
There are no \Cpp{} headers for the C standard library's headers
@@ -2857,15 +2857,15 @@
28572857
\tcode{xor_eq}
28582858
are keywords in \Cpp{}\iref{lex.key},
28592859
and are not introduced as macros
2860-
by \libdeprheaderref{iso646.h}.
2860+
by \libheaderref{iso646.h}.
28612861

28622862
\rSec3[diff.header.stdalign.h]{Header \tcode{<stdalign.h>}}
28632863
\indexhdr{stdalign.h}%
28642864

28652865
\pnum
28662866
The token \tcode{alignas} is a keyword in \Cpp{}\iref{lex.key},
28672867
and is not introduced as a macro
2868-
by \libdeprheaderref{stdalign.h}.
2868+
by \libheaderref{stdalign.h}.
28692869

28702870
\rSec3[diff.header.stdbool.h]{Header \tcode{<stdbool.h>}}
28712871
\indexhdr{stdbool.h}%
@@ -2874,7 +2874,7 @@
28742874
The tokens \tcode{bool}, \tcode{true}, and \tcode{false}
28752875
are keywords in \Cpp{}\iref{lex.key},
28762876
and are not introduced as macros
2877-
by \libdeprheaderref{stdbool.h}.
2877+
by \libheaderref{stdbool.h}.
28782878

28792879
\rSec3[diff.null]{Macro \tcode{NULL}}
28802880

@@ -2927,7 +2927,7 @@
29272927
declares the names \tcode{nullptr_t}, \tcode{byte}, and \tcode{to_integer},
29282928
and the operators and operator templates in \iref{support.types.byteops},
29292929
in addition to the names declared in
2930-
\libheaderrefx{stddef.h}{depr.c.headers} in the C standard library.
2930+
\libheaderrefx{stddef.h}{support.c.headers} in the C standard library.
29312931

29322932
\rSec2[diff.mods.to.behavior]{Modifications to behavior}
29332933

source/future.tex

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

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

386201
\pnum

source/lib-intro.tex

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -913,7 +913,7 @@
913913
or namespaces nested within namespace
914914
\tcode{std}.
915915
\begin{footnote}
916-
The C standard library headers\iref{depr.c.headers} also define
916+
The C standard library headers\iref{support.c.headers} also define
917917
names within the global namespace, while the \Cpp{} headers for C library
918918
facilities\iref{headers} can also define names within the global namespace.
919919
\end{footnote}
@@ -1150,7 +1150,7 @@
11501150
\end{footnote}
11511151

11521152
\pnum
1153-
\ref{depr.c.headers}, C standard library headers, describes the effects of using
1153+
\ref{support.c.headers}, C standard library headers, describes the effects of using
11541154
the \tcode{\placeholder{name}.h} (C header) form in a \Cpp{} program.
11551155
\begin{footnote}
11561156
The
@@ -1358,7 +1358,7 @@
13581358
\indextext{unit!translation}%
13591359
Each may be included more than once, with no effect different from
13601360
being included exactly once, except that the effect of including either
1361-
\libheaderref{cassert} or \libheaderrefx{assert.h}{depr.c.headers}
1361+
\libheaderref{cassert} or \libheaderrefx{assert.h}{support.c.headers}
13621362
depends each time on the lexically current definition of
13631363
\indextext{\idxcode{NDEBUG}}%
13641364
\indexlibraryglobal{NDEBUG}%
@@ -2898,7 +2898,7 @@
28982898
included after any other header that also defines it\iref{basic.def.odr}.
28992899

29002900
\pnum
2901-
The C standard library headers\iref{depr.c.headers}
2901+
The C standard library headers\iref{support.c.headers}
29022902
shall include only their corresponding \Cpp{} standard library header,
29032903
as described in~\ref{headers}.
29042904

0 commit comments

Comments
 (0)