Skip to content

Commit 16b35d6

Browse files
committed
[depr.c.headers] Undo P0619R4's removal of synopses for <ccomplex>,
<cstdalign>, <cstdbool>, and <ctgmath>. Instead, repurpose these to be synopses for <complex.h>, <stdalign.h>, <stdbool.h>, and <tgmath.h>, and move them into [depr.c.headers]. Also introduce a synopsis for <iso646.h>. This avoids three of these five headers being specified as equivalent to a non-existent <cfoo> header, and the other two missing a synopsis.
1 parent 577dee5 commit 16b35d6

File tree

3 files changed

+150
-45
lines changed

3 files changed

+150
-45
lines changed

source/compatibility.tex

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2134,11 +2134,11 @@
21342134
in~\ref{depr.c.headers}, but their use is deprecated in \Cpp{}.
21352135

21362136
\pnum
2137-
There are no \Cpp{} headers for the C headers
2137+
There are no \Cpp{} headers for the C standard library's headers
21382138
\tcode{<stdatomic.h>}\indextext{\idxhdr{stdatomic.h}!absence thereof},
21392139
\tcode{<stdnoreturn.h>}\indextext{\idxhdr{stdnoreturn.h}!absence thereof},
21402140
and \tcode{<threads.h>}\indextext{\idxhdr{threads.h}!absence thereof},
2141-
nor are the C headers themselves part of \Cpp{}.
2141+
nor are these headers from the C standard library headers themselves part of \Cpp{}.
21422142

21432143
\pnum
21442144
The C headers \tcode{<complex.h>}\indexhdr{complex.h} and
@@ -2196,21 +2196,27 @@
21962196
and
21972197
\tcode{xor_eq}
21982198
are keywords in this International
2199-
Standard\iref{lex.key}.
2199+
Standard\iref{lex.key},
2200+
and are not introduced as macros
2201+
by \tcode{<iso646.h>}\iref{depr.iso646.h.syn}.
22002202

22012203
\rSec3[diff.header.stdalign.h]{Header \tcode{<stdalign.h>}}
22022204
\indexhdr{stdalign.h}%
22032205

22042206
\pnum
22052207
The token \tcode{alignas} is a keyword in this International
2206-
Standard\iref{lex.key}.
2208+
Standard\iref{lex.key},
2209+
and is not introduced as a macro
2210+
by \tcode{<stdalign.h>}\iref{depr.stdalign.h.syn}.
22072211

22082212
\rSec3[diff.header.stdbool.h]{Header \tcode{<stdbool.h>}}
22092213
\indexhdr{stdbool.h}%
22102214

22112215
\pnum
22122216
The tokens \tcode{bool}, \tcode{true}, and \tcode{false}
2213-
are keywords in this International Standard\iref{lex.key}.
2217+
are keywords in this International Standard\iref{lex.key},
2218+
and are not introduced as macros
2219+
by \tcode{<stdbool.h>}\iref{depr.stdbool.h.syn}.
22142220

22152221
\rSec3[diff.null]{Macro \tcode{NULL}}
22162222

source/future.tex

Lines changed: 133 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -110,57 +110,155 @@
110110
C standard library, the \Cpp{} standard library provides
111111
the \defnx{C headers}{headers!C library} shown in \tref{future.c.headers}.
112112

113-
\begin{floattable}{C headers}{tab:future.c.headers}
113+
\begin{multicolfloattable}{C headers}{tab:future.c.headers}
114114
{lllll}
115-
\topline
115+
\tcode{<assert.h>} \\
116+
\tcode{<complex.h>} \\
117+
\tcode{<ctype.h>} \\
118+
\tcode{<errno.h>} \\
119+
\tcode{<fenv.h>} \\
120+
\tcode{<float.h>} \\
121+
\columnbreak
122+
\tcode{<inttypes.h>} \\
123+
\tcode{<iso646.h>} \\
124+
\tcode{<limits.h>} \\
125+
\tcode{<locale.h>} \\
126+
\tcode{<math.h>} \\
127+
\tcode{<setjmp.h>} \\
128+
\columnbreak
129+
\tcode{<signal.h>} \\
130+
\tcode{<stdalign.h>} \\
131+
\tcode{<stdarg.h>} \\
132+
\tcode{<stdbool.h>} \\
133+
\tcode{<stddef.h>} \\
134+
\tcode{<stdint.h>} \\
135+
\columnbreak
136+
\tcode{<stdio.h>} \\
137+
\tcode{<stdlib.h>} \\
138+
\tcode{<string.h>} \\
139+
\tcode{<tgmath.h>} \\
140+
\tcode{<time.h>} \\
141+
\tcode{<uchar.h>} \\
142+
\columnbreak
143+
\tcode{<wchar.h>} \\
144+
\tcode{<wctype.h>} \\
145+
\end{multicolfloattable}
146+
147+
\rSec2[depr.complex.h.syn]{Header \tcode{<complex.h>} synopsis}
148+
149+
\indexhdr{complex.h}%
150+
\begin{codeblock}
151+
#include <complex>
152+
\end{codeblock}
153+
154+
\pnum
155+
The header \tcode{<complex.h>}
156+
behaves as if it simply includes the header
157+
\tcode{<complex>}\iref{complex.syn}.
158+
159+
\pnum
160+
\begin{note}
161+
Names introduced by \tcode{<complex>} in namespace \tcode{std}
162+
are not placed into the global namespace scope by \tcode{<complex.h>}.
163+
\end{note}
164+
165+
\rSec2[depr.iso646.h.syn]{Header \tcode{<iso646.h>} synopsis}
166+
167+
\indexhdr{iso646.h}%
168+
\pnum
169+
The \Cpp{} header \tcode{<iso646.h>} is empty.
170+
\begin{note}
171+
\tcode{and},
172+
\tcode{and_eq},
173+
\tcode{bitand},
174+
\tcode{bitor},
175+
\tcode{compl},
176+
\tcode{not_eq},
177+
\tcode{not},
178+
\tcode{or},
179+
\tcode{or_eq},
180+
\tcode{xor}, and
181+
\tcode{xor_eq}
182+
are keywords in this International Standard\iref{lex.key}.
183+
\end{note}
184+
185+
\rSec2[depr.stdalign.h.syn]{Header \tcode{<stdalign.h>} synopsis}
186+
187+
\indexlibrary{\idxcode{__alignas_is_defined}}%
188+
\indexhdr{stdalign.h}%
189+
\begin{codeblock}
190+
#define @\xname{alignas_is_defined}@ 1
191+
\end{codeblock}
192+
193+
\pnum
194+
\indexhdr{stdalign.h}%
195+
The contents of the \Cpp{} header \tcode{<stdalign.h>} are the same as the C
196+
standard library header \tcode{<stdalign.h>}, with the following changes:
197+
The header \tcode{<stdalign.h>} does not
198+
define a macro named \tcode{alignas}.
199+
200+
\xrefc{7.15}
116201

117-
\tcode{<assert.h>} &
118-
\tcode{<inttypes.h>} &
119-
\tcode{<signal.h>} &
120-
\tcode{<stdio.h>} &
121-
\tcode{<wchar.h>} \\
202+
\rSec2[depr.stdbool.h.syn]{Header \tcode{<stdbool.h>} synopsis}
122203

123-
\tcode{<complex.h>} &
124-
\tcode{<iso646.h>} &
125-
\tcode{<stdalign.h>} &
126-
\tcode{<stdlib.h>} &
127-
\tcode{<wctype.h>} \\
204+
\indexhdr{stdbool.h}%
205+
\indexlibrary{\idxcode{__bool_true_false_are_defined}}%
206+
\begin{codeblock}
207+
#define @\xname{bool_true_false_are_defined}@ 1
208+
\end{codeblock}
209+
210+
\pnum
211+
\indexhdr{stdbool.h}%
212+
The contents of the \Cpp{} header \tcode{<stdbool.h>} are the same as the C
213+
standard library header \tcode{<stdbool.h>}, with the following changes:
214+
The header \tcode{<stdbool.h>} does not
215+
define macros named \tcode{bool}, \tcode{true}, or \tcode{false}.
128216

129-
\tcode{<ctype.h>} &
130-
\tcode{<limits.h>} &
131-
\tcode{<stdarg.h>} &
132-
\tcode{<string.h>} & \\
217+
\xrefc{7.18}
133218

134-
\tcode{<errno.h>} &
135-
\tcode{<locale.h>} &
136-
\tcode{<stdbool.h>} &
137-
\tcode{<tgmath.h>} & \\
219+
\rSec2[depr.tgmath.h.syn]{Header \tcode{<tgmath.h>} synopsis}
138220

139-
\tcode{<fenv.h>} &
140-
\tcode{<math.h>} &
141-
\tcode{<stddef.h>} &
142-
\tcode{<time.h>} & \\
221+
\indexhdr{tgmath.h}%
222+
\begin{codeblock}
223+
#include <cmath>
224+
#include <complex>
225+
\end{codeblock}
143226

144-
\tcode{<float.h>} &
145-
\tcode{<setjmp.h>} &
146-
\tcode{<stdint.h>} &
147-
\tcode{<uchar.h>} & \\
227+
\pnum
228+
The header \tcode{<tgmath.h>}
229+
behaves as if it simply includes the headers
230+
\tcode{<cmath>}\iref{cmath.syn} and
231+
\tcode{<complex>}\iref{complex.syn}.
148232

149-
\end{floattable}
233+
\pnum
234+
\begin{note} The overloads provided in C by type-generic macros are already
235+
provided in \tcode{<complex>} and \tcode{<cmath>} by ``sufficient'' additional
236+
overloads.\end{note}
150237

151238
\pnum
152-
The header \tcode{<complex.h>} behaves as if it simply includes the header \tcode{<complex>}\iref{complex.syn}.
153-
The header \tcode{<tgmath.h>} behaves as if it simply includes the headers \tcode{<complex>}\iref{complex.syn}
154-
and \tcode{<cmath>}\iref{cmath.syn}.
239+
\begin{note}
240+
Names introduced by \tcode{<cmath>} or \tcode{<complex>}
241+
in namespace \tcode{std}
242+
are not placed into the global namespace scope by \tcode{<tgmath.h>}.
243+
\end{note}
244+
245+
\rSec2[depr.c.headers.other]{Other C headers}
155246

156247
\pnum
157-
Every other C header, each of
248+
Every C header
249+
other than
250+
\tcode{<complex.h>},
251+
\tcode{<iso646.h>},
252+
\tcode{<stdalign.h>},
253+
\tcode{<stdbool.h>}, and
254+
\tcode{<tgmath.h>},
255+
each of
158256
which has a name of the form
159257
\indextext{header!C}%
160-
\tcode{name.h},
258+
\tcode{<\placeholder{name}.h>},
161259
behaves as if each name placed in the standard library namespace by
162260
the corresponding
163-
\tcode{c\textit{name}}
261+
\tcode{<c\placeholder{name}>}
164262
header is placed within
165263
the global namespace scope,
166264
except for the functions described in \ref{sf.cmath},
@@ -188,7 +286,6 @@
188286
much as in the C Standard. It may also provide these names within
189287
the namespace \tcode{std}.
190288
\end{example}
191-
192289
\rSec1[depr.relops]{Relational operators}
193290

194291
\pnum

source/xrefdelta.tex

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,6 @@
120120
% Deprecated features were removed.
121121
\removedxref{depr.except.spec}
122122
\removedxref{depr.cpp.headers}
123-
\removedxref{depr.ccomplex.syn}
124-
\removedxref{depr.cstdalign.syn}
125-
\removedxref{depr.cstdbool.syn}
126-
\removedxref{depr.ctgmath.syn}
127123
\removedxref{depr.uncaught}
128124
\removedxref{depr.func.adaptor.binding}
129125
\removedxref{depr.weak.result_type}
@@ -134,6 +130,12 @@
134130
\removedxref{depr.temporary.buffer}
135131
\removedxref{depr.util.smartptr.shared.obs}
136132

133+
% Deprecated <cfoo> headers were removed for some <foo.h> headers
134+
\movedxref{depr.ccomplex.syn}{depr.complex.h.syn}
135+
\movedxref{depr.cstdalign.syn}{depr.stdalign.h.syn}
136+
\movedxref{depr.cstdbool.syn}{depr.stdbool.h.syn}
137+
\movedxref{depr.ctgmath.syn}{depr.tgmath.h.syn}
138+
137139
% Deprecated features.
138140
%\deprxref{old.label} (if moved to depr.old.label, otherwise use \movedxref)
139141

0 commit comments

Comments
 (0)