<!DOCTYPE html>
<!-- saved from url=(0058)https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3978.htm -->
<html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>C2Y issue log, r2 (N3978)</title>
<style>
pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.hll { background-color: #ffffcc }
.c { color: #3D7B7B; font-style: italic } /* Comment */
.err { border: 1px solid #FF0000 } /* Error */
.k { color: #008000; font-weight: bold } /* Keyword */
.o { color: #666666 } /* Operator */
.ch { color: #3D7B7B; font-style: italic } /* Comment.Hashbang */
.cm { color: #3D7B7B; font-style: italic } /* Comment.Multiline */
.cp { color: #9C6500 } /* Comment.Preproc */
.cpf { color: #3D7B7B; font-style: italic } /* Comment.PreprocFile */
.c1 { color: #3D7B7B; font-style: italic } /* Comment.Single */
.cs { color: #3D7B7B; font-style: italic } /* Comment.Special */
.gd { color: #A00000 } /* Generic.Deleted */
.ge { font-style: italic } /* Generic.Emph */
.ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */
.gr { color: #E40000 } /* Generic.Error */
.gh { color: #000080; font-weight: bold } /* Generic.Heading */
.gi { color: #008400 } /* Generic.Inserted */
.go { color: #717171 } /* Generic.Output */
.gp { color: #000080; font-weight: bold } /* Generic.Prompt */
.gs { font-weight: bold } /* Generic.Strong */
.gu { color: #800080; font-weight: bold } /* Generic.Subheading */
.gt { color: #0044DD } /* Generic.Traceback */
.kc { color: #008000; font-weight: bold } /* Keyword.Constant */
.kd { color: #008000; font-weight: bold } /* Keyword.Declaration */
.kn { color: #008000; font-weight: bold } /* Keyword.Namespace */
.kp { color: #008000 } /* Keyword.Pseudo */
.kr { color: #008000; font-weight: bold } /* Keyword.Reserved */
.kt { color: #B00040 } /* Keyword.Type */
.m { color: #666666 } /* Literal.Number */
.s { color: #BA2121 } /* Literal.String */
.na { color: #687822 } /* Name.Attribute */
.nb { color: #008000 } /* Name.Builtin */
.nc { color: #0000FF; font-weight: bold } /* Name.Class */
.no { color: #880000 } /* Name.Constant */
.nd { color: #AA22FF } /* Name.Decorator */
.ni { color: #717171; font-weight: bold } /* Name.Entity */
.ne { color: #CB3F38; font-weight: bold } /* Name.Exception */
.nf { color: #0000FF } /* Name.Function */
.nl { color: #767600 } /* Name.Label */
.nn { color: #0000FF; font-weight: bold } /* Name.Namespace */
.nt { color: #008000; font-weight: bold } /* Name.Tag */
.nv { color: #19177C } /* Name.Variable */
.ow { color: #AA22FF; font-weight: bold } /* Operator.Word */
.w { color: #bbbbbb } /* Text.Whitespace */
.mb { color: #666666 } /* Literal.Number.Bin */
.mf { color: #666666 } /* Literal.Number.Float */
.mh { color: #666666 } /* Literal.Number.Hex */
.mi { color: #666666 } /* Literal.Number.Integer */
.mo { color: #666666 } /* Literal.Number.Oct */
.sa { color: #BA2121 } /* Literal.String.Affix */
.sb { color: #BA2121 } /* Literal.String.Backtick */
.sc { color: #BA2121 } /* Literal.String.Char */
.dl { color: #BA2121 } /* Literal.String.Delimiter */
.sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */
.s2 { color: #BA2121 } /* Literal.String.Double */
.se { color: #AA5D1F; font-weight: bold } /* Literal.String.Escape */
.sh { color: #BA2121 } /* Literal.String.Heredoc */
.si { color: #A45A77; font-weight: bold } /* Literal.String.Interpol */
.sx { color: #008000 } /* Literal.String.Other */
.sr { color: #A45A77 } /* Literal.String.Regex */
.s1 { color: #BA2121 } /* Literal.String.Single */
.ss { color: #19177C } /* Literal.String.Symbol */
.bp { color: #008000 } /* Name.Builtin.Pseudo */
.fm { color: #0000FF } /* Name.Function.Magic */
.vc { color: #19177C } /* Name.Variable.Class */
.vg { color: #19177C } /* Name.Variable.Global */
.vi { color: #19177C } /* Name.Variable.Instance */
.vm { color: #19177C } /* Name.Variable.Magic */
.il { color: #666666 } /* Literal.Number.Integer.Long */
</style>
</head>
<body>
<h1>C2Y issue log, r2 (N3978)</h1>
<table>
<thead>
<tr>
<th align="left">Issue</th>
<th align="left">Summary</th>
<th align="left">Status</th>
</tr>
</thead>
<tbody>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3978.htm#issue1094">1094</a></td>
<td align="left">Missing <code>[[unsequenced]]</code> in <code><stdbit.h></code></td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3978.htm#issue1096">1096</a></td>
<td align="left"><code>fopen</code> mode string issues</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3978.htm#issue1097">1097</a></td>
<td align="left">Incomplete internal linkage tentative definitions completed in inner scope</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3978.htm#issue1098">1098</a></td>
<td align="left">Source files not ending with newline</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3978.htm#issue1099">1099</a></td>
<td align="left">UCNs from token concatenation</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3978.htm#issue1100">1100</a></td>
<td align="left"><code><math.h></code> overflow in non-default rounding modes</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3978.htm#issue1101">1101</a></td>
<td align="left">Static assertions in expressions in <code>for</code> loops</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3978.htm#issue1109">1109</a></td>
<td align="left">N3322 and N3466 overlooked a few cases</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3978.htm#issue1110">1110</a></td>
<td align="left"><code>strftime %c</code> and additional <code>struct tm</code> members</td>
<td align="left">Open</td>
</tr>
</tbody>
</table>
<hr>
<div id="issue1094">
<h2>Issue 1094: Missing <code>[[unsequenced]]</code> in <code><stdbit.h></code></h2>
<p>Authors: Joseph Myers<br>
Date: 2026-08-26<br>
Submitted against: C2Y (N3886 draft)<br>
Status: Open</p>
<p>When
<a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3367.htm">N3367</a>
(More Modern Bit Utilities) was adopted for C2Y, it was without
<code>[[unsequenced]]</code> attributes, since those in the paper were neither
complete nor all correct, and with the expectation of a separate paper
later to add such attributes. They should be added to all the new
functions except for the <code>stdc_store8_*</code> functions.</p>
<h3>Suggested correction</h3>
<p>Add the <code>[[unsequenced]]</code> attributes immediately before the final
semicolon of all <code><stdbit.h></code> functions (including generic functions)
in 7.18.17 (Rotate Left), 7.18.18 (Rotate Right), 7.18.19 (8-bit
Memory Reversal), 7.18.20 (Exact-width 8-bit Memory Reversal), and
7.18.21 (Endian-Aware 8-bit Load).</p>
<hr>
<p>Comment from Jay Ghiron on 2026-10-09:</p>
<p>The function <code>stdc_memreverse8</code> in 7.18.19 should not have
<code>[[unsequenced]]</code> because it is not idempotent. That is, calling
<code>stdc_memreverse8</code> twice with the same argument is not always
equivalent to omitting the second call. The <code>stdc_store8_*</code> functions
in 7.18.22 could have <code>[[unsequenced]]</code> because repeating a call
immediately after always has no effect, and they meet the other
requirements.</p>
</div>
<hr>
<hr>
<div id="issue1096">
<h2>Issue 1096: <code>fopen</code> mode string issues</h2>
<p>Authors: Joseph Myers<br>
Date: 2026-08-27<br>
Submitted against: C2Y (N3886 draft)<br>
Status: Open</p>
<p><a href="https://www.open-std.org/jtc1/sc22/wg14/26283">Reflector message
26283</a> notes various
issues with the specification for <code>fopen</code> mode strings that remain
after the integration of
<a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3247.pdf">N3247</a>
(and the subsequent
<a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3275.pdf">N3275</a>
for <code>fopen_s</code>).</p>
<ol>
<li>The wording for <code>'+'</code> needs updating to reflect that it might not
be the second or third character any more with relaxed ordering; it
could be any character after the first. This could probably be
fixed editorially by saying "a" in place of "the second or third".</li>
<li>The footnote "If the string begins with one of the listed mode
sequences, the implementation can choose to ignore the remaining
characters, or it can use them to select different kinds of a file
(some of which can potentially not conform to the properties in
7.24.2)." only really made sense as is when there was a full list
of possible mode sequences; now there's a mode character followed
by other characters in any order, it needs to be rephrased so it no
longer talks about "one of the listed mode sequences". Also, we
should consider carefully where this footnote should go; is the
current paragraph (which starts talking about the first character
in the argument, leaving other characters for later) really the
best place still?</li>
<li>Previously there was explicit undefined behavior for any string not
in the given list. Now, there's only explicit undefined behavior
if the <em>first character</em> isn't in the list; the normative wording
says nothing about what happens if any subsequent character is not
one for which semantics are defined. Maybe it's implicitly
undefined where it says "can contain any of the following
characters in any order", if some other character is present, but
being explicit is generally better. (This is an example of
"undefined behavior as an extension point", where implementations
might give other meanings to strings with other characters; cf. the
footnote discussed above. A request to make it
implementation-defined in C23 CD1 comment GB-210 was rejected (no
consensus 4/4/5) with "David Banham asked to bring this suggestion
up for C2Y", i.e. a paper making an extension point might be
appropriate to consider. This could not be implementation-defined
behavior in the sense of enumerated alternatives, however, only
kind of implementation-documented but unbounded behavior discussed
in
<a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3863.pdf">N3863</a>.)</li>
<li>It has been suggested to me that the wording about <code>'p'</code> is
inadequate, because "cannot be accessed by other means" would seem
to exclude all the suggested implementation strategies; <code>O_TMPFILE</code>
or a suid helper doesn't prevent access via <code>/proc/self/fd/</code>, for
example, or by direct privileged access to the underlying device.
It may be that this is a case where the normative wording can only
be understood to refer to mechanisms within the scope of the
standard, however, and as with <code>memset_explicit</code> not all the intent
about what is or is not an appropriate implementation strategy can
be expressed within the concepts usable in normative wording in
terms of the abstract machine. The normative wording should
probably be reworded to avoid saying things that cannot be
implemented, and further matters of intent moved to Recommended
Practice. Unlike the first three issues, the problematic wording
appears for <code>fopen_s</code> as well as for <code>fopen</code>. I tend to think that
it would be best for the <code>fopen_s</code> specification to say as little
as possible about the semantics of <code>'x'</code> and <code>'p'</code>, deferring
instead to the fopen specification as far as possible.</li>
</ol>
</div>
<hr>
<hr>
<div id="issue1097">
<h2>Issue 1097: Incomplete internal linkage tentative definitions completed in inner scope</h2>
<p>Authors: Joseph Myers<br>
Date: 2026-08-27<br>
Submitted against: C2Y (N3886 draft)<br>
Status: Open</p>
<p>As noted in <a href="https://www.open-std.org/jtc1/sc22/wg14/34118">reflector message
34118</a>, the adoption of
<a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3347.pdf">N3347</a>,
with wording taken from <a href="https://www.open-std.org/jtc1/sc22/wg14/26758">reflector message
26758</a>, left an
ambiguously worded constraint. 6.9.3 (External object definitions)
paragraph 1 says:</p>
<blockquote>
<p>If the declaration of an identifier for an object is a tentative
definition with incomplete type and internal linkage, the type of
the object shall be completed before the end of the translation
unit.</p>
</blockquote>
<p>Suppose the type is completed in an inner scope:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #008000; font-weight: bold">static</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>a[];
<span style="color: #B00040">void</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">f</span>()<span style="color: #bbbbbb"> </span>{<span style="color: #bbbbbb"> </span><span style="color: #008000; font-weight: bold">extern</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>a[<span style="color: #666666">1</span>];<span style="color: #bbbbbb"> </span>}
</pre></div>
<p>Is this valid, because the type gets completed in an inner scope
before the end of the translation unit, or invalid, because the type
at the end of the translation unit is incomplete even though the type
inside <code>f</code> at the end of that function is complete?</p>
</div>
<hr>
<hr>
<div id="issue1098">
<h2>Issue 1098: Source files not ending with newline</h2>
<p>Authors: Joseph Myers<br>
Date: 2026-09-01<br>
Submitted against: C2Y (N3886 draft)<br>
Status: Open</p>
<p>As noted in <a href="https://www.open-std.org/jtc1/sc22/wg14/33995">reflector message
33995</a>, when we
accepted
<a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3411.pdf">N3411</a>,
allowing source files without a final newline, we did not make any
corresponding change to the syntax for many preprocessing directives,
which includes new-line, as does that for text-line, so leaving syntax
violations for source files without the final newline character, when
the intent was to allow such file as if the final newline were added.
It was also said when we accepted
<a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3478.pdf">N3478</a>,
making partial comments at the end of a file into a constraint
violation, that we should allow a <code>//</code> comment on the final line of a
file without needing trailing newline.</p>
<p>In <a href="https://www.open-std.org/jtc1/sc22/wg14/34017">reflector message
34017</a>, Corentin Jabot
suggested following the wording used by C++. This would allow a
source file with no final newline without allowing the case where the
source file ends with a backslash (and no following newline) to act as
if line splicing occurs. It would both resolve the issues introduced
by the integration of N3411, and allow a <code>//</code> comment on the final
line of a file without a trailing newline to be handled as such rather
than being a constraint violation.</p>
<h3>Suggested correction</h3>
<p>At the end of translation phase 2 in 5.2.1.2 (Translation phases),
add:</p>
<blockquote>
<ol start="2">
<li>Each instance of a backslash character (<code>\</code>) immediately followed
by a new-line character is deleted, splicing physical source
lines to form logical source lines. Only the last backslash on
any physical source line shall be eligible for being part of such
a splice. <ins>A source file that is not empty and that (after
splicing) does not end in a new-line character is processed as if
an additional new-line character were appended to the file.</ins></li>
</ol>
</blockquote>
<hr>
<p>Comment from Issues list maintainer on 2026-10-15:</p>
<p>Alejandro Colomar has expressed an intent to propose a constraint
against source files without a final newline; this has been allocated
document number N3988.</p>
</div>
<hr>
<hr>
<div id="issue1099">
<h2>Issue 1099: UCNs from token concatenation</h2>
<p>Authors: Joseph Myers<br>
Date: 2026-09-01<br>
Submitted against: C2Y (N3886 draft)<br>
Status: Open</p>
<p>In <a href="https://www.open-std.org/jtc1/sc22/wg14/29430">reflector message
29430</a>, Corentin Jabot
noted that the adoption of
<a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3418.pdf">N3418</a>,
disallowing producing a UCN by token concatenation, was the opposite
of existing practice and that C++ requires this to be accepted, so the
change diverges C from C++ without good reason.</p>
<h3>Suggested correction</h3>
<p>In 6.10.5.4 (The <code>##</code> operator), delete the second Constraint.</p>
<blockquote>
<p><del>A character sequence that matches the syntax of a universal
character name shall not be produced by token concatenation.</del></p>
</blockquote>
</div>
<hr>
<hr>
<div id="issue1100">
<h2>Issue 1100: <code><math.h></code> overflow in non-default rounding modes</h2>
<p>Authors: Joseph Myers<br>
Date: 2026-09-01<br>
Submitted against: C2Y (N3886 draft)<br>
Status: Open</p>
<p><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3737.pdf">N3737</a>
made changes to <code><math.h></code> error handling that were described as being
clarifications.</p>
<p>Those changes added one sentence that is very unclear, with
problematic effects on another changed sentence. The unclear sentence
is</p>
<blockquote>
<p>Range errors in non-default rounding modes are
implementation-defined.</p>
</blockquote>
<p>in 7.12.2 paragraph 5. This does not say anything about what aspects
of range errors are implementation-defined or what the options
available to implementations are: whether it's implementation-defined
when such errors occur, or what value functions return on such errors,
or what exceptions are raised, or what value <code>errno</code> is set to, or any
other aspect of how the abstract machine behaves on error. It does
not say whether any other sentence describing range errors is still
applicable in the case of non-default rounding modes, although
normally such sentences would still apply unless specifically
excluded. (The case of the value returned <em>is</em> excluded in text
referring to <code>HUGE_VAL</code> returned on overflow, which only discusses the
return value when "default rounding is in effect".)</p>
<p>Consider the case of a range error for overflow that is specified to
"occur", rather than as "may occur", in a non-default rounding mode,
for an implementation where <code>math_errhandling & MATH_ERRNO</code> is
nonzero. The current wording in 7.12.2 paragraph 7 says:</p>
<blockquote>
<p>If a range error occurs because of floating-point overflow and the
integer expression <code>math_errhandling & MATH_ERRNO</code> is nonzero, the
integer expression <code>errno</code> acquires the value <code>ERANGE</code>.</p>
</blockquote>
<p>Previously, this only applied if "default rounding is in effect".
Does the implementation-defined behavior act to change all "occur"
into "may occur" in a non-default rounding mode, or to make it
implementation-defined whether <code>errno</code> is set even when the error
occurs? Or does this sentence about overflow now require <code>errno</code> to
be set where it was not previously required to be set, with the
implementation-defined behavior only changing some smaller aspect that
is genuinely unspecified by other text in the standard, such as the
precise overflow threshold or the returned value (both of which do
depend on the rounding mode in IEC 60559 floating point)?</p>
<p>If <code>errno</code> is now required to be set for some overflows in non-default
rounding modes (where it was clearly not previously required to be
set), that is problematic because such overflows cannot generally be
detected by the implementation from the value it computes, unlike in
round-to-nearest, since the largest finite value of the appropriate
sign can occur in both overflowing and non-overflowing cases in some
rounding modes.</p>
</div>
<hr>
<hr>
<div id="issue1101">
<h2>Issue 1101: Static assertions in expressions in <code>for</code> loops</h2>
<p>Authors: Joseph Myers<br>
Date: 2026-09-01<br>
Submitted against: C2Y (N3886 draft)<br>
Status: Open</p>
<p>As noted in <a href="https://www.open-std.org/jtc1/sc22/wg14/34193">reflector message
34193</a>, the addition of
static assertions in expressions from
<a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3715.pdf">N3715</a>
included syntactic disambiguation for block items, but not for the
first clause of a <code>for</code> statement. (As with that for block items,
this doesn't affect the final semantics of the static assertion, just
which sequence of syntax productions it goes through. There is no
such syntactic ambiguity in the selection header of <code>if</code> or <code>switch</code>.)</p>
<h3>Suggested correction</h3>
<p>In 6.8.6.4 (The <code>for</code> statement), amend the second paragraph.</p>
<blockquote>
<p>Both <em>clause-1</em> and <em>expression-3</em> can be omitted. <ins>If
<em>clause-1</em> is a static assertion, it is interpreted as a
<code>static_assert</code> declaration.</ins> An omitted <em>expression-2</em> is
replaced by a nonzero constant.</p>
</blockquote>
</div>
<hr>
<hr>
<div id="issue1109">
<h2>Issue 1109: N3322 and N3466 overlooked a few cases</h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-09-15<br>
Submitted against: C2Y (N3886 draft)<br>
Status: Open</p>
<p>The proposals
<a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3322.pdf">N3322</a>
and
<a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3466.pdf">N3466</a>
allowed null pointers to many library functions when no elements are
accessed. However, there were a few cases that were not mentioned in
either proposal:</p>
<ol>
<li>In any of the <code>*printf</code> functions, a conversion specification of <code>s</code>
with a precision of zero for example <code>%.s</code>.</li>
<li><code>strftime</code> and <code>wcsftime</code>.</li>
<li><code>mbstowcs</code> and <code>wcstombs</code>.</li>
</ol>
<p>The first two should probably be valid, the third is already defined
by POSIX so the behavior should remain undefined or the POSIX behavior
should be adopted.</p>
<h3>Suggested correction</h3>
<p>Modify N3886 7.24.6.2 (The <code>fprintf</code> function) paragraph 8:</p>
<blockquote>
<p>If no <code>l</code> length modifier is present, the argument shall be a
pointer to storage of character type. Characters from the storage
are written up to (but not including) the terminating null
character. If the precision is specified, no more than that many
bytes are written. If the precision is not specified or is greater
than the size of the storage, the storage shall contain a null
character.<ins> If the precision is specified as zero, the argument
may be a null pointer.</ins></p>
<p>If an <code>l</code> length modifier is present, the argument shall be a
pointer to storage of <code>wchar_t</code> type. Wide characters from the
storage are converted to multibyte characters (each as if by a call
to the <code>wcrtomb</code> function, with the conversion state described by an
<code>mbstate_t</code> object initialized to zero before the first wide
character is converted) up to and including a terminating null wide
character. The resulting multibyte characters are written up to
(but not including) the terminating null character (byte). If no
precision is specified, the storage shall contain a null wide
character. If a precision is specified, no more than that many
bytes are written (including shift sequences, if any), and the
storage shall contain a null wide character if, to equal the
multibyte character sequence length given by the precision, the
function would need to access a wide character one past the end of
the array. In no case is a partial multibyte character
written.<ins> If the precision is specified as zero, the argument
may be a null pointer.</ins></p>
</blockquote>
<p>Modify N3886 7.33.2.2 (The <code>fwprintf</code> function) paragraph 8:</p>
<blockquote>
<p>If no <code>l</code> length modifier is present, the argument shall be a
pointer to storage of character type containing a multibyte
character sequence beginning in the initial shift state. Characters
from the storage are converted as if by repeated calls to the
<code>mbrtowc</code> function, with the conversion state described by an
<code>mbstate_t</code> object initialized to zero before the first multibyte
character is converted, and written up to (but not including) the
terminating null wide character. If the precision is specified, no
more than that many wide characters are written. If the precision
is not specified or is greater than the size of the converted
storage, the converted storage shall contain a null wide
character.<ins> If the precision is specified as zero, the argument
may be a null pointer.</ins></p>
<p>If an <code>l</code> length modifier is present, the argument shall be a
pointer to storage of <code>wchar_t</code> type. Wide characters from the
storage are written up to (but not including) a terminating null
wide character. If the precision is specified, no more than that
many wide characters are written. If the precision is not specified
or is greater than the size of the array, the storage shall contain
a null wide character.<ins> If the precision is specified as zero,
the argument may be a null pointer.</ins></p>
</blockquote>
<p>Modify N3886 7.31.3.6 (The <code>strftime</code> function) paragraph 2:</p>
<blockquote>
<p>The <code>strftime</code> function places characters into the array pointed to
by <code>s</code> as controlled by the string pointed to by <code>format</code>. The
format shall be a multibyte character sequence, beginning and ending
in its initial shift state. The <code>format</code> string consists of zero or
more conversion specifiers and ordinary multibyte characters. A
conversion specifier consists of a <code>%</code> character, possibly followed
by an <code>E</code> or <code>O</code> modifier character (described later), followed by a
character that determines the behavior of the conversion specifier.
All ordinary multibyte characters (including the terminating null
character) are copied unchanged into the array. If copying takes
place between objects that overlap, the behavior is undefined. No
more than <code>maxsize</code> characters are placed into the array.<ins> If
<code>maxsize</code> is zero, <code>s</code> may be a null pointer.</ins></p>
</blockquote>
<p>Note: <code>wcsftime</code> refers to <code>strftime</code> directly so no wording
adjustment is needed there.</p>
<p>Modify N3886 7.25.9.2 (The <code>mbstowcs</code> function) paragraph 3:</p>
<blockquote>
<p>No more than <code>n</code> elements will be modified in the array pointed to
by <code>pwcs</code>. If copying takes place between objects that overlap, the
behavior is undefined.<ins> If <code>pwcs</code> is a null pointer value, the
behavior is undefined.</ins></p>
</blockquote>
<p>Modify N3886 7.25.9.3 (The <code>wcstombs</code> function) paragraph 3:</p>
<blockquote>
<p>No more than <code>n</code> bytes will be modified in the array pointed to by
<code>s</code>. If copying takes place between objects that overlap, the
behavior is undefined.<ins> If <code>s</code> is a null pointer value, the
behavior is undefined.</ins></p>
</blockquote>
</div>
<hr>
<hr>
<div id="issue1110">
<h2>Issue 1110: <code>strftime %c</code> and additional <code>struct tm</code> members</h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-09-17<br>
Submitted against: C2Y (N3886 draft)<br>
Status: Open</p>
<p>The proposal
<a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3272.htm">N3272</a>
added wording so that <code>%z</code> and <code>%Z</code> in <code>strftime</code> can use additional
members in <code>struct tm</code> added by an implementation. However, <code>%c</code> and
<code>%Ec</code> on some implementations also use these members to determine the
time zone. For example: glibc with <code>en_US.UTF-8</code> as seen on
<a href="https://godbolt.org/z/acc4TKsxd">godbolt</a>. The same wording should
be copied to <code>%c</code> and <code>%Ec</code> to allow for additional members added by
an implementation to be used.</p>
<h3>Suggested correction</h3>
<p>Modify N3886 7.31.3.6 (The <code>strftime</code> function) paragraph 3:</p>
<blockquote>
<p><code>%c</code> is replaced by the locale’s appropriate date and time
representation.<ins> Behavior is implementation-defined if the
broken-down time structure does not have a value that could be
returned by <code>localtime</code> or <code>gmtime</code>.</ins> [all <del>specified in
7.31.1</del><ins>members, including any non-standard additional
members</ins>]</p>
</blockquote>
</div>
<hr>
</body></html>