<!DOCTYPE html>
<!-- saved from url=(0058)https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm -->
<html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>C23 issue log, r7 (N3977)</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>C23 issue log, r7 (N3977)</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/n3977.htm#issue1000">1000</a></td>
<td align="left">Structure type compatibility with flexible array members</td>
<td align="left">Fixed in C2Y</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1001">1001</a></td>
<td align="left">Qualified rvalues from structure or union members</td>
<td align="left">Fixed (pending integration in working draft) in C2Y</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1002">1002</a></td>
<td align="left">Type qualifiers in <code>[*]</code> in abstract declarators</td>
<td align="left">Fixed in C2Y</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1003">1003</a></td>
<td align="left">Linkage between library functions</td>
<td align="left">Fixed in C2Y</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1004">1004</a></td>
<td align="left">Classification of <code>scanf</code> failures</td>
<td align="left">Fixed (pending integration in working draft) in C2Y</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1005">1005</a></td>
<td align="left">Annex D refers to option removed from UAX#31 in revision 39</td>
<td align="left">Fixed in C2Y</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1006">1006</a></td>
<td align="left"><code>atomic_fetch</code> operations and "address types"</td>
<td align="left">Fixed in C2Y</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1007">1007</a></td>
<td align="left">Implicitly unsigned bit-fields ambiguity</td>
<td align="left">Fixed (pending integration in working draft) in C2Y</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1008">1008</a></td>
<td align="left">Bad constraint on attributes with tags</td>
<td align="left">Fixed in C2Y</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1009">1009</a></td>
<td align="left"><code>extern thread_local</code> should not be an external definition</td>
<td align="left">Fixed in C2Y</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1010">1010</a></td>
<td align="left">Termination of the execution with threads</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1011">1011</a></td>
<td align="left"><code>powr</code>(negative, qNaN)</td>
<td align="left">Fixed in C2Y</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1012">1012</a></td>
<td align="left">Error returns from specific width length modifiers</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1013">1013</a></td>
<td align="left">Ambiguity of "same type"</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1015">1015</a></td>
<td align="left">Imprecise wording for <code>cnd_t</code> functions</td>
<td align="left">Fixed in C2Y</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1016">1016</a></td>
<td align="left">Are digit separators allowed in <code>__LINE__</code>?</td>
<td align="left">Fixed in C2Y</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1017">1017</a></td>
<td align="left">Unspecified timing and synchronization for <code>cnd_t</code> functions</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1018">1018</a></td>
<td align="left">Issue with <code>enum</code> compatibility</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1019">1019</a></td>
<td align="left">String functions and trailing null inclusion</td>
<td align="left">Fixed (pending integration in working draft) in C2Y</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1020">1020</a></td>
<td align="left">Definition of address constant</td>
<td align="left">Fixed (pending integration in working draft) in C2Y</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1021">1021</a></td>
<td align="left">Integer promotions for enumerations</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1022">1022</a></td>
<td align="left">Void expressions and lvalues</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1023">1023</a></td>
<td align="left"><code>static_assert</code> in structure and union definitions</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1024">1024</a></td>
<td align="left">Redeclaration of standard library typedefs</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1025">1025</a></td>
<td align="left">Variably modified standard library types</td>
<td align="left">Review</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1026">1026</a></td>
<td align="left"><code>thrd_t</code> as an array type</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1027">1027</a></td>
<td align="left">Member declaration attributes and composite types</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1028">1028</a></td>
<td align="left"><code>jmp_buf</code> as an incomplete array type</td>
<td align="left">Review</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1029">1029</a></td>
<td align="left">Spelling of <code>__LINE__</code></td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1030">1030</a></td>
<td align="left">Lvalue conversion for generic associations</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1031">1031</a></td>
<td align="left">Generic selection controlling expression lvalue of incomplete non-array type</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1032">1032</a></td>
<td align="left"><code>errno</code> as a bit-field</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1033">1033</a></td>
<td align="left"><code>FILE</code> as a void type</td>
<td align="left">Review</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1034">1034</a></td>
<td align="left">Extra members in <code>div_t</code> types</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1035">1035</a></td>
<td align="left"><code>wctrans_t</code> and <code>wctype_t</code> as <code>nullptr_t</code></td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1036">1036</a></td>
<td align="left">Initializer syntactic requirements</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1037">1037</a></td>
<td align="left">Scopes and <code>noreturn</code> declarations</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1038">1038</a></td>
<td align="left">Issues with <code>float_t</code> and related types</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1039">1039</a></td>
<td align="left">Function type attributes on abstract declarators</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1040">1040</a></td>
<td align="left">Freestanding library issues</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1041">1041</a></td>
<td align="left">Alignment of structure and union members</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1042">1042</a></td>
<td align="left">Attributes on compound literals</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1043">1043</a></td>
<td align="left">Issues with library integer types</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1044">1044</a></td>
<td align="left">Alignment specifier consistency rules</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1045">1045</a></td>
<td align="left">Are VLAs adjusted to pointers variably modified?</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1046">1046</a></td>
<td align="left">Order of arguments to <code>powr</code></td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1047">1047</a></td>
<td align="left">Function call returning <code>void</code></td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1048">1048</a></td>
<td align="left">Mixed [non-]designated initializer behavior</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1049">1049</a></td>
<td align="left">Future language direction of storage-class specifiers</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1050">1050</a></td>
<td align="left">Values of <code>wctrans_t</code> and <code>wctype_t</code></td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1051">1051</a></td>
<td align="left">Standard library integer types wider than <code>intmax_t</code></td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1052">1052</a></td>
<td align="left">Relations between standard library integer types</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1053">1053</a></td>
<td align="left">Conversion of <code>NULL</code> to <code>intptr_t</code> or <code>uintptr_t</code></td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1054">1054</a></td>
<td align="left">Signals from freestanding integer conversion</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1055">1055</a></td>
<td align="left">Incomplete enumerated types in the standard library</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1056">1056</a></td>
<td align="left"><code>WEOF</code> in integer constant expressions</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1057">1057</a></td>
<td align="left">Standard library types as atomic types</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1058">1058</a></td>
<td align="left">Categories of standard library types</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1059">1059</a></td>
<td align="left"><code><fenv.h></code> types underspecified</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1060">1060</a></td>
<td align="left">Declaring <code>main</code> with attributes</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1061">1061</a></td>
<td align="left">Variably modified parameters with typeof specifiers</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1062">1062</a></td>
<td align="left">Signaling NaNs in structures, unions, and standard library types</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1063">1063</a></td>
<td align="left">Conversions to signed integer types</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1064">1064</a></td>
<td align="left"><code>__VA_OPT__()</code> hypothetical substitution</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1065">1065</a></td>
<td align="left">More issues with <code>noreturn</code></td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1066">1066</a></td>
<td align="left">Duplicate macro definitions with variadic macros</td>
<td align="left">Fixed (pending integration in working draft) in C2Y</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1067">1067</a></td>
<td align="left">Bitwise operators on signed types</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1068">1068</a></td>
<td align="left">Standard pragmas after labels</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1069">1069</a></td>
<td align="left">Placemarker preprocessing token concatenation and expansion</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1070">1070</a></td>
<td align="left">Evaluation of <code>[static]</code> parameter array lengths</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1071">1071</a></td>
<td align="left">Header names, <code>__has_include</code>, and <code>__has_embed</code></td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1072">1072</a></td>
<td align="left">Initialization with string literals</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1073">1073</a></td>
<td align="left"><code>char</code><em>N</em><code>_t</code> in freestanding</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1074">1074</a></td>
<td align="left">Feature test macros and freestanding</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1075">1075</a></td>
<td align="left">Empty structure types as standard library types</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1076">1076</a></td>
<td align="left">Bit-field storage issues</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1077">1077</a></td>
<td align="left">Bit-field expression issues</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1078">1078</a></td>
<td align="left">Valid locations for <code>__VA_ARGS__</code> and <code>__VA_OPT__</code></td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1079">1079</a></td>
<td align="left"><code>restrict</code>, <code>_Atomic</code>, and multidimensional arrays</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1080">1080</a></td>
<td align="left"><code>_Generic</code> and VLA type compatibility</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1081">1081</a></td>
<td align="left">Limitations on extended integer constant expressions</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1082">1082</a></td>
<td align="left">Dollar signs in nondigits</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1083">1083</a></td>
<td align="left">Whitespace in macro expansions</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1084">1084</a></td>
<td align="left">Unspecified evaluation order of <code>#</code> and <code>##</code></td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1085">1085</a></td>
<td align="left">Non-finite values in arithmetic constant expressions</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1086">1086</a></td>
<td align="left">Questions about infinity</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1087">1087</a></td>
<td align="left">Reentering variably modified declaration</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1088">1088</a></td>
<td align="left">Objects with temporary lifetime sharing storage</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1089">1089</a></td>
<td align="left"><code>offsetof</code> and <code>va_arg</code> handling of commas outside of parentheses</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1090">1090</a></td>
<td align="left">Pointer arithmetic involving flexible array members</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1091">1091</a></td>
<td align="left">Issues with external definitions</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1092">1092</a></td>
<td align="left">Strictly conforming programs using <code>argv</code> and handling errors</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1093">1093</a></td>
<td align="left">Compatibility of array types completed by initialization</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1095">1095</a></td>
<td align="left">Inconsistent usage of "based on"</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1102">1102</a></td>
<td align="left">Conditions for when types are inferred</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1103">1103</a></td>
<td align="left">Contradictory requirements of linkage</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1104">1104</a></td>
<td align="left">Flexible array members and alignment</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1105">1105</a></td>
<td align="left">Issues with atomic integer types in <code><stdatomic.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/n3977.htm#issue1106">1106</a></td>
<td align="left">Questions about translation limits</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1107">1107</a></td>
<td align="left"><code>decimal_point</code> and <code>thousands_sep</code> issues</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1108">1108</a></td>
<td align="left"><code>grouping</code> and <code>mon_grouping</code> questions</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1111">1111</a></td>
<td align="left">Inconsistent definitions of version macros</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1112">1112</a></td>
<td align="left">Undefined behavior from uninitialized reads</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1113">1113</a></td>
<td align="left">Questions about character constants</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1114">1114</a></td>
<td align="left">Requirements on <code>RSIZE_MAX</code></td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1115">1115</a></td>
<td align="left">Directives partially contained in multiline macro invocations</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1116">1116</a></td>
<td align="left">Requirements on array parameters</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1117">1117</a></td>
<td align="left">Effective type object access requirements</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1118">1118</a></td>
<td align="left">Flexible array member layout</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1119">1119</a></td>
<td align="left">Meaning of <code>TSS_DTOR_ITERATIONS</code></td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1120">1120</a></td>
<td align="left">Full expressions, declarators, and abstract declarators</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1121">1121</a></td>
<td align="left">Bitwise representation of unsigned integer types</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1122">1122</a></td>
<td align="left">Constraints on string literals and character constants</td>
<td align="left">Open</td>
</tr>
<tr>
<td align="left"><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1123">1123</a></td>
<td align="left"><code>fopen</code> and <code>restrict</code> qualified parameters</td>
<td align="left">Open</td>
</tr>
</tbody>
</table>
<hr>
<div id="issue1000">
<h2>Issue 1000: Structure type compatibility with flexible array members</h2>
<p>Authors: Joseph Myers<br>
Date: 2025-03-05<br>
Status: Fixed<br>
Fixed in: C2Y</p>
<p>The definition of compatible type for structure types (C23 6.2.7)
allows two structures to be compatible where one ends with a flexible
array member and the other ends with a member with complete array
type. (Before C23, this was an issue for structures in separate
translation units; C23 makes it applicable within a single translation
unit.)</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">s</span><span style="color: #bbbbbb"> </span>{<span style="color: #bbbbbb"> </span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>a;<span style="color: #bbbbbb"> </span><span style="color: #B00040">char</span><span style="color: #bbbbbb"> </span>b[];<span style="color: #bbbbbb"> </span>}<span style="color: #bbbbbb"> </span>x;
<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: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">s</span><span style="color: #bbbbbb"> </span>{<span style="color: #bbbbbb"> </span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>a;<span style="color: #bbbbbb"> </span><span style="color: #B00040">char</span><span style="color: #bbbbbb"> </span>b[<span style="color: #666666">2</span>];<span style="color: #bbbbbb"> </span>}<span style="color: #bbbbbb"> </span>y<span style="color: #bbbbbb"> </span><span style="color: #666666">=</span><span style="color: #bbbbbb"> </span>{};
<span style="color: #bbbbbb"> </span>x<span style="color: #bbbbbb"> </span><span style="color: #666666">=</span><span style="color: #bbbbbb"> </span>y;<span style="color: #bbbbbb"> </span><span style="color: #3D7B7B; font-style: italic">// OK, assignment between compatible types.</span>
}
</pre></div>
<p>However, the definition of flexible array members explicitly
anticipates that the offset of the flexible array member may be
different from that of a member with complete array type ("the offset
of the array shall remain that of the flexible array member, even if
this would differ from that of the replacement array"), which is not
consistent with the types being compatible. Furthermore, the rules
for assignment (and likewise initialization and argument passing and
function return) and conditional expressions are underspecified in
this case; it is not clear what members would be copied when such a
mixture of types is involved.</p>
<h3>Suggested correction</h3>
<p>In C23 6.2.7 (Compatible type and composite type), after the first
bullet point for compatibility for structure and union types, insert
another bullet point:</p>
<blockquote>
<ul>
<li><ins>if one member of the pair is declared with a complete array
type, the other is declared with a complete array type;</ins></li>
</ul>
</blockquote>
<hr>
<p>Comment from Issues list maintainer on 2025-09-01:</p>
<p>At the August 2025 (Brno) meeting of WG14, the suggested correction
was accepted, subject to review at the next meeting.</p>
<h3>Proposed correction</h3>
<p>In C23 6.2.7 (Compatible type and composite type), after the first
bullet point for compatibility for structure and union types, insert
another bullet point:</p>
<blockquote>
<ul>
<li><ins>if one member of the pair is declared with a complete array
type, the other is declared with a complete array type;</ins></li>
</ul>
</blockquote>
<hr>
<p>Comment from Issues list maintainer on 2026-02-09:</p>
<p>At the February 2026 meeting of WG14, the proposed correction was
adopted.</p>
<h3>Correction</h3>
<p>In C23 6.2.7 (Compatible type and composite type), after the first
bullet point for compatibility for structure and union types, insert
another bullet point:</p>
<blockquote>
<ul>
<li><ins>if one member of the pair is declared with a complete array
type, the other is declared with a complete array type;</ins></li>
</ul>
</blockquote>
</div>
<hr>
<hr>
<div id="issue1001">
<h2>Issue 1001: Qualified rvalues from structure or union members</h2>
<p>Authors: Joseph Myers<br>
Date: 2025-03-06<br>
Status: Fixed (pending integration in working draft)<br>
Fixed in: C2Y<br>
Cross-references: <a href="https://www.open-std.org/jtc1/sc22/wg14/issues/c11c17/issue0423.html">0423</a>, <a href="https://www.open-std.org/jtc1/sc22/wg14/issues/c11c17/issue0481.html">0481</a></p>
<p>C23 6.7.3.5 (Atomic type specifiers) says "The properties associated
with atomic types are meaningful only for expressions that are
lvalues." and, similarly, in 6.7.4.1 (Type qualifiers), "The
properties associated with qualified types are meaningful only for
expressions that are lvalues.". Not being meaningful, however, leaves
open the possibility that an rvalue might nevertheless have such a
type (with no semantic difference compared to having an unqualified
type).</p>
<p>Before C11, it was never possible to observe whether an rvalue had a
qualified type. C11 introduced <code>_Generic</code> with the potential to
observe more details of the types of rvalues, and C23 introduced
<code>typeof</code>, and these features resulted in a series of changes to avoid
rvalues having qualified or atomic types or to avoid such types being
observable:</p>
<ul>
<li>
<p>The resolution of <a href="https://www.open-std.org/jtc1/sc22/wg14/issues/c11c17/issue0423.html">issue 0423</a> said that casts convert
to the unqualified version of the named type, and that function
types always return the unqualified version of the return type named
in the declaration or type name.</p>
</li>
<li>
<p>The resolution of <a href="https://www.open-std.org/jtc1/sc22/wg14/issues/c11c17/issue0481.html">issue 0481</a> then dealt with
<code>_Generic</code> on lvalues by saying the type of the controlling
expression is taken "as if it had undergone an lvalue conversion,
array to pointer conversion, or function to pointer conversion".
This left more ambiguous the case of any remaining rvalues with
qualified type: does "as if it had undergone an lvalue conversion"
remove qualifiers from the type of a qualified rvalue?</p>
</li>
<li>
<p><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2726.htm">N2726</a>
removed the <code>const</code> qualifier from <code>_Complex_I</code> and <code>_Imaginary_I</code>.</p>
</li>
<li>
<p>The resolution of C23 CD1 comment GB-065 extended the resolution of
issue 0423 to use the non-atomic versions of atomic types.</p>
</li>
</ul>
<p>In June 2024, Aaron Ballman pointed out in <a href="https://www.open-std.org/jtc1/sc22/wg14/26025">reflector message
26025</a> that it was
still possible to have a qualified rvalue when accessing a qualified
member of an rvalue structure or union (the result of a function call,
assignment expression, conditional expression or comma expression with
structure or union type), leading to a long discussion continuing
through July and into August. In that discussion, Alex Celeste
pointed out (<a href="https://www.open-std.org/jtc1/sc22/wg14/26098">message
26098</a>) that qualifiers
on array element types (which before C23 were not considered to be
qualifiers on the array type) should still be preserved.</p>
<p>Consistency with the direction of the sequence of changes listed above
would indicate that qualifiers and <code>_Atomic</code> should not be preserved
in other cases. That suggests the following would be valid.</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">s1</span><span style="color: #bbbbbb"> </span>{<span style="color: #bbbbbb"> </span><span style="color: #008000; font-weight: bold">const</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>i;<span style="color: #bbbbbb"> </span>}<span style="color: #bbbbbb"> </span>f1();
<span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">s2</span><span style="color: #bbbbbb"> </span>{<span style="color: #bbbbbb"> </span><span style="color: #008000; font-weight: bold">const</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>}<span style="color: #bbbbbb"> </span>f2();
<span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">s1a</span><span style="color: #bbbbbb"> </span>{<span style="color: #bbbbbb"> </span><span style="color: #B00040">_Atomic</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>i;<span style="color: #bbbbbb"> </span>}<span style="color: #bbbbbb"> </span>f1a();
<span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">s2a</span><span style="color: #bbbbbb"> </span>{<span style="color: #bbbbbb"> </span><span style="color: #B00040">_Atomic</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>}<span style="color: #bbbbbb"> </span>f2a();
<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>i;
<span style="color: #008000; font-weight: bold">extern</span><span style="color: #bbbbbb"> </span><span style="color: #008000; font-weight: bold">const</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: #008000; font-weight: bold">extern</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">_Atomic</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>aa[<span style="color: #666666">1</span>];
<span style="color: #008000; font-weight: bold">extern</span><span style="color: #bbbbbb"> </span>typeof(f1().i)<span style="color: #bbbbbb"> </span>i;
<span style="color: #008000; font-weight: bold">extern</span><span style="color: #bbbbbb"> </span>typeof(f2().a)<span style="color: #bbbbbb"> </span>a;
<span style="color: #008000; font-weight: bold">extern</span><span style="color: #bbbbbb"> </span>typeof(f1a().i)<span style="color: #bbbbbb"> </span>i;
<span style="color: #008000; font-weight: bold">extern</span><span style="color: #bbbbbb"> </span>typeof(f2a().a)<span style="color: #bbbbbb"> </span>aa;
<span style="color: #008000; font-weight: bold">static_assert</span>(<span style="color: #008000; font-weight: bold">_Generic</span>(f1().i,<span style="color: #bbbbbb"> </span><span style="color: #B00040">int</span><span style="color: #666666">:</span><span style="color: #bbbbbb"> </span><span style="color: #666666">1</span>,<span style="color: #bbbbbb"> </span><span style="color: #008000; font-weight: bold">default</span><span style="color: #666666">:</span><span style="color: #bbbbbb"> </span><span style="color: #666666">0</span>));
<span style="color: #008000; font-weight: bold">static_assert</span>(<span style="color: #008000; font-weight: bold">_Generic</span>(f2().a,<span style="color: #bbbbbb"> </span><span style="color: #008000; font-weight: bold">const</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #666666">*:</span><span style="color: #bbbbbb"> </span><span style="color: #666666">1</span>,<span style="color: #bbbbbb"> </span><span style="color: #008000; font-weight: bold">default</span><span style="color: #666666">:</span><span style="color: #bbbbbb"> </span><span style="color: #666666">0</span>));
<span style="color: #008000; font-weight: bold">static_assert</span>(<span style="color: #008000; font-weight: bold">_Generic</span>(f1a().i,<span style="color: #bbbbbb"> </span><span style="color: #B00040">int</span><span style="color: #666666">:</span><span style="color: #bbbbbb"> </span><span style="color: #666666">1</span>,<span style="color: #bbbbbb"> </span><span style="color: #008000; font-weight: bold">default</span><span style="color: #666666">:</span><span style="color: #bbbbbb"> </span><span style="color: #666666">0</span>));
<span style="color: #008000; font-weight: bold">static_assert</span>(<span style="color: #008000; font-weight: bold">_Generic</span>(f2a().a,<span style="color: #bbbbbb"> </span><span style="color: #B00040">_Atomic</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #666666">*:</span><span style="color: #bbbbbb"> </span><span style="color: #666666">1</span>,<span style="color: #bbbbbb"> </span><span style="color: #008000; font-weight: bold">default</span><span style="color: #666666">:</span><span style="color: #bbbbbb"> </span><span style="color: #666666">0</span>));
</pre></div>
<h3>Suggested correction</h3>
<p>In C23 6.5.3.4 (Structure and union members), insert at the end of the
first Semantics paragraph:</p>
<blockquote>
<p><ins>If the first expression is not an lvalue and the designated
member does not have array type, the result has the unqualified,
non-atomic version of the type of the designated member.</ins></p>
</blockquote>
<hr>
<p>Comment from Issues list maintainer on 2025-06-27:</p>
<p>In <a href="https://www.open-std.org/jtc1/sc22/wg14/29935">reflector message
29935</a>, Jens Gustedt
expresses concern about the removal of <code>_Atomic</code> qualifiers.</p>
<p>The handling of array members in non-lvalue structures and unions may
require updates in C2y to either the wording proposed in this issue or
the wording for array element access added in the integration of
<a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3517.htm">N3517</a>.
See <a href="https://www.open-std.org/jtc1/sc22/wg14/29936">reflector message
29936</a>.</p>
<hr>
<p>Comment from Issues list maintainer on 2025-09-01:</p>
<p>No vote was taken on a resolution for this issue at the August 2025
(Brno) meeting of WG14, because of the need to update the suggested
changes to take account of the integration of
<a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3517.htm">N3517</a> in
C2y.</p>
<p>In <a href="https://www.open-std.org/jtc1/sc22/wg14/33425">reflector message
33425</a>, the issue
submitter suggested two possible approaches to this.</p>
<h3>Suggested correction, option 1</h3>
<p>This option continues the approach that rvalue arrays can have
qualified types.</p>
<p>In C23 6.5.3.4 (Structure and union members), insert at the end of the
first Semantics paragraph:</p>
<blockquote>
<p><ins>If the first expression is not an lvalue and the designated
member does not have array type, the result has the unqualified,
non-atomic version of the type of the designated member.</ins></p>
</blockquote>
<p>In the wording added by N3517, make changes to preserve qualifiers on
rvalue arrays:</p>
<blockquote>
<p>If <code>E</code> is an lvalue, the expression is an lvalue; otherwise, the
expression is not an lvalue<del> and its type</del><ins>. If <code>E</code> is
an lvalue or the array’s element type is an array type, the type of
the expression is the array’s element type; otherwise, the type of
the expression</ins> is the unqualified, non-atomic version of the
array’s element type.</p>
</blockquote>
<h3>Suggested correction, option 2</h3>
<p>This option has strictly no qualified rvalues even when they are
arrays and it is possible to construct lvalues from their elements.</p>
<p>In C23 6.5.3.4 (Structure and union members), insert at the end of the
first Semantics paragraph:</p>
<blockquote>
<p><ins>If the first expression is not an lvalue, the result has the
unqualified, non-atomic version of the type of the designated
member.</ins></p>
</blockquote>
<hr>
<p>Comment from Issues list maintainer on 2026-02-09:</p>
<p>At the February 2026 meeting of WG14, option 2 for the suggested
correction was accepted, subject to review at the August 2026 meeting.</p>
<h3>Proposed correction</h3>
<p>In C23 6.5.3.4 (Structure and union members), insert at the end of the
first Semantics paragraph:</p>
<blockquote>
<p><ins>If the first expression is not an lvalue, the result has the
unqualified, non-atomic version of the type of the designated
member.</ins></p>
</blockquote>
<hr>
<p>Comment from Issues list maintainer on 2026-08-20:</p>
<p>At the August 2026 (Ottawa) meeting of WG14, the proposed correction
was adopted.</p>
<h3>Correction</h3>
<p>In C23 6.5.3.4 (Structure and union members), insert at the end of the
first Semantics paragraph:</p>
<blockquote>
<p><ins>If the first expression is not an lvalue, the result has the
unqualified, non-atomic version of the type of the designated
member.</ins></p>
</blockquote>
</div>
<hr>
<hr>
<div id="issue1002">
<h2>Issue 1002: Type qualifiers in <code>[*]</code> in abstract declarators</h2>
<p>Authors: Joseph Myers<br>
Date: 2025-03-06<br>
Status: Fixed<br>
Fixed in: C2Y<br>
Cross-references: <a href="https://www.open-std.org/jtc1/sc22/wg14/issues/c99/issue0289.html">0289</a></p>
<p>An array declarator can have the form (syntax in C23 6.7.7.1):</p>
<blockquote>
<p><em>direct-declarator</em> <code>[</code> <em>type-qualifier-list</em><sub>opt</sub> <code>*</code> <code>]</code></p>
</blockquote>
<p>but the corresponding abstract-declarator syntax in 6.7.8 omits the
<em>type-qualifier-list</em><sub>opt</sub>. David Keaton stated in
<a href="https://www.open-std.org/jtc1/sc22/wg14/14798">reflector message
14798</a> that this
difference was not deliberate. The response to <a href="https://www.open-std.org/jtc1/sc22/wg14/issues/c99/issue0289.html">issue
0289</a> fixed such a difference in the case where an
assignment expression is involved, but did nothing about the <code>[*]</code>
case.</p>
<p>If abstract declarators have a more restrictive syntax than
declarators, that confuses both the rules about replacing an
expression at function prototype scope with <code>*</code>, and the rule that
"If, in a parameter declaration, an identifier can be treated either
as a typedef name or as a parameter name, it shall be taken as a
typedef name.". It seems clear that the syntax should match in the
two cases.</p>
<h3>Suggested correction</h3>
<p>In C23 6.7.8 (Type names), change the fourth option in the Syntax for
array-abstract-declarator:</p>
<blockquote>
<p><em>direct-abstract-declarator</em><sub>opt</sub> <code>[</code> <ins><em>type-qualifier-list</em><sub>opt</sub></ins> <code>*</code> <code>]</code></p>
</blockquote>
<hr>
<p>Comment from Issues list maintainer on 2025-09-01:</p>
<p>At the August 2025 (Brno) meeting of WG14, the suggested correction
was accepted, subject to review at the next meeting.</p>
<h3>Proposed correction</h3>
<p>In C23 6.7.8 (Type names), change the fourth option in the Syntax for
array-abstract-declarator:</p>
<blockquote>
<p><em>direct-abstract-declarator</em><sub>opt</sub> <code>[</code> <ins><em>type-qualifier-list</em><sub>opt</sub></ins> <code>*</code> <code>]</code></p>
</blockquote>
<hr>
<p>Comment from Issues list maintainer on 2026-02-09:</p>
<p>At the February 2026 meeting of WG14, the proposed correction was
adopted.</p>
<h3>Correction</h3>
<p>In C23 6.7.8 (Type names), change the fourth option in the Syntax for
array-abstract-declarator:</p>
<blockquote>
<p><em>direct-abstract-declarator</em><sub>opt</sub> <code>[</code> <ins><em>type-qualifier-list</em><sub>opt</sub></ins> <code>*</code> <code>]</code></p>
</blockquote>
</div>
<hr>
<hr>
<div id="issue1003">
<h2>Issue 1003: Linkage between library functions</h2>
<p>Authors: Joseph Myers<br>
Date: 2025-03-07<br>
Status: Fixed<br>
Fixed in: C2Y<br>
Cross-references: <a href="https://www.open-std.org/jtc1/sc22/wg14/issues/c90/issue0078.html">0078</a></p>
<p>C23 footnote 20, in 6.2.2 (Linkages of identifiers), says:</p>
<blockquote>
<p>There is no linkage between different identifiers.</p>
</blockquote>
<p>Is this footnote (not normative) referring only to linkage between
identifiers defined by the user's program? Or is it also intended to
say that there cannot be linkage between different library functions?</p>
<p>In practice, it is common that pointers to library functions with
compatible semantics may compare equal: that <code>memcpy == memmove</code>, or
<code>ldexp == scalbn</code>, for example. The response to <a href="https://www.open-std.org/jtc1/sc22/wg14/issues/c90/issue0078.html">C90 issue
0078</a> said that this is permitted. However, the footnote
in question was added in C99, which makes it less clear if that issue
response reflects the current intent.</p>
<p>It seems appropriate to amend both normative and non-normative text to
make clear that it is OK for pointers to different library functions
to compare equal.</p>
<h3>Suggested correction</h3>
<p>In C23 7.1.2 (Standard headers), insert text as follows.</p>
<blockquote>
<p>Any declaration of a library function shall have external linkage.
<ins>Pointers to different library functions may compare equal where
this is compatible with the semantics of those
functions.<sup>FN)</sup></ins></p>
</blockquote>
<blockquote>
<p><ins><sup>FN)</sup>For example, it is possible that <code>memcpy == memmove</code> or that <code>ldexp == scalbn</code>.</ins></p>
</blockquote>
<p>In C23 6.2.2 (Linkages of identifiers), amend footnote 20 as follows.</p>
<blockquote>
<p><del>There is no</del> <ins>This document does not define any
mechanism to establish</ins> linkage between different identifiers.
<ins>As described in 7.1.2, it is possible that pointers to
different library functions compare equal where that is compatible
with the semantics of those functions.</ins></p>
</blockquote>
<hr>
<p>Comment from Issues list maintainer on 2025-09-01:</p>
<p>At the August 2025 (Brno) meeting of WG14, the suggested correction
was accepted, subject to review at the next meeting.</p>
<h3>Proposed correction</h3>
<p>In C23 7.1.2 (Standard headers), insert text as follows.</p>
<blockquote>
<p>Any declaration of a library function shall have external linkage.
<ins>Pointers to different library functions may compare equal where
this is compatible with the semantics of those
functions.<sup>FN)</sup></ins></p>
</blockquote>
<blockquote>
<p><ins><sup>FN)</sup>For example, it is possible that <code>memcpy == memmove</code> or that <code>ldexp == scalbn</code>.</ins></p>
</blockquote>
<p>In C23 6.2.2 (Linkages of identifiers), amend footnote 20 as follows.</p>
<blockquote>
<p><del>There is no</del> <ins>This document does not define any
mechanism to establish</ins> linkage between different identifiers.
<ins>As described in 7.1.2, it is possible that pointers to
different library functions compare equal where that is compatible
with the semantics of those functions.</ins></p>
</blockquote>
<hr>
<p>Comment from Issues list maintainer on 2026-02-09:</p>
<p>At the February 2026 meeting of WG14, the proposed correction was
adopted.</p>
<h3>Correction</h3>
<p>In C23 7.1.2 (Standard headers), insert text as follows.</p>
<blockquote>
<p>Any declaration of a library function shall have external linkage.
<ins>Pointers to different library functions may compare equal where
this is compatible with the semantics of those
functions.<sup>FN)</sup></ins></p>
</blockquote>
<blockquote>
<p><ins><sup>FN)</sup>For example, it is possible that <code>memcpy == memmove</code> or that <code>ldexp == scalbn</code>.</ins></p>
</blockquote>
<p>In C23 6.2.2 (Linkages of identifiers), amend footnote 20 as follows.</p>
<blockquote>
<p><del>There is no</del> <ins>This document does not define any
mechanism to establish</ins> linkage between different identifiers.
<ins>As described in 7.1.2, it is possible that pointers to
different library functions compare equal where that is compatible
with the semantics of those functions.</ins></p>
</blockquote>
</div>
<hr>
<hr>
<div id="issue1004">
<h2>Issue 1004: Classification of <code>scanf</code> failures</h2>
<p>Authors: Joseph Myers<br>
Date: 2025-03-07<br>
Status: Fixed (pending integration in working draft)<br>
Fixed in: C2Y<br>
Cross-references: <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1012">1012</a></p>
<p>C23 7.23.6.3 (The <code>fscanf</code> function) describes failures as follows:</p>
<blockquote>
<p>Failures are described as input failures (due to the occurrence of
an encoding error or the unavailability of input characters), or
matching failures (due to inappropriate input).</p>
</blockquote>
<p>Unsupported specific width length modifiers (for example, <code>%w123d</code> if
there is no <code>int123_t</code> or <code>int_least123_t</code> type and <code>w123</code> is not
implementation-defined to be supported anyway) are defined as error
conditions for both <code>printf</code> and <code>scanf</code> functions (rather than
undefined behavior). But is such an error an input failure or a
matching failure? Or is it some new kind of failure, requiring the
quoted dichotomy to be updated?</p>
<p>The same issue also applies for <code>fwscanf</code>.</p>
<p>No specific change is proposed here to address this issue since
appropriate wording would depend on direction from the committee on
what kind of failure this should be.</p>
<hr>
<p>Comment from Issues list maintainer on 2025-09-01:</p>
<p>At the August 2025 (Brno) meeting of WG14, the committee gave
direction to treat this as a matching failure rather than a third
kind of failure.</p>
<p>In <a href="https://www.open-std.org/jtc1/sc22/wg14/33426">reflector message
33426</a>, the issue
submitter suggested possible wording for this.</p>
<h3>Suggested correction</h3>
<p>In C23 7.23.6.3 (The <code>fscanf</code> function), insert:</p>
<blockquote>
<p>Failures are described as input failures (due to the occurrence of
an encoding error or the unavailability of input characters), or
matching failures (due to inappropriate input). <ins>If the
implementation does not support a specific width length modifier,
this is a matching failure.</ins></p>
</blockquote>
<p>Under Returns, remove:</p>
<blockquote>
<p>Otherwise, the function returns the number of input items assigned,
which can be fewer than provided for, or even zero, in the event of
an early matching failure<del> or if the implementation does not
support a specific width length modifier</del>.</p>
</blockquote>
<p>Make the same changes in C23 7.31.2.3 (The <code>fwscanf</code> function).</p>
<p>These changes would supersede those for <code>scanf</code> functions in <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1012">issue
1012</a>.</p>
<p>The wording was further discussed in reflector messages
<a href="https://www.open-std.org/jtc1/sc22/wg14/33429">33429</a> and
<a href="https://www.open-std.org/jtc1/sc22/wg14/33435">33435</a>.</p>
<hr>
<p>Comment from Issues list maintainer on 2026-02-09:</p>
<p>At the February 2026 meeting of WG14, the suggested correction was
accepted, subject to review at the August 2026 meeting.</p>
<h3>Proposed correction</h3>
<p>In C23 7.23.6.3 (The <code>fscanf</code> function), insert:</p>
<blockquote>
<p>Failures are described as input failures (due to the occurrence of
an encoding error or the unavailability of input characters), or
matching failures (due to inappropriate input). <ins>If the
implementation does not support a specific width length modifier,
this is a matching failure.</ins></p>
</blockquote>
<p>Under Returns, remove:</p>
<blockquote>
<p>Otherwise, the function returns the number of input items assigned,
which can be fewer than provided for, or even zero, in the event of
an early matching failure<del> or if the implementation does not
support a specific width length modifier</del>.</p>
</blockquote>
<p>Make the same changes in C23 7.31.2.3 (The <code>fwscanf</code> function).</p>
<p>These changes would supersede those for <code>scanf</code> functions in <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1012">issue
1012</a>.</p>
<hr>
<p>Comment from Issues list maintainer on 2026-08-20:</p>
<p>At the August 2026 (Ottawa) meeting of WG14, the proposed correction
was adopted.</p>
<h3>Correction</h3>
<p>In C23 7.23.6.3 (The <code>fscanf</code> function), insert:</p>
<blockquote>
<p>Failures are described as input failures (due to the occurrence of
an encoding error or the unavailability of input characters), or
matching failures (due to inappropriate input). <ins>If the
implementation does not support a specific width length modifier,
this is a matching failure.</ins></p>
</blockquote>
<p>Under Returns, remove:</p>
<blockquote>
<p>Otherwise, the function returns the number of input items assigned,
which can be fewer than provided for, or even zero, in the event of
an early matching failure<del> or if the implementation does not
support a specific width length modifier</del>.</p>
</blockquote>
<p>Make the same changes in C23 7.31.2.3 (The <code>fwscanf</code> function).</p>
</div>
<hr>
<hr>
<div id="issue1005">
<h2>Issue 1005: Annex D refers to option removed from UAX#31 in revision 39</h2>
<p>Authors: Joseph Myers<br>
Date: 2025-03-07<br>
Status: Fixed<br>
Fixed in: C2Y</p>
<p>C23 D.2.2 (Restricted Format Characters) refers to an option
UAX#31-R1a that appears to have been removed in <a href="https://www.unicode.org/reports/tr31/tr31-39.html">revision 39 of
UAX#31</a> (the
<a href="https://www.unicode.org/reports/tr31/">current revision</a> as of this
writing is revision 41).</p>
<p>This subclause should thus be updated or removed. See <a href="https://www.open-std.org/jtc1/sc22/wg14/25125">reflector
message 25125</a> for some
relevant references. It would be best for our Unicode experts and C++
liaison to establish what fix is best and most compatible with C++,
but in the absence of that I propose the obvious minimal change.</p>
<h3>Suggested correction</h3>
<p>Remove C23 D.2.2 (Restricted Format Characters).</p>
<hr>
<p>Comment from Issues list maintainer on 2025-09-01:</p>
<p>At the August 2025 (Brno) meeting of WG14, the suggested correction
was accepted, subject to review at the next meeting.</p>
<h3>Proposed correction</h3>
<p>Remove C23 D.2.2 (Restricted Format Characters).</p>
<hr>
<p>Comment from Issues list maintainer on 2026-02-09:</p>
<p>At the February 2026 meeting of WG14, the proposed correction was
adopted.</p>
<h3>Correction</h3>
<p>Remove C23 D.2.2 (Restricted Format Characters).</p>
</div>
<hr>
<hr>
<div id="issue1006">
<h2>Issue 1006: <code>atomic_fetch</code> operations and "address types"</h2>
<p>Authors: Joseph Myers<br>
Date: 2025-03-07<br>
Status: Fixed<br>
Fixed in: C2Y</p>
<p>C23 7.17.7.6 (The <code>atomic_fetch</code> and modify generic functions) says:</p>
<blockquote>
<p>All these operations are applicable to an object of any atomic
integer type other than <code>_Atomic bool</code>, <code>atomic_bool</code>, or the atomic
version of an enumeration with underlying type <code>bool</code>.</p>
</blockquote>
<p>and then later says:</p>
<blockquote>
<p>For address types, the result may be an undefined address, but the
operations otherwise have no undefined behavior.</p>
</blockquote>
<p>The effect seems to be confused about whether pointer types should be
included or not; the first quoted sentence clearly does not include
them, but the second one seems to envisage that they might be
included. It also has further problems:</p>
<ul>
<li>There is no definition of "address types" in the standard.</li>
<li>As pointed out by Martin Uecker in the February 2023 meeting, there
is no definition of "undefined address" either.</li>
</ul>
<p>Making the minimal change of removing the second quoted sentence, as
suggested in C23 CD1 comment GB-196, did not receive consensus, but
the wording is still defective in its present state so some change is
needed to address that (either allowing pointer types and adjusting
the wording to avoid using terminology that is not defined, or
removing the problematic sentence if only integer types are to be
allowed). A larger set of changes, mixing both normative and
non-normative changes but including changes to allow pointer types
here, was in
<a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2389.pdf">N2389</a>,
which was <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2509.pdf#page=8">discussed in Ithaca, October
2019</a>.</p>
<p>Given the previous lack of consensus, no specific wording change is
proposed here; committee direction would be needed before proposing
specific changes to address this issue.</p>
<hr>
<p>Comment from Issues list maintainer on 2025-06-27:</p>
<p><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3542.htm">N3542</a>
proposes changes that would address this issue.</p>
<hr>
<p>Comment from Issues list maintainer on 2025-09-01:</p>
<p>At the August 2025 (Brno) meeting of WG14, the committee discussed
<a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3606.htm">N3606</a>
and supported making changes along the lines. This was queued for an
online vote on adoption of a fixed version of the paper.</p>
<hr>
<p>Comment from Issues list maintainer on 2026-02-09:</p>
<p>This issue was resolved at the February 2026 meeting of WG14 by
adoption of
<a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3788.htm">N3788</a>
into C2y.</p>
</div>
<hr>
<hr>
<div id="issue1007">
<h2>Issue 1007: Implicitly unsigned bit-fields ambiguity</h2>
<p>Authors: Joseph Myers<br>
Date: 2025-03-11<br>
Status: Fixed (pending integration in working draft)<br>
Fixed in: C2Y<br>
Cross-references: <a href="https://www.open-std.org/jtc1/sc22/wg14/issues/c99/issue0315.html">0315</a></p>
<p>There are several cases in which the rule that bit-fields declared
with types that are not explicitly <code>signed</code> or <code>unsigned</code> might be
treated as if either <code>signed</code> or <code>unsigned</code> had been specified leaves
ambiguity about exactly what is permitted. One such case dates back
to C90, and others have arisen over time as features have been added
to the standard (but they are all included together in this issue
report given how closely related they are).</p>
<p>In C23, the rule is specified in 6.7.3.1 (Type specifiers):</p>
<blockquote>
<p>Each of the comma-separated multisets designates the same type,
except that for bit-fields, it is implementation-defined whether the
specifier <code>int</code> designates the same type as <code>signed int</code> or the same
type as <code>unsigned int</code>.</p>
</blockquote>
<p>Footnote 132, in 6.7.3.2 (Structure and union specifiers), explicitly
notes that such a type might be produced from a typedef name or typeof
specifiers:</p>
<blockquote>
<p>As specified in 6.7.3, if the actual type specifier used is <code>int</code> or
a typedef-name defined as <code>int</code>, then it is implementation-defined
whether the bit-field is signed or unsigned. This includes an <code>int</code>
type specifier produced using the typeof specifiers (6.7.3.6).</p>
</blockquote>
<p>(It's not entirely clear that this inclusion of typedef names is
adequately supported by the normative text, but that's not the subject
of this issue report.)</p>
<p>The final response to <a href="https://www.open-std.org/jtc1/sc22/wg14/issues/c99/issue0315.html">issue 0315</a> said the
implementation-defined signedness also applied for other
implementation-defined declared types such as <code>char</code>, <code>short</code>, <code>long</code>
and <code>long long</code>.</p>
<p>No specific wording is suggested to address the questions here, as
direction from the committee is needed. For C2Y, my preference would
be to follow C++14 and remove the option for bit-fields to be
implicitly unsigned when the declared type is not unsigned, but that
would need a separate paper and not be appropriate to apply to C23
(notwithstanding that <a href="https://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#739">C++ core issue
739</a>
was considered a defect for C++). If that change were made for C2Y,
it might then be appropriate to declare most of these cases explicitly
unspecified for C23; if no such change is made for C2Y, further
consideration should be given to specifying some of these cases
explicitly.</p>
<h3>Question 1</h3>
<p>Suppose the declared type of the bit-field is a typedef name defined
in a standard header and required to be a signed integer type. Must
that type also be signed as a bit-field, or might it be unsigned (for
example, plain <code>int</code>)?</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#include</span><span style="color: #bbbbbb"> </span><span style="color: #3D7B7B; font-style: italic"><stddef.h></span>
<span style="color: #9C6500">#include</span><span style="color: #bbbbbb"> </span><span style="color: #3D7B7B; font-style: italic"><stdint.h></span>
<span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">s1</span><span style="color: #bbbbbb"> </span>{
<span style="color: #bbbbbb"> </span><span style="color: #B00040">ptrdiff_t</span><span style="color: #bbbbbb"> </span>b1a<span style="color: #bbbbbb"> </span><span style="color: #666666">:</span><span style="color: #bbbbbb"> </span><span style="color: #666666">20</span>;
<span style="color: #bbbbbb"> </span><span style="color: #B00040">int32_t</span><span style="color: #bbbbbb"> </span>b1b<span style="color: #bbbbbb"> </span><span style="color: #666666">:</span><span style="color: #bbbbbb"> </span><span style="color: #666666">20</span>;
};
</pre></div>
<p>Although <code>ptrdiff_t</code> illustrates that this issue was present in C90,
it may be more likely to be encountered with types such as <code>int32_t</code>.</p>
<p>If the option for bit-fields to be implicitly unsigned is not removed,
it might be appropriate to require typedefs in standard headers that
are required to be signed integer types to be signed as bit-field
types as well.</p>
<h3>Question 2</h3>
<p>C11 introduced the rule that typedef names can be redefined with the
same type in the same scope. But what if the type is only the same
outside of bit-fields? Is the type of the bit-field considered
explicitly signed when one definition uses <code>signed</code> and another does
not?</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #008000; font-weight: bold">typedef</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>T;
<span style="color: #008000; font-weight: bold">typedef</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">signed</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>T;
<span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">s2</span><span style="color: #bbbbbb"> </span>{
<span style="color: #bbbbbb"> </span>T<span style="color: #bbbbbb"> </span>b2<span style="color: #bbbbbb"> </span><span style="color: #666666">:</span><span style="color: #bbbbbb"> </span><span style="color: #666666">20</span>;
};
</pre></div>
<h3>Question 3</h3>
<p>In some cases, it seems clear whether a type from the typeof
specifiers should be considered explicitly signed. For example,
typeof specifiers applied to a type name do not introduce any issues,
and if the typeof specifiers are applied to an expression referring to
a single declaration, or to a cast, it seems clear whether the
resulting type is explicitly signed.</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>i;
<span style="color: #B00040">signed</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>si;
<span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">s3a</span><span style="color: #bbbbbb"> </span>{
<span style="color: #bbbbbb"> </span>typeof<span style="color: #bbbbbb"> </span>(<span style="color: #B00040">int</span>)<span style="color: #bbbbbb"> </span>b3a<span style="color: #bbbbbb"> </span><span style="color: #666666">:</span><span style="color: #bbbbbb"> </span><span style="color: #666666">20</span>;<span style="color: #bbbbbb"> </span><span style="color: #3D7B7B; font-style: italic">// not explicitly signed</span>
<span style="color: #bbbbbb"> </span>typeof<span style="color: #bbbbbb"> </span>(<span style="color: #B00040">signed</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">int</span>)<span style="color: #bbbbbb"> </span>b3b<span style="color: #bbbbbb"> </span><span style="color: #666666">:</span><span style="color: #bbbbbb"> </span><span style="color: #666666">20</span>;<span style="color: #bbbbbb"> </span><span style="color: #3D7B7B; font-style: italic">// explicitly signed</span>
<span style="color: #bbbbbb"> </span>typeof<span style="color: #bbbbbb"> </span>(i)<span style="color: #bbbbbb"> </span>b3c<span style="color: #bbbbbb"> </span><span style="color: #666666">:</span><span style="color: #bbbbbb"> </span><span style="color: #666666">20</span>;<span style="color: #bbbbbb"> </span><span style="color: #3D7B7B; font-style: italic">// not explicitly signed</span>
<span style="color: #bbbbbb"> </span>typeof<span style="color: #bbbbbb"> </span>(si)<span style="color: #bbbbbb"> </span>b3d<span style="color: #bbbbbb"> </span><span style="color: #666666">:</span><span style="color: #bbbbbb"> </span><span style="color: #666666">20</span>;<span style="color: #bbbbbb"> </span><span style="color: #3D7B7B; font-style: italic">// explicitly signed</span>
<span style="color: #bbbbbb"> </span>typeof<span style="color: #bbbbbb"> </span>((<span style="color: #B00040">int</span>)<span style="color: #bbbbbb"> </span>si)<span style="color: #bbbbbb"> </span>b3e<span style="color: #bbbbbb"> </span><span style="color: #666666">:</span><span style="color: #bbbbbb"> </span><span style="color: #666666">20</span>;<span style="color: #bbbbbb"> </span><span style="color: #3D7B7B; font-style: italic">// not explicitly signed</span>
<span style="color: #bbbbbb"> </span>typeof<span style="color: #bbbbbb"> </span>((<span style="color: #B00040">signed</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">int</span>)<span style="color: #bbbbbb"> </span>i)<span style="color: #bbbbbb"> </span>b3f<span style="color: #bbbbbb"> </span><span style="color: #666666">:</span><span style="color: #bbbbbb"> </span><span style="color: #666666">20</span>;<span style="color: #bbbbbb"> </span><span style="color: #3D7B7B; font-style: italic">// explicitly signed</span>
};
</pre></div>
<p>In some other cases, it is less clear: where composite types are
involved, or usual arithmetic conversions, for example.</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>i;
<span style="color: #B00040">signed</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>si;
<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>x;
<span style="color: #008000; font-weight: bold">extern</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">signed</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>x;
<span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">s3b</span><span style="color: #bbbbbb"> </span>{
<span style="color: #bbbbbb"> </span>typeof<span style="color: #bbbbbb"> </span>(x)<span style="color: #bbbbbb"> </span>b3g<span style="color: #bbbbbb"> </span><span style="color: #666666">:</span><span style="color: #bbbbbb"> </span><span style="color: #666666">20</span>;
<span style="color: #bbbbbb"> </span>typeof<span style="color: #bbbbbb"> </span>(i<span style="color: #bbbbbb"> </span><span style="color: #666666">+</span><span style="color: #bbbbbb"> </span>si)<span style="color: #bbbbbb"> </span>b3h<span style="color: #bbbbbb"> </span><span style="color: #666666">:</span><span style="color: #bbbbbb"> </span><span style="color: #666666">20</span>;
};
</pre></div>
<p>In some further cases, the type appears to be specified as not
explicitly signed (and so potentially unsigned as a bit-field) because
the standard says <code>int</code> rather than <code>signed int</code>, but may not have
been considering this issue.</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #B00040">signed</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">short</span><span style="color: #bbbbbb"> </span>s;
<span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">s3c</span><span style="color: #bbbbbb"> </span>{
<span style="color: #bbbbbb"> </span>typeof<span style="color: #bbbbbb"> </span>(<span style="color: #666666">+</span>s)<span style="color: #bbbbbb"> </span>b3i<span style="color: #bbbbbb"> </span><span style="color: #666666">:</span><span style="color: #bbbbbb"> </span><span style="color: #666666">20</span>;<span style="color: #bbbbbb"> </span><span style="color: #3D7B7B; font-style: italic">// integer promotions convert signed short to int</span>
<span style="color: #bbbbbb"> </span>typeof<span style="color: #bbbbbb"> </span>(s<span style="color: #bbbbbb"> </span><span style="color: #666666">==</span><span style="color: #bbbbbb"> </span>s)<span style="color: #bbbbbb"> </span>b3j<span style="color: #bbbbbb"> </span><span style="color: #666666">:</span><span style="color: #bbbbbb"> </span><span style="color: #666666">20</span>;<span style="color: #bbbbbb"> </span><span style="color: #3D7B7B; font-style: italic">// comparisons return int</span>
<span style="color: #bbbbbb"> </span>typeof<span style="color: #bbbbbb"> </span>(<span style="color: #666666">0</span>)<span style="color: #bbbbbb"> </span>b3k<span style="color: #bbbbbb"> </span><span style="color: #666666">:</span><span style="color: #bbbbbb"> </span><span style="color: #666666">20</span>;<span style="color: #bbbbbb"> </span><span style="color: #3D7B7B; font-style: italic">// this integer literal has type int</span>
<span style="color: #bbbbbb"> </span>typeof<span style="color: #bbbbbb"> </span>(<span style="color: #666666">-1</span>)<span style="color: #bbbbbb"> </span>b3l<span style="color: #bbbbbb"> </span><span style="color: #666666">:</span><span style="color: #bbbbbb"> </span><span style="color: #666666">20</span>;<span style="color: #bbbbbb"> </span><span style="color: #3D7B7B; font-style: italic">// negating an int literal leaves type int</span>
};
</pre></div>
<p>Which of the above cases should be considered explicitly signed, and
which should not?</p>
<h3>Question 4</h3>
<p>Does the rule about implementation-defined signedness include
<code>_BitInt</code>?</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">s4</span><span style="color: #bbbbbb"> </span>{
<span style="color: #bbbbbb"> </span><span style="color: #B00040">_BitInt</span><span style="color: #bbbbbb"> </span>(<span style="color: #666666">32</span>)<span style="color: #bbbbbb"> </span>b4<span style="color: #bbbbbb"> </span><span style="color: #666666">:</span><span style="color: #bbbbbb"> </span><span style="color: #666666">20</span>;<span style="color: #bbbbbb"> </span><span style="color: #3D7B7B; font-style: italic">// may this be unsigned?</span>
};
</pre></div>
<p>I think there is a reasonable case to answer "no" to this question
based only on the current wording, on the basis that the response to
issue 0315 was only concerned with implementation-defined bit-field
types, and support for <code>_BitInt</code> types for bit-fields is not
implementation-defined.</p>
<h3>Question 5</h3>
<p>If the answer to Question 4 is "yes", does the constraint disallowing
a type <code>_BitInt(1)</code> apply before or after the reinterpretation as
unsigned for a bit-field?</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">s5</span><span style="color: #bbbbbb"> </span>{
<span style="color: #bbbbbb"> </span><span style="color: #B00040">_BitInt</span><span style="color: #bbbbbb"> </span>(<span style="color: #666666">1</span>)<span style="color: #bbbbbb"> </span>b5<span style="color: #bbbbbb"> </span><span style="color: #666666">:</span><span style="color: #bbbbbb"> </span><span style="color: #666666">1</span>;<span style="color: #bbbbbb"> </span><span style="color: #3D7B7B; font-style: italic">// is this valid if _BitInt bit-fields are unsigned?</span>
};
</pre></div>
<hr>
<p>Comment from Issues list maintainer on 2025-09-01:</p>
<p>In <a href="https://www.open-std.org/jtc1/sc22/wg14/33157">reflector message
33157</a>, Robert Seacord
suggested that all ambiguous cases should be viewed as explicitly
signed.</p>
<p>This issue was discussed at the August 2025 (Brno) meeting of WG14 but
without establishing any clear direction for C2y. A desire was
expressed for more information on what different compilers with
implicitly unsigned bit-fields do on the given examples.</p>
<hr>
<p>Comment from Issues list maintainer on 2026-02-09:</p>
<p>This issue was discussed again at the February 2026 meeting of WG14,
with Robert Seacord taking the action item to write a paper on it.</p>
<hr>
<p>Comment from Issues list maintainer on 2026-02-23:</p>
<p>Robert Seacord provided
<a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3828.pdf">N3828</a>
that discusses this issue and proposes removing the option for
bit-fields to be implicitly unsigned.</p>
<hr>
<p>Comment from Issues list maintainer on 2026-06-25:</p>
<p>Robert Seacord provided a revised paper
<a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3902.pdf">N3902</a>
that discusses this issue and proposes removing the option for
bit-fields to be implicitly unsigned.</p>
<hr>
<p>Comment from Issues list maintainer on 2026-08-19:</p>
<p>This issue was handled at the August 2026 (Ottawa) meeting of WG14 via
processing the
<a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3902.pdf">N3902</a>
paper rather than through the issue handling process. That paper was
adopted into C2y. There was no consensus to add it to the Extensions
to Obsolete Versions of C list.</p>
</div>
<hr>
<hr>
<div id="issue1008">
<h2>Issue 1008: Bad constraint on attributes with tags</h2>
<p>Authors: Joseph Myers<br>
Date: 2025-03-11<br>
Status: Fixed<br>
Fixed in: C2Y</p>
<p>C23 6.7.3.2 (Structure and union specifiers) contains a constraint:</p>
<blockquote>
<p>An attribute specifier sequence shall not appear in a
struct-or-union specifier without a member declaration list, except
in a declaration of the form:</p>
</blockquote>
<blockquote>
<blockquote>
<p><em>struct-or-union</em> <em>attribute-specifier-sequence</em> <em>identifier</em> <code>;</code></p>
</blockquote>
</blockquote>
<p>C23 6.7.3.4 (Tags) contains a stricter constraint:</p>
<blockquote>
<p>A type specifier of the form</p>
</blockquote>
<blockquote>
<blockquote>
<p><em>struct-or-union</em> <em>attribute-specifier-sequence</em><sub>opt</sub> <em>identifier</em></p>
</blockquote>
</blockquote>
<blockquote>
<p>shall not contain an attribute specifier sequence.</p>
</blockquote>
<p>The latter constraint does not make sense; if such an attribute
specifier sequence is not allowed, why is this case in the syntax for
struct-or-union-specifier at all?</p>
<p>The stated intent given in drafting notes in
<a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2335.pdf">N2335</a> was:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span>[[something]]<span style="color: #bbbbbb"> </span>x;<span style="color: #bbbbbb"> </span><span style="color: #3D7B7B; font-style: italic">/* valid */</span>
<span style="color: #B00040">void</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">f</span>(<span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span>[[something]]<span style="color: #bbbbbb"> </span>s);<span style="color: #bbbbbb"> </span><span style="color: #3D7B7B; font-style: italic">/* invalid */</span>
</pre></div>
<p>However, both those cases go through the syntax for type-specifier, so
both would be invalid with the constraints as written.</p>
<p>I think the latter constraint is in fact not needed at all because
everything relevant is covered in the first quoted constraint.</p>
<h3>Suggested correction</h3>
<p>In C23 6.7.3.4 (Tags), remove the paragraph (including attached
footnote):</p>
<blockquote>
<p><del>A type specifier of the form</del></p>
</blockquote>
<blockquote>
<blockquote>
<p><del><em>struct-or-union</em> <em>attribute-specifier-sequence</em><sub>opt</sub> <em>identifier</em></del></p>
</blockquote>
</blockquote>
<blockquote>
<p><del>shall not contain an attribute specifier sequence.<sup>141)</sup></del></p>
</blockquote>
<blockquote>
<p><del><sup>141)</sup> As specified in 6.7.3.2, the type specifier can
be followed by a <code>;</code> or a member declaration list.</del></p>
</blockquote>
<hr>
<p>Comment from Issues list maintainer on 2025-09-01:</p>
<p>At the August 2025 (Brno) meeting of WG14, the suggested correction
was accepted, subject to review at the next meeting.</p>
<h3>Proposed correction</h3>
<p>In C23 6.7.3.4 (Tags), remove the paragraph (including attached
footnote):</p>
<blockquote>
<p><del>A type specifier of the form</del></p>
</blockquote>
<blockquote>
<blockquote>
<p><del><em>struct-or-union</em> <em>attribute-specifier-sequence</em><sub>opt</sub> <em>identifier</em></del></p>
</blockquote>
</blockquote>
<blockquote>
<p><del>shall not contain an attribute specifier sequence.<sup>141)</sup></del></p>
</blockquote>
<blockquote>
<p><del><sup>141)</sup> As specified in 6.7.3.2, the type specifier can
be followed by a <code>;</code> or a member declaration list.</del></p>
</blockquote>
<hr>
<p>Comment from Issues list maintainer on 2026-02-09:</p>
<p>At the February 2026 meeting of WG14, the proposed correction was
adopted.</p>
<h3>Correction</h3>
<p>In C23 6.7.3.4 (Tags), remove the paragraph (including attached
footnote):</p>
<blockquote>
<p><del>A type specifier of the form</del></p>
</blockquote>
<blockquote>
<blockquote>
<p><del><em>struct-or-union</em> <em>attribute-specifier-sequence</em><sub>opt</sub> <em>identifier</em></del></p>
</blockquote>
</blockquote>
<blockquote>
<p><del>shall not contain an attribute specifier sequence.<sup>141)</sup></del></p>
</blockquote>
<blockquote>
<p><del><sup>141)</sup> As specified in 6.7.3.2, the type specifier can
be followed by a <code>;</code> or a member declaration list.</del></p>
</blockquote>
</div>
<hr>
<hr>
<div id="issue1009">
<h2>Issue 1009: <code>extern thread_local</code> should not be an external definition</h2>
<p>Authors: Joseph Myers<br>
Date: 2025-03-12<br>
Status: Fixed<br>
Fixed in: C2Y</p>
<p>The following issue was pointed out by Ori Bernstein in <a href="https://www.open-std.org/jtc1/sc22/wg14/25279">reflector
message 25279</a>.</p>
<p>C23 6.9.3 says:</p>
<blockquote>
<p>If the declaration of an identifier for an object has file scope and
an initializer, or has file scope and storage-class specifier
<code>thread_local</code>, the declaration is an external definition for the
identifier.</p>
</blockquote>
<p>This fails to allow for the combination <code>extern thread_local</code>, which
should not be an external definition.</p>
<h3>Suggested correction</h3>
<p>In C23 6.9.3, amend the quoted paragraph as follows:</p>
<blockquote>
<p>If the declaration of an identifier for an object has file scope and
an initializer, or has file scope and storage-class specifier
<code>thread_local</code> <ins>without <code>extern</code></ins>, the declaration is an
external definition for the identifier.</p>
</blockquote>
<hr>
<p>Comment from Issues list maintainer on 2025-09-01:</p>
<p>At the August 2025 (Brno) meeting of WG14, the suggested correction
was accepted, subject to review at the next meeting.</p>
<h3>Proposed correction</h3>
<p>In C23 6.9.3, amend the quoted paragraph as follows:</p>
<blockquote>
<p>If the declaration of an identifier for an object has file scope and
an initializer, or has file scope and storage-class specifier
<code>thread_local</code> <ins>without <code>extern</code></ins>, the declaration is an
external definition for the identifier.</p>
</blockquote>
<hr>
<p>Comment from Issues list maintainer on 2026-02-09:</p>
<p>At the February 2026 meeting of WG14, the proposed correction was
adopted.</p>
<h3>Correction</h3>
<p>In C23 6.9.3, amend the quoted paragraph as follows:</p>
<blockquote>
<p>If the declaration of an identifier for an object has file scope and
an initializer, or has file scope and storage-class specifier
<code>thread_local</code> <ins>without <code>extern</code></ins>, the declaration is an
external definition for the identifier.</p>
</blockquote>
</div>
<hr>
<hr>
<div id="issue1010">
<h2>Issue 1010: Termination of the execution with threads</h2>
<p>Authors: Jens Gustedt<br>
Date: 2025-03-13<br>
Status: Open</p>
<p>In C23 there is still ambiguity concerning the termination of the
execution in the presence of threads, in particular if some threads
are detached and not joined during the execution. Here, the behavior
of <code>thrd_exit</code> for the last thread is not sufficiently
clarified. C23 7.28.5.5 (The <code>thrd_exit</code> function) p5 states</p>
<blockquote>
<p>The program terminates normally after the last thread has been
terminated. The behavior is as if the program called the <code>exit</code>
function with the status <code>EXIT_SUCCESS</code> at thread termination time.</p>
</blockquote>
<p>This text seems to indicate that the notion of happens-before extends
to the overall termination of all threads (thus a "last" thread), but
it leaves it unspecified whether or not the execution of the cleanup
code that is run on <code>exit</code> (<code>atexit</code> handlers, closure of streams and
similar) synchronizes with threads that have been detached.</p>
<p>Our observation of implementations seems to indicate that such a
synchronization does indeed take place, it would be better to note
this explicitly in the standard. We propose to change the above
paragraph to the following:</p>
<blockquote>
<p>The program terminates normally after the last thread has been
terminated. The behavior is as if the <del>program</del> <ins>end of
the call to <code>thrd_exit</code> of this last thread synchronized with all
terminations of other threads of the execution and thereafter is</ins>
called the <code>exit</code> function with the status <code>EXIT_SUCCESS</code> <del>at
thread termination time</del>.</p>
</blockquote>
<hr>
<p>Comment from Issues list maintainer on 2025-06-27:</p>
<p><a href="https://www.open-std.org/jtc1/sc22/wg14/29707">Reflector message
29707</a> provides a
revised wording suggestion and <a href="https://www.open-std.org/jtc1/sc22/wg14/29718">reflector message
29718</a> comments on that
suggestion.</p>
<hr>
<p>Comment from Issues list maintainer on 2025-09-01:</p>
<p>This issue was discussed at the August 2025 (Brno) meeting of WG14 but
without voting on specific wording. It was noted that "is called" is
misplaced in the proposed wording.</p>
<hr>
<p>Comment from Issues list maintainer on 2026-02-09:</p>
<p>This issue was discussed at the February 2026 meeting of WG14, but the
committee was not yet ready to answer it.</p>
<hr>
<p>Comment from Issues list maintainer on 2026-07-06:</p>
<p>Jens Gustedt provided
<a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3917.htm">N3917</a>
that discusses this issue.</p>
<hr>
<p>Comment from Issues list maintainer on 2026-08-19:</p>
<p>At the August 2026 (Ottawa) meeting of WG14, the committee discussed
<a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3917.htm">N3917</a>
and supported making changes along the lines.</p>
</div>
<hr>
<hr>
<div id="issue1011">
<h2>Issue 1011: <code>powr</code>(negative, qNaN)</h2>
<p>Authors: Joseph Myers<br>
Date: 2025-03-18<br>
Status: Fixed<br>
Fixed in: C2Y</p>
<p>Annex F is unclear about whether <code>powr</code>(<em>x</em>, qNaN) raises "invalid" for
negative <em>x</em>, though the intent seems to be that it should (as
indicated in <a href="https://www.open-std.org/jtc1/sc22/wg14/29708">reflector message
29708</a> and <a href="http://mailman.oakapple.net/pipermail/cfp-interest/2025-March/003430.html">CFP message
3415</a>).</p>
<p>C23 F.10.1 (Mathematics <code><math.h></code> and <code><tgmath.h></code>) says:</p>
<blockquote>
<p>Functions with a NaN argument return a NaN result and raise no
floating-point exception, except where explicitly stated otherwise.</p>
</blockquote>
<p>C23 F.10.5.7 (The <code>powr</code> functions) says:</p>
<blockquote>
<p><code>powr</code>(<em>x</em>, <em>y</em>) returns a NaN and raises the "invalid"
floating-point exception for <em>x</em> < 0.</p>
</blockquote>
<p>This doesn't explicitly include the case where <em>y</em> is a NaN. By
contrast, F.10.5.8 (The <code>rootn</code> functions) says:</p>
<blockquote>
<p><code>rootn</code>(<em>x</em>, 0) returns a NaN and raises the "invalid"
floating-point exception for all <em>x</em> (including NaN).</p>
</blockquote>
<p>IEEE 754-2019 says in clause 9:</p>
<blockquote>
<p><strong>powr</strong>(<em>x</em>, <em>y</em>) signals the invalid operation exception for <em>x</em> < 0</p>
</blockquote>
<p>and:</p>
<blockquote>
<p><strong>powr</strong>(<em>x</em>, qNaN) is qNaN for <em>x</em> ≥ 0</p>
</blockquote>
<p>together with a more general statement:</p>
<blockquote>
<p>Outside its domain an operation shall return a quiet NaN and signal
the invalid operation exception.</p>
</blockquote>
<p>This seems to indicate that "invalid" should be raised in this case.</p>
<h3>Suggested correction</h3>
<p>In F.10.5.7 (The <code>powr</code> functions), amend the seventh bullet point as
indicated.</p>
<blockquote>
<p><code>powr</code>(<em>x</em>, <em>y</em>) returns a NaN and raises the "invalid"
floating-point exception for <em>x</em> < 0 <ins>and all <em>y</em> (including
NaN)</ins>.</p>
</blockquote>
<hr>
<p>Comment from Issues list maintainer on 2025-06-27:</p>
<p><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3560.pdf">N3560</a>
from the CFP group proposes the same wording as suggested in this
issue.</p>
<hr>
<p>Comment from Issues list maintainer on 2025-09-01:</p>
<p>At the August 2025 (Brno) meeting of WG14, the suggested correction
was accepted, subject to review at the next meeting.</p>
<h3>Proposed correction</h3>
<p>In F.10.5.7 (The <code>powr</code> functions), amend the seventh bullet point as
indicated.</p>
<blockquote>
<p><code>powr</code>(<em>x</em>, <em>y</em>) returns a NaN and raises the "invalid"
floating-point exception for <em>x</em> < 0 <ins>and all <em>y</em> (including
NaN)</ins>.</p>
</blockquote>
<hr>
<p>Comment from Issues list maintainer on 2026-02-09:</p>
<p>At the February 2026 meeting of WG14, the proposed correction was
adopted.</p>
<h3>Correction</h3>
<p>In F.10.5.7 (The <code>powr</code> functions), amend the seventh bullet point as
indicated.</p>
<blockquote>
<p><code>powr</code>(<em>x</em>, <em>y</em>) returns a NaN and raises the "invalid"
floating-point exception for <em>x</em> < 0 <ins>and all <em>y</em> (including
NaN)</ins>.</p>
</blockquote>
</div>
<hr>
<hr>
<div id="issue1012">
<h2>Issue 1012: Error returns from specific width length modifiers</h2>
<p>Authors: Joseph Myers<br>
Date: 2025-03-18<br>
Status: Open<br>
Cross-references: <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1004">1004</a></p>
<p>Each function in the <code>printf</code> and <code>scanf</code> family has its own
<strong>Returns</strong> specification that describes error cases and corresponding
return values as well as the return value on success (the error cases
sometimes depend on the specific function from the family; for
example, some kinds of errors can only occur for the functions using
files, not those using strings).</p>
<p>When error cases were added to <code>fprintf</code>, <code>fscanf</code>, <code>fwprintf</code> and
<code>fwscanf</code> for unsupported specific width length modifiers, no
corresponding changes were made to the <strong>Returns</strong> specification for
the other functions in those families, so failing to give those other
functions a corresponding error case (and leaving them with implicit
undefined behavior in this case). It seems clear that all functions
in these families should have corresponding error handling.</p>
<p>This is related to but separate from <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1004">issue 1004</a>, which
concerns the classification of such errors from <code>scanf</code> functions.</p>
<p>Also, the descriptions for <code>printf</code> functions refer to "specified
width length modifier" but those for <code>scanf</code> functions refer to
"specific width length modifier", with no apparent reason for the
inconsistent terminology.</p>
<h3>Suggested correction</h3>
<p>All these changes are to the <strong>Returns</strong> specification of their
respective functions, and all subclause numbers are in C23.</p>
<p>First, for consistency of terminology, make the following changes.</p>
<p>In 7.23.6.2 (The <code>fprintf</code> function), change:</p>
<blockquote>
<p>The <code>fprintf</code> function returns the number of characters transmitted,
or a negative value if an output or encoding error occurred or if
the implementation does not support a <del>specified</del>
<ins>specific</ins> width length modifier.</p>
</blockquote>
<p>In 7.31.2.2 (The <code>fwprintf</code> function), change:</p>
<blockquote>
<p>The <code>fwprintf</code> function returns the number of wide characters
transmitted, or a negative value if an output or encoding error
occurred or if the implementation does not support a
<del>specified</del> <ins>specific</ins> width length modifier.</p>
</blockquote>
<p>Then amend the other functions in these families as follows.</p>
<p>In each of 7.23.6.4 (The <code>printf</code> function), 7.23.6.6 (The <code>snprintf</code>
function), 7.23.6.7 (The <code>sprintf</code> function), 7.23.6.9 (The <code>vfprintf</code>
function), 7.23.6.11 (The <code>vprintf</code> function), 7.23.6.13 (The
<code>vsnprintf</code> function), 7.23.6.14 (The <code>vsprintf</code>) function), 7.31.2.4
(The <code>swprintf</code> function), 7.31.2.6 (The <code>vfwprintf</code> function),
7.31.2.8 (The <code>vswprintf</code> function), 7.31.2.10 (The <code>vwprintf</code>
function), 7.31.2.12 (The <code>wprintf</code> function), K.3.5.4.7 (The
<code>sprintf_s</code> function), K.3.5.4.14 (The <code>vsprintf_s</code> function),
K.3.9.2.4 (The <code>swprintf_s</code> function), and K.3.9.2.9 (The
<code>vswprintf_s</code> function), change:</p>
<blockquote>
<p>... encoding error occurred <ins>or if the implementation does not
support a specific width length modifier</ins> ...</p>
</blockquote>
<p>(Some of these functions also refer to output errors earlier in the
amended text; others, where the output is to a string rather than a
file, do not. In the case of <code>swprintf</code>,<code>vswprintf</code>, <code>swprintf_s</code>,
and <code>vswprintf_s</code>, the amended text is followed by another error case
in the same sentence; in the case of <code>sprintf_s</code>, <code>vsprintf_s</code>,
<code>swprintf_s</code>, and <code>vswprintf_s</code>, a description of the return value
appears after the amended text.)</p>
<p>In each of 7.23.6.5 (The <code>scanf</code> function), 7.23.6.8 (The <code>sscanf</code>
function), 7.23.6.10 (The <code>vfscanf</code> function), 7.23.6.12 (The <code>vscanf</code>
function), 7.23.6.15 (The <code>vsscanf</code> function), 7.31.2.5 (The <code>swscanf</code>
function), 7.31.2.7 (The <code>vfwscanf</code> function), 7.31.2.9 (The
<code>vswscanf</code> function), 7.31.2.11 (The <code>vwscanf</code> function), 7.31.2.13
(The <code>wscanf</code> function), K.3.5.4.3 (The <code>fscanf_s</code> function),
K.3.5.4.5 (The <code>scanf_s</code> function), K.3.5.4.8 (The <code>sscanf_s</code>
function), K.3.5.4.10 (The <code>vfscanf_s</code> function), K.3.5.4.12 (The
<code>vscanf_s</code> function), K.3.5.4.15 (The <code>vsscanf_s</code> function), K.3.9.2.2
(The <code>fwscanf_s</code> function), K.3.9.2.5 (The <code>swscanf_s</code> function),
K.3.9.2.7 (The <code>vfwscanf_s</code> function), K.3.9.2.10 (The <code>vswscanf_s</code>
function), K.3.9.2.12 (The <code>vwscanf_s</code> function), and K.3.9.2.14 (The
<code>wscanf_s</code> function), change:</p>
<blockquote>
<p>... in the event of an early matching failure <ins>or if the
implementation does not support a specific width length
modifier</ins>.</p>
</blockquote>
<p>In each of K.3.5.4.2 (The <code>fprintf_s</code> function), K.3.5.4.4 (The
<code>printf_s</code> function), K.3.5.4.6 (The <code>snprintf_s</code> function), K.3.5.4.9
(The <code>vfprintf_s</code> function), K.3.5.4.11 (The <code>vprintf_s</code> function),
K.3.5.4.13 (The <code>vsnprintf_s</code> function), K.3.9.2.1 (The <code>fwprintf_s</code>
function), K.3.9.2.3 (The <code>snwprintf_s</code> function), K.3.9.2.6 (The
<code>vfwprintf_s</code> function), K.3.9.2.8 (The <code>vsnwprintf_s</code> function),
K.3.9.2.11 (The <code>vwprintf_s</code> function), and K.3.9.2.13 (The
<code>wprintf_s</code> function), change:</p>
<blockquote>
<p>... runtime-constraint violation occurred <ins>or if the
implementation does not support a specific width length
modifier</ins>.</p>
</blockquote>
<hr>
<p>Comment from Issues list maintainer on 2025-09-01:</p>
<p>This issue was discussed at the August 2025 (Brno) meeting of WG14 but
without voting on specific wording. For <code>printf</code> functions, Alejandro
Colomar plans to write a paper addressing this issue. For <code>scanf</code>
functions, new wording suggested for <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1004">issue 1004</a> would
also address this issue.</p>
<hr>
<p>Comment from Issues list maintainer on 2026-02-09:</p>
<p>This issue was discussed at the February 2026 meeting of WG14, but
Alejandro's paper was not yet available.</p>
<hr>
<p>Comment from Issues list maintainer on 2026-08-20:</p>
<p>This issue was discussed at the August 2026 (Ottawa) meeting of WG14.
The case of <code>scanf</code> functions has been resolved by the resolution
adopted for <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1004">issue 1004</a>. Alejandro had proposed wording
for this issue in <a href="https://www.open-std.org/jtc1/sc22/wg14/36156">reflector message
36156</a> but this was not
yet available as a WG14 document and would need further revision,
which he is working on; if the formatted input/output functions are
editorially reordered as suggsted in <a href="https://www.open-std.org/jtc1/sc22/wg14/37579">reflector message
37579</a>, that would
help.</p>
</div>
<hr>
<hr>
<div id="issue1013">
<h2>Issue 1013: Ambiguity of "same type"</h2>
<p>Authors: Joseph Myers<br>
Date: 2025-03-18<br>
Status: Open<br>
Cross-references: <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1027">1027</a>, <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1060">1060</a>, <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1061">1061</a>, <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1070">1070</a></p>
<p>Most places in the standard requiring consistency of types in two
declarations or expressions use the notion of "compatible type". Two
places, however, require the types to be the "same type", not just
compatible, so avoiding needing to merge information from separate
declarations but encountering places where it is not clear what counts
as the same type (a concept with no definition in the standard).</p>
<p>C23 6.7.1 (Declarations) says:</p>
<blockquote>
<p>a typedef name can be redefined to denote the same type as it
currently does, provided that type is not a variably modified type;</p>
</blockquote>
<p>C23 6.7.3.4 (Tags) says:</p>
<blockquote>
<p>Where two declarations that use the same tag declare the same type,
they shall both use the same choice of <code>struct</code>, <code>union</code>, or <code>enum</code>.
If two declarations of the same type have a member-declaration or
enumerator-list, one shall not be nested within the other and both
declarations shall fulfill all requirements of compatible types
(6.2.7) with the additional requirement that corresponding members
of structure or union types shall have the same (and not merely
compatible) types.</p>
</blockquote>
<p>No specific wording is suggested to address the ambiguities identified
here; direction from the committee is needed on what the answers
should be, and maybe on the overall approach to take to defining "same
type" better.</p>
<h3>Question 1</h3>
<p>Do function type attributes form part of the type for the purposes of
"same type"?</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #008000; font-weight: bold">typedef</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">T1</span>(<span style="color: #B00040">int</span>);
<span style="color: #008000; font-weight: bold">typedef</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">T1</span>(<span style="color: #B00040">int</span>)<span style="color: #bbbbbb"> </span>[[reproducible]];
</pre></div>
<p>Suggested answer: they form part of the type (so where implementations
accept this example, that is a bug).</p>
<h3>Question 2</h3>
<p>Are function types the same if one specified a parameter as a pointer,
and another specified it as a function or array adjusted to a pointer,
or if one specified a qualified type for a parameter and another
specified an unqualified type?</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #008000; font-weight: bold">typedef</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">T2A</span>(<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #666666">*</span>);
<span style="color: #008000; font-weight: bold">typedef</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">T2A</span>(<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>[]);
<span style="color: #008000; font-weight: bold">typedef</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">T2B</span>(<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>(<span style="color: #666666">*</span>)());
<span style="color: #008000; font-weight: bold">typedef</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">T2B</span>(<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>());
<span style="color: #008000; font-weight: bold">typedef</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">T2C</span>(<span style="color: #B00040">int</span>);
<span style="color: #008000; font-weight: bold">typedef</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">T2C</span>(<span style="color: #008000; font-weight: bold">const</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">int</span>);
</pre></div>
<p>C23 6.7.7.4 (Function declarators) says:</p>
<blockquote>
<p>In the determination of type compatibility and of a composite type,
each parameter declared with function or array type is taken as
having the adjusted type and each parameter declared with qualified
type is taken as having the unqualified version of its declared
type.</p>
</blockquote>
<p>That wording does not refer to "same type", but it would seem rather
confusing for the types before adjustment to affect "same type" when
not affecting the function's type in other ways.</p>
<p>Suggested answer: those pairs of types are the same (but wording may
need amending to make that clear).</p>
<h3>Question 3</h3>
<p>Does the use of <code>static</code> inside a parameter array declarator affect
the type for the purposes of "same type"?</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #008000; font-weight: bold">typedef</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">T3</span>(<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>[<span style="color: #666666">2</span>]);
<span style="color: #008000; font-weight: bold">typedef</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">T3</span>(<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>[<span style="color: #008000; font-weight: bold">static</span><span style="color: #bbbbbb"> </span><span style="color: #666666">2</span>]);
</pre></div>
<p>Suggested answer: it should not affect the type, if the suggested
answer to the previous question is followed.</p>
<h3>Question 4</h3>
<p>Both the uses of the "same type" concept are in contexts where
variably modified types are disallowed, to avoid problems comparing
such types. However, in the presence of <code>typeof</code> that does not in
fact suffice to prevent such comparison issues, because of variably
modified parameters in function definitions, which are not treated the
same as <code>[*]</code> but also do not make the function type itself variably
modified. Which of the following are considered the same type?</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #B00040">void</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">f4a</span>(<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>m,<span style="color: #bbbbbb"> </span><span style="color: #B00040">char</span><span style="color: #bbbbbb"> </span>(<span style="color: #666666">*</span>p)[m])<span style="color: #bbbbbb"> </span>{}
<span style="color: #B00040">void</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">f4b</span>(<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>n,<span style="color: #bbbbbb"> </span><span style="color: #B00040">char</span><span style="color: #bbbbbb"> </span>(<span style="color: #666666">*</span>p)[n])<span style="color: #bbbbbb"> </span>{}
<span style="color: #B00040">void</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">f4c</span>(<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>n,<span style="color: #bbbbbb"> </span><span style="color: #B00040">char</span><span style="color: #bbbbbb"> </span>(<span style="color: #666666">*</span>p)[(n)])<span style="color: #bbbbbb"> </span>{}
<span style="color: #B00040">void</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">f4d</span>(<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>t,<span style="color: #bbbbbb"> </span><span style="color: #B00040">char</span><span style="color: #bbbbbb"> </span>(<span style="color: #666666">*</span>p)[t<span style="color: #666666">*1</span>])<span style="color: #bbbbbb"> </span>{}
<span style="color: #B00040">void</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">f4e</span>(<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>t,<span style="color: #bbbbbb"> </span><span style="color: #B00040">char</span><span style="color: #bbbbbb"> </span>(<span style="color: #666666">*</span>p)[t<span style="color: #666666">+1</span>])<span style="color: #bbbbbb"> </span>{}
<span style="color: #008000; font-weight: bold">typedef</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">void</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">T4</span>(<span style="color: #B00040">int</span>,<span style="color: #bbbbbb"> </span><span style="color: #B00040">char</span><span style="color: #bbbbbb"> </span>(<span style="color: #666666">*</span>)[<span style="color: #666666">*</span>]);
<span style="color: #008000; font-weight: bold">typedef</span><span style="color: #bbbbbb"> </span>typeof(f4a)<span style="color: #bbbbbb"> </span>T4;
<span style="color: #008000; font-weight: bold">typedef</span><span style="color: #bbbbbb"> </span>typeof(f4b)<span style="color: #bbbbbb"> </span>T4;
<span style="color: #008000; font-weight: bold">typedef</span><span style="color: #bbbbbb"> </span>typeof(f4c)<span style="color: #bbbbbb"> </span>T4;
<span style="color: #008000; font-weight: bold">typedef</span><span style="color: #bbbbbb"> </span>typeof(f4d)<span style="color: #bbbbbb"> </span>T4;
<span style="color: #008000; font-weight: bold">typedef</span><span style="color: #bbbbbb"> </span>typeof(f4e)<span style="color: #bbbbbb"> </span>T4;
</pre></div>
<p>Suggested approach for resolving this: apply the adjustment to <code>[*]</code>
for the purposes of the function type even in the case of function
definitions (but without affecting the type of the parameters when
referenced inside the definition).</p>
<h3>Question 5</h3>
<p>A similar issue applies when parameters are declared using a
block-scope typedef name for a variably modified type; the adjustment
to <code>[*]</code> appears not to occur in that case either. Which of the
following are considered the same type?</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #B00040">void</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">f</span>(<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>a)
{
<span style="color: #bbbbbb"> </span><span style="color: #008000; font-weight: bold">typedef</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>T[a];
<span style="color: #bbbbbb"> </span><span style="color: #008000; font-weight: bold">typedef</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>U[a];
<span style="color: #bbbbbb"> </span><span style="color: #008000; font-weight: bold">typedef</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">void</span><span style="color: #bbbbbb"> </span>T5(T<span style="color: #666666">*</span>);
<span style="color: #bbbbbb"> </span><span style="color: #008000; font-weight: bold">typedef</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">void</span><span style="color: #bbbbbb"> </span>T5(T<span style="color: #666666">*</span>);
<span style="color: #bbbbbb"> </span><span style="color: #008000; font-weight: bold">typedef</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">void</span><span style="color: #bbbbbb"> </span>T5(U<span style="color: #666666">*</span>);
}
</pre></div>
<p>Suggested approach for resolving this: apply the adjustment to <code>[*]</code>
to any VLA type referenced in a parameter type, including when it
comes from a typedef name, not just when it uses an array declarator.</p>
<hr>
<p>Comment from Issues list maintainer on 2025-09-01:</p>
<p>This issue was discussed at the August 2025 (Brno) meeting of WG14 but
without voting on specific wording. There was disagreement about the
correct answer to question 1, given ignorability of attributes; it was
noted that any answer to question 1 could only apply to standard
attributes but not necessarily to any implementation-specific type
attributes provided as an extension.</p>
<hr>
<p>Comment from Issues list maintainer on 2026-02-09:</p>
<p>This issue was discussed further at the February 2026 meeting of WG14.
There were some suggestions to separate question 1 (attributes) from
the others, but it was not agreed whether this question is easier or
harder than the others. It was suggested that the questions involving
adjustment should wait until after Alejandro's papers on that subject
have been seen, and noted that "same" cannot be defined in terms of
"compatible" without introducing circular definitions.</p>
<hr>
<p>Comment from Issues list maintainer on 2026-08-20:</p>
<p>This issue was discussed at the August 2026 (Ottawa) meeting of WG14.
There were some suggestions that the real problem was the
observability of "same type" in typedef and tag redefinitions and that
those places should be changed to allow compatible types instead.
Martin Uecker and Jens Gustedt took an action item to explore this
question and hopefully write a paper with a proposal.</p>
</div>
<hr>
<hr>
<div id="issue1015">
<h2>Issue 1015: Imprecise wording for <code>cnd_t</code> functions</h2>
<p>Authors: Jens Gustedt<br>
Date: 2025-06-17<br>
Reference document: <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3559.htm">N3559</a><br>
Status: Fixed<br>
Fixed in: C2Y</p>
<p>The wording in C23 7.28 (7.30 in C2y draft N3550) concerning the
<code>cnd_t</code> type has several imprecisions.</p>
<h3>Use of the verb require</h3>
<p>C23 7.28.3.2, 7.28.3.5 and 7.28.3.6 use the verb "require" to formulate a
requirement for which it is by itself not clear what the status of a
violation of such a requirement would be.</p>
<h4>Proposed solution</h4>
<p>Change the wording such that it uses "shall" and clearly state that a
violation of the requirement results in undefined behavior.</p>
<h4>Suggested wording</h4>
<p>See <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3559.htm">n3559</a>.</p>
<h3>Use of <em>lock</em> and <em>unlock</em> of a mutex without explicit semantics</h3>
<p>C23 7.28.3.5 and 7.28.3.6 and talk about locking and unlocking a mutex
<code>mtx</code> without further specifying how these operations interact with
other operations on the same mutex.</p>
<h4>Proposed solution</h4>
<p>Since the <code>cnd_t</code> feature was modeled along the lines of POSIX's
<code>pthread_cond_t</code> we propose to take the same solution as is in effect,
there. This amounts to say that the lock and unlock operations are
performed as if by calls to <code>mtx_lock</code> and <code>mtx_unlock</code>, and then to
be a bit more specific on which phases of the condition wait functions
synchronize with <code>mtx_t</code> functions and how.</p>
<h4>Suggested wording</h4>
<p>See <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3559.htm">n3559</a>.</p>
<hr>
<p>Comment from Issues list maintainer on 2025-09-01:</p>
<p>This issue was handled at the August 2025 (Brno) meeting of WG14 via
processing the
<a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3559.htm">N3559</a>
paper rather than through the issue handling process. That paper was
adopted into C2y and the Extensions to Obsolete Versions of C list.</p>
<p>After it was adopted, Jonathan Wakely expressed concerns about the
changes in <a href="https://www.open-std.org/jtc1/sc22/wg14/33463">reflector message
33463</a>.</p>
</div>
<hr>
<hr>
<div id="issue1016">
<h2>Issue 1016: Are digit separators allowed in <code>__LINE__</code>?</h2>
<p>Authors: Jens Gustedt<br>
Date: 2025-06-18<br>
Status: Fixed<br>
Fixed in: C2Y<br>
Cross-references: <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1029">1029</a></p>
<h3>Problem description</h3>
<p>The introduction of digit separators in C23 seems to have overlooked
the case of the <code>__LINE__</code> macro. The current text would allow them.</p>
<p>If it is possible that such digit separators occur the following code
could have expansions that are invalid in compilation phase 7:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#define UNIQ_(L, ...) __VA_ARGS__ ## L</span>
<span style="color: #9C6500">#define UNIQ(...) UNIQ_(__LINE__, __VA_ARGS__)</span>
<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">UNIQ</span>(special)<span style="color: #bbbbbb"> </span><span style="color: #666666">=</span><span style="color: #bbbbbb"> </span><span style="color: #666666">78</span>;<span style="color: #bbbbbb"> </span>callit(UNIQ(special));
</pre></div>
<p>In general in all implementations that I am aware of the last line
would expand to something like:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>special50138<span style="color: #bbbbbb"> </span><span style="color: #666666">=</span><span style="color: #bbbbbb"> </span><span style="color: #666666">78</span>;<span style="color: #bbbbbb"> </span>callit(special50138);
</pre></div>
<p>If the expansion would contain digit separators that would be</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>special50<span style="border: 1px solid #FF0000">'</span><span style="color: #666666">138</span><span style="color: #bbbbbb"> </span><span style="color: #666666">=</span><span style="color: #bbbbbb"> </span><span style="color: #666666">78</span>;<span style="color: #bbbbbb"> </span>callit(special50<span style="border: 1px solid #FF0000">'</span><span style="color: #666666">138</span>);
</pre></div>
<p>which would be invalid in phase 7.</p>
<h3>Proposed solution</h3>
<p>Forbid the use of digit separators in the expansion of <code>__LINE__</code>.</p>
<h3>Suggested wording</h3>
<p>Change the corresponding item in "6.10.10.2 Mandatory macros":</p>
<blockquote>
<p><code>__LINE__</code> The presumed line number (within the current source file)
of the current source line (an integer literal <ins>not containing
digit separators</ins>).<sup>216)</sup></p>
</blockquote>
<hr>
<p>Comment from Issues list maintainer on 2025-09-01:</p>
<p>At the August 2025 (Brno) meeting of WG14, the suggested correction
was accepted, subject to review at the next meeting.</p>
<p>An editorial request was made to change "not containing digit
separators" to "excluding any digit separators" for consistency with
wording already in the standard.</p>
<h3>Proposed correction</h3>
<p>Change the corresponding item in "6.10.10.2 Mandatory macros":</p>
<blockquote>
<p><code>__LINE__</code> The presumed line number (within the current source file)
of the current source line (an integer literal <ins>excluding any
digit separators</ins>).<sup>216)</sup></p>
</blockquote>
<hr>
<p>Comment from Issues list maintainer on 2026-02-09:</p>
<p>At the February 2026 meeting of WG14, the proposed correction was
adopted.</p>
<h3>Correction</h3>
<p>Change the corresponding item in "6.10.10.2 Mandatory macros":</p>
<blockquote>
<p><code>__LINE__</code> The presumed line number (within the current source file)
of the current source line (an integer literal <ins>excluding any
digit separators</ins>).<sup>216)</sup></p>
</blockquote>
</div>
<hr>
<hr>
<div id="issue1017">
<h2>Issue 1017: Unspecified timing and synchronization for <code>cnd_t</code> functions</h2>
<p>Authors: Jens Gustedt<br>
Date: 2025-06-24<br>
Status: Open</p>
<p>The timing and synchronization of calls to <code>cnd_t</code> functions are
underspecified. In particular the text for <code>cnd_broadcast</code> and
<code>cnd_signal</code> talk about</p>
<blockquote>
<p>... threads that are blocked on the condition variable pointed to by
<code>cond</code> at the time of the call</p>
</blockquote>
<p>Fortunately, this lack of precision has not yet resulted in severe
misunderstandings or even bugs. Nevertheless, it has merely pushed
implementors to go on the safe side, perhaps imposing too much
synchronization constraints on calls to <code>cnd_t</code> functions. For
example, it seems that many implementations regulate the access to
<code>cnd_t</code> variables through an internal mutex and thus impose
acquire-release semantics not only on the user mutex <code>*mtx</code> that is
involved in the calls to the wait functions, but on all calls to
<code>cnd_signal</code> and <code>cnd_broadcast</code>.</p>
<h3>Liaison</h3>
<p>The feature had been inspired by a similar feature in POSIX, but it
does not seem that the situation is better, there. Their text probably
dates from before synchronization and happens-before had been
formalized in C11, so it is as vague as the text in C23.</p>
<h3>Questions</h3>
<h4>What is the "time of the call", here?</h4>
<p>The only inter-thread time model that we have for multi-threaded
executions is the happens-before relation, and that relation need
synchronization either through atomic objects, fences or
mutexes.</p>
<h5>Which atomic operations would participate in such a happens-before relationship between calls.</h5>
<h4>Is there implicitly a modification order on <code>cnd_t</code> objects as a whole?</h4>
<p>Such a modification order would be consistent with the handling we
have for <code>mtx_t</code> where C23 7.28.4.1 (7.30.4.1 in working draft N3550)
introduces such a (poorly worded) order.</p>
<h4>If there is such a modification order on a <code>cnd_t</code> which are the functions that participate in that modification order?</h4>
<p>One could assume that wait functions have two entries in the
modification order, one for the entry into the call (maybe with
release semantics) and the other for a wakeup (maybe with acquire
semantics).</p>
<p>Signal and broadcast operations would probably only count each as one
operation. For these function not even some form of atomicity is
currently specified. Even the general paragraph 7.1.4 p5 that talks
about race conditions for library functions <strong>does not help</strong>: its
provision is explicitly only formulated for races that would result
from functions that access hidden state. Since these <code>cnd_t</code> functions
potentially access the same data, nothing currently guarantees that
calls to these functions is atomic.</p>
<h4>Are <code>cnd_broadcast</code> and <code>cnd_signal</code> load-modify-store operations on the <code>cnd_t</code>?</h4>
<p>If yes, what would their memory ordering be? Two plausible candidates
would be <code>memory_order_relaxed</code> and <code>memory_order_acq_rel</code>.</p>
<h4>How do the different operations on <code>cnd_t</code> synchronize with each other?</h4>
<h3>Suggested partial solution</h3>
<p>I think it is unavoidable to add a "General" section to C23 7.28.3
(7.30.3 in working draft N3550) that describes a consistency model
between different calls that act on the same <code>cnd_t</code> object. This
would best be done by claiming that there is a over-all modification
order on a <code>cnd_t</code> variable on which wait, signal and broadcast
operate atomically.</p>
<p>How the synchronization constraints for these operations would be
handled seems to be quite open and needs harmonization between POSIX,
C++ and C at the least.</p>
<hr>
<p>Comment from Issues list maintainer on 2025-09-01:</p>
<p>This issue was discussed at the August 2025 (Brno) meeting of WG14 but
without voting on specific wording. Some suggested wording can be
found in
<a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3673.htm">N3673</a>.</p>
<hr>
<p>Comment from Issues list maintainer on 2026-02-09:</p>
<p>This issue was not discussed at the February 2026 meeting of WG14
because it is covered in
<a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3764.htm">N3764</a>
which was discussed earlier in that meeting.</p>
<hr>
<p>Comment from Issues list maintainer on 2026-08-20:</p>
<p>At the August 2026 (Ottawa) meeting of WG14, Jens Gustedt reported
that there was no progress on this issue and it would need to go
through liaison with C++.</p>
</div>
<hr>
<hr>
<div id="issue1018">
<h2>Issue 1018: Issue with <code>enum</code> compatibility</h2>
<p>Authors: Martin Uecker<br>
Date: 2025-07-24<br>
Status: Open</p>
<p>As reported in the GCC bug</p>
<p>https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121212</p>
<p>the standard is not clear about whether two different
enums (i.e. declared with different scope) with fixed
underlying type are complete or not.</p>
<p>Example:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #008000; font-weight: bold">enum</span><span style="color: #bbbbbb"> </span>E<span style="color: #bbbbbb"> </span><span style="color: #666666">:</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">int</span>;
{
<span style="color: #bbbbbb"> </span><span style="color: #008000; font-weight: bold">enum</span><span style="color: #bbbbbb"> </span>E<span style="color: #bbbbbb"> </span><span style="color: #666666">:</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">int</span>;
}
</pre></div>
<p>Previously, forward declared enums did not exist, but
C23 enums with fixed underlying type are complete types - even
when declared without enumerator list. This introduced a new
situation where a type can be complete but the members are not
known.</p>
<p>The standard assumes that we can determine type compatibility
for two complete tagged types, i.e. we have</p>
<blockquote>
<p>Moreover, two complete structure, union, or enumerated types
declared with the same tag are compatible if members satisfy
the following requirements:</p>
</blockquote>
<p>and</p>
<blockquote>
<p>For two enumerations, corresponding members shall have the
same values; if one has a fixed underlying type, then the
other shall have a compatible fixed underlying type.</p>
</blockquote>
<h3>Possible solution</h3>
<p>The first sentence could be changed to:</p>
<blockquote>
<p>Moreover, two complete structure, union, or enumerated
types declared with the same tag are compatible if <ins>both
declare their content and the</ins> members satisfy
the following requirements:</p>
</blockquote>
<p>Alternatively, one could declare those type to be compatible
but then they could be redeclared inconsistently later
(and then not be compatible anymore).</p>
<p>Finally, we could just ignore enumeration constants
for type compatibility for enums with fixed underlying
type (which might allow adding them incrementally, which may
even be useful).</p>
<hr>
<p>Comment from Issues list maintainer on 2025-09-01:</p>
<p>This issue was discussed at the August 2025 (Brno) meeting of WG14 but
without voting on specific wording. Martin Uecker will write a paper
with further discussion of possible fixes for this issue.</p>
<hr>
<p>Comment from Issues list maintainer on 2026-02-09:</p>
<p>This issue was discussed at the February 2026 meeting of WG14, but
Martin's paper was not yet available.</p>
<hr>
<p>Comment from Issues list maintainer on 2026-08-20:</p>
<p>At the August 2026 (Ottawa) meeting of WG14, Martin Uecker reported
that he had written but not yet submitted his paper.</p>
</div>
<hr>
<hr>
<div id="issue1019">
<h2>Issue 1019: String functions and trailing null inclusion</h2>
<p>Authors: Joseph Myers<br>
Date: 2025-09-24<br>
Status: Fixed (pending integration in working draft)<br>
Fixed in: C2Y</p>
<p>The definitions of "string" and "wide string" in C23 7.1.1
(Definitions of terms) are clear that the terminating null character
or null wide character are included:</p>
<blockquote>
<p>A <em>string</em> is a contiguous sequence of characters terminated by and
including the first null character.</p>
</blockquote>
<blockquote>
<p>A <em>wide string</em> is a contiguous sequence of wide characters
terminated by and including the first null wide character.</p>
</blockquote>
<p>However, the specifications of some functions that take two strings as
arguments are written on the assumption that the null character is not
included in one or both strings.</p>
<p>The specification for <code>strpbrk</code> (C23 7.26.5.5) says:</p>
<blockquote>
<p>The <code>strpbrk</code> generic function returns a pointer to the character,
or a null pointer if no character from <code>s2</code> occurs in <code>s1</code>.</p>
</blockquote>
<p>With the terminating null character understood as being part of <code>s2</code>
in accordance with the definition, "if no character from <code>s2</code> occurs
in <code>s1</code>" is not a possible condition.</p>
<p>The specification of <code>strspn</code> (C23 7.26.5.7) says:</p>
<blockquote>
<p>The <code>strspn</code> function computes the length of the maximum initial
segment of the string pointed to by <code>s1</code> which consists entirely of
characters from the string pointed to by <code>s2</code>.</p>
</blockquote>
<p>As commonly understood, however, the length returned does not include
the terminating null character of <code>s1</code> in the case where every
character is found in <code>s2</code>.</p>
<p>The specification of <code>strtok</code> (C23 7.26.5.9) says:</p>
<blockquote>
<p>The first call in the sequence searches the string pointed to by
<code>s1</code> for the first character that is <em>not</em> contained in the current
separator string pointed to by <code>s2</code>. If no such character is found,
then there are no tokens in the string pointed to by <code>s1</code> and the
<code>strtok</code> function returns a null pointer. If such a character is
found, it is the start of the first token.</p>
</blockquote>
<p>and</p>
<blockquote>
<p>The <code>strtok</code> function then searches from there for a character that
<em>is</em> contained in the current separator string. If no such character
is found, the current token extends to the end of the string pointed
to by <code>s1</code>, and subsequent searches for a token will return a null
pointer.</p>
</blockquote>
<p>The latter paragraph must be assuming that <code>s1</code> or <code>s2</code> does not
include the trailing null character, because "no such character is
found" would not be possible if the null character is included in both
strings. The former paragraph is not intended to consider the null
character in <code>s1</code> as being a character not contained in <code>s2</code>, so must
be assuming that <code>s1</code> does not include the trailing null character
(since if <code>s1</code> were considered to include it, the latter paragraph
would imply <code>s2</code> is not considered to include it).</p>
<p>The same issues apply to <code>wcspbrk</code> (C23 7.31.4.6.4), <code>wcsspn</code> (C23
7.31.4.6.6) and <code>wcstok</code> (C23 7.31.4.6.8).</p>
<h3>Suggested correction</h3>
<p>In C23 7.26.5.5 (The <code>strpbrk</code> generic function), change the
<strong>Description</strong> specification:</p>
<blockquote>
<p>The <code>strpbrk</code> generic function locates the first occurrence in the
string pointed to by <code>s1</code> of any character from the string pointed
to by <code>s2</code><ins>, excluding the terminating null character of
<code>s2</code></ins>.</p>
</blockquote>
<p>In C23 7.26.5.7 (The <code>strspn</code> function), change the <strong>Description</strong>
specification:</p>
<blockquote>
<p>The <code>strspn</code> function computes the length of the maximum initial
segment of the string pointed to by <code>s1</code> which consists entirely of
characters from the string pointed to by <code>s2</code><ins>, excluding the
terminating null character of <code>s2</code></ins>.</p>
</blockquote>
<p>In C23 7.26.5.9 (The <code>strtok</code> function), change the <strong>Description</strong>
specification:</p>
<blockquote>
<p>The first call in the sequence searches the string pointed to by
<code>s1</code> for the first character that is <em>not</em> contained in the current
separator string pointed to by <code>s2</code><ins>, excluding the terminating
null characters of both strings</ins>. If no such character is
found, then there are no tokens in the string pointed to by <code>s1</code> and
the <code>strtok</code> function returns a null pointer. If such a character is
found, it is the start of the first token.</p>
<p>The <code>strtok</code> function then searches from there for a character that
<em>is</em> contained in the current separator string<ins>, excluding the
terminating null characters of both strings</ins>. If no such
character is found, the current token extends to the end of the
string pointed to by <code>s1</code>, and subsequent searches for a token will
return a null pointer.</p>
</blockquote>
<p>In C23 7.31.4.6.4 (The <code>wcspbrk</code> generic function), change the
<strong>Description</strong> specification:</p>
<blockquote>
<p>The <code>wcspbrk</code> generic function locates the first occurrence in the
wide string pointed to by <code>s1</code> of any wide character from the wide
string pointed to by <code>s2</code><ins>, excluding the terminating null wide
character of <code>s2</code></ins>.</p>
</blockquote>
<p>In C23 7.31.4.6.6 (The <code>wcsspn</code> function), change the <strong>Description</strong>
specification:</p>
<blockquote>
<p>The <code>wcsspn</code> function computes the length of the maximum initial
segment of the wide string pointed to by <code>s1</code> which consists
entirely of wide characters from the wide string pointed to by
<code>s2</code><ins>, excluding the terminating null wide character of
<code>s2</code></ins>.</p>
</blockquote>
<p>In C23 7.31.4.6.8 (The <code>wcstok</code> function), change the <strong>Description</strong>
specification:</p>
<blockquote>
<p>The first call in the sequence searches the wide string pointed to
by <code>s1</code> for the first wide character that is <em>not</em> contained in the
current separator wide string pointed to by <code>s2</code><ins>, excluding the
terminating null wide characters of both wide strings</ins>. If no
such wide character is found, then there are no tokens in the wide
string pointed to by <code>s1</code> and the <code>wcstok</code> function returns a null
pointer. If such a wide character is found, it is the start of the
first token.</p>
<p>The <code>wcstok</code> function then searches from there for a wide character
that <em>is</em> contained in the current separator wide string<ins>,
excluding the terminating null wide characters of both wide
strings</ins>. If no such wide character is found, the current token
extends to the end of the wide string pointed to by <code>s1</code>, and
subsequent searches in the same wide string for a token return a
null pointer. If such a wide character is found, it is overwritten
by a null wide character, which terminates the current token.</p>
</blockquote>
<hr>
<p>Comment from Issues list maintainer on 2026-02-09:</p>
<p>At the February 2026 meeting of WG14, the suggested correction was
accepted, subject to review at the August 2026 meeting.</p>
<h3>Proposed correction</h3>
<p>In C23 7.26.5.5 (The <code>strpbrk</code> generic function), change the
<strong>Description</strong> specification:</p>
<blockquote>
<p>The <code>strpbrk</code> generic function locates the first occurrence in the
string pointed to by <code>s1</code> of any character from the string pointed
to by <code>s2</code><ins>, excluding the terminating null character of
<code>s2</code></ins>.</p>
</blockquote>
<p>In C23 7.26.5.7 (The <code>strspn</code> function), change the <strong>Description</strong>
specification:</p>
<blockquote>
<p>The <code>strspn</code> function computes the length of the maximum initial
segment of the string pointed to by <code>s1</code> which consists entirely of
characters from the string pointed to by <code>s2</code><ins>, excluding the
terminating null character of <code>s2</code></ins>.</p>
</blockquote>
<p>In C23 7.26.5.9 (The <code>strtok</code> function), change the <strong>Description</strong>
specification:</p>
<blockquote>
<p>The first call in the sequence searches the string pointed to by
<code>s1</code> for the first character that is <em>not</em> contained in the current
separator string pointed to by <code>s2</code><ins>, excluding the terminating
null characters of both strings</ins>. If no such character is
found, then there are no tokens in the string pointed to by <code>s1</code> and
the <code>strtok</code> function returns a null pointer. If such a character is
found, it is the start of the first token.</p>
<p>The <code>strtok</code> function then searches from there for a character that
<em>is</em> contained in the current separator string<ins>, excluding the
terminating null characters of both strings</ins>. If no such
character is found, the current token extends to the end of the
string pointed to by <code>s1</code>, and subsequent searches for a token will
return a null pointer.</p>
</blockquote>
<p>In C23 7.31.4.6.4 (The <code>wcspbrk</code> generic function), change the
<strong>Description</strong> specification:</p>
<blockquote>
<p>The <code>wcspbrk</code> generic function locates the first occurrence in the
wide string pointed to by <code>s1</code> of any wide character from the wide
string pointed to by <code>s2</code><ins>, excluding the terminating null wide
character of <code>s2</code></ins>.</p>
</blockquote>
<p>In C23 7.31.4.6.6 (The <code>wcsspn</code> function), change the <strong>Description</strong>
specification:</p>
<blockquote>
<p>The <code>wcsspn</code> function computes the length of the maximum initial
segment of the wide string pointed to by <code>s1</code> which consists
entirely of wide characters from the wide string pointed to by
<code>s2</code><ins>, excluding the terminating null wide character of
<code>s2</code></ins>.</p>
</blockquote>
<p>In C23 7.31.4.6.8 (The <code>wcstok</code> function), change the <strong>Description</strong>
specification:</p>
<blockquote>
<p>The first call in the sequence searches the wide string pointed to
by <code>s1</code> for the first wide character that is <em>not</em> contained in the
current separator wide string pointed to by <code>s2</code><ins>, excluding the
terminating null wide characters of both wide strings</ins>. If no
such wide character is found, then there are no tokens in the wide
string pointed to by <code>s1</code> and the <code>wcstok</code> function returns a null
pointer. If such a wide character is found, it is the start of the
first token.</p>
<p>The <code>wcstok</code> function then searches from there for a wide character
that <em>is</em> contained in the current separator wide string<ins>,
excluding the terminating null wide characters of both wide
strings</ins>. If no such wide character is found, the current token
extends to the end of the wide string pointed to by <code>s1</code>, and
subsequent searches in the same wide string for a token return a
null pointer. If such a wide character is found, it is overwritten
by a null wide character, which terminates the current token.</p>
</blockquote>
<hr>
<p>Comment from Issues list maintainer on 2026-08-20:</p>
<p>At the August 2026 (Ottawa) meeting of WG14, the proposed correction
was adopted.</p>
<h3>Correction</h3>
<p>In C23 7.26.5.5 (The <code>strpbrk</code> generic function), change the
<strong>Description</strong> specification:</p>
<blockquote>
<p>The <code>strpbrk</code> generic function locates the first occurrence in the
string pointed to by <code>s1</code> of any character from the string pointed
to by <code>s2</code><ins>, excluding the terminating null character of
<code>s2</code></ins>.</p>
</blockquote>
<p>In C23 7.26.5.7 (The <code>strspn</code> function), change the <strong>Description</strong>
specification:</p>
<blockquote>
<p>The <code>strspn</code> function computes the length of the maximum initial
segment of the string pointed to by <code>s1</code> which consists entirely of
characters from the string pointed to by <code>s2</code><ins>, excluding the
terminating null character of <code>s2</code></ins>.</p>
</blockquote>
<p>In C23 7.26.5.9 (The <code>strtok</code> function), change the <strong>Description</strong>
specification:</p>
<blockquote>
<p>The first call in the sequence searches the string pointed to by
<code>s1</code> for the first character that is <em>not</em> contained in the current
separator string pointed to by <code>s2</code><ins>, excluding the terminating
null characters of both strings</ins>. If no such character is
found, then there are no tokens in the string pointed to by <code>s1</code> and
the <code>strtok</code> function returns a null pointer. If such a character is
found, it is the start of the first token.</p>
<p>The <code>strtok</code> function then searches from there for a character that
<em>is</em> contained in the current separator string<ins>, excluding the
terminating null characters of both strings</ins>. If no such
character is found, the current token extends to the end of the
string pointed to by <code>s1</code>, and subsequent searches for a token will
return a null pointer.</p>
</blockquote>
<p>In C23 7.31.4.6.4 (The <code>wcspbrk</code> generic function), change the
<strong>Description</strong> specification:</p>
<blockquote>
<p>The <code>wcspbrk</code> generic function locates the first occurrence in the
wide string pointed to by <code>s1</code> of any wide character from the wide
string pointed to by <code>s2</code><ins>, excluding the terminating null wide
character of <code>s2</code></ins>.</p>
</blockquote>
<p>In C23 7.31.4.6.6 (The <code>wcsspn</code> function), change the <strong>Description</strong>
specification:</p>
<blockquote>
<p>The <code>wcsspn</code> function computes the length of the maximum initial
segment of the wide string pointed to by <code>s1</code> which consists
entirely of wide characters from the wide string pointed to by
<code>s2</code><ins>, excluding the terminating null wide character of
<code>s2</code></ins>.</p>
</blockquote>
<p>In C23 7.31.4.6.8 (The <code>wcstok</code> function), change the <strong>Description</strong>
specification:</p>
<blockquote>
<p>The first call in the sequence searches the wide string pointed to
by <code>s1</code> for the first wide character that is <em>not</em> contained in the
current separator wide string pointed to by <code>s2</code><ins>, excluding the
terminating null wide characters of both wide strings</ins>. If no
such wide character is found, then there are no tokens in the wide
string pointed to by <code>s1</code> and the <code>wcstok</code> function returns a null
pointer. If such a wide character is found, it is the start of the
first token.</p>
<p>The <code>wcstok</code> function then searches from there for a wide character
that <em>is</em> contained in the current separator wide string<ins>,
excluding the terminating null wide characters of both wide
strings</ins>. If no such wide character is found, the current token
extends to the end of the wide string pointed to by <code>s1</code>, and
subsequent searches in the same wide string for a token return a
null pointer. If such a wide character is found, it is overwritten
by a null wide character, which terminates the current token.</p>
</blockquote>
</div>
<hr>
<hr>
<div id="issue1020">
<h2>Issue 1020: Definition of address constant</h2>
<p>Authors: Javier Múgica<br>
Date: 2025-09-29<br>
Status: Fixed (pending integration in working draft)<br>
Fixed in: C2Y</p>
<p>The text on constant expressions defines an address constant as</p>
<blockquote>
<p>An <em>address constant</em> is a null pointer, a pointer to an lvalue
designating an object of static storage duration, or a pointer to a
function designator; it shall be created explicitly using the unary
<code>&</code> operator or an integer constant cast to pointer type, or
implicitly using an expression of array or function type.</p>
</blockquote>
<p>Then, among the possible categories for constant expressions it lists</p>
<blockquote>
<ul>
<li>an address constant</li>
<li>an address constant for a complete object type plus or minus an
integer constant expression</li>
</ul>
</blockquote>
<p>Consider the following two triplets of expressions, where <code>&a</code> is
supposed to be an address constant for a complete object type:</p>
<table>
<thead>
<tr>
<th align="left"></th>
<th align="left"></th>
</tr>
</thead>
<tbody>
<tr>
<td align="left"><code>&a</code></td>
<td align="left"><code>&a +1 +2</code></td>
</tr>
<tr>
<td align="left"><code>&a +1</code></td>
<td align="left"><code>1 +&a +2</code></td>
</tr>
<tr>
<td align="left"><code>&a +1 +2</code></td>
<td align="left"><code>1 +2 +&a</code></td>
</tr>
</tbody>
</table>
<p>Of the three at the left, only the first two ones fall under either of
the categories "an address constant" or "an address constant for a
complete object type plus or minus an integer constant expression". Of
those at the right, only the last one.</p>
<p>By contrast, both the wording for compound literal constant and that
for named constant make explicit mention that recursive application of
the <code>.</code> member access operator is possible.</p>
<p>By looking at the uses of the term "address constant" throughout the
document we see that there is no need for the concept as separate from
address constant plus or minus an ICE. The only use outside constant
expressions is in the description of the <code>offsetof</code> operator:</p>
<blockquote>
<p>The type and member designator shall be such that given</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span>static<span style="color: #bbbbbb"> </span><span style="color: #008000; font-weight: bold">type</span><span style="color: #bbbbbb"> </span>t;
</pre></div>
<p>then the expression <code>&(t.</code><em>member-designator</em><code>)</code> evaluates to an
address constant.</p>
</blockquote>
<p>and nothing changes here if "address constant for a complete object
type plus or minus an integer constant expression" is also called
"address constant".</p>
<h3>Suggested correction</h3>
<p>Include the construction "address constant for a complete object type
plus or minus an integer constant expression" into the concept
"address constant", providing a right definition allowing for
recursive addition or subtraction of ICE.</p>
<ul>
<li>
<p>In "Constant expressions", 6.6.1 General, replace the paragraph
defining address constant (p. 9 in the post-Brno working draft) by</p>
<blockquote>
<p>A null pointer, a pointer to an lvalue designating an object of
static storage duration or a pointer to a function designator is an
<em>address constant</em>; it is created explicitly using the unary <code>&</code>
operator or an integer constant cast to pointer type, or implicitly
using an expression of array or function type. An address constant
for a complete object type plus or minus an integer constant
expression is also an address constant.</p>
</blockquote>
<p>(Keep the footnote.)</p>
</li>
<li>
<p>Remove the following item from the list of categories a constant
expression may be or evaluate to:</p>
<blockquote>
<p><del>an address constant for a complete object type plus or minus an
integer constant expression</del>.</p>
</blockquote>
</li>
</ul>
<hr>
<p>Comment from Issues list maintainer on 2026-02-09:</p>
<p>At the February 2026 meeting of WG14, the suggested correction was
accepted, subject to review at the August 2026 meeting.</p>
<h3>Proposed correction</h3>
<p>Include the construction "address constant for a complete object type
plus or minus an integer constant expression" into the concept
"address constant", providing a right definition allowing for
recursive addition or subtraction of ICE.</p>
<ul>
<li>
<p>In "Constant expressions", 6.6.1 General, replace the paragraph
defining address constant (p. 9 in the post-Brno working draft) by</p>
<blockquote>
<p>A null pointer, a pointer to an lvalue designating an object of
static storage duration or a pointer to a function designator is an
<em>address constant</em>; it is created explicitly using the unary <code>&</code>
operator or an integer constant cast to pointer type, or implicitly
using an expression of array or function type. An address constant
for a complete object type plus or minus an integer constant
expression is also an address constant.</p>
</blockquote>
<p>(Keep the footnote.)</p>
</li>
<li>
<p>Remove the following item from the list of categories a constant
expression may be or evaluate to:</p>
<blockquote>
<p><del>an address constant for a complete object type plus or minus an
integer constant expression</del>.</p>
</blockquote>
</li>
</ul>
<hr>
<p>Comment from Issues list maintainer on 2026-08-20:</p>
<p>At the August 2026 (Ottawa) meeting of WG14, the proposed correction
was adopted.</p>
<h3>Correction</h3>
<p>Include the construction "address constant for a complete object type
plus or minus an integer constant expression" into the concept
"address constant", providing a right definition allowing for
recursive addition or subtraction of ICE.</p>
<ul>
<li>
<p>In "Constant expressions", 6.6.1 General, replace the paragraph
defining address constant (p. 9 in the post-Brno working draft) by</p>
<blockquote>
<p>A null pointer, a pointer to an lvalue designating an object of
static storage duration or a pointer to a function designator is an
<em>address constant</em>; it is created explicitly using the unary <code>&</code>
operator or an integer constant cast to pointer type, or implicitly
using an expression of array or function type. An address constant
for a complete object type plus or minus an integer constant
expression is also an address constant.</p>
</blockquote>
<p>(Keep the footnote.)</p>
</li>
<li>
<p>Remove the following item from the list of categories a constant
expression may be or evaluate to:</p>
<blockquote>
<p><del>an address constant for a complete object type plus or minus an
integer constant expression</del>.</p>
</blockquote>
</li>
</ul>
</div>
<hr>
<hr>
<div id="issue1021">
<h2>Issue 1021: Integer promotions for enumerations</h2>
<p>Authors: Joseph Myers<br>
Date: 2025-12-18<br>
Status: Open<br>
Cross-references: <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1043">1043</a></p>
<p>The following issue is based on a discussion that started in <a href="https://www.open-std.org/jtc1/sc22/wg14/34564">reflector
message 34564</a>.</p>
<p>When an expression with enumerated type (with or without fixed
underlying type) is used in an expression, if the type's integer
conversion rank (which equals the rank of the underlying type) is less
than or equal to the rank of <code>int</code> and <code>unsigned int</code>, the integer
promotions convert it to <code>int</code> or <code>unsigned int</code> (depending on whether
<code>int</code> can represent all values of the type). When an expression with
enumerated type with larger rank is used in an expression, it is
unchanged by the integer promotions, but the usual arithmetic
conversions still act to convert it to the underlying type.</p>
<p>This means that in contexts that apply the integer promotions but not
the usual arithmetic conversions, such as unary <code>+</code> and <code>-</code>, shift
operators, and the default argument promotions when passing arguments
to variadic functions, such an expression is not converted to the
underlying type.</p>
<p>For unary <code>+</code> and <code>-</code>, this differs from some implementation practice,
which accepts the following example that is not valid according to the
current wording.</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #008000; font-weight: bold">enum</span><span style="color: #bbbbbb"> </span>e<span style="color: #bbbbbb"> </span><span style="color: #666666">:</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">long</span><span style="color: #bbbbbb"> </span>{<span style="color: #bbbbbb"> </span>E1<span style="color: #bbbbbb"> </span>};
<span style="color: #008000; font-weight: bold">enum</span><span style="color: #bbbbbb"> </span>f<span style="color: #bbbbbb"> </span><span style="color: #666666">:</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">long</span><span style="color: #bbbbbb"> </span>{<span style="color: #bbbbbb"> </span>F1<span style="color: #bbbbbb"> </span>};
<span style="color: #008000; font-weight: bold">extern</span><span style="color: #bbbbbb"> </span>typeof<span style="color: #bbbbbb"> </span>(<span style="color: #666666">+</span>(<span style="color: #008000; font-weight: bold">enum</span><span style="color: #bbbbbb"> </span>e)<span style="color: #666666">0</span>)<span style="color: #bbbbbb"> </span>x;
<span style="color: #008000; font-weight: bold">extern</span><span style="color: #bbbbbb"> </span>typeof<span style="color: #bbbbbb"> </span>(<span style="color: #666666">+</span>(<span style="color: #008000; font-weight: bold">enum</span><span style="color: #bbbbbb"> </span>f)<span style="color: #666666">0</span>)<span style="color: #bbbbbb"> </span>x;<span style="color: #bbbbbb"> </span><span style="color: #3D7B7B; font-style: italic">// Not valid; enum e and enum f not compatible.</span>
</pre></div>
<p>For shift operators, the standard wording assumes that the promoted
left operand has a signed or unsigned integer type. But while
enumerated types have signed or unsigned behavior, they do not fall
into the definition of signed or unsigned types.</p>
<p>For variadic functions, the following example shows that calling
<code>va_arg</code> with a different enumerated type whose underlying type
differs in signedness can be valid when calling it with a different
enumerated type with the same underlying type is not valid, which does
not seem intuitive.</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#include</span><span style="color: #bbbbbb"> </span><span style="color: #3D7B7B; font-style: italic"><stdarg.h></span>
<span style="color: #008000; font-weight: bold">typedef</span><span style="color: #bbbbbb"> </span><span style="color: #008000; font-weight: bold">enum</span><span style="color: #bbbbbb"> </span>e<span style="color: #bbbbbb"> </span><span style="color: #666666">:</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">long</span><span style="color: #bbbbbb"> </span>{<span style="color: #bbbbbb"> </span>E1<span style="color: #bbbbbb"> </span>}<span style="color: #bbbbbb"> </span>e;
<span style="color: #008000; font-weight: bold">typedef</span><span style="color: #bbbbbb"> </span><span style="color: #008000; font-weight: bold">enum</span><span style="color: #bbbbbb"> </span>f<span style="color: #bbbbbb"> </span><span style="color: #666666">:</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">long</span><span style="color: #bbbbbb"> </span>{<span style="color: #bbbbbb"> </span>F1<span style="color: #bbbbbb"> </span>}<span style="color: #bbbbbb"> </span>f;
<span style="color: #008000; font-weight: bold">typedef</span><span style="color: #bbbbbb"> </span><span style="color: #008000; font-weight: bold">enum</span><span style="color: #bbbbbb"> </span>g<span style="color: #bbbbbb"> </span><span style="color: #666666">:</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">unsigned</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">long</span><span style="color: #bbbbbb"> </span>{<span style="color: #bbbbbb"> </span>G1<span style="color: #bbbbbb"> </span>}<span style="color: #bbbbbb"> </span>g;
<span style="color: #B00040">void</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">foo</span>(<span style="color: #B00040">int</span>,<span style="color: #bbbbbb"> </span>...)
{
<span style="color: #bbbbbb"> </span><span style="color: #B00040">va_list</span><span style="color: #bbbbbb"> </span>ap;
<span style="color: #bbbbbb"> </span>va_start(ap);
<span style="color: #bbbbbb"> </span>va_arg(ap,<span style="color: #bbbbbb"> </span>g);<span style="color: #bbbbbb"> </span><span style="color: #3D7B7B; font-style: italic">// okay</span>
<span style="color: #bbbbbb"> </span>va_arg(ap,<span style="color: #bbbbbb"> </span>f);<span style="color: #bbbbbb"> </span><span style="color: #3D7B7B; font-style: italic">// UB</span>
}
<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">main</span>(<span style="color: #B00040">void</span>)
{
<span style="color: #bbbbbb"> </span>foo(<span style="color: #666666">0</span>,<span style="color: #bbbbbb"> </span>(e)<span style="color: #666666">0</span>,<span style="color: #bbbbbb"> </span>(e)<span style="color: #666666">0</span>);
}
</pre></div>
<p>No specific wording change is proposed here to address these issues.
The committee should first give direction on whether the conversion to
the underlying type should be added to the integer promotions (and
removed from the usual arithmetic conversions) for enumerated types
with rank larger than that of <code>int</code> and <code>unsigned int</code>. If not, then
appropriate fixes should be considered individually for each of the
cases listed here.</p>
<hr>
<p>Comment from Issues list maintainer on 2026-02-09:</p>
<p>This issue was discussed at the February 2026 meeting of WG14.
Direction was given that the conversions to an enumeration's
underlying type should occur in all cases discussed in the issue.</p>
<hr>
<p>Comment from Issues list maintainer on 2026-02-25:</p>
<p><a href="https://www.open-std.org/jtc1/sc22/wg14/35358">Reflector message
35358</a> (12 Feb 2026)
proposes wording for this issue to make the integer promotions convert
all enumerations to their underlying type.</p>
<p>In C23 6.3.2.1, change the wording about integer promotions:</p>
<blockquote>
<p><del>The following can be used in an expression wherever an <code>int</code> or
<code>unsigned int</code> can be used:</del></p>
<ul>
<li>
<p><del>An object or expression with an integer type (other than
<code>int</code> or <code>unsigned int</code>) whose integer conversion rank is less
than or equal to the rank of <code>int</code> and <code>unsigned int</code>.</del></p>
</li>
<li>
<p><del>A bit-field of type <code>bool</code>, <code>int</code>, <code>signed int</code>, or <code>unsigned int</code>.</del></p>
</li>
</ul>
<p><del>The value from a bit-field of a bit-precise integer type is
converted to the corresponding bit-precise integer type. If the
original type is not a bit-precise integer type (6.2.5): if an <code>int</code>
can represent all values of the original type (as restricted by the
width, for a bit-field), the value is converted to an
<code>int</code>;<sup>50)</sup> otherwise, it is converted to an <code>unsigned int</code>. These are called the <em>integer promotions</em>. All other types are
unchanged by the integer promotions.</del></p>
</blockquote>
<p>to:</p>
<blockquote>
<p><ins>The <em>integer promotions</em> are the following sequence of
conversions, applied to certain kinds of expressions where specified
in their respective subclauses. Each conversion is applied in turn
if the type resulting from the previous conversions satisfies the
given conditions.</ins></p>
<ul>
<li>
<p><ins>If the expression has enumerated type, it is converted to the
underlying type of the enumeration.</ins></p>
</li>
<li>
<p><ins>If the expression after the previous conversion is a
bit-field of a bit-precise integer type (6.2.5), it is converted
to the corresponding bit-precise integer
type.</ins><sup><ins>50)</ins></sup></p>
</li>
<li>
<p><ins>If the type resulting from the previous conversions is a
bit-precise integer type, no further conversions are applied as
part of the integer promotions.</ins></p>
</li>
<li>
<p><ins>If the expression after the previous conversions:</ins></p>
<ul>
<li>
<p><ins>has an integer type (other than <code>int</code> or <code>unsigned int</code>)
whose integer conversion rank is less than or equal to the rank
of <code>int</code> and <code>unsigned int</code>; or</ins></p>
</li>
<li>
<p><ins>is a bit-field of type <code>bool</code>, <code>int</code>, <code>signed int</code>, or
<code>unsigned int</code></ins></p>
</li>
</ul>
<p><ins>then:</ins></p>
<ul>
<li>
<p><ins>if an <code>int</code> can represent all values of the original type
(as restricted by the width, for a bit-field), the value is
converted to an <code>int</code>;</ins></p>
</li>
<li>
<p><ins>otherwise, it is converted to an <code>unsigned int</code>.</ins></p>
</li>
</ul>
</li>
</ul>
<p><ins>All other types are unchanged by the integer promotions.</ins></p>
</blockquote>
<p>Keep the existing footnote (number 50 in C23), moved to the new
location indicated, and the existing NOTE following the replaced text.
If the option for plain <code>int</code> bit-fields to be implicitly unsigned is
removed, <code>signed int</code> can be removed from the list of bit-field types
above.</p>
<p>In C23 6.3.2.8 (Usual arithmetic conversion), change:</p>
<blockquote>
<p><del>Otherwise, if any of the two types is an enumeration, it is
converted to its underlying type. Then, the</del> <ins>The</ins>
integer promotions are performed on both operands.</p>
</blockquote>
<hr>
<p>Comment from Issues list maintainer on 2026-08-20:</p>
<p>In <a href="https://www.open-std.org/jtc1/sc22/wg14/37132">reflector message
37132</a>, Robert Seacord
expressed concerns about the proposed wording. This issue was
discussed at the August 2026 (Ottawa) meeting of WG14, where it was
also suggested that the integer promotions should be described as
applying to operands rather than expressions. Joseph Myers took an
action item to propose revised wording for this issue.</p>
<hr>
<p>Comment from Issues list maintainer on 2026-08-25:</p>
<p>In <a href="https://www.open-std.org/jtc1/sc22/wg14/37697">reflector message
37697</a>, Joseph Myers
proposed revised wording for this issue to make the integer promotions
convert all enumerations to their underlying type while addressing the
previously raised wording concerns.</p>
<p>In C23 6.3.2.1, change the wording about integer promotions:</p>
<blockquote>
<p><del>The following can be used in an expression wherever an <code>int</code> or
<code>unsigned int</code> can be used:</del></p>
<ul>
<li>
<p><del>An object or expression with an integer type (other than
<code>int</code> or <code>unsigned int</code>) whose integer conversion rank is less
than or equal to the rank of <code>int</code> and <code>unsigned int</code>.</del></p>
</li>
<li>
<p><del>A bit-field of type <code>bool</code>, <code>int</code>, <code>signed int</code>, or <code>unsigned int</code>.</del></p>
</li>
</ul>
<p><del>The value from a bit-field of a bit-precise integer type is
converted to the corresponding bit-precise integer type. If the
original type is not a bit-precise integer type (6.2.5): if an <code>int</code>
can represent all values of the original type (as restricted by the
width, for a bit-field), the value is converted to an
<code>int</code>;<sup>50)</sup> otherwise, it is converted to an <code>unsigned int</code>. These are called the <em>integer promotions</em>. All other types are
unchanged by the integer promotions.</del></p>
</blockquote>
<p>to:</p>
<blockquote>
<p><ins>The <em>integer promotions</em> are the following sequence of
conversions, applied to operands of expressions where specified in
their respective subclauses. Each conversion is applied in turn if
and only if the type resulting from the previous conversions
satisfies the given conditions.</ins></p>
<ul>
<li>
<p><ins>If the operand has enumerated type, it is converted to the
underlying type of the enumeration.</ins></p>
</li>
<li>
<p><ins>If the operand after the previous conversion is a bit-field
of a bit-precise integer type (6.2.5), it is converted to the
corresponding bit-precise integer
type.</ins><sup><ins>50)</ins></sup></p>
</li>
<li>
<p><ins>If the type resulting from the previous conversions is a
bit-precise integer type, no further conversions are applied as
part of the integer promotions.</ins></p>
</li>
<li>
<p><ins>If the operand after the previous conversions:</ins></p>
<ul>
<li>
<p><ins>has an integer type (other than <code>int</code> or <code>unsigned int</code>)
whose integer conversion rank is less than or equal to the rank
of <code>int</code> and <code>unsigned int</code>; or</ins></p>
</li>
<li>
<p><ins>is a bit-field of type <code>bool</code>, <code>int</code>, <code>signed int</code>, or
<code>unsigned int</code></ins></p>
</li>
</ul>
<p><ins>then:</ins></p>
<ul>
<li>
<p><ins>if an <code>int</code> can represent all values of the original type
(as restricted by the width, for a bit-field), the value is
converted to an <code>int</code>;</ins></p>
</li>
<li>
<p><ins>otherwise, it is converted to an <code>unsigned int</code>.</ins></p>
</li>
</ul>
</li>
</ul>
<p><ins>All other types are unchanged by the integer promotions.</ins></p>
</blockquote>
<p>Keep the existing footnote (number 50 in C23), moved to the new
location indicated, and the existing NOTE following the replaced text.
For C2y, where the option for plain <code>int</code> bit-fields to be implicitly
unsigned has been removed, <code>signed int</code> should be removed from the
list of bit-field types above.</p>
<p>In C23 6.3.2.8 (Usual arithmetic conversion), change:</p>
<blockquote>
<p><del>Otherwise, if any of the two types is an enumeration, it is
converted to its underlying type. Then, the</del> <ins>The</ins>
integer promotions are performed on both operands.</p>
</blockquote>
<hr>
<p>Comment from Joseph Myers on 2026-08-27:</p>
<p>After further reflector discussion, the following revised wording is
proposed to make the integer promotions convert all enumerations to
their underlying type while addressing the previously raised wording
concerns.</p>
<p>In C23 6.3.2.1, change the wording about integer promotions:</p>
<blockquote>
<p><del>The following can be used in an expression wherever an <code>int</code> or
<code>unsigned int</code> can be used:</del></p>
<ul>
<li>
<p><del>An object or expression with an integer type (other than
<code>int</code> or <code>unsigned int</code>) whose integer conversion rank is less
than or equal to the rank of <code>int</code> and <code>unsigned int</code>.</del></p>
</li>
<li>
<p><del>A bit-field of type <code>bool</code>, <code>int</code>, <code>signed int</code>, or <code>unsigned int</code>.</del></p>
</li>
</ul>
<p><del>The value from a bit-field of a bit-precise integer type is
converted to the corresponding bit-precise integer type. If the
original type is not a bit-precise integer type (6.2.5): if an <code>int</code>
can represent all values of the original type (as restricted by the
width, for a bit-field), the value is converted to an
<code>int</code>;<sup>50)</sup> otherwise, it is converted to an <code>unsigned int</code>. These are called the <em>integer promotions</em>. All other types are
unchanged by the integer promotions.</del></p>
</blockquote>
<p>to:</p>
<blockquote>
<p><ins>The <em>integer promotions</em> are the following sequence of
conversions, applied to operands of expressions where specified in
their respective subclauses. Each conversion is applied in turn if
and only if the type resulting from the previous conversions
satisfies the given conditions.</ins></p>
<ul>
<li>
<p><ins>If the operand has enumerated type, it is converted to the
underlying type of the enumeration.</ins></p>
</li>
<li>
<p><ins>If the operand after the previous conversion is a bit-field
of a bit-precise integer type (6.2.5), it is converted to the
corresponding bit-precise integer
type.</ins><sup><ins>50)</ins></sup></p>
</li>
<li>
<p><ins>If the operand after the previous conversions has a
bit-precise integer type, no further conversions are applied as
part of the integer promotions.</ins></p>
</li>
<li>
<p><ins>If the operand after the previous conversions:</ins></p>
<ul>
<li>
<p><ins>has an integer type (other than <code>int</code> or <code>unsigned int</code>)
whose integer conversion rank is less than or equal to the rank
of <code>int</code> and <code>unsigned int</code>; or</ins></p>
</li>
<li>
<p><ins>is a bit-field of type <code>bool</code>, <code>int</code>, <code>signed int</code>, or
<code>unsigned int</code></ins></p>
</li>
</ul>
<p><ins>then:</ins></p>
<ul>
<li>
<p><ins>if an <code>int</code> can represent all values of the original type
(as restricted by the width, for a bit-field), the value is
converted to an <code>int</code>;</ins></p>
</li>
<li>
<p><ins>otherwise, it is converted to an <code>unsigned int</code>.</ins></p>
</li>
</ul>
</li>
</ul>
<p><ins>All other types are unchanged by the integer promotions.</ins></p>
</blockquote>
<p>Keep the existing footnote (number 50 in C23), moved to the new
location indicated, and the existing NOTE following the replaced text.
For C2y, where the option for plain <code>int</code> bit-fields to be implicitly
unsigned has been removed, <code>signed int</code> should be removed from the
list of bit-field types above.</p>
<p>In C23 6.3.2.8 (Usual arithmetic conversion), change:</p>
<blockquote>
<p><del>Otherwise, if any of the two types is an enumeration, it is
converted to its underlying type. Then, the</del> <ins>The</ins>
integer promotions are performed on both operands.</p>
</blockquote>
<hr>
<p>Comment from Issues list maintainer on 2026-09-30:</p>
<p><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3970.htm">N3970</a>
proposes alternative wording that would address this issue and that
allows for more implementation divergence regarding bit-fields.</p>
</div>
<hr>
<hr>
<div id="issue1022">
<h2>Issue 1022: Void expressions and lvalues</h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-02-05<br>
Status: Open<br>
Cross-references: <a href="https://www.open-std.org/jtc1/sc22/wg14/issues/c90/issue0012.html">0012</a>, <a href="https://www.open-std.org/jtc1/sc22/wg14/issues/c90/issue0106.html">0106</a></p>
<p>The standard does not seem to reflect the intent in the responses to
<a href="https://www.open-std.org/jtc1/sc22/wg14/issues/c90/issue0012.html">DR 12</a> and <a href="https://www.open-std.org/jtc1/sc22/wg14/issues/c90/issue0106.html">DR 106</a>. Specifically this is
the result of discussion in <a href="https://github.com/llvm/llvm-project/issues/112121">LLVM issue
112121</a>.</p>
<p>Being able to dereference void pointers is useful in making generic
code, specifically when doing <code>typeof(*_Generic(...))</code> to select
between multiple types. Returning a void pointer here causes the type
to be <code>void</code>. Same with pointers to qualified <code>void</code>, <code>_Atomic void*</code>, and pointers to qualified atomic <code>void</code>.</p>
<h3>Question 1</h3>
<p>Given the declaration <code>void*p;</code> is the expression <code>*p</code> valid?</p>
<h3>Question 2</h3>
<p>If <code>*p</code> is valid, is it an lvalue or a void expression? The standard
as written appears to say lvalue, even though that contradicts the
definition of lvalues and the intent expressed in <a href="https://www.open-std.org/jtc1/sc22/wg14/issues/c90/issue0012.html">DR 12</a>
and <a href="https://www.open-std.org/jtc1/sc22/wg14/issues/c90/issue0106.html">DR 106</a>: "If the operand points to a function, the
result is a function designator; if it points to an object, the result
is an lvalue designating the object." (C23 6.5.4.3).</p>
<h3>Question 3</h3>
<p>If <code>*p</code> is valid and it is a void expression, when does evaluating the
expression produce defined behavior or undefined behavior? That is,
what does it mean for a pointer to void to be invalid? Presumably if
<code>p</code> is indeterminate the behavior is undefined.</p>
<h3>Question 4</h3>
<p>If <code>*p</code> is valid and it is an lvalue, would it therefore be valid to
do <code>&*p</code> directly contradicting <a href="https://www.open-std.org/jtc1/sc22/wg14/issues/c90/issue0012.html">DR 12</a>?</p>
<h3>Question 5</h3>
<p>Is the declaration <code>extern void v;</code> valid?</p>
<h3>Question 6</h3>
<p>If that declaration is valid, is an expression naming <code>v</code> valid?</p>
<h3>Question 7</h3>
<p>If that declaration is valid and an expression naming <code>v</code> is valid, is
such an expression an lvalue or a void expression? The standard as
written appears to say lvalue, even though that contradicts the
definition of lvalues and the intent expressed in <a href="https://www.open-std.org/jtc1/sc22/wg14/issues/c90/issue0012.html">DR 12</a>:
"An identifier primary expression designating an object is an lvalue."
(C23 6.5.2).</p>
<h3>Question 8</h3>
<p>If that declaration is valid and an expression naming <code>v</code> is valid and
is an lvalue, would it therefore be valid to do <code>&v</code> directly
contradicting <a href="https://www.open-std.org/jtc1/sc22/wg14/issues/c90/issue0012.html">DR 12</a>?</p>
<h3>Question 9</h3>
<p>Are qualified versions of <code>void</code>, the type <code>_Atomic void</code>, and
qualified versions of <code>_Atomic void</code> regular incomplete types with no
special semantics in expressions? That seems to be the intent in <a href="https://www.open-std.org/jtc1/sc22/wg14/issues/c90/issue0012.html">DR
12</a>, but <a href="https://www.open-std.org/jtc1/sc22/wg14/issues/c90/issue0106.html">DR 106</a> appears to also treat them
as void expressions too.</p>
<hr>
<p>Comment from Issues list maintainer on 2026-03-13:</p>
<p>Jay Ghiron notes regarding question 4:</p>
<blockquote>
<p>I noticed that the unary operator <code>&</code> is defined as allowing results
of the unary operator <code>*</code>. So <code>&*(void*)0</code> does not appear to
violate the constraint, even if <code>*(void*)0</code> were a void expression.</p>
</blockquote>
<hr>
<p>Comment from Issues list maintainer on 2026-08-21:</p>
<p>This issue was discussed at the August 2026 (Ottawa) meeting of WG14;
in <a href="https://www.open-std.org/jtc1/sc22/wg14/37580">reflector message
37580</a>, Aaron Ballman
provided information about what implementations accept or reject
certain constructs. The committee did not identify any clear general
principles to determine what the desired answers to the questions
should be. Regarding the meaning of the current standard text, it was
noted that lvalue conversion of expressions of incomplete types is now
a constraint violation, but the definition of lvalues explicitly
excludes type <code>void</code> so this does not apply to expressions of type
<code>void</code>.</p>
</div>
<hr>
<hr>
<div id="issue1023">
<h2>Issue 1023: <code>static_assert</code> in structure and union definitions</h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-02-17<br>
Status: Open</p>
<p>The standard syntactically allows the following structure definition:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">S</span>{<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>x;<span style="color: #008000; font-weight: bold">static_assert</span>(<span style="color: #008000; font-weight: bold">sizeof</span>(<span style="color: #B00040">int</span>)<span style="color: #666666">==4</span>);};
</pre></div>
<p>However, it appears to violate the following constraint (C23 6.7.3.2
"Structure and union specifiers" paragraph 2):</p>
<blockquote>
<p>A member declaration that does not declare an anonymous structure or
anonymous union shall contain a member declarator list.</p>
</blockquote>
<p>It seems unintended to syntactically allow <code>static_assert</code> while
forbidding it. A second issue with this constraint is that it does not
forbid:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">A</span>{<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>y;<span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">B</span>{<span style="color: #008000; font-weight: bold">struct</span>{<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>z;};};};
</pre></div>
<p>Since the member declaration <code>struct B{struct{int z;};};</code> does declare
an anonymous structure, just not one within <code>A</code>. I assume that this
is not intended, however.</p>
<p>Considering "The optional attribute specifier sequence in a member
declaration appertains to each of the members declared by the member
declarator list; it shall not appear if the optional member declarator
list is omitted." (C23 6.7.3.2 paragraph 9) and "Except where the type
is inferred (6.7.10), at least one type specifier shall be given in
the declaration specifiers in each declaration, and in the
specifier-qualifier list in each member declaration and type name."
(C23 6.7.3.1 paragraph 2) also use the phrase "member declaration" to
not include static_assert declarations, a correction can separate
static_assert-declaration from member-declaration instead of changing
each of the uses of "member declaration".</p>
<p>A correction to the second issue should be done similar to C23 6.7.1
paragraph 2, except that it requires the absence of a tag. That
wording is not perfect either, adding examples to clarify the intent
would be useful in 6.7.3.2 as well.</p>
<hr>
<p>Comment from Issues list maintainer on 2026-08-21:</p>
<p>This issue was discussed at the August 2026 (Ottawa) meeting of WG14.
Joseph Myers took an action item to propose wording with a minimal
correction to exclude <code>static_assert</code> declarations from this
constraint, while Martin Uecker took an action item to write a paper
allowing unnamed members more generally (with it being noted in
discussion that it would be necessary to check whether implementations
are consistent in how they handle such members, and in particular
whether there are variations in the size of a structure or union among
those that accept them).</p>
<hr>
<p>Comment from Issues list maintainer on 2026-08-25:</p>
<p>In <a href="https://www.open-std.org/jtc1/sc22/wg14/37699">reflector message
37699</a>, Joseph Myers
proposed wording for this issue.</p>
<p>In C23 6.7.3.2 (Structure and union specifiers), change:</p>
<blockquote>
<p>A member declaration that does not declare an anonymous structure or
anonymous union shall contain a member declarator list.</p>
</blockquote>
<p>to</p>
<blockquote>
<p>If a member declaration other than a static_assert declaration does
not include a member declarator list, its specifier qualifier list
shall include a structure or union specifier with no tag.</p>
</blockquote>
<p>In C23 6.7.3.2 (Structure and union specifiers), also change:</p>
<blockquote>
<p>The member declaration list is a sequence of declarations for the
members of the structure or union<ins>, possibly mixed with
static_assert declarations</ins>.</p>
</blockquote>
<p>In C23 3.17 (definition of "memory location"), change:</p>
<blockquote>
<p>The same applies to two bit-fields, if one is declared inside a
nested structure declaration and the other is not, or if the two are
separated by a zero-length bit-field declaration, or if they are
separated by a non-bit-field<ins>, non-static_assert</ins> member
declaration.</p>
</blockquote>
<hr>
<p>Comment from Issues list maintainer on 2026-10-09:</p>
<p>The proposal
<a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3926.pdf">N3926</a>
would also make changes to allow more cases of unnamed members.</p>
</div>
<hr>
<hr>
<div id="issue1024">
<h2>Issue 1024: Redeclaration of standard library typedefs</h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-02-25<br>
Status: Open</p>
<p>Since C11, it has been valid to redeclare typedefs with an equivalent
type. For example:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #008000; font-weight: bold">typedef</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>T;
<span style="color: #008000; font-weight: bold">typedef</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>T;
</pre></div>
<p>However, this is never stated as being valid for standard library
types:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#include</span><span style="color: #3D7B7B; font-style: italic"><stddef.h></span>
<span style="color: #008000; font-weight: bold">typedef</span><span style="color: #bbbbbb"> </span>typeof(<span style="color: #008000; font-weight: bold">sizeof</span>(<span style="color: #666666">0</span>))<span style="color: #B00040">size_t</span>;
</pre></div>
<p>Since <code>size_t</code> is a reserved identifier, it is not valid to provide a
macro definition or another definition at file scope. But it seems
unnecessary to forbid this, it would be impossible to make this
invalid in an implementation of the standard library using normal C
typedefs. If the order were swapped:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #008000; font-weight: bold">typedef</span><span style="color: #bbbbbb"> </span>typeof(<span style="color: #008000; font-weight: bold">sizeof</span>(<span style="color: #666666">0</span>))<span style="color: #B00040">size_t</span>;
<span style="color: #9C6500">#include</span><span style="color: #3D7B7B; font-style: italic"><stddef.h></span>
</pre></div>
<p>Then it would be possible for a normal C header to forbid this, for example:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#ifndef __SIZE_T_DEFINED__</span><span style="color: #3D7B7B; font-style: italic">/* or another name reserved to the implementation */</span>
<span style="color: #9C6500">#define __SIZE_T_DEFINED__</span>
<span style="color: #008000; font-weight: bold">static_assert</span>(<span style="color: #008000; font-weight: bold">_Generic</span>((<span style="color: #B00040">void</span>(<span style="color: #666666">*</span>)(<span style="color: #B00040">int</span>(<span style="color: #B00040">size_t</span>)))<span style="color: #666666">0</span>,<span style="color: #B00040">void</span>(<span style="color: #666666">*</span>)(<span style="color: #B00040">int</span>)<span style="color: #666666">:1</span>,<span style="color: #008000; font-weight: bold">default</span><span style="color: #666666">:0</span>));
<span style="color: #008000; font-weight: bold">typedef</span><span style="color: #bbbbbb"> </span>typeof(<span style="color: #008000; font-weight: bold">sizeof</span>(<span style="color: #666666">0</span>))<span style="color: #B00040">size_t</span>;
<span style="color: #9C6500">#endif</span>
</pre></div>
<p>Though it would not make any sense for this to be done. A motivating
example to allow this is so that a header can provide <code>size_t</code> without
including everything else in one of the standard headers that provides
<code>size_t</code>. The same would also be possible for <code>ptrdiff_t</code>, <code>wchar_t</code>,
<code>errno_t</code>, <code>rsize_t</code>, <code>char8_t</code>, <code>char16_t</code>, <code>char32_t</code>, <code>nullptr_t</code>,
<code>constraint_handler_t</code>, <code>tss_dtor_t</code>, <code>thrd_start_t</code>, and many of the
types beginning with <code>atomic_</code>.</p>
<h3>Suggested correction</h3>
<p>Insert at the end of C23 7.1.2 paragraph 1:</p>
<blockquote>
<p>Declarations of types described here, in Annex H, or in Annex K,
shall not include type qualifiers, unless explicitly stated
otherwise.<ins> For types in the ordinary name space described here,
in Annex H, or in Annex K, it is permissible to declare the
identifier as a typedef name at file scope with an equivalent type,
including declarations which occur before any standard header
defines the identifier.</ins></p>
</blockquote>
<p>Note: The wording "ordinary name space" is used to avoid including the
types <code>struct timespec</code>, <code>struct tm</code>, and <code>struct lconv</code>.</p>
<p>Note: There seems to be some irregularity in the standard when saying
an identifier has file scope, it uses "has file scope" (or
equivalently "have file scope"), "at file scope", "in file scope", and
"with file scope".</p>
<p>Modify C23 7.1.2 paragraph 5:</p>
<blockquote>
<p>If used, a header shall be included outside of any external
declaration or definition, and it shall first be included before the
first reference to any of the functions or objects it declares, or to
any of the types or macros it defines<ins>, except for functions or
types declared or defined respectively before the header is
included</ins>.</p>
</blockquote>
<p>Note: The text seems to currently forbid declaring a library function,
using it, then including the header. Even though it would be valid to
declare a library function and use it without including the header.</p>
<hr>
<p>Comment from Issues list maintainer on 2026-08-21:</p>
<p>This issue was discussed at the August 2026 (Ottawa) meeting of WG14.
Joseph Myers took an action item to propose wording to disallow such
redeclarations (making them undefined behavior if a header with the
standard declaration is included in the same translation unit, not
requiring or expecting any implementations to change), in accordance
with the view that declaring library functions other than through
including the relevant header is also a legacy feature and in general
declaring standard library features in user code is to be discouraged.</p>
<hr>
<p>Comment from Issues list maintainer on 2026-08-25:</p>
<p>In <a href="https://www.open-std.org/jtc1/sc22/wg14/37700">reflector message
37700</a>, Joseph Myers
proposed a response that confirms there is existing undefined behavior
for such redeclarations and that this reflects the committee's intent.</p>
<h3>Suggested response</h3>
<p>C23 6.4.3.1 (Identifiers: General) specifies that:</p>
<blockquote>
<p>If the program declares or defines an identifier in a context in
which it is reserved (other than as allowed by 7.1.4), the behavior
is undefined.</p>
</blockquote>
<p>C23 7.1.3 (Reserved identifiers) says:</p>
<blockquote>
<ul>
<li>Each identifier with file scope listed in any of the following
subclauses (including the future library directions) is reserved
for use as a macro name and as an identifier with file scope in
the same name space if any of its associated headers is included.</li>
</ul>
</blockquote>
<p>C23 7.1.4 (Use of library functions) does not provide any exceptions
relevant to typedef names.</p>
<p>Thus, it is undefined behavior for an application to declare a
standard library typedef name with file scope in any translation unit
that includes the associated header. The committee does not wish to
allow such redeclarations.</p>
</div>
<hr>
<hr>
<div id="issue1025">
<h2>Issue 1025: Variably modified standard library types</h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-02-26<br>
Status: Review<br>
Cross-references: <a href="https://www.open-std.org/jtc1/sc22/wg14/issues/c90/issue0147.html">0147</a></p>
<p>The standard never directly says that standard library types cannot be
variably modified, though it would be impossible to actually define
any of the types this way in a normal C header. Given <a href="https://www.open-std.org/jtc1/sc22/wg14/issues/c90/issue0147.html">DR
147</a> was accepted and that library functions needed
special wording to ensure proper sequence points, it seems necessary
to do the same with types to ensure that they are not variably
modified.</p>
<h3>Suggested correction</h3>
<p>Modify C23 7.1.2 paragraph 1:</p>
<blockquote>
<p>Declarations of types described here, in Annex H, or in Annex K,
shall not <del>include type qualifiers</del><ins>be qualified or
variably modified</ins>, unless explicitly stated otherwise.</p>
</blockquote>
<p>Note: The existing wording "include type qualifiers" is changed here
so it is clear that types such as <code>const int*</code> are not forbidden.</p>
<hr>
<p>Comment from Issues list maintainer on 2026-08-21:</p>
<p>At the August 2026 (Ottawa) meeting of WG14, a modified version of the
suggested correction was accepted, subject to review at the next
meeting.</p>
<h3>Proposed correction</h3>
<p>Modify C23 7.1.2 paragraph 1:</p>
<blockquote>
<p>Declarations of types described here, in Annex H, or in Annex K,
<del>shall not include type qualifiers</del> <ins>are not qualified
or variably modified</ins>, unless explicitly stated otherwise.</p>
</blockquote>
</div>
<hr>
<hr>
<div id="issue1026">
<h2>Issue 1026: <code>thrd_t</code> as an array type</h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-02-27<br>
Status: Open<br>
Cross-references: <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1058">1058</a></p>
<p>No wording exists currently to say that <code>thrd_t</code> is not an array type:</p>
<blockquote>
<p>The types are</p>
<p>...</p>
<p><code>thrd_t</code></p>
<p>which is a complete object type that holds an identifier for a thread;</p>
</blockquote>
<p>(C23 7.28.1 "Introduction" paragraph 4).</p>
<p>However, the definition of <code>thrd_current</code> returns a <code>thrd_t</code>:</p>
<blockquote>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span>thrd_t thrd_current(void);
</pre></div>
</blockquote>
<p>(C23 7.28.5.2 "The <code>thrd_current</code> function" paragraph 1).</p>
<p>Functions are not allowed to return arrays, so if <code>thrd_t</code> were an
array type then this declaration would be invalid.</p>
<h3>Suggested correction</h3>
<p>Modify C23 7.28.1 paragraph 4:</p>
<blockquote>
<p><code>thrd_t</code></p>
<p>which is a complete object type<ins> other than an array type</ins>
that holds an identifier for a thread;</p>
</blockquote>
<hr>
<p>Comment from Issues list maintainer on 2026-08-21:</p>
<p>This issue was discussed at the August 2026 (Ottawa) meeting of WG14.
It was suggested that, rather than array types being excluded
individually in particular cases, the general wording about library
types should exclude them by default, with only a few specific cases
such as <code>jmp_buf</code> and <code>va_list</code> allowing them. Joseph Myers took an
action item to propose wording for this (building on the wording for
<a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1025">issue 1025</a>).</p>
<hr>
<p>Comment from Issues list maintainer on 2026-08-25:</p>
<p>In <a href="https://www.open-std.org/jtc1/sc22/wg14/37708">reflector message
37708</a>, Joseph Myers
provided an analysis of which standard library types are not currently
excluded from being array types.</p>
</div>
<hr>
<hr>
<div id="issue1027">
<h2>Issue 1027: Member declaration attributes and composite types</h2>
<p>Authors: Joseph Myers<br>
Date: 2026-02-27<br>
Status: Open<br>
Cross-references: <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1013">1013</a></p>
<p>The rules for redeclaration of structure, union and enumerated types,
and for compatibility and composite type, do not address how
attributes on members (not on their types) are handled. This is
different from the questions in <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1013">issue 1013</a> around "same
type" when the attributes are part of the type of a member.</p>
<h3>Question 1</h3>
<p>What are the effects of variations in attributes for redeclarations of
the same type?</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">s</span><span style="color: #bbbbbb"> </span>{
<span style="color: #bbbbbb"> </span>[[deprecated]]<span style="color: #bbbbbb"> </span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>a;
<span style="color: #bbbbbb"> </span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>b;
}<span style="color: #bbbbbb"> </span>x;
<span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">s</span><span style="color: #bbbbbb"> </span>{
<span style="color: #bbbbbb"> </span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>a;
<span style="color: #bbbbbb"> </span>[[deprecated]]<span style="color: #bbbbbb"> </span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>b;
}<span style="color: #bbbbbb"> </span>y;
</pre></div>
<p>The types of the members are clearly the same (the attribute
appertains to the member, not its type), so it appears this is valid
(and both definitions of <code>struct s</code>, being in the same scope and using
the same tag, also thus declare the same type). Does the rule about
<code>[[maybe_unused]]</code> and <code>[[deprecated]]</code> that "An entity is considered
marked with the attribute after the first declaration that marks it."
apply to member declarations as it does to other cases of multiple
declarations of the same entity? Would subsequent references to
<code>x.a</code>, <code>x.b</code>, <code>y.a</code> and <code>y.b</code> thus all be considered references to a
deprecated entity, since <code>x</code> and <code>y</code> have the same type, where both
members are deprecated? (An example of this was raised in <a href="https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119526#c2">GCC bug
119526</a>.)</p>
<h3>Question 2</h3>
<p>How do such variations affect composite types?</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">s</span><span style="color: #bbbbbb"> </span>{
<span style="color: #bbbbbb"> </span>[[deprecated]]<span style="color: #bbbbbb"> </span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>a;
<span style="color: #bbbbbb"> </span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>b;
}<span style="color: #bbbbbb"> </span>x;
<span style="color: #B00040">void</span>
<span style="color: #0000FF">f</span>(<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>i)
{
<span style="color: #bbbbbb"> </span><span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">s</span><span style="color: #bbbbbb"> </span>{
<span style="color: #bbbbbb"> </span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>a;
<span style="color: #bbbbbb"> </span>[[deprecated]]<span style="color: #bbbbbb"> </span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>b;
<span style="color: #bbbbbb"> </span>}<span style="color: #bbbbbb"> </span>y<span style="color: #bbbbbb"> </span><span style="color: #666666">=</span><span style="color: #bbbbbb"> </span>{<span style="color: #bbbbbb"> </span>i,<span style="color: #bbbbbb"> </span>i<span style="color: #bbbbbb"> </span>};
<span style="color: #bbbbbb"> </span>(i<span style="color: #bbbbbb"> </span><span style="color: #666666">?</span><span style="color: #bbbbbb"> </span><span style="color: #666666">&</span>x<span style="color: #bbbbbb"> </span><span style="color: #666666">:</span><span style="color: #bbbbbb"> </span><span style="color: #666666">&</span>y)<span style="color: #666666">-></span>b<span style="color: #bbbbbb"> </span><span style="color: #666666">=</span><span style="color: #bbbbbb"> </span><span style="color: #666666">1</span>;
}
</pre></div>
<p>In the composite of two compatible types in <code>(i ? &x : &y)</code>, which
members are considered deprecated? The rule for composites of
structure and union types does not consider any information about the
members (such as attributes) that might be different, but not
affecting compatibility and not part of the types of those members.</p>
<hr>
<p>Comment from Aaron Ballman on 2026-08-19:</p>
<p>Issue 1027 starts asking the right questions but there are other
questions in the same area.</p>
<p>Related to question 1 is: how do attribute arguments impact things? e.g.,</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">S</span><span style="color: #bbbbbb"> </span>{
<span style="color: #bbbbbb"> </span>[[deprecated]]<span style="color: #bbbbbb"> </span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>i;
};
<span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">S</span><span style="color: #bbbbbb"> </span>{
<span style="color: #bbbbbb"> </span>[[deprecated(<span style="color: #BA2121">""</span>)]]<span style="color: #bbbbbb"> </span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>i;
};
</pre></div>
<p><a href="https://godbolt.org/z/1qnrrejqr">Compiler Explorer link</a></p>
<p>Those are semantically equivalent but not syntactically equivalent.
Probably something that users might expect to work, but do we want to
encourage that kind of coding pattern by allowing it? Do attributes
the implementation does not know about change the answer? e.g.,</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">S</span><span style="color: #bbbbbb"> </span>{
<span style="color: #bbbbbb"> </span>[[vendor<span style="color: #666666">::</span>unknown(<span style="color: #BA2121">""</span>)]]<span style="color: #bbbbbb"> </span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>i;
};
<span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">S</span><span style="color: #bbbbbb"> </span>{
<span style="color: #bbbbbb"> </span>[[vendor<span style="color: #666666">::</span>unknown]]<span style="color: #bbbbbb"> </span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>i;
};
</pre></div>
<p><a href="https://godbolt.org/z/PzPbxdKfP">Compiler Explorer link</a></p>
<p>Is the answer consistent for other kinds of equivalent attributes, like:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">S</span><span style="color: #bbbbbb"> </span>{
<span style="color: #bbbbbb"> </span>[[gnu<span style="color: #666666">::</span>unused]]<span style="color: #bbbbbb"> </span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>i;
};
<span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">S</span><span style="color: #bbbbbb"> </span>{
<span style="color: #bbbbbb"> </span>[[maybe_unused]]<span style="color: #bbbbbb"> </span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>i;
};
</pre></div>
<p><a href="https://godbolt.org/z/oejGb6fq3">Compiler Explorer link</a></p>
<p>What about when mixed with keyword-based attributes?</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">S</span><span style="color: #bbbbbb"> </span>{
<span style="color: #bbbbbb"> </span>[[gnu<span style="color: #666666">::</span>aligned(<span style="color: #666666">8</span>)]]<span style="color: #bbbbbb"> </span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>i;
};
<span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">S</span><span style="color: #bbbbbb"> </span>{
<span style="color: #bbbbbb"> </span><span style="color: #008000; font-weight: bold">alignas</span>(<span style="color: #666666">8</span>)<span style="color: #bbbbbb"> </span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>i;
};
</pre></div>
<p><a href="https://godbolt.org/z/Gev7aWcad">Compiler Explorer link</a></p>
<hr>
<p>Comment from Issues list maintainer on 2026-08-21:</p>
<p>This issue was discussed at the August 2026 (Ottawa) meeting of WG14.
It was noted that similar issues also apply to declaration attributes
on function parameters. Martin Uecker will consider declaration
attributes when writing a paper for <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1013">issue 1013</a>, and
Aaron Ballman volunteered to discuss attributes issues with him.
Matters related to alignment are discussed in <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1041">issue 1041</a>
and <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1044">issue 1044</a>.</p>
</div>
<hr>
<hr>
<div id="issue1028">
<h2>Issue 1028: <code>jmp_buf</code> as an incomplete array type</h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-03-03<br>
Status: Review</p>
<p>No wording exists currently to say that <code>jmp_buf</code> must be a complete
object type:</p>
<blockquote>
<p>The type declared is</p>
<p><code>jmp_buf</code></p>
<p>which is an array type suitable for holding the information needed to
restore a calling environment.</p>
</blockquote>
<p>(C23 7.13.1 "Non-local jumps" paragraph 3.)</p>
<p>If <code>jmp_buf</code> were an incomplete object type, this would break almost
all uses of it. Interestingly, the example of <code>longjmp</code> in C23
7.13.3.1 paragraph 5 would be fine because it defines an object of
type <code>jmp_buf</code> by using a tentative definition.</p>
<h3>Suggested correction</h3>
<p>Modify C23 7.13.1 paragraph 3:</p>
<blockquote>
<p><code>jmp_buf</code></p>
<p>which is<ins> a complete object type that is</ins> an array type
suitable for holding the information needed to restore a calling
environment.</p>
</blockquote>
<p>Note: This wording is suggested instead of "complete array type" to
clarify that <code>jmp_buf</code> must have a fundamental alignment requirement.</p>
<hr>
<p>Comment from Issues list maintainer on 2026-08-21:</p>
<p>At the August 2026 (Ottawa) meeting of WG14, a modified version of the
suggested correction was accepted (noting that <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1058">issue
1058</a> should be responded to in a way such that "complete
array type" is sufficient to guarantee a fundamental alignment
requirement), subject to review at the next meeting.</p>
<h3>Proposed correction</h3>
<p>Modify C23 7.13.1 paragraph 3:</p>
<blockquote>
<p><code>jmp_buf</code></p>
<p>which is <del>an</del> <ins>a complete</ins> array type suitable for
holding the information needed to restore a calling environment.</p>
</blockquote>
</div>
<hr>
<hr>
<div id="issue1029">
<h2>Issue 1029: Spelling of <code>__LINE__</code></h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-03-05<br>
Status: Open<br>
Cross-references: <a href="https://www.open-std.org/jtc1/sc22/wg14/issues/c11c17/issue0464.html">0464</a>, <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1016">1016</a></p>
<p><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1016">Issue 1016</a> was resolved as not allowing digit separators
in <code>__LINE__</code>. However, there are other issues with the permissible
spellings of <code>__LINE__</code>. Specifically relating to <code>#line __LINE__</code> as
mentioned in <a href="https://www.open-std.org/jtc1/sc22/wg14/issues/c11c17/issue0464.html">DR 464</a>. First, if <code>__LINE__</code> expands to a
binary constant or a hexadecimal constant then <code>#line __LINE__</code> is
invalid. Second, if <code>__LINE__</code> expands to include an integer suffix
then <code>#line __LINE__</code> is also invalid. Third, if <code>__LINE__</code> expands
to an octal constant then <code>#line __LINE__</code> will possibly result in a
different value. For example:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #3D7B7B; font-style: italic">//line 1</span>
<span style="color: #3D7B7B; font-style: italic">//line 2</span>
<span style="color: #3D7B7B; font-style: italic">//line 3</span>
<span style="color: #3D7B7B; font-style: italic">//line 4</span>
<span style="color: #3D7B7B; font-style: italic">//line 5</span>
<span style="color: #3D7B7B; font-style: italic">//line 6</span>
<span style="color: #3D7B7B; font-style: italic">//line 7</span>
<span style="color: #9C6500">#line __LINE__</span>
__LINE__
</pre></div>
<p>As indicated in <a href="https://www.open-std.org/jtc1/sc22/wg14/issues/c11c17/issue0464.html">DR 464</a>, this could expand to eight or
nine. However if an octal constant were used, this could instead
expand to ten or eleven. Since <code>#line 010</code> is interpreted as setting
the line number to ten, not eight.</p>
<h3>Question 1</h3>
<p>Is it intended that <code>#line __LINE__</code> must be valid?</p>
<h3>Question 2</h3>
<p>Is it intended that <code>#line __LINE__</code> cannot have more than two
possible results due to octal constants possibly being used?</p>
<h3>Question 3</h3>
<p>Outside of <code>#line __LINE__</code>, should the spelling of <code>__LINE__</code> be
strictly defined so that stringization and concatenation have well
defined results? For example:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#define CAT(X,Y,...)__VA_OPT__(X)##__VA_OPT__(Y)</span>
<span style="color: #9C6500">#define DEFINE int CAT(v,__LINE__,,);CAT(v,__LINE__,,)=42</span>
<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">main</span>(){
DEFINE;
}
</pre></div>
<p>There are many programs like this that rely on the spelling of
<code>__LINE__</code> being consistent within a line. See also <a href="https://cplusplus.github.io/CWG/issues/3142.html">C++ CWG
3142</a>.</p>
<hr>
<p>Comment from Issues list maintainer on 2026-08-21:</p>
<p>At the August 2026 (Ottawa) meeting of WG14, it was agreed that
<code>__LINE__</code> should be decimal or possibly <code>0</code> so that <code>#line __LINE__</code>
works and there is a unique possible spelling for a given line number.
Joseph Myers took an action item to propose wording for this,
preferably similar to the wording used in C++.</p>
<hr>
<p>Comment from Issues list maintainer on 2026-08-25:</p>
<p>In <a href="https://www.open-std.org/jtc1/sc22/wg14/37710">reflector message
37710</a>, Joseph Myers
proposed wording for this issue.</p>
<p>The following proposed wording is based on C2y draft
<a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3886.pdf">N3886</a>;
for C23 (as amended by <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1016">issue 1016</a>), "integer literal"
and "decimal literal" should be read as "integer constant" and
"decimal constant".</p>
<p>Change 6.10.10.2 Mandatory macros:</p>
<blockquote>
<p><code>__LINE__</code> The <del>presumed line number (within the current source
file) of the current source line (an</del> integer literal <ins><code>0</code>
or an unsuffixed decimal literal (6.4.5.2),</ins> excluding any
digit separators<del>)</del><ins>, representing the presumed line
number of the current source line within the current source
file</ins>.</p>
</blockquote>
<hr>
<p>Comment from Joseph Myers on 2026-10-09:</p>
<p>With further wording changes that have been made to the working draft
in git regarding contexts that do not permit digit separators, the
proposed wording becomes as follows; for C23 (as amended by <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1016">issue
1016</a>), "integer literal" and "decimal literal" should be
read as "integer constant" and "decimal constant".</p>
<p>Change 6.10.10.2 Mandatory macros:</p>
<blockquote>
<p><code>__LINE__</code> The <del>presumed line number (within the current source
file) of the current source line (an</del> integer literal <ins><code>0</code>
or an unsuffixed decimal literal (6.4.5.2),</ins> not containing any
digit separators<del>)</del><ins>, representing the presumed line
number of the current source line within the current source
file</ins>.</p>
</blockquote>
</div>
<hr>
<hr>
<div id="issue1030">
<h2>Issue 1030: Lvalue conversion for generic associations</h2>
<p>Authors: Joseph Myers<br>
Date: 2026-03-05<br>
Status: Open<br>
Cross-references: <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1031">1031</a></p>
<p>This is an issue previously mentioned in <a href="https://www.open-std.org/jtc1/sc22/wg14/28292">reflector message
28292</a>.</p>
<p>In C23, there is undefined behavior for lvalue conversion of an lvalue
with incomplete, non-array type, and for array-to-pointer conversion
of an array object with register storage class. (In C2Y, the first of
these has become a constraint violation, and the second has become
implementation-defined behavior.)</p>
<p>In both cases, it should be understood that the undefined behavior is
translation-time undefined, since it relates to a property of a
translation unit, not a property of a particular execution. In both
cases, there are specific contexts, such as operands of <code>sizeof</code> or
<code>typeof</code>, where the relevant conversion does not occur, and thus the
undefined behavior, constraint violation or implementation-defined
behavior does not occur either.</p>
<p>This raises the question of how those contexts are defined for generic
associations in a generic selection other than the one that is the
result expression.</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">s</span><span style="color: #bbbbbb"> </span><span style="color: #666666">*</span>p;
<span style="color: #B00040">void</span>
<span style="color: #0000FF">f1</span>()
{
<span style="color: #bbbbbb"> </span>typeof(<span style="color: #008000; font-weight: bold">_Generic</span>(<span style="color: #666666">1</span>,<span style="color: #bbbbbb"> </span><span style="color: #B00040">int</span><span style="color: #666666">:</span><span style="color: #bbbbbb"> </span><span style="color: #666666">*</span>p))<span style="color: #bbbbbb"> </span><span style="color: #666666">*</span>q;
}
<span style="color: #B00040">void</span>
<span style="color: #0000FF">f2</span>()
{
<span style="color: #bbbbbb"> </span>typeof(<span style="color: #008000; font-weight: bold">_Generic</span>(<span style="color: #666666">1</span>,<span style="color: #bbbbbb"> </span><span style="color: #B00040">int</span><span style="color: #666666">:</span><span style="color: #bbbbbb"> </span><span style="color: #666666">0</span>,<span style="color: #bbbbbb"> </span><span style="color: #B00040">long</span><span style="color: #666666">:</span><span style="color: #bbbbbb"> </span><span style="color: #666666">*</span>p))<span style="color: #bbbbbb"> </span><span style="color: #666666">*</span>q;
}
<span style="color: #B00040">void</span>
<span style="color: #0000FF">f3</span>()
{
<span style="color: #bbbbbb"> </span><span style="color: #008000; font-weight: bold">_Generic</span>(<span style="color: #666666">1</span>,<span style="color: #bbbbbb"> </span><span style="color: #B00040">int</span><span style="color: #666666">:</span><span style="color: #bbbbbb"> </span><span style="color: #666666">0</span>,<span style="color: #bbbbbb"> </span><span style="color: #B00040">long</span><span style="color: #666666">:</span><span style="color: #bbbbbb"> </span><span style="color: #666666">*</span>p);
}
</pre></div>
<p>In <code>f1</code>, <code>*p</code> is the result expression, and is treated as being the
operand of <code>typeof</code> by common practice (this is a natural consequence
of "It is an lvalue, a function designator, or a void expression if
its result expression is, respectively, an lvalue, a function
designator, or a void expression."; if it is an lvalue, it is to be
expected that conversions do or do not occur based on its context,
although the current text may not be fully clear on this and the
<a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3722.pdf">N3722</a>
proposal does not fully address this case either). Thus the code in
<code>f1</code> is valid.</p>
<p>In <code>f2</code> and <code>f3</code>, however, <code>*p</code> is not the result expression. This
could be interpreted as meaning that none of the "Except when"
conditions for avoiding lvalue conversion apply, and so undefined
behavior (C23) or a constraint violation (C2Y) occurs. Alternatively,
it could be interpreted as occurring only in <code>f3</code> because of the
<code>typeof</code> present in <code>f2</code>.</p>
<p>For each of the three examples, there is a question of intent: should
lvalue conversion occur in that case? Then, there is the question of
whether the standard is sufficiently clear about this or whether it
needs amendment to meet the desired intent.</p>
<p>I suggest that all three examples ought to be valid. <code>f1</code> ought to be
valid because the lvalue is the operand of <code>typeof</code> (via <code>_Generic</code>).
The other two ought to be valid because no lvalue conversion should
occur for generic associations other than the result expression, which
would make it irrelevant what the context surrounding <code>_Generic</code> is.
This would require changes to the standard to add to the "Except when"
conditions.</p>
<p>Changes such as those proposed in
<a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3809.pdf">N3809</a>
(to allow arbitrary balanced token sequences rather than properly
typed expressions for generic associations other than the result
expression) would alternatively make <code>f2</code> and <code>f3</code> valid, but
introduce incompatibilities regarding scoping of identifiers declared
in such generic associations, which would render it unsuitable to
apply to earlier versions of C.</p>
<hr>
<p>Comment from Issues list maintainer on 2026-08-21:</p>
<p>This issue was discussed at the August 2026 (Ottawa) meeting of WG14.
There was agreement that all three examples should be valid. Joseph
Myers took an action item to propose wording for this.</p>
<hr>
<p>Comment from Issues list maintainer on 2026-08-25:</p>
<p>In <a href="https://www.open-std.org/jtc1/sc22/wg14/37713">reflector message
37713</a>, Joseph Myers
proposed wording for this issue.</p>
<p>Change C23 6.3.3.1 (Lvalues, arrays, and function designators):</p>
<blockquote>
<p>Except when it is the operand of the <code>sizeof</code> operator, or the
typeof operators, the unary <code>&</code> operator, the <code>++</code> operator, the
<code>--</code> operator, <ins>or a generic assocation that is not the result
expression of its generic selection,</ins> or the left operand of
the <code>.</code> operator or an assignment operator, an lvalue that does not
have array type is converted to the value stored in the designated
object (and is no longer an lvalue); this is called <em>lvalue
conversion</em>.</p>
</blockquote>
<p>In C2y this has become a bulleted list (see <a href="https://www.open-std.org/jtc1/sc22/wg14/37712">reflector message
37712</a>) so the new
words would become a new bullet point at the indicated place.</p>
</div>
<hr>
<hr>
<div id="issue1031">
<h2>Issue 1031: Generic selection controlling expression lvalue of incomplete non-array type</h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-03-06<br>
Status: Open<br>
Cross-references: <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1030">1030</a></p>
<p>In C23 the type a generic selection uses is defined as such:</p>
<blockquote>
<p>The type of the controlling expression is the type of the expression
as if it had undergone an lvalue conversion, array to pointer
conversion, or function to pointer conversion.</p>
</blockquote>
<p>(C23 6.5.2.1 "Generic selection" paragraph 2.)</p>
<p>However, lvalue conversions are defined as such:</p>
<blockquote>
<p>Except when it is the operand of the <code>sizeof</code> operator, or the
typeof operators, the unary <code>&</code> operator, the <code>++</code> operator, the
<code>--</code> operator, or the left operand of the <code>.</code> operator or an
assignment operator, an lvalue that does not have array type is
converted to the value stored in the designated object (and is no
longer an lvalue); this is called <em>lvalue conversion</em>.</p>
</blockquote>
<p>(C23 6.3.3.1 "Lvalues, arrays, and function designators" paragraph 2.)</p>
<p>There is no exemption here for expressions that are the controlling
expression of a generic selection, so it appears that lvalue
conversions will happen in controlling expressions of generic
associations. Given this, it appears that the "as if it had undergone
an lvalue conversion" is redundant since the expression must have
already undergone lvalue conversions if it were an lvalue of non-array
type. I do not think this was the intent, however. An example of
where this difference matters is:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #008000; font-weight: bold">extern</span><span style="color: #bbbbbb"> </span><span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">incomplete</span><span style="color: #bbbbbb"> </span>s;
<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">main</span>(){
<span style="color: #008000; font-weight: bold">_Generic</span>(s,<span style="color: #008000; font-weight: bold">default</span><span style="color: #666666">:0</span>);
}
</pre></div>
<h3>Question 1</h3>
<p>Does this program actually do lvalue conversion, and cause undefined
behavior? In C2Y this has been changed to a constraint.</p>
<h3>Question 2</h3>
<p>If it should not actually do lvalue conversion, does the hypothetical
lvalue conversion cause undefined behavior? In C2Y this has been
changed to a constraint.</p>
<p>A correction should consider that C2Y has changed the constraints on
generic associations to allow for incomplete types.</p>
<hr>
<p>Comment from Issues list maintainer on 2026-08-21:</p>
<p>This issue was discussed at the August 2026 (Ottawa) meeting of WG14.
The view was expressed that while the type of the controlling
expression is interpreted as if lvalue conversion occurs, the lvalue
conversion itself should not occur. JeanHeyd Meneide took an action
item to propose wording for this.</p>
</div>
<hr>
<hr>
<div id="issue1032">
<h2>Issue 1032: <code>errno</code> as a bit-field</h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-03-13<br>
Status: Open</p>
<p>No wording exists currently to say that <code>errno</code> cannot expand to a
bit-field lvalue that has type <code>int</code>:</p>
<blockquote>
<p>The macros are</p>
<p>...</p>
<p><code>errno</code></p>
<p>which expands to a modifiable lvalue that has type <code>int</code> and thread
storage duration,</p>
</blockquote>
<p>(C23 7.5 "Errors <errno.h>" paragraph 2.)</p>
<p>Additionally it does not forbid <code>register</code> from being used, though
that is exclusive with thread storage duration. If it were allowed to
be a bit-field expression or use <code>register</code>, then <code>&errno</code> would be
invalid. The wording for <code>errno</code> also says that the lvalue itself has
thread storage duration, rather than the object which it refers to.
This is inconsistent with the rest of the standard which uses storage
duration as a property of objects, rather than of expressions.</p>
<h3>Suggested correction</h3>
<p>Modify C23 7.5 paragraph 2:</p>
<blockquote>
<p><code>errno</code></p>
<p>which expands to a modifiable lvalue that has type <code>int</code> <del>and
thread storage duration</del><ins>wherein the designated object has
thread storage duration, is not a bit-field, and is not declared
with the <code>register</code> storage-class specifier</ins>,</p>
</blockquote>
<hr>
<p>Comment from Issues list maintainer on 2026-08-21:</p>
<p>This issue was discussed at the August 2026 (Ottawa) meeting of WG14.
There was agreement that the wording about thread storage duration
needed fixing and some disagreement about whether the other parts of
the change are desirable, or whether having type <code>int</code> is inconsistent
with being a bit-field and having thread storage duration is
inconsistent with being declared with <code>register</code> and so no such
changes are needed, or only some of those changes are desirable.
Joseph Myers took an action item to propose revised wording which
would refer to <code>&errno</code> being valid rather than to specific ways in
which it might not be valid.</p>
<hr>
<p>Comment from Issues list maintainer on 2026-08-25:</p>
<p>In <a href="https://www.open-std.org/jtc1/sc22/wg14/37714">reflector message
37714</a>, Joseph Myers
proposed wording for this issue.</p>
<p>Change C23 7.5 (Errors <code><errno.h></code>):</p>
<blockquote>
<p>... which expands to a modifiable lvalue that has type <code>int</code>
<del>and</del> <ins>such that the designated object has</ins> thread
storage duration <ins>and <code>&errno</code> is a valid expression for the
address of that object</ins><del>, the value of which</del><ins>.
The value of <code>errno</code></ins> ...</p>
</blockquote>
</div>
<hr>
<hr>
<div id="issue1033">
<h2>Issue 1033: <code>FILE</code> as a void type</h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-03-17<br>
Status: Review</p>
<p>No wording exists currently to say that <code>FILE</code> cannot be <code>void</code> or
<code>_Atomic void</code>:</p>
<blockquote>
<p>The types declared are</p>
<p>...</p>
<p><code>FILE</code></p>
<p>which is an object type capable of recording all the information
needed to control a stream, including its file position indicator, a
pointer to its associated buffer (if any), an <em>error indicator</em> that
records whether a read/write error has occurred, and an <em>end-of-file
indicator</em> that records whether the end of the file has been
reached;</p>
</blockquote>
<p>(C23 7.23.1 "Introduction" paragraph 3.)</p>
<p>In C11 the definition of object type was modified to include
incomplete types, and this was intentionally extended to <code>FILE</code> so it
can be defined as an incomplete type. For example:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #008000; font-weight: bold">typedef</span><span style="color: #bbbbbb"> </span><span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">_FILE</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">FILE</span>;
</pre></div>
<p>Which will prevent programs from accessing the contents of a <code>FILE</code>
through a <code>FILE*</code>. This change however also included allowing <code>FILE</code>
to be defined as <code>void</code> or <code>_Atomic void</code>, though such definitions
were likely not intended to be valid. A motivating example to forbid
such definitions is so that <code>_Generic</code> can always distinguish between
<code>void*</code> and <code>FILE*</code>. A definition of <code>FILE</code> as <code>void</code> would also
result in lots of undesirable implicit conversions to <code>FILE*</code> being
possible.</p>
<h3>Suggested correction</h3>
<p>Modify C23 7.23.1 paragraph 3:</p>
<blockquote>
<p><code>FILE</code></p>
<p>which is an object type<ins> other than a void type</ins> capable of
recording all the information needed to control a stream, including
its file position indicator, a pointer to its associated buffer (if
any), an <em>error indicator</em> that records whether a read/write error
has occurred, and an <em>end-of-file indicator</em> that records whether
the end of the file has been reached;</p>
</blockquote>
<p>Note: The wording "a void type" is already used to include <code>_Atomic void</code>, though that is never clearly defined.</p>
<hr>
<p>Comment from Issues list maintainer on 2026-08-21:</p>
<p>This issue was discussed at the August 2026 (Ottawa) meeting of WG14.
It was suggested that if such a restriction were added, it should be
to require <code>FILE</code> to be a structure or union type, rather than only
excluding void types; it would also be necessary to investigate the
effect of such a restriction on existing implementations. The
committee agreed that no such restriction on the type of <code>FILE</code> was
needed, subject to review at the next meeting.</p>
<h3>Proposed response</h3>
<p>It is OK for <code>FILE</code> to be a void type.</p>
</div>
<hr>
<hr>
<div id="issue1034">
<h2>Issue 1034: Extra members in <code>div_t</code> types</h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-03-20<br>
Status: Open<br>
Cross-references: <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1058">1058</a></p>
<p>The current definitions of the division types do not clearly state
whether or not they can have members other than <code>quot</code> or <code>rem</code>:</p>
<blockquote>
<p>The <code>div</code>, <code>ldiv</code>, and <code>lldiv</code> functions return a structure of type
<code>div_t</code>, <code>ldiv_t</code>, and <code>lldiv_t</code>, respectively, comprising both the
quotient and the remainder. The structures shall contain (in either
order) the members <code>quot</code> (the quotient) and <code>rem</code> (the remainder),
each of which has the same type as the arguments <code>numer</code> and
<code>denom</code>.</p>
</blockquote>
<p>(C23 7.24.7.2 "The <code>div</code>, <code>ldiv</code>, and <code>lldiv</code> functions" paragraph 3.)</p>
<blockquote>
<p>The <code>imaxdiv</code> function returns a structure of type <code>imaxdiv_t</code>
comprising both the quotient and the remainder. The structure shall
contain (in either order) the members <code>quot</code> (the quotient) and
<code>rem</code> (the remainder), each of which has type <code>intmax_t</code>.</p>
</blockquote>
<p>(C23 7.8.3.2 "The <code>imaxdiv</code> function" paragraph 3.)</p>
<p>The other definitions of structure types use the wording "at least the
following members" which clearly indicates that they can contain
further members. The definitions of the division types do not use
such wording that clearly indicates there can be other members, but
also do not clearly forbid including other members. An example of
where this matters is:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#include</span><span style="color: #3D7B7B; font-style: italic"><stdlib.h></span>
<span style="color: #008000; font-weight: bold">struct</span>{<span style="color: #B00040">div_t</span><span style="color: #bbbbbb"> </span>d;<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>x;}s<span style="color: #666666">=</span>{<span style="color: #666666">1</span>,<span style="color: #666666">2</span>,<span style="color: #666666">3</span>};
</pre></div>
<p>If there can be other members this might be invalid or give the member
<code>x</code> of <code>s</code> a value of zero. Moreover, the <code>quot</code> and <code>rem</code> members of
<code>s.d</code> could either individually be zero or both be zero if the other
members can be added between <code>quot</code> and <code>rem</code> or before both <code>quot</code>
and <code>rem</code>. It seems unintended to allow definitions of the division
types that contain members other than <code>quot</code> and <code>rem</code>.</p>
<h3>Suggested correction</h3>
<p>Modify C23 7.24.7.2 paragraph 3:</p>
<blockquote>
<p>The structures shall contain<ins> exactly</ins> (in either order)
the members <code>quot</code> (the quotient) and <code>rem</code> (the remainder), each of
which has the same type as the arguments <code>numer</code> and <code>denom</code>.</p>
</blockquote>
<p>Modify C23 7.8.3.2 paragraph 3:</p>
<blockquote>
<p>The structure shall contain<ins> exactly</ins> (in either order) the
members <code>quot</code> (the quotient) and <code>rem</code> (the remainder), each of
which has type <code>intmax_t</code>.</p>
</blockquote>
</div>
<hr>
<hr>
<div id="issue1035">
<h2>Issue 1035: <code>wctrans_t</code> and <code>wctype_t</code> as <code>nullptr_t</code></h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-03-24<br>
Status: Open<br>
Cross-references: <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1050">1050</a>, <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1055">1055</a></p>
<p>No wording exists currently to say that <code>wctrans_t</code> and <code>wctype_t</code> cannot
be defined as <code>nullptr_t</code>:</p>
<blockquote>
<p>The types declared are <code>wint_t</code> described in 7.31.1;</p>
<p><code>wctrans_t</code></p>
<p>which is a scalar type that can hold values which represent
locale-specific character mappings; and</p>
<p><code>wctype_t</code></p>
<p>which is a scalar type that can hold values which represent
locale-specific character classifications.</p>
</blockquote>
<p>(C23 7.32.1 "Introduction" paragraph 2.)</p>
<p>Before C23 <code>nullptr_t</code> did not exist as a scalar type so <code>wctrans_t</code>
and <code>wctype_t</code> could not be defined as <code>nullptr_t</code>, but in C23
<code>nullptr_t</code> was added as a scalar type which is what <code>wctrans_t</code> and
<code>wctype_t</code> are defined in terms of. An example of where this matters
is:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#include</span><span style="color: #3D7B7B; font-style: italic"><wctype.h></span>
<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">main</span>(){
<span style="color: #B00040">bool</span><span style="color: #bbbbbb"> </span>b<span style="color: #666666">=</span><span style="color: #008000">true</span>;
<span style="color: #B00040">wctrans_t</span><span style="color: #bbbbbb"> </span>t<span style="color: #666666">=</span>b<span style="color: #666666">?</span>wctrans(<span style="color: #BA2121">"example"</span>)<span style="color: #666666">:0</span>;
}
</pre></div>
<p>If <code>wctrans_t</code> were defined as <code>nullptr_t</code>, then this program would have a
constraint violation:</p>
<blockquote>
<p>One of the following shall hold for the second and third operands:</p>
<ul>
<li>both operands have arithmetic type;</li>
<li>both operands have compatible structure or union type;</li>
<li>both operands have void type;</li>
<li>both operands are pointers to qualified or unqualified versions of
compatible types;</li>
<li>both operands have <code>nullptr_t</code> type;</li>
<li>one operand is a pointer and the other is a null pointer constant or
has type <code>nullptr_t</code>; or</li>
<li>one operand is a pointer to an object type and the other is a
pointer to a qualified or unqualified version of <code>void</code>.</li>
</ul>
</blockquote>
<p>(C23 6.5.16 "Conditional operator" paragraph 3.)</p>
<p>There seems to be no reason to allow for <code>wctrans_t</code> or <code>wctype_t</code> to
be defined as <code>nullptr_t</code>. Such definitions would also not be
sufficient to include all of the standard categories which are
defined. The same is also true for <code>bool</code>, bit-precise integer types
with a small width, and extended integer types with a small width.</p>
<h3>Suggested correction</h3>
<p>Modify C23 7.32.1 paragraph 2:</p>
<blockquote>
<p><code>wctrans_t</code></p>
<p>which is a scalar type that can hold <ins>at least two nonzero
</ins>values which represent locale-specific character mappings; and</p>
<p><code>wctype_t</code></p>
<p>which is a scalar type that can hold <ins>at least twelve nonzero
</ins>values which represent locale-specific character
classifications.</p>
</blockquote>
<p>Note: Zero is already used to mean null for pointer types, though that
is never clearly defined.</p>
</div>
<hr>
<hr>
<div id="issue1036">
<h2>Issue 1036: Initializer syntactic requirements</h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-03-25<br>
Status: Open<br>
Cross-references: <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1072">1072</a></p>
<p>The proposal
<a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3722.pdf">N3722</a>
was framed as a clarification, rather than a new feature. It appears
that this was never voted on, however. Specifically this is the
result of discussion in <a href="https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115566">GCC issue
115566</a>.</p>
<p>Another issue in initialization is that braced initializers used to
initialize objects with scalar type are not specified as allowing
trailing commas (see <a href="https://www.open-std.org/jtc1/sc22/wg14/34083">reflector message
34083</a>, 25 Sep 2025,
and subsequent discussion):</p>
<blockquote>
<p>The initializer for a scalar shall be a single expression, optionally
enclosed in braces, or it shall be an empty initializer.</p>
</blockquote>
<p>(C23 6.7.11 "Initialization" paragraph 12.)</p>
<p>Existing implementations do not reject using trailing commas for this
purpose, and there seems to be no reason to reject trailing commas
here.</p>
<h3>Question 1</h3>
<p>Is the following declaration meant to be valid in C23?</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #B00040">char</span><span style="color: #bbbbbb"> </span>x[]<span style="color: #666666">=</span>(<span style="color: #BA2121">"abc"</span>);
</pre></div>
<h3>Question 2</h3>
<p>Is the following declaration meant to be valid?</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>y<span style="color: #666666">=</span>{<span style="color: #666666">0</span>,};
</pre></div>
</div>
<hr>
<hr>
<div id="issue1037">
<h2>Issue 1037: Scopes and <code>noreturn</code> declarations</h2>
<p>Authors: Joseph Myers<br>
Date: 2026-03-25<br>
Status: Open<br>
Cross-references: <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1065">1065</a></p>
<p>The specification for the <code>[[noreturn]]</code> attribute (C23 6.7.13.7)
says:</p>
<blockquote>
<p>The first declaration of a function shall specify the <code>noreturn</code>
attribute if any declaration of that function specifies the
<code>noreturn</code> attribute. If a function is declared with the <code>noreturn</code>
attribute in one translation unit and the same function is declared
without the <code>noreturn</code> attribute in another translation unit, the
behavior is undefined.</p>
</blockquote>
<p>As noted in <a href="https://www.open-std.org/jtc1/sc22/wg14/35399">reflector message
35399</a> (16 Feb 2026),
this is unclear about the meaning of the "first" declaration if there
is a prior declaration that is not in scope:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #B00040">void</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">t</span>()
{
<span style="color: #bbbbbb"> </span>[[<span style="color: #008000; font-weight: bold">noreturn</span>]]<span style="color: #bbbbbb"> </span><span style="color: #B00040">void</span><span style="color: #bbbbbb"> </span>f();
}
<span style="color: #B00040">void</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">f</span>();
[[<span style="color: #008000; font-weight: bold">noreturn</span>]]<span style="color: #bbbbbb"> </span><span style="color: #B00040">void</span><span style="color: #bbbbbb"> </span>g();
<span style="color: #B00040">void</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">u</span>()
{
<span style="color: #bbbbbb"> </span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>g;
<span style="color: #bbbbbb"> </span>{
<span style="color: #bbbbbb"> </span><span style="color: #B00040">void</span><span style="color: #bbbbbb"> </span>g();
<span style="color: #bbbbbb"> </span>}
}
</pre></div>
<h3>Question 1</h3>
<p>Is the second declaration of <code>f</code> above valid, or invalid because the
<code>noreturn</code> declaration is not visible (being in a scope that has
ended) at the point of the second declaration?</p>
<h3>Question 2</h3>
<p>Is the second declaration of <code>g</code> as a function above valid, or invalid
because <code>g</code> is shadowed in an inner scope by the block-scope
declaration of <code>g</code> as an object?</p>
</div>
<hr>
<hr>
<div id="issue1038">
<h2>Issue 1038: Issues with <code>float_t</code> and related types</h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-03-31<br>
Status: Open</p>
<h3>Question 1</h3>
<p>What does it mean when <code>float_t</code> or <code>double_t</code> are complex types?
Specifically:</p>
<blockquote>
<p>The types</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span>float_t
double_t
</pre></div>
<p>are floating types ... If they are not real floating types, the
behavior is implementation-defined.</p>
</blockquote>
<p>(C23 7.12.1 "Mathematics" paragraph 3.)</p>
<p>The behavior of what is implementation-defined? Any program that uses
the types <code>float_t</code> or <code>double_t</code>? Any program that performs
floating-point arithmetic? Any program at all, simply because the
types are defined this way?</p>
<h3>Question 2</h3>
<p>Can <code>float_t</code> and <code>double_t</code> be defined as decimal floating types?
They are real floating types, but such definitions would prevent
adding <code>float</code> and <code>float_t</code> or <code>double</code> and <code>double_t</code>. To satisfy
the requirements on the ranges of values, at least one of the decimal
floating types would need to represent a set of values which are a
superset of the values representable by <code>float</code> for such definitions
to be possible.</p>
<h3>Question 3</h3>
<p>Can <code>long_double_t</code> and <code>_FloatN_t</code> be defined as complex types?</p>
</div>
<hr>
<hr>
<div id="issue1039">
<h2>Issue 1039: Function type attributes on abstract declarators</h2>
<p>Authors: Thiago Adams, Jens Gustedt<br>
Date: 2026-04-01<br>
Status: Open</p>
<p>Currently we have in C23 6.7.13.8.1 "General" of 6.7.13.8 of "Standard
attributes for function types"</p>
<blockquote>
<p>An attribute for a function type shall be applied to a function
declarator<sup>175)</sup> or to a type specifier that has a function
type.</p>
</blockquote>
<p>This description misses one case that we think should be valid, namely
if the attribute is applied to a "function abstract declarator" such
as in</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span>typeof(<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>(<span style="color: #B00040">void</span>)[[unsequenced]])<span style="color: #666666">*</span><span style="color: #bbbbbb"> </span>func;
</pre></div>
<p>Scanning the rest of the standard shows that the same problem may also
be present at other places, such as</p>
<ul>
<li>translation limits (5.3.5.2)</li>
<li>function prototype scope (6.2.1)</li>
<li>6.5.3.3 Function calls</li>
</ul>
<h3>Suggested correction</h3>
<p>Changes similar to the following:</p>
<p>Modify 6.2.1 "Scopes of identifiers, type names, and compound
literals":</p>
<blockquote>
<p>If the declarator or type specifier that declares the identifier
appears within the list of parameter declarations in a function
prototype (not part of a function definition), the identifier has
<em>function prototype scope</em>, which terminates at the end of the
function declarator <ins>or function abstract declarator</ins>.</p>
</blockquote>
<p>Modify 6.7.13.8.1 "General" of 6.7.13.8 of "Standard attributes for
function types" as follows:</p>
<blockquote>
<p>An attribute for a function type shall be applied to a function
declarator<ins>, function abstract declarator,</ins><sup>175)</sup>
or to a type specifier that has a function type.</p>
</blockquote>
</div>
<hr>
<hr>
<div id="issue1040">
<h2>Issue 1040: Freestanding library issues</h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-04-01<br>
Status: Open</p>
<p>The wording with freestanding in C23 does not seem to be as intended:</p>
<blockquote>
<p>A <em>conforming freestanding implementation</em> shall accept any strictly
conforming program in which the use of the features specified in the
library clause (Clause 7) is confined to the contents of the
standard headers <code><float.h></code>, <code><iso646.h></code>, <code><limits.h></code>,
<code><stdalign.h></code>, <code><stdarg.h></code>, <code><stdbit.h></code>, <code><stdbool.h></code>,
<code><stddef.h></code>, <code><stdint.h></code>, and <code><stdnoreturn.h></code>. Additionally, a
conforming freestanding implementation shall accept any strictly
conforming program where:</p>
<ul>
<li>the features specified in the header <code><string.h></code> are used, except
the following functions: <code>strcoll</code>, <code>strdup</code>, <code>strerror</code>, <code>strndup</code>,
<code>strtok</code>, <code>strxfrm</code>; and/or,</li>
<li>the selected function <code>memalignment</code> from <code><stdlib.h></code> is used.</li>
</ul>
</blockquote>
<p>(Clause 4 "Conformance" paragraph 7.)</p>
<p>The first sentence omits the header <code><stdckdint.h></code> from the list of
allowed standard headers, which seems unintended. The second sentence
seems to be intended to extend what is allowed in the first sentence,
but the way it is worded does not actually do that:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#include</span><span style="color: #3D7B7B; font-style: italic"><stdlib.h></span>
<span style="color: #B00040">void</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">foo</span>(){
memalignment(<span style="color: #666666">0</span>);
}
<span style="color: #9C6500">#include</span><span style="color: #3D7B7B; font-style: italic"><stdio.h></span>
<span style="color: #B00040">void</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">bar</span>(){
puts(<span style="color: #BA2121">"ok?"</span>);
}
</pre></div>
<p>The <code>memalignment</code> function is used, so the second sentence requires a
conforming freestanding implementation to accept this code.</p>
<p>A possible correction could involve deleting this text and marking
each header or function as being allowed in freestanding. It may also
be useful to allow including headers such as <code><stdio.h></code> if none of
the features in it are used, to make writing code that works with both
freestanding implementations and hosted implementations easier.
Though this would impose requirements on what freestanding
implementations can include in such headers.</p>
</div>
<hr>
<hr>
<div id="issue1041">
<h2>Issue 1041: Alignment of structure and union members</h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-04-02<br>
Status: Open<br>
Cross-references: <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1044">1044</a></p>
<p>The definition of common initial sequences fails to mention alignment:</p>
<blockquote>
<p>One special guarantee is made to simplify the use of unions: if a
union contains several structures that share a common initial
sequence (see following sentence), and if the union object currently
contains one of these structures, it is permitted to inspect the
common initial part of any of them anywhere that a declaration of
the completed type of the union is visible. Two structures share a
<em>common initial sequence</em> if corresponding members have compatible
types (and, for bit-fields, the same widths) for a sequence of one
or more initial members.</p>
</blockquote>
<p>(C23 6.5.3.4 "Structure and union members" paragraph 6.)</p>
<p>Meaning that currently, the following two structures have all of their
members in the common initial sequence:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">A</span>{
<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>x;
<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>y;
};
<span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">B</span>{
<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>x;
<span style="color: #008000; font-weight: bold">alignas</span>(<span style="color: #008000; font-weight: bold">alignof</span>(<span style="color: #B00040">int</span>)<span style="color: #666666">*2</span>)<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>y;
};
</pre></div>
<p>That is, <code>alignas</code> cannot change how padding is inserted within a
structure. No compilers actually follow this, however. The
definition of type compatibility requires alignments to be the same:</p>
<blockquote>
<p>Moreover, two complete structure, union, or enumerated types declared
with the same tag are compatible if members satisfy the following
requirements:</p>
<p>...</p>
<ul>
<li>if one member of the pair is declared with an alignment specifier,
the other is declared with an equivalent alignment specifier;</li>
</ul>
</blockquote>
<p>(C23 6.2.7 "Compatible type and composite type" paragraph 1.)</p>
<p>It is not clear what "equivalent alignment specifier" means. Consider
the following four translation units:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">S</span>{<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>x;};<span style="color: #3D7B7B; font-style: italic">/* TU 1 */</span>
<span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">S</span>{<span style="color: #008000; font-weight: bold">alignas</span>(<span style="color: #666666">0</span>)<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>x;};<span style="color: #3D7B7B; font-style: italic">/* TU 2 */</span>
<span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">S</span>{<span style="color: #008000; font-weight: bold">alignas</span>(<span style="color: #B00040">int</span>)<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>x;};<span style="color: #3D7B7B; font-style: italic">/* TU 3 */</span>
<span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">S</span>{<span style="color: #008000; font-weight: bold">alignas</span>(<span style="color: #008000; font-weight: bold">alignof</span>(<span style="color: #B00040">int</span>))<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>x;};<span style="color: #3D7B7B; font-style: italic">/* TU 4 */</span>
</pre></div>
<p>GCC considers all four structure types to be compatible, even though
it seems clear that the first structure type should not be compatible
with the third structure type or fourth structure type. The first two
structure types being compatible is less clear, the second has an
alignment specifier and the first does not but <code>alignas(0)</code> is
described as having no effect.</p>
<h3>Question 1</h3>
<p>Is it intended for common initial sequences to consider alignment
requirements specified by <code>alignas</code>?</p>
<h3>Question 2</h3>
<p>What does "equivalent alignment specifier" mean? What if there are
multiple alignment specifiers? Should an alignment specifier that has
no effect or does not alter the alignment requirements change type
compatibility? See also
<a href="https://github.com/cplusplus/CWG/issues/867">https://github.com/cplusplus/CWG/issues/867</a>.</p>
</div>
<hr>
<hr>
<div id="issue1042">
<h2>Issue 1042: Attributes on compound literals</h2>
<p>Authors: Thiago Adams, Jens Gustedt<br>
Date: 2026-04-02<br>
Status: Open</p>
<p>The current text has the following syntax for compound literals</p>
<blockquote>
<p><em>compound-literal</em>:</p>
</blockquote>
<blockquote>
<blockquote>
<p><code>(</code> <em>storage-class-specifiers</em><sub>opt</sub> <em>type-name</em> <code>)</code> <em>braced-initializer</em></p>
</blockquote>
</blockquote>
<p>It seems that the term <em>type-name</em> has no possibility to have leading
attributes, so the current syntax does not allow to specify attributes
that would directly be applicable to the object that is created by a
compound literal. Currently the only useful one from the standard
attributes seem to be <code>[[maybe_unused]]</code>, but still that seems an
unnecessary restriction.</p>
<h3>Suggested correction</h3>
<p>Add the following line to the <em>storage-class-specifiers</em> production</p>
<blockquote>
<p><em>storage-class-specifiers</em>:</p>
</blockquote>
<blockquote>
<blockquote>
<p><ins><em>attribute-specifier-sequence</em></ins></p>
</blockquote>
</blockquote>
<blockquote>
<blockquote>
<p><em>storage-class-specifier</em></p>
</blockquote>
</blockquote>
<blockquote>
<blockquote>
<p><em>storage-class-specifiers</em> <em>storage-class-specifier</em></p>
</blockquote>
</blockquote>
<p>This would just introduce the possibility to prefix the current
construct with attributes. (<em>storage-class-specifiers</em> is only used
by <em>compound-literal</em>.)</p>
</div>
<hr>
<hr>
<div id="issue1043">
<h2>Issue 1043: Issues with library integer types</h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-04-08<br>
Status: Open<br>
Cross-references: <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1021">1021</a>, <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1051">1051</a>, <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1055">1055</a></p>
<p>Some standard library types do not properly constrain what integer
types are allowed. For example:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#include</span><span style="color: #3D7B7B; font-style: italic"><stddef.h></span>
<span style="color: #008000; font-weight: bold">enum</span><span style="color: #bbbbbb"> </span>E<span style="color: #666666">:</span><span style="color: #B00040">size_t</span>{e};
</pre></div>
<p>In C23, if <code>size_t</code> were a bit-precise unsigned integer type then this
program would have a constraint violation. In C2Y now that
<a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3705.htm">N3705</a> is
accepted, this program would be fine regardless. The functions in
<code><stdbit.h></code> only work with some bit-precise unsigned integer types,
and the functions in <code><stdckdint.h></code> never with any bit-precise
integer types. Therefore if <code>size_t</code> were a bit-precise unsigned
integer type it might not be possible to use <code><stdbit.h></code> with
<code>size_t</code> and it would never be possible to use <code><stdckdint.h></code> with
<code>size_t</code>. Bit-precise integer types also have different rules in
promotions, so code that relied on integer promotions happening before
C23 would be broken.</p>
<p>The same issues also exist for many other types. <code>sig_atomic_t</code> can
be <code>char</code>, a bit-precise integer type, an enumerated type, or a
<code>volatile</code> qualified version of any of those types. <code>ptrdiff_t</code> can
be a bit-precise signed integer type. <code>wchar_t</code> can be <code>char</code>, a
bit-precise integer type, or an enumerated type. <code>wint_t</code> can be a
bit-precise integer type, or an enumerated type if <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1021">issue
1021</a> is resolved as enumerated types possibly being the
results of integer promotions. <code>uint_least1_t</code> and <code>uint_fast1_t</code> can
both be defined as <code>bool</code>, though this is forbidden in C2Y now that
<a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3747.pdf">N3747</a> is
accepted.</p>
<p>The types <code>time_t</code>, <code>clock_t</code>, <code>wctrans_t</code>, and <code>wctype_t</code> can be any
integer type but they can also be types other than integer types so it
does not seem important to restrict which integer types they can be.
<code>memory_order</code> is defined to be an enumerated type with no
restrictions on its underlying type, though that does not seem
important to restrict. Code using <code>time_t</code> or <code>clock_t</code> could also
assume that integer promotions would apply if they were not floating
types and had widths less than the width of <code>int</code>, but that does not
seem important.</p>
<h3>Suggested correction</h3>
<p>Modify C23 7.21.1 paragraph 3:</p>
<blockquote>
<p><code>ptrdiff_t</code></p>
<p>which is the signed integer type<ins> other than a bit-precise
signed integer type</ins> of the result of subtracting two pointers;</p>
<p><code>size_t</code></p>
<p>which is the unsigned integer type<ins> other than a bit-precise
unsigned integer type</ins> of the result of the <code>sizeof</code> operator;</p>
<p>...</p>
<p><code>wchar_t</code></p>
<p>which is a<del>n</del> <ins>signed or unsigned </ins>integer
type<ins> other than a bit-precise integer type</ins> whose range of
values can represent distinct codes for all members of the largest
extended character set specified among the supported locales; the
null character shall have the code value zero.</p>
</blockquote>
<p>Note: C23 6.4.5.5 paragraph 9 already contains the wording "the
unsigned type corresponding to <code>wchar_t</code>" which would not make sense
if <code>wchar_t</code> were defined as <code>char</code> or an enumerated type.</p>
<p>Modify C23 7.14.1 paragraph 2:</p>
<blockquote>
<p><code>sig_atomic_t</code></p>
<p>which is the (possibly volatile-qualified) <ins>signed or unsigned
</ins>integer type<ins> other than a bit-precise integer type</ins>
of an object that can be accessed as an atomic entity, even in the
presence of asynchronous interrupts.</p>
</blockquote>
<p>Modify C23 7.31.1 paragraph 3:</p>
<blockquote>
<p><code>wint_t</code></p>
<p>which is a<del>n</del> <ins>signed or unsigned </ins>integer
type<ins> other than a bit-precise integer type</ins> unchanged by
default argument promotions that can hold any value corresponding to
members of the extended character set, as well as at least one value
that does not correspond to any member of the extended character set
(see subsequent <code>WEOF</code> description);</p>
</blockquote>
<p>Modify C23 7.22.1 paragraph 4:</p>
<blockquote>
<p>None of the types shall be defined as a synonym for a bit-precise
integer type<ins> or <code>bool</code></ins>.</p>
</blockquote>
<p>Note: This last change does not need to be applied in C2Y.</p>
</div>
<hr>
<hr>
<div id="issue1044">
<h2>Issue 1044: Alignment specifier consistency rules</h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-04-08<br>
Status: Open<br>
Cross-references: <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1041">1041</a></p>
<p>This is related to <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1041">Issue 1041</a>. The following text has
some ambiguity and does not seem as intended:</p>
<blockquote>
<p>If the definition of an object has an alignment specifier, any other
declaration of that object shall either specify equivalent alignment
or have no alignment specifier. If the definition of an object does
not have an alignment specifier, any other declaration of that
object shall also have no alignment specifier. If declarations of
an object in different translation units have different alignment
specifiers, the behavior is undefined.</p>
</blockquote>
<p>(C23 6.7.6 "Alignment specifier" paragraph 8.)</p>
<p>In all subsequent examples, assume that any alignment used is
supported by the implementation.</p>
<h3>Question 1</h3>
<p>Since the last sentence in the quoted text only mentions different
translation units, is the following translation unit valid?</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #008000; font-weight: bold">extern</span><span style="color: #bbbbbb"> </span><span style="color: #008000; font-weight: bold">alignas</span>(<span style="color: #008000; font-weight: bold">alignof</span>(<span style="color: #B00040">int</span>)<span style="color: #666666">*2</span>)<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>x;
<span style="color: #008000; font-weight: bold">extern</span><span style="color: #bbbbbb"> </span><span style="color: #008000; font-weight: bold">alignas</span>(<span style="color: #008000; font-weight: bold">alignof</span>(<span style="color: #B00040">int</span>)<span style="color: #666666">*4</span>)<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>x;
</pre></div>
<p>Assuming that <code>x</code> is neither declared nor defined in any other
translation unit, there does not appear to be anything saying that
these alignment specifiers being different is incorrect.</p>
<h3>Question 2</h3>
<p>What does "equivalent alignment" mean with multiple alignment
specifiers? Is it per alignment specifier or using the maximum
specified alignment?</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #008000; font-weight: bold">alignas</span>(<span style="color: #008000; font-weight: bold">alignof</span>(<span style="color: #B00040">int</span>)<span style="color: #666666">*2</span>)<span style="color: #008000; font-weight: bold">alignas</span>(<span style="color: #008000; font-weight: bold">alignof</span>(<span style="color: #B00040">int</span>)<span style="color: #666666">*4</span>)<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>y<span style="color: #666666">=0</span>;
<span style="color: #008000; font-weight: bold">extern</span><span style="color: #bbbbbb"> </span><span style="color: #008000; font-weight: bold">alignas</span>(<span style="color: #008000; font-weight: bold">alignof</span>(<span style="color: #B00040">int</span>)<span style="color: #666666">*4</span>)<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>y;
</pre></div>
<p>This is only valid if it is considering the maximum specified alignment.</p>
<h3>Question 3</h3>
<p>Should an alignment specifier that has no effect or does not alter the
alignment requirements be ignored for the purposes of this text?</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>z<span style="color: #666666">=0</span>;
<span style="color: #008000; font-weight: bold">extern</span><span style="color: #bbbbbb"> </span><span style="color: #008000; font-weight: bold">alignas</span>(<span style="color: #666666">0</span>)<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>z;
<span style="color: #008000; font-weight: bold">extern</span><span style="color: #bbbbbb"> </span><span style="color: #008000; font-weight: bold">alignas</span>(<span style="color: #B00040">int</span>)<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>z;
<span style="color: #008000; font-weight: bold">alignas</span>(<span style="color: #008000; font-weight: bold">alignof</span>(<span style="color: #B00040">int</span>)<span style="color: #666666">*2</span>)<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>w<span style="color: #666666">=0</span>;
<span style="color: #008000; font-weight: bold">extern</span><span style="color: #bbbbbb"> </span><span style="color: #008000; font-weight: bold">alignas</span>(<span style="color: #666666">0</span>)<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>w;
<span style="color: #008000; font-weight: bold">extern</span><span style="color: #bbbbbb"> </span><span style="color: #008000; font-weight: bold">alignas</span>(<span style="color: #B00040">int</span>)<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>w;
<span style="color: #008000; font-weight: bold">alignas</span>(<span style="color: #666666">0</span>)<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>v<span style="color: #666666">=0</span>;
<span style="color: #008000; font-weight: bold">extern</span><span style="color: #bbbbbb"> </span><span style="color: #008000; font-weight: bold">alignas</span>(<span style="color: #B00040">int</span>)<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>v;
<span style="color: #008000; font-weight: bold">alignas</span>(<span style="color: #B00040">int</span>)<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>u<span style="color: #666666">=0</span>;
<span style="color: #008000; font-weight: bold">extern</span><span style="color: #bbbbbb"> </span><span style="color: #008000; font-weight: bold">alignas</span>(<span style="color: #666666">0</span>)<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>u;
</pre></div>
<p>This is only valid if such alignment specifiers are ignored.</p>
<h3>Question 4</h3>
<p>What does "different alignment specifiers" mean? The questions about
multiple alignment specifiers and alignments specifiers that have no
effect or do not alter the alignment requirements also apply here.</p>
<h3>Question 5</h3>
<p>Can tentative definitions use alignment specifiers?</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #008000; font-weight: bold">alignas</span>(<span style="color: #008000; font-weight: bold">alignof</span>(<span style="color: #B00040">int</span>)<span style="color: #666666">*2</span>)<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>t;
</pre></div>
<p>That is, does the extra definition for the tentative definition
violate the quoted text?</p>
<hr>
<p>Comment from Issues list maintainer on 2026-04-08:</p>
<p>See also <a href="https://www.open-std.org/jtc1/sc22/wg14/34105">reflector message
34105</a> (30 Sep 2025)
for discussion of similar issues in the context of C2Y after changes
to reduce undefined behavior were integrated.</p>
</div>
<hr>
<hr>
<div id="issue1045">
<h2>Issue 1045: Are VLAs adjusted to pointers variably modified?</h2>
<p>Authors: Michael Forney<br>
Date: 2026-04-22<br>
Status: Open<br>
Cross-references: <a href="https://www.open-std.org/jtc1/sc22/wg14/issues/c99/issue0311.html">0311</a></p>
<p>Example 1 in C23 6.5.3.6 uses a function definition with a VLA
parameter that gets adjusted to a pointer, and it claimed that the
length expression should be evaluated on function entry.</p>
<p>This isn't clear to me from the standard text, and it seems different
implementations seem to interpret it in different ways.</p>
<p>Consider a <a href="https://godbolt.org/z/coKx74aMT">similar example here</a>:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#include</span><span style="color: #bbbbbb"> </span><span style="color: #3D7B7B; font-style: italic"><stdio.h></span>
<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>x;
<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">f</span>(<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>a[x<span style="color: #bbbbbb"> </span><span style="color: #666666">+=</span><span style="color: #bbbbbb"> </span><span style="color: #666666">1</span>])<span style="color: #bbbbbb"> </span>{
<span style="color: #bbbbbb"> </span>typeof(x<span style="color: #bbbbbb"> </span><span style="color: #666666">+=</span><span style="color: #bbbbbb"> </span><span style="color: #666666">2</span>,<span style="color: #bbbbbb"> </span>a)<span style="color: #bbbbbb"> </span>b;
<span style="color: #bbbbbb"> </span>printf(<span style="color: #BA2121">"x=%d</span><span style="color: #AA5D1F; font-weight: bold">\n</span><span style="color: #BA2121">"</span>,<span style="color: #bbbbbb"> </span>x);
<span style="color: #bbbbbb"> </span><span style="color: #008000; font-weight: bold">return</span><span style="color: #bbbbbb"> </span>x;
}
<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">main</span>(<span style="color: #B00040">void</span>)<span style="color: #bbbbbb"> </span>{
<span style="color: #bbbbbb"> </span>f(<span style="color: #666666">0</span>);
}
</pre></div>
<p>C23 6.7.7.4p6 says</p>
<blockquote>
<p>A declaration of a parameter as "array of <em>type</em>" shall be adjusted
to "qualified pointer to <em>type</em>", where the type qualifiers (if any)
are those specified within the <code>[</code> and <code>]</code> of the array type
derivation.</p>
</blockquote>
<p>From this, it's clear that <code>a</code>'s type is adjusted to <code>int *</code>.</p>
<p>C23 defines a variably modified type in 6.7.7.1p3:</p>
<blockquote>
<p>If, in the nested sequence of declarators in a full declarator,
there is a declarator specifying a variable length array type, the
type specified by the full declarator is said to be <em>variably
modified</em>. Furthermore, any type derived by declarator type
derivation from a variably modified type is itself variably
modified.</p>
</blockquote>
<p>This establishes the term "variably modified" as a property of the
type.</p>
<p>C23 6.9.2p11 describes when variably modified types used in the
prototype are evaluated:</p>
<blockquote>
<p>On entry to the function, the size expressions of each variably
modified parameter and typeof operators used in declarations of
parameters are evaluated and the value of each argument expression
is converted to the type of the corresponding parameter as if by
assignment.</p>
</blockquote>
<p>Here, it refers to a "variably modified parameter". Since this is a
property of a type, I assume this means a parameter with a variably
modified type. The expression <code>x += 1</code> should be evaluated iff <code>a</code> is
a "variably modified parameter".</p>
<p>In the function body, there is a <code>typeof</code> specifier containing a
comma expression which has the same type as <code>a</code>. According to C23
6.7.3.6:</p>
<blockquote>
<p>If the type of the operand is a variably modified type, the operand
is evaluated; otherwise, the operand is not evaluated.</p>
</blockquote>
<p>So the expression <code>x += 2</code> should be evaluated iff <code>a</code> has a variably
modified type.</p>
<p>It seems to me that either both of these expressions should be
evaluated, or neither should be evaluated. Existing implementations
seem to disagree. gcc prints 1, clang prints 3, icc prints 1, tcc
prints 0, and cproc (my compiler) prints 0.</p>
<p>I think the standard should clarify whether parameter types that get
adjusted from VLAs to pointers retain their "variably modified"-ness
even if there is no VLA in the resulting derivation.</p>
</div>
<hr>
<hr>
<div id="issue1046">
<h2>Issue 1046: Order of arguments to <code>powr</code></h2>
<p>Authors: Stephen Heumann<br>
Date: 2026-04-22<br>
Status: Open</p>
<p>In C23 7.12.8.7, the synopsis for the <code>powr</code> functions shows that the
first parameter is named <code>y</code> and the second is named <code>x</code>:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #B00040">double</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">powr</span>(<span style="color: #B00040">double</span><span style="color: #bbbbbb"> </span>y,<span style="color: #bbbbbb"> </span><span style="color: #B00040">double</span><span style="color: #bbbbbb"> </span>x);
</pre></div>
<p>(and similarly for <code>powrf</code>, <code>powrl</code>, <code>powrd32</code>, <code>powrd64</code>, and
<code>powrd128</code>).</p>
<p>The description then says that</p>
<blockquote>
<p>The <code>powr</code> functions compute <code>x</code> raised to the power <code>y</code> as
<em>e</em><sup><code>y</code> log<sub><em>e</em></sub> <code>x</code></sup>.</p>
</blockquote>
<p>So the <code>powr</code> functions are specified as computing their second
argument raised to the power of their first argument. This is the
opposite order of arguments from the original specification of <code>powr</code>
in TS 18661-4:2015. It is also the opposite order of arguments from
<code>pow</code>.</p>
<p>This change to the order of arguments is likely to cause confusion,
and I can find no record that the committee did it intentionally, so
it may be an editorial error. Moreover, most of the special cases for
<code>powr</code> specified in F.10.5.7 do not make sense mathematically if
<code>powr</code> actually computes its second argument raised to the power of
its first argument.</p>
<p>The standard should be clarified to indicate the actually intended
order of arguments for the <code>powr</code> functions. I suggest changing it
back to match TS 18661-4:2015.</p>
<h3>Suggested correction</h3>
<p>In C23 7.12.8.7 paragraph 1 (Synopsis) and B.11, change all the <code>powr</code>
functions to have <code>x</code> as the first parameter and <code>y</code> as the second.</p>
</div>
<hr>
<hr>
<div id="issue1047">
<h2>Issue 1047: Function call returning <code>void</code></h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-04-22<br>
Status: Open</p>
<p>The following text has not been properly updated to consider that <code>void</code>
is an object type:</p>
<blockquote>
<p>If the expression that denotes the called function has type pointer
to function returning an object type, the function call expression
has the same type as that object type, and has the value determined
as specified in 6.8.7.5. Otherwise, the function call has type
<code>void</code>.</p>
</blockquote>
<p>(C23 6.5.3.3 "Function calls" paragraph 5.)</p>
<h3>Suggested correction</h3>
<p>Modify 6.5.3.3 paragraph 5:</p>
<blockquote>
<p>If the expression that denotes the called function has type pointer to
function returning a<del>n</del> <ins>complete </ins>object type, the
function call expression has the same type as that object type, and
has the value determined as specified in 6.8.7.5.</p>
</blockquote>
</div>
<hr>
<hr>
<div id="issue1048">
<h2>Issue 1048: Mixed [non-]designated initializer behavior</h2>
<p>Authors: Aaron Ballman<br>
Date: 2026-04-22<br>
Status: Open</p>
<p>Consider the following code:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#include</span><span style="color: #bbbbbb"> </span><span style="color: #3D7B7B; font-style: italic"><stdio.h></span>
<span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span>{
<span style="color: #bbbbbb"> </span><span style="color: #B00040">char</span><span style="color: #bbbbbb"> </span>str[<span style="color: #666666">16</span>];
}<span style="color: #bbbbbb"> </span>hello<span style="color: #bbbbbb"> </span><span style="color: #666666">=</span><span style="color: #bbbbbb"> </span>{
<span style="color: #bbbbbb"> </span><span style="color: #BA2121">"hello world"</span>,
<span style="color: #bbbbbb"> </span>.str[<span style="color: #666666">6</span>]<span style="color: #bbbbbb"> </span><span style="color: #666666">=</span><span style="color: #bbbbbb"> </span><span style="color: #BA2121">'W'</span>,
<span style="color: #bbbbbb"> </span><span style="color: #BA2121">"ORLD"</span>
};
<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">main</span>(<span style="color: #B00040">void</span>)<span style="color: #bbbbbb"> </span>{
<span style="color: #bbbbbb"> </span>printf(<span style="color: #BA2121">"hello.str = </span><span style="color: #AA5D1F; font-weight: bold">\"</span><span style="color: #BA2121">%s</span><span style="color: #AA5D1F; font-weight: bold">\"\n</span><span style="color: #BA2121">"</span>,<span style="color: #bbbbbb"> </span>hello.str);
<span style="color: #bbbbbb"> </span>printf(<span style="color: #BA2121">"raw bytes: "</span>);
<span style="color: #bbbbbb"> </span><span style="color: #008000; font-weight: bold">for</span><span style="color: #bbbbbb"> </span>(<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>i<span style="color: #bbbbbb"> </span><span style="color: #666666">=</span><span style="color: #bbbbbb"> </span><span style="color: #666666">0</span>;<span style="color: #bbbbbb"> </span>i<span style="color: #bbbbbb"> </span><span style="color: #666666"><</span><span style="color: #bbbbbb"> </span><span style="color: #666666">16</span>;<span style="color: #bbbbbb"> </span>i<span style="color: #666666">++</span>)<span style="color: #bbbbbb"> </span>{
<span style="color: #bbbbbb"> </span>printf(<span style="color: #BA2121">"%d "</span>,<span style="color: #bbbbbb"> </span>(<span style="color: #B00040">unsigned</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">char</span>)hello.str[i]);
<span style="color: #bbbbbb"> </span>}
<span style="color: #bbbbbb"> </span>printf(<span style="color: #BA2121">"</span><span style="color: #AA5D1F; font-weight: bold">\n</span><span style="color: #BA2121">"</span>);
<span style="color: #bbbbbb"> </span><span style="color: #008000; font-weight: bold">return</span><span style="color: #bbbbbb"> </span><span style="color: #666666">0</span>;
}
</pre></div>
<p>What should this program output?</p>
<ul>
<li>SDCC, TCC, cc65 diagnose as too many initializers</li>
<li>EDG, Compcert reject due to conversion from <code>char *</code> to <code>char</code> which
results in truncation (with assigning <code>"ORLD"</code> to <code>str[7]</code> presumably)</li>
<li>Clang, MSVC accept and produce <code>"hello WORLD"</code></li>
<li>GCC accepts and produces <code>"ORLD"</code></li>
<li>Chibicc accepts and produces <code>"hello Wl@@"</code></li>
</ul>
<p>Which, if any, of these behaviors is the expected one? I can see a
reading of the standard that allows for any of the first three
behaviors depending on how you interpret C23 6.7.11p18-19.</p>
</div>
<hr>
<hr>
<div id="issue1049">
<h2>Issue 1049: Future language direction of storage-class specifiers</h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-04-23<br>
Status: Open</p>
<p>The following text has not been changed since initial standardization:</p>
<blockquote>
<p>The placement of a storage-class specifier other than at the
beginning of the declaration specifiers in a declaration is an
obsolescent feature.</p>
</blockquote>
<p>(C23 6.11.5 "Storage-class specifiers" paragraph 1.)</p>
<p>Originally it was not valid to use two or more storage-class
specifiers in a declaration. Now it is possible to use even three
storage-class specifiers:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span>constexpr<span style="color: #bbbbbb"> </span><span style="color: #008000; font-weight: bold">static</span><span style="color: #bbbbbb"> </span><span style="color: #008000; font-weight: bold">auto</span><span style="color: #bbbbbb"> </span>x<span style="color: #666666">=0</span>;
<span style="color: #008000; font-weight: bold">static</span><span style="color: #bbbbbb"> </span><span style="color: #008000; font-weight: bold">thread_local</span><span style="color: #bbbbbb"> </span><span style="color: #008000; font-weight: bold">auto</span><span style="color: #bbbbbb"> </span>y<span style="color: #666666">=0</span>;
</pre></div>
<p>There is no order here that is not considered obsolescent.
Additionally, using alignment specifiers before storage-class
specifiers is useful in the context of headers compatible with C and
C++:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #008000; font-weight: bold">alignas</span>(<span style="color: #008000; font-weight: bold">alignof</span>(<span style="color: #B00040">int</span>)<span style="color: #666666">*2</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>z;
</pre></div>
<p>The non-obsolescent ways to write this declaration are:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #008000; font-weight: bold">extern</span><span style="color: #bbbbbb"> </span><span style="color: #008000; font-weight: bold">alignas</span>(<span style="color: #008000; font-weight: bold">alignof</span>(<span style="color: #B00040">int</span>)<span style="color: #666666">*2</span>)<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>z;
</pre></div>
<p>Or, alternatively:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></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><span style="color: #0000FF">alignas</span>(<span style="color: #008000; font-weight: bold">alignof</span>(<span style="color: #B00040">int</span>)<span style="color: #666666">*2</span>)z;
</pre></div>
<p>But only the obsolescent declaration is also valid in C++, which has
<code>alignas</code> grammatically as an attribute rather than a declaration
specifier. This means that it is even valid to put <code>alignas</code> after
the identifier:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></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>z<span style="color: #bbbbbb"> </span><span style="color: #0000FF">alignas</span>(<span style="color: #008000; font-weight: bold">alignof</span>(<span style="color: #B00040">int</span>)<span style="color: #666666">*2</span>);
</pre></div>
<p>With the style of "east <code>const</code>" being common the following is also
not so unreasonable:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>constexpr<span style="color: #bbbbbb"> </span>c<span style="color: #666666">=0</span>;
</pre></div>
<p>Lastly, since <code>auto</code> is currently a storage-class specifier the style
of "<code>const</code> west" with <code>auto</code> is considered obsolescent:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #008000; font-weight: bold">const</span><span style="color: #bbbbbb"> </span><span style="color: #008000; font-weight: bold">auto</span><span style="color: #bbbbbb"> </span>d<span style="color: #666666">=0</span>;
</pre></div>
<p>This applies to the other qualifiers as well, including <code>_Atomic</code>. It
seems unnecessary to obsolete this commonly used style when used in
combination with auto.</p>
<h3>Question 1</h3>
<p>Should using multiple storage-class specifiers be obsolescent?</p>
<h3>Question 2</h3>
<p>Should using alignment specifiers before storage-class specifiers be
obsolescent?</p>
<h3>Question 3</h3>
<p>If the answer to question two is that it should not be obsolescent,
should compound literals be allowed to also put alignment specifiers
before storage-class specifiers? This is currently forbidden by the
syntax of compound literals. There is no motivation to allow this
aside from consistency.</p>
<h3>Question 4</h3>
<p>Should using "east <code>const</code>" with constexpr be obsolescent? That is,
putting <code>constexpr</code> after the type specifiers.</p>
<h3>Question 5</h3>
<p>If the answer to question four is that it should not be obsolescent,
should compound literals be allowed to also put <code>constexpr</code> after the
type specifiers? This is currently forbidden by the syntax of
compound literals.</p>
<h3>Question 6</h3>
<p>Should using "<code>const</code> west" with <code>auto</code> be obsolescent? That is,
putting <code>const</code> before <code>auto</code>.</p>
</div>
<hr>
<hr>
<div id="issue1050">
<h2>Issue 1050: Values of <code>wctrans_t</code> and <code>wctype_t</code></h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-04-23<br>
Status: Open<br>
Cross-references: <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1035">1035</a>, <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1062">1062</a></p>
<p>The types <code>wctrans_t</code> and <code>wctype_t</code> are both scalar types which have
a value of zero mentioned, for example:</p>
<blockquote>
<p>If <code>property</code> identifies a valid class of wide characters according
to the <code>LC_CTYPE</code> category of the current locale, the <code>wctype</code>
function returns a nonzero value that is valid as the second
argument to the <code>iswctype</code> function; otherwise, it returns zero.</p>
</blockquote>
<p>(C23 7.32.2.3.3 "The <code>wctype</code> function" paragraph 4.)</p>
<p>For integer types the meaning is obvious. For pointer types it is
less obvious but the only answer that makes sense is that zero means
null. For floating types, specifically those that support signed
zeros or non-canonical representations of (positive, negative, or
unsigned) zero the answer is less clear. To support uses like the
following:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #B00040">wctype_t</span><span style="color: #bbbbbb"> </span>c<span style="color: #666666">=</span>wctype(<span style="color: #BA2121">"example"</span>);
<span style="color: #008000; font-weight: bold">if</span>(c){
<span style="color: #3D7B7B; font-style: italic">/*...*/</span>
}
</pre></div>
<p>It seems clear that anything which compares equal to zero should not
be returned in success. But it is not as clear if negative zero or a
non-canonical representation of (positive, negative, or unsigned) zero
can be returned in failure.</p>
<p>Another issue with <code>wctrans_t</code> and <code>wctype_t</code> being floating types is
when those floating types support NaNs. If a signaling NaN can be
returned on success, then using the result could result in the
signaling NaN taking effect. It can occur even when copying the
value, see C23 F.3 paragraph 4. For quiet NaNs it would not have that
issue but it would still break comparisons between different values.
Though it is never actually specified that equality between different
<code>wctrans_t</code> values or that equality between different <code>wctype_t</code>
values requires them to work the same with <code>towctrans</code> and <code>iswctype</code>,
respectively.</p>
<h3>Question 1</h3>
<p>For both <code>wctrans</code> and <code>wctype</code>, can they return negative zero or a
non-canonical representation of (positive, negative, or unsigned) zero
to indicate success?</p>
<h3>Question 2</h3>
<p>If the answer to question one is that any value which compares equal
to zero cannot be returned on success, for both <code>wctrans</code> and <code>wctype</code>
can they return any value which compares equal to zero to indicate
failure?</p>
<h3>Question 3</h3>
<p>For both <code>wctrans</code> and <code>wctype</code>, can they return signaling NaNs to
indicate success?</p>
<h3>Question 4</h3>
<p>For both <code>wctrans</code> and <code>wctype</code>, can they return quiet NaNs to
indicate success?</p>
<h3>Question 5</h3>
<p>Does equality between different <code>wctrans_t</code> values and equality
between different <code>wctype_t</code> values require that those values work the
same with <code>towctrans</code> and <code>iswctype</code>, respectively? For example,
would it be valid for an implementation to use padding bits in the
determination of <code>towctrans</code> and <code>iswctype</code> so that values which
compare equal function differently? For floating types non-canonical
representations and payloads of NaNs provide other means of
distinguishing values which compare equal. For pointer types it may
also be possible that pointers which compare equal can be
distinguished using provenance.</p>
<h3>Question 6</h3>
<p>For both <code>wctrans</code> and <code>wctype</code>, are multiple invocations with the same
<code>LC_CTYPE</code> and argument required to return the same value?</p>
</div>
<hr>
<hr>
<div id="issue1051">
<h2>Issue 1051: Standard library integer types wider than <code>intmax_t</code></h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-04-24<br>
Status: Open<br>
Cross-references: <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1043">1043</a></p>
<p>Before C23, the following program was always valid:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#include</span><span style="color: #3D7B7B; font-style: italic"><stdint.h></span>
<span style="color: #9C6500">#if SIZE_MAX</span>
<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">main</span>(){}
<span style="color: #9C6500">#endif</span>
</pre></div>
<p>However, <code>uintmax_t</code> is no longer specified as being at least as wide as
<code>size_t</code> so this program can be invalid because of:</p>
<blockquote>
<p>For all unsigned integer types for which <code><limits.h></code> or
<code><stdint.h></code> define a macro with suffix <code>_WIDTH</code> holding its width
<em>N</em>, there is a macro with suffix <code>_MAX</code> holding the maximal value
2<sup><em>N</em></sup>-1 that is representable by the type and that has the
same type as would an expression that is an object of the
corresponding type converted according to the integer promotions.
If the value is in the range of the type <code>uintmax_t</code> (7.22.2.6) the
macro is suitable for use in conditional expression inclusion
preprocessing directives.</p>
<p>For all signed integer types for which <code><limits.h></code> or <code><stdint.h></code>
define a macro with suffix <code>_WIDTH</code> holding its width <em>N</em>, there are
macros with suffix <code>_MIN</code> and <code>_MAX</code> holding the minimal and maximal
values -2<sup><em>N</em>-1</sup> and 2<sup><em>N</em>-1</sup>-1 that are
representable by the type and that have the same type as would an
expression that is an object of the corresponding type converted
according to the integer promotions. If the values are in the range
of the type <code>intmax_t</code> (7.22.2.6) the macros are suitable for use in
conditional expression inclusion preprocessing directives.</p>
</blockquote>
<p>(C23 5.3.5.3.2 "Characteristics of integer types <code><limits.h></code>"
paragraphs 2 and 3.)</p>
<p>No implementations had trouble with <code>size_t</code> needing to be larger than
<code>uintmax_t</code>, so it seems unnecessary to allow this possibility. The
same applies to <code>sig_atomic_t</code>, <code>ptrdiff_t</code>, <code>wchar_t</code>, and
<code>wint_t</code>. For the types <code>int</code><em>N</em><code>_t</code>, <code>uint</code><em>N</em><code>_t</code>,
<code>int_least</code><em>N</em><code>_t</code>, <code>uint_least</code><em>N</em><code>_t</code>, <code>int_fast</code><em>N</em><code>_t</code>,
<code>uint_fast</code><em>N</em><code>_t</code>, <code>intptr_t</code>, and <code>uintptr_t</code> it seems intentional
and useful to allow them to be wider than <code>intmax_t</code>. For example,
CHERI has <code>intmax_t</code> and <code>uintmax_t</code> as sixty four bits but pointers
are one hundred twenty eight bits.</p>
<h3>Suggested correction</h3>
<p>Modify C23 7.22.2.6 paragraph 1:</p>
<blockquote>
<p>These types are required<ins> and have widths which are no less than
any of the widths of <code>long long</code>, <code>size_t</code>, <code>ptrdiff_t</code>, <code>wchar_t</code>,
<code>wint_t</code>, and <code>sig_atomic_t</code></ins>.</p>
</blockquote>
</div>
<hr>
<hr>
<div id="issue1052">
<h2>Issue 1052: Relations between standard library integer types</h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-05-01<br>
Status: Open</p>
<p>The minimum-width integer types do not properly consider padding or
bit-precise integer types:</p>
<blockquote>
<p>The typedef name <code>int_least</code><em>N</em><code>_t</code> designates a signed integer type
with a width of at least <em>N</em>, such that no signed integer type with
lesser size has at least the specified width. Thus, <code>int_least32_t</code>
denotes a signed integer type with a width of at least 32 bits.</p>
<p>The typedef name <code>uint_least</code><em>N</em><code>_t</code> designates an unsigned integer
type with a width of at least <em>N</em>, such that no unsigned integer
type with lesser size has at least the specified width. Thus,
<code>uint_least16_t</code> denotes an unsigned integer type with a width of at
least 16 bits.</p>
</blockquote>
<p>(C23 7.22.2.3 "Minimum-width integer types" paragraphs 1 and 2.)</p>
<p>For example:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#include</span><span style="color: #3D7B7B; font-style: italic"><stdint.h></span>
<span style="color: #008000; font-weight: bold">static_assert</span>(UINT_LEAST16_WIDTH<span style="color: #666666"><=</span>UINT_LEAST32_WIDTH);
</pre></div>
<p>Considering these are supposed to be the minimum-width integer types
it would be quite surprising if this static assertion might not hold.
But consider the following implementation: there are no extended
integer types, bytes are eight bits, <code>short</code> is sixty four bits with
thirty two bits being padding, <code>int</code> is sixty four bits with zero bits
being padding, <code>long</code> is more than sixty four bits with zero bits
being padding, and <code>long long</code> is sixty four bits with zero bits being
padding. The following definitions would then be valid:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #008000; font-weight: bold">typedef</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">unsigned</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">uint_least16_t</span>;
<span style="color: #008000; font-weight: bold">typedef</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">unsigned</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">short</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">uint_least32_t</span>;
</pre></div>
<p>Meaning that <code>UINT_LEAST16_WIDTH</code> is sixty four and
<code>UINT_LEAST32_WIDTH</code> is thirty two. The current wording only
considers the size in terms of bytes, so it prevents
<code>sizeof(uint_least16_t)>sizeof(uint_least32_t)</code> but it seems
unintended to allow for the widths to be like this. It also means
that for this hypothetical implementation:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #008000; font-weight: bold">typedef</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">unsigned</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">uint_least16_t</span>;
</pre></div>
<p>There is no preference as to which type (<code>unsigned</code> or <code>unsigned short</code>) can be chosen, so even though there is a type with a smaller
width <code>uint_least16_t</code> does not need to choose that type over the type
with the larger width. That is weird, but it does not seem too
important to try and restrict it. The fastest minimum-width integer
types similarly do not constrain the widths to prevent larger values
of <em>N</em> in <code>int_fast</code><em>N</em><code>_t</code> or <code>uint_fast</code><em>N</em><code>_t</code> from decreasing the
width, and using padding bits is not even necessary to imagine an
implementation that could use such weird definitions. It seems
unintended too since if <code>int_fast</code><em>N</em><code>_t</code> were wider than
<code>int_fast</code><em>M</em><code>_t</code> with <em>N</em><<em>M</em> both types would be valid definitions
for both <code>int_fast</code><em>N</em><code>_t</code> and <code>int_fast</code><em>M</em><code>_t</code>. To define them that
way is to suggest that each type is faster than the other type, which
does not make sense.</p>
<p>For the issue with bit-precise integer types consider the following
implementation: there are no extended integer types, bytes are eight
bits, <code>short</code> is thirty two bits, <code>int</code> is thirty two bits, <code>long</code> is
sixty four bits, <code>long long</code> is sixty four bits, all standard integer
types have no padding bits, and <code>_BitInt(24)</code> has no padding bits.
<code>int_least16_t</code> should be defined either as <code>short</code> or as <code>int</code>, but
because <code>_BitInt(24)</code> exists there is now an integer type with a
lesser size than both that has at least sixteen bits in width.
<code>int_least16_t</code> cannot be defined as a bit-precise integer type, since
that is explicitly forbidden. Therefore it seems like such an
implementation is forbidden and <code>_BitInt(24)</code> must be given padding
bits, though that is surely unintended.</p>
<h3>Suggested correction</h3>
<p>Modify C23 7.22.2.1 paragraph 2:</p>
<blockquote>
<p>In the following descriptions, the symbol <em>N</em> represents an unsigned
decimal integer with no leading zeros (e.g. 8 or 24, but not 04 or
048).<ins> When two typedef names differing only in the value of <em>N</em>
are defined, the typedef name whose <em>N</em> has a larger value shall not
denote a type which has a width less than the width of the type
which the other typedef name denotes.</ins></p>
</blockquote>
<p>Modify C23 7.22.2.3 paragraphs 1 and 2:</p>
<blockquote>
<p>The typedef name <code>int_least</code><em>N</em><code>_t</code> designates a signed integer type
with a width of at least <em>N</em>, such that no signed integer type<ins>
other than a bit-precise signed integer type</ins> with lesser size
has at least the specified width. Thus, <code>int_least32_t</code> denotes a
signed integer type with a width of at least 32 bits.</p>
<p>The typedef name <code>uint_least</code><em>N</em><code>_t</code> designates an unsigned integer
type with a width of at least <em>N</em>, such that no unsigned integer
type<ins> other than a bit-precise unsigned integer type</ins> with
lesser size has at least the specified width. Thus,
<code>uint_least16_t</code> denotes an unsigned integer type with a width of at
least 16 bits.</p>
</blockquote>
</div>
<hr>
<hr>
<div id="issue1053">
<h2>Issue 1053: Conversion of <code>NULL</code> to <code>intptr_t</code> or <code>uintptr_t</code></h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-05-06<br>
Status: Open</p>
<p>Before C23, the following program was always valid if <code>intptr_t</code> was
defined:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#include</span><span style="color: #3D7B7B; font-style: italic"><stddef.h></span>
<span style="color: #9C6500">#include</span><span style="color: #3D7B7B; font-style: italic"><stdint.h></span>
<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">main</span>(){
(<span style="color: #B00040">intptr_t</span>)<span style="color: #008000">NULL</span>;
}
</pre></div>
<p>However, <code>NULL</code> is now allowed to be defined as <code>nullptr</code> which cannot
be cast to an integer type. It seems unnecessary to forbid this, and
C++ allows using <code>nullptr</code> in place of <code>(void*)0</code> in pointer to
integer conversions.</p>
<h3>Suggested correction</h3>
<p>Modify C23 6.5.5 paragraph 4:</p>
<blockquote>
<p>The type <code>nullptr_t</code> shall not be converted to any <ins>floating
</ins>type<del> other than <code>void</code>, <code>bool</code> or a pointer type</del>.</p>
</blockquote>
<p>Note: The text seems to currently forbid <code>(nullptr_t)nullptr</code> despite
the next sentence intending to allow it.</p>
<p>Replace C23 6.3.3.4:</p>
<blockquote>
<p>A value of type <code>nullptr_t</code> can be converted to an integer type, the
result is equivalent to converting <code>(void*)0</code> to the same integer
type. A value of type <code>nullptr_t</code> can be converted to a pointer
type or <code>nullptr_t</code>, the result is a null pointer.</p>
</blockquote>
<blockquote>
<p>Note: The text currently says "The type <code>nullptr_t</code> can be converted
..." which is inconsistent with how other conversions are described
on values rather than types.</p>
</blockquote>
<p>Note: It seems unnecessary to define the conversion of <code>nullptr_t</code> to
<code>void</code> here.</p>
<hr>
<p>Comment from Jay Ghiron on 2026-10-09:</p>
<p>It appears that the suggested correction removes any wording that
defines conversion of a null pointer constant other than <code>nullptr</code> to
<code>nullptr_t</code>. Additionally, it appears that the previous section which
defines conversions with pointers already defines conversion of
<code>nullptr_t</code> to pointer types. Alternative wording for C23 6.3.3.4:</p>
<blockquote>
<p>A value of type <code>nullptr_t</code> can be converted to an integer type, the
result is equivalent to converting <code>(void*)0</code> to the same integer
type. A null pointer constant or a value of type <code>nullptr_t</code> can be
converted to <code>nullptr_t</code>, the result in either case is <code>nullptr</code>.</p>
</blockquote>
</div>
<hr>
<hr>
<div id="issue1054">
<h2>Issue 1054: Signals from freestanding integer conversion</h2>
<p>Authors: Dave Banham<br>
Date: 2026-05-06<br>
Status: Open</p>
<p>Is it a defect for the standard to suggest that a non-freestanding
feature be used for what would otherwise be a core aspect of the
standard that a conforming freestanding implementation would be
required to implement?</p>
<p>The specific case I came across is in C23 6.3.2.3 "Signed and unsigned
integers":</p>
<p>In paragraph 3 it states</p>
<blockquote>
<p>Otherwise, the new type is signed and the value cannot be
represented in it; either the result is implementation-defined or an
implementation-defined signal is raised.</p>
</blockquote>
<p>But as the use of signals is optional for a freestanding
implementation this creates a potential issue when the underlying
hardware raises an exception. Would "trap" be a better word to use
rather than "signal"?</p>
</div>
<hr>
<hr>
<div id="issue1055">
<h2>Issue 1055: Incomplete enumerated types in the standard library</h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-05-07<br>
Status: Open<br>
Cross-references: <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1035">1035</a>, <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1043">1043</a></p>
<p>There is currently an idea of an incomplete enumerated type, though
such types can never actually be named:</p>
<blockquote>
<p>A type specifier of the form</p>
<p><code>enum</code> <em>identifier</em></p>
<p>without an enumerator list shall only appear after the type it
specifies is complete.</p>
</blockquote>
<p>(C23 6.7.3.4 "Tags" paragraph 2.)</p>
<p>Some existing implementations do actually allow naming these types
though, for example GCC. And it seems like these incomplete
enumerated types really are integer types and scalar types, since
"basic type" is defined specifically for the purpose of excluding
enumerated types when defining basic types as complete object types
rather than all arithmetic types. Some types in the standard library
seem to even be allowed to use such definitions:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #008000; font-weight: bold">enum</span><span style="color: #bbbbbb"> </span>_FILE;<span style="color: #3D7B7B; font-style: italic">//GCC extension</span>
<span style="color: #008000; font-weight: bold">typedef</span><span style="color: #bbbbbb"> </span><span style="color: #008000; font-weight: bold">enum</span><span style="color: #bbbbbb"> </span>_FILE<span style="color: #bbbbbb"> </span><span style="color: #B00040">FILE</span>;
</pre></div>
<p>Though this does not seem to cause any problems. A case which would
be more problematic is:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #008000; font-weight: bold">enum</span><span style="color: #bbbbbb"> </span>_Incomplete;<span style="color: #3D7B7B; font-style: italic">//GCC extension</span>
<span style="color: #008000; font-weight: bold">typedef</span><span style="color: #bbbbbb"> </span><span style="color: #008000; font-weight: bold">enum</span><span style="color: #bbbbbb"> </span>_Incomplete<span style="color: #bbbbbb"> </span><span style="color: #B00040">time_t</span>;
</pre></div>
<p>That is surely not intended to be valid. The following suggested
correction assumes that <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1043">issue 1043</a> is resolved to not
allow the types described there to be enumerated types.</p>
<h3>Suggested correction</h3>
<p>Modify C23 7.17.1 paragraph 5:</p>
<blockquote>
<p>The types include</p>
<p><code>memory_order</code></p>
<p>which is a<del>n</del> <ins>complete </ins>enumerated type whose
enumerators identify memory ordering constraints;</p>
</blockquote>
<p>Note:
<a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3366.htm">N3366</a>
<code>stdc_mcerr</code> should also be modified in the same way.</p>
<p>Modify C23 7.29.1 paragraph 4:</p>
<blockquote>
<p>The types declared are <code>size_t</code> (described in 7.21);</p>
<p><code>clock_t</code></p>
<p>and</p>
<p><code>time_t</code></p>
<p>which are <ins>complete </ins>real types capable of representing
times;</p>
</blockquote>
<p>Modify C23 7.32.1 paragraph 2:</p>
<blockquote>
<p>The types declared are <code>wint_t</code> described in 7.31.1;</p>
<p><code>wctrans_t</code></p>
<p>which is a <ins>complete </ins>scalar type that can hold values
which represent locale-specific character mappings; and</p>
<p><code>wctype_t</code></p>
<p>which is a <ins>complete </ins>scalar type that can hold values
which represent locale-specific character classifications.</p>
</blockquote>
<p>Note: This interacts with the same wording as <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1035">issue
1035</a>.</p>
</div>
<hr>
<hr>
<div id="issue1056">
<h2>Issue 1056: <code>WEOF</code> in integer constant expressions</h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-05-08<br>
Status: Open</p>
<p>Unlike most macros in the standard library, <code>WEOF</code> is described as
expanding to a constant expression of a particular type without
defining it as an integer constant expression:</p>
<blockquote>
<p>The macros defined are <code>NULL</code> (described in 7.21); <code>WCHAR_MIN</code>,
<code>WCHAR_MAX</code>, and <code>WCHAR_WIDTH</code> (described in 7.22); and</p>
<p><code>WEOF</code></p>
<p>which expands to a constant expression of type <code>wint_t</code> whose value
does not correspond to any member of the extended character set.</p>
</blockquote>
<p>(C23 7.31.1 "Introduction" paragraph 4.)</p>
<p>Since it is not described as an integer constant expression, the
following definition is currently permitted:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#define WEOF ((__wint_t)-1.)</span>
<span style="color: #3D7B7B; font-style: italic">/* __wint_t instead of wint_t to avoid issues with local definitions</span>
<span style="color: #3D7B7B; font-style: italic">of wint_t */</span>
</pre></div>
<p>Which is neither an integer constant expression nor usable in
conditional expression inclusion preprocessing directives. Therefore
the following uses might be invalid:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#if WEOF<0</span>
<span style="color: #3D7B7B; font-style: italic">/*...*/</span>
<span style="color: #9C6500">#endif</span>
<span style="color: #008000; font-weight: bold">enum</span>{NegativeWEOF<span style="color: #666666">=</span>WEOF<span style="color: #666666"><0</span>};
</pre></div>
<p>It seems unintended to allow definitions that preclude these uses.
Note that MSVC cannot make the former case work because it defines
<code>wint_t</code> as <code>unsigned short</code>, though that is not a valid definition of
<code>wint_t</code>.</p>
<h3>Suggested correction</h3>
<p>Modify C23 7.31.1 paragraph 4:</p>
<blockquote>
<p>The macros defined are <code>NULL</code> (described in 7.21); <code>WCHAR_MIN</code>,
<code>WCHAR_MAX</code>, and <code>WCHAR_WIDTH</code> (described in 7.22); and</p>
<p><code>WEOF</code></p>
<p>which expands to a<ins>n integer</ins> constant expression of type
<code>wint_t</code> whose value does not correspond to any member of the
extended character set.</p>
</blockquote>
</div>
<hr>
<hr>
<div id="issue1057">
<h2>Issue 1057: Standard library types as atomic types</h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-05-11<br>
Status: Open<br>
Cross-references: <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1058">1058</a></p>
<p>The standard on some occasions uses type categories such as character
type to include atomic types:</p>
<blockquote>
<p>If a value is stored into an object having no declared type through
an lvalue having a type that is not a non-atomic character type,
then the type of the lvalue becomes the effective type of the object
for that access and for subsequent accesses that do not modify the
stored value.</p>
</blockquote>
<p>(C23 6.5.1 "General" paragraph 6.)</p>
<p>If the type category character type did not include atomic types, it
would be redundant to mention non-atomic here. C2Y moves this wording
into the definition of the type category byte type. Given this, it
does not appear that standard library types such as <code>size_t</code> are
forbidden from being atomic types. This would have some awkward
consequences (assume <code>__STDC_NO_ATOMICS__</code> is not defined):</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#include</span><span style="color: #3D7B7B; font-style: italic"><stddef.h></span>
<span style="color: #B00040">_Atomic</span>(<span style="color: #B00040">size_t</span>)x;<span style="color: #3D7B7B; font-style: italic">/* possibly invalid */</span>
<span style="color: #B00040">size_t</span><span style="color: #bbbbbb"> </span>y;
<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">main</span>(){
<span style="color: #008000; font-weight: bold">auto</span><span style="color: #bbbbbb"> </span>z<span style="color: #666666">=</span>y;<span style="color: #3D7B7B; font-style: italic">/* uses typeof_unqual(size_t) not size_t */</span>
}
</pre></div>
<p>The same applies to <code>ptrdiff_t</code>, <code>wchar_t</code>, <code>wint_t</code>, <code>int</code><em>N</em><code>_t</code>,
<code>uint</code><em>N</em><code>_t</code>, <code>int_least</code><em>N</em><code>_t</code>, <code>uint_least</code><em>N</em><code>_t</code>,
<code>int_fast</code><em>N</em><code>_t</code>, <code>uint_fast</code><em>N</em><code>_t</code>, <code>intptr_t</code>, <code>uintptr_t</code>,
<code>intmax_t</code>, <code>uintmax_t</code>, <code>float_t</code>, <code>double_t</code>, <code>long_double_t</code>,
<code>_Decimal32_t</code>, <code>_Decimal64_t</code>, <code>_Float</code><em>N</em><code>_t</code>, <code>_Decimal</code><em>N</em><code>_t</code>,
<code>time_t</code>, <code>clock_t</code>, <code>imaxdiv_t</code>, <code>div_t</code>, <code>ldiv_t</code>, <code>lldiv_t</code>,
<code>wctrans_t</code>, <code>wctype_t</code>, <code>memory_order</code>, and <code>sig_atomic_t</code>
considering that it may also be volatile qualified. The same also
applies to
<a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3366.htm">N3366</a>
<code>stdc_mcerr</code>, it is described as an enumerated type similar to
<code>memory_order</code>.</p>
<p><code>atomic_flag</code> is described as a structure type, though it being atomic
does not seem unreasonable. <code>struct timespec</code>, <code>struct tm</code>, and
<code>struct lconv</code> surely cannot be atomic because of how they are named.
<code>jmp_buf</code> can also not be atomic because it must be an array type.
Future issues will discuss other types along with other problems that
they have.</p>
<p>There seems to be three possible solutions:</p>
<ol>
<li>Add wording to each of the types mentioned above forbidding atomic
types.</li>
<li>Add wording forbidding atomic types that applies to all standard
library types that can only be scalar types. Also add wording to
the division types forbidding them from being atomic types.</li>
<li>Clarify that type categories such as integer type and structure
type do not include atomic types. This would have a very broad
impact on the standard. If this is done, it would also be useful
to clarify if qualifiers are included or not.</li>
</ol>
</div>
<hr>
<hr>
<div id="issue1058">
<h2>Issue 1058: Categories of standard library types</h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-05-13<br>
Status: Open<br>
Cross-references: <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1026">1026</a>, <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1034">1034</a>, <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1057">1057</a>, <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1059">1059</a></p>
<p>The standard library describes many types as being complete object
types. For many of them it places further restrictions on them:
having fundamental alignment requirements, not being array types
(copyable), and being byte copyable. Byte copyable is never defined,
but in C2Y some types are specifically excluded from being byte
copyable. However, the restrictions in place are insufficient and
allow many definitions that should not be allowed. The types being
considered in this issue are <code>imaxdiv_t</code>, <code>div_t</code>, <code>ldiv_t</code>,
<code>lldiv_t</code>, <code>struct timespec</code>, <code>struct tm</code>, <code>fpos_t</code>, <code>struct lconv</code>,
<code>mbstate_t</code>, <code>cnd_t</code>, <code>thrd_t</code>, <code>tss_t</code>, <code>mtx_t</code>, <code>once_flag</code>,
<code>atomic_flag</code>, <code>jmp_buf</code>, <code>va_list</code>, and <code>max_align_t</code>. The types
<code>fenv_t</code>, <code>fexcept_t</code>, and <code>femode_t</code> will be discussed in a future
issue. The type <code>FILE</code> will additionally be discussed, but only for
its alignment requirements. If <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1034">issue 1034</a> is resolved
as requiring exactly the two specified members in the division types,
then <code>imaxdiv_t</code>, <code>div_t</code>, <code>ldiv_t</code>, and <code>lldiv_t</code> will not have some
of the issues described here. See also <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1057">issue 1057</a> which
also mentions <code>imaxdiv_t</code>, <code>div_t</code>, <code>ldiv_t</code>, and <code>lldiv_t</code>.
<code>atomic_flag</code> is specified as a structure type, but it does not appear
that it is intended to be copyable as other types like <code>mbstate_t</code>.</p>
<p>First, other than <code>jmp_buf</code> these types are not forbidden from being
structure types with flexible array members or unions that contain
such structures among their members (including, recursively, members
of contained unions). An example of this causing issues is:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#include</span><span style="color: #3D7B7B; font-style: italic"><stdarg.h></span>
<span style="color: #B00040">va_list</span><span style="color: #bbbbbb"> </span>v[<span style="color: #666666">1</span>];<span style="color: #3D7B7B; font-style: italic">/* invalid with flexible array members */</span>
</pre></div>
<p>Second, other than <code>atomic_flag</code> these types that cannot be array
types are not forbidden from being structure or union types which in
either case contain members with const qualified types (including,
recursively, members or elements of subaggregates and contained
unions). An example of this causing issues is:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#include</span><span style="color: #3D7B7B; font-style: italic"><stdio.h></span>
<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">main</span>(){
<span style="color: #B00040">fpos_t</span><span style="color: #bbbbbb"> </span>x<span style="color: #666666">=</span>{},y;
y<span style="color: #666666">=</span>x;<span style="color: #3D7B7B; font-style: italic">/* invalid with a const member */</span>
}
</pre></div>
<p>Third, other than <code>atomic_flag</code> these types in the ordinary name space
that cannot be array types are not forbidden from being atomic types.
An example of this causing issues is:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#include</span><span style="color: #3D7B7B; font-style: italic"><wchar.h></span>
<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">main</span>(){
<span style="color: #B00040">mbstate_t</span><span style="color: #bbbbbb"> </span>s<span style="color: #666666">=</span>{};
<span style="color: #008000; font-weight: bold">auto</span><span style="color: #bbbbbb"> </span>t<span style="color: #666666">=</span>s;<span style="color: #3D7B7B; font-style: italic">/* does not preserve atomic */</span>
mbsinit(<span style="color: #666666">&</span>t);<span style="color: #3D7B7B; font-style: italic">/* invalid with atomic mbstate_t */</span>
}
</pre></div>
<p>Fourth, for these types that are intended to be byte copyable they are
not forbidden from being atomic types and from being aggregate or
union types which in either case contain members or elements with
atomic type (including, recursively, members or elements of
subaggregates and contained unions). Objects with atomic type cannot
have their object representation meaningfully modified, so they should
be forbidden if byte copying is to be allowed.</p>
<p>Fifth, the requirement on fundamental alignments does not clearly
apply to all of these types, and it is unclear how it applies to
<code>FILE</code>:</p>
<blockquote>
<p>The alignment requirements of the following types shall be fundamental
alignments:</p>
<p>...</p>
<ul>
<li>all types specified in Clause 7 as complete object types;</li>
</ul>
</blockquote>
<p>(C23 6.2.8 "Alignment of objects" paragraph 2.)</p>
<p>Specifically, whether or not "specified in Clause 7 as complete object
type" requires the text in the standard to say "complete object type"
or if it being defined as a complete object type is sufficient for
this requirement to apply. With
<a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3312.pdf">N3312</a>
being accepted, presumably the <code>atomic_*</code> types other than
<code>atomic_flag</code> should not be required to have fundamental alignment
requirements. It might make sense to expand this to types such as
<code>mtx_t</code> or <code>atomic_flag</code> too, since they probably need to use atomics
to work.</p>
<p>For the purposes of the following questions, the following type
categories are defined:</p>
<ul>
<li><em>fundamentally-aligned</em> types are complete object types that are not
over-aligned.</li>
<li><em>strict</em> types are complete object types that can be the element
type of an array type.</li>
<li><em>flexible</em> types are complete object types that are not strict
types.</li>
<li><em>modifiable</em> types are complete object types that can be the types
of modifiable lvalues.</li>
<li><em>unmodifiable</em> types are complete object types that are not
modifiable types.</li>
<li><em>representation-usable</em> types are complete object types wherein
copying the object representation is sufficient to copy the value.</li>
<li><em>representation-unusable</em> types are complete object types that are
not representation-usable.</li>
</ul>
<h3>Question 1</h3>
<p>If <code>FILE</code> is defined as a complete object type, must it be
fundamentally-aligned or is it allowed to be over-aligned?</p>
<h3>Question 2</h3>
<p>Which of the types <code>imaxdiv_t</code>, <code>div_t</code>, <code>ldiv_t</code>, <code>lldiv_t</code>, <code>struct timespec</code>, <code>struct tm</code>, <code>fpos_t</code>, <code>struct lconv</code>, <code>mbstate_t</code>,
<code>cnd_t</code>, <code>thrd_t</code>, <code>tss_t</code>, <code>mtx_t</code>, <code>once_flag</code>, <code>atomic_flag</code>,
<code>jmp_buf</code>, and <code>va_list</code> are required to be fundamentally-aligned and
which can be over-aligned?</p>
<h3>Question 3</h3>
<p>Should the types <code>struct timespec</code>, <code>struct tm</code>, <code>fpos_t</code>, <code>struct lconv</code>, <code>mbstate_t</code>, <code>cnd_t</code>, <code>thrd_t</code>, <code>tss_t</code>, <code>mtx_t</code>, <code>once_flag</code>,
<code>atomic_flag</code>, <code>va_list</code>, and <code>max_align_t</code> be required to be strict
types or should they be allowed to be flexible types? If <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1034">issue
1034</a> is resolved as allowing extra members in the
division types, should <code>imaxdiv_t</code>, <code>div_t</code>, <code>ldiv_t</code>, and <code>lldiv_t</code>
be required to be strict types or should they be allowed to be
flexible types?</p>
<h3>Question 4</h3>
<p>Should the types <code>struct timespec</code>, <code>struct tm</code>, <code>fpos_t</code>, <code>struct lconv</code>, and <code>mbstate_t</code> be required to be modifiable types or should
they be allowed to be unmodifiable types? If <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1034">issue 1034</a>
is resolved as allowing extra members in the division types, should
<code>imaxdiv_t</code>, <code>div_t</code>, <code>ldiv_t</code>, and <code>lldiv_t</code> be required to be
modifiable types or should they be allowed to be unmodifiable types?
If <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1026">issue 1026</a> is resolved as requiring that <code>thrd_t</code> is
not an array type, should it be required to be a modifiable type or
should it be allowed to be an unmodifiable type? Should <code>atomic_flag</code>
be required to be a modifiable type or should it be allowed to be an
unmodifiable type?</p>
<h3>Question 5</h3>
<p>Should the types <code>struct timespec</code>, <code>struct tm</code>, <code>fpos_t</code>, <code>struct lconv</code>, and <code>mbstate_t</code> be required to be non-atomic types or should
they be allowed to be atomic types? <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1057">Issue 1057</a>
discusses this for <code>imaxdiv_t</code>, <code>div_t</code>, <code>ldiv_t</code>, and <code>lldiv_t</code>. If
<a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1026">issue 1026</a> is resolved as requiring that <code>thrd_t</code> is not
an array type, should it be required to be a non-atomic type or should
it be allowed to be an atomic type? Should <code>atomic_flag</code> be required
to be a non-atomic type or should it be allowed to be an atomic type?</p>
<h3>Question 6</h3>
<p>Of the types <code>struct timespec</code>, <code>struct tm</code>, <code>fpos_t</code>, <code>struct lconv</code>,
<code>mbstate_t</code>, <code>cnd_t</code>, <code>thrd_t</code>, <code>tss_t</code>, <code>mtx_t</code>, <code>once_flag</code>,
<code>atomic_flag</code>, <code>jmp_buf</code>, and <code>max_align_t</code> which are intended to
require the type to be representation-usable and which are intended to
allow representation-unusable types? If <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1034">issue 1034</a> is
resolved as allowing extra members in the division types, are
<code>imaxdiv_t</code>, <code>div_t</code>, <code>ldiv_t</code>, and <code>lldiv_t</code> intended to require the
types to be representation-usable or is it intended to allow
representation-unusable types? <code>FILE</code> and <code>va_list</code> are already
described as possibly being representation-unusable. C++ also
requires that <code>max_align_t</code> is trivially copyable.</p>
<h3>Question 7</h3>
<p>Should the types that are required to be representation-usable be
forbidden from being atomic types and from being aggregate or union
types which in either case contain members or elements with atomic
type (including, recursively, members or elements of subaggregates and
contained unions)?</p>
<h3>Question 8</h3>
<p>Should any of the types that are allowed to be unmodifiable be
required to not inhibit structures or unions which in either case
contain them from being modifiable? For example:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#include</span><span style="color: #3D7B7B; font-style: italic"><stddef.h></span>
<span style="color: #008000; font-weight: bold">union</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">U</span>{
max_align_t<span style="color: #bbbbbb"> </span>m;
<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>i;
};
<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">main</span>(){
<span style="color: #008000; font-weight: bold">union</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">U</span><span style="color: #bbbbbb"> </span>u1<span style="color: #666666">=</span>{.i<span style="color: #666666">=0</span>},u2;
u2<span style="color: #666666">=</span>u1;
}
</pre></div>
<p>The assignment will break if <code>max_align_t</code> is defined as a structure
type with a member of const qualified type, but it will not break if
it is defined as a type such as <code>long long[2]</code>.</p>
<h3>Question 9</h3>
<p>If some of the types that must be modifiable types are not intended to
be representation-usable, is copying their value using assignment or
as if by assignment guaranteed to produce a valid copy of the value?
For example, if <code>mbstate_t</code> is not required to be representation-usable
but is required to be modifiable then there does not appear to be
anything preventing cyclic pointers or global state that precludes
copying normally. If the answer to question eight is that there are
some such types and some of those types are not representation-usable,
this question would also apply to them but with assignment involving a
structure that contains one member of one of those types instead.</p>
<hr>
<p>Comment from Issues list maintainer on 2026-08-21:</p>
<p>In discussion of <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1028">issue 1028</a> at the August 2026 (Ottawa)
meeting of WG14, it was noted that wording such as "complete array
type", and other words that imply that a standard library type is
required to be a complete object type, should be sufficient to
guarantee a fundamental alignment requirement, rather than requiring
the exact words "complete object type" to be used for each such type.</p>
</div>
<hr>
<hr>
<div id="issue1059">
<h2>Issue 1059: <code><fenv.h></code> types underspecified</h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-05-15<br>
Status: Open<br>
Cross-references: <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1058">1058</a></p>
<p><code><fenv.h></code> defines three types:</p>
<blockquote>
<p>The type</p>
<p><code>fenv_t</code></p>
<p>represents the entire dynamic floating-point environment.</p>
<p>The type</p>
<p><code>femode_t</code></p>
<p>represents the collection of dynamic floating-point control modes
supported by the implementation, including the dynamic rounding
direction mode.</p>
<p>The type</p>
<p><code>fexcept_t</code></p>
<p>represents the floating-point status flags collectively, including
any status the implementation associates with the flags.</p>
</blockquote>
<p>(C23 7.6.1 "Floating-point environment <code><fenv.h></code>" paragraph 6, 7, and
8.)</p>
<p>Unlike most other types in the standard library, there are no
constraints on the possible types here beyond the general requirement
that excludes qualified types. It seems unintended to allow for all
of these possible types, for example const qualification does not make
sense with function types. The additional type categories defined in
<a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1058">issue 1058</a> will also be used in the following questions.</p>
<h3>Question 1</h3>
<p>Should <code>fenv_t</code>, <code>fexcept_t</code>, and <code>femode_t</code> be required to be object
types?</p>
<h3>Question 2</h3>
<p>If the answer to question one is that they must be object types,
should <code>fenv_t</code>, <code>fexcept_t</code>, and <code>femode_t</code> be required to be
complete object types? All further questions assume the answer to
this question is that they must be complete object types.</p>
<h3>Question 3</h3>
<p>Of the types <code>fenv_t</code>, <code>fexcept_t</code>, and <code>femode_t</code>, which should be
required to be fundamentally-aligned types and which should be allowed
to be over-aligned types?</p>
<h3>Question 4</h3>
<p>Of the types <code>fenv_t</code>, <code>fexcept_t</code>, and <code>femode_t</code>, which should be
required to be strict types and which should be allowed to be flexible
types?</p>
<h3>Question 5</h3>
<p>Of the types <code>fenv_t</code>, <code>fexcept_t</code>, and <code>femode_t</code>, which should be
required to be modifiable types and which should be allowed to be
unmodifiable types?</p>
<h3>Question 6</h3>
<p>Of the types <code>fenv_t</code>, <code>fexcept_t</code>, and <code>femode_t</code>, which should be
required to be non-atomic types and which should be allowed to be
atomic types?</p>
<h3>Question 7</h3>
<p>Of the types <code>fenv_t</code>, <code>fexcept_t</code>, and <code>femode_t</code>, which are intended
to require representation-usable types and which are intended to allow
representation-unusable types? Question seven from <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1058">issue
1058</a> also applies to these types if representation-usable
types are intended to be required.</p>
<h3>Question 8</h3>
<p>If the answer to question five is that some of those types should
allow unmodifiable types, should any of them be required to not
inhibit structures or unions which in either case contain them from
being modifiable?</p>
<p>Question nine from <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1058">issue 1058</a> may also apply to
<code>fenv_t</code>, <code>fexcept_t</code>, and <code>femode_t</code> depending upon how the questions
here are answered.</p>
</div>
<hr>
<hr>
<div id="issue1060">
<h2>Issue 1060: Declaring <code>main</code> with attributes</h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-05-15<br>
Status: Open<br>
Cross-references: <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1013">1013</a></p>
<p><code>main</code> cannot be declared with the <code>_Noreturn</code> function specifier:</p>
<blockquote>
<p>In a hosted environment, no function specifier(s) shall appear in a
declaration of <code>main</code>.</p>
</blockquote>
<p>(C23 6.7.5 "Function specifiers" paragraph 4.)</p>
<p>However, there does not appear to be any equivalent wording for the
<code>[[noreturn]]</code> attribute directly preventing its use with <code>main</code>:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span>[[<span style="color: #008000; font-weight: bold">noreturn</span>]]<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>main(){
<span style="color: #008000; font-weight: bold">for</span>(;;);
}
</pre></div>
<p>It is worth noting that other translation units must equivalently use
<code>[[noreturn]]</code>, that is the following translation unit would cause
undefined behavior in combination with the previous translation unit:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">main</span>();
</pre></div>
<p>Additionally, it is unclear whether or not <code>[[reproducible]]</code> and
<code>[[unsequenced]]</code> can be used on the type of <code>main</code>. See also <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1013">issue
1013</a> which discusses type equivalence with these
attributes. For the following questions, assume that the
implementation is hosted and supports no additional types of <code>main</code>.</p>
<h3>Question 1</h3>
<p>Is the following definition of <code>main</code> valid?</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span>[[<span style="color: #008000; font-weight: bold">noreturn</span>]]<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>main(){
<span style="color: #008000; font-weight: bold">for</span>(;;);
}
</pre></div>
<h3>Question 2</h3>
<p>Is the following definition of <code>main</code> valid?</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">main</span>()[[reproducible]]{}
</pre></div>
<h3>Question 3</h3>
<p>Is the following definition of <code>main</code> valid?</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">main</span>()[[unsequenced]]{}
</pre></div>
</div>
<hr>
<hr>
<div id="issue1061">
<h2>Issue 1061: Variably modified parameters with typeof specifiers</h2>
<p>Authors: Joseph Myers<br>
Date: 2026-05-15<br>
Status: Open<br>
Cross-references: <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1013">1013</a></p>
<p>There are three ways in which a function parameter can be given
variably modified type (before adjustment of parameter arrays to
pointers): an array declarator specifying a length that is not an
integer constant expression; declaration specifiers containing a
typedef name for a variably modified type; declaration specifiers
containing a typeof specifier for a variably modified type.</p>
<p>When the function declarator is used in a type name or a declaration
that is not a definition of that function, the length in the first
case is treated as replaced by <code>*</code>. In the second case, of a typedef
name (only possible inside a function), <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1013">issue 1013</a>
question 5 suggests the replacement should occur as well, for the
purposes of determining the "same type" property.</p>
<p>In the third case, of a typeof specifier, it would be natural to apply
such replacement as well when determining the type, but simply
changing the type to one of unspecified length is not sufficient to
resolve questions around the evaluation of the operand of the typeof
specifier. Consider the code:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>x;
<span style="color: #B00040">void</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">f</span>(typeof(<span style="color: #666666">++</span>x,<span style="color: #bbbbbb"> </span>(<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>(<span style="color: #666666">*</span>)[x])<span style="color: #666666">0</span>));
</pre></div>
<p>If the change to an array of unspecified length is applied, the
parameter's type is <code>int (*)[*]</code>. But this does not address what
happens to the evaluation of the <code>++x</code> part of the operand of
<code>typeof</code>. When the above code occurs at file scope, there should not
be such an evaluation because there is no meaningful point at which
such evaluation could occur; in turn, that means there should be no
evaluation at block scope either. But this would require wording for
replacing lengths by <code>*</code> to say something about not evaluating the
operand of a typeof specifier in the declaration specifiers for the
function parameter. (The exact wording for C2Y might depend on the
adoption of the "discarded" proposal.)</p>
</div>
<hr>
<hr>
<div id="issue1062">
<h2>Issue 1062: Signaling NaNs in structures, unions, and standard library types</h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-05-19<br>
Status: Open<br>
Cross-references: <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1050">1050</a></p>
<blockquote>
<p>Whether C assignment (6.5.17) (and conversion as if by assignment)
to the same format is an ISO/IEC 60559 convertFormat or copy
operation<sup>425)</sup> is implementation-defined, even if
<code><fenv.h></code> defines the macro <code>FE_SNANS_ALWAYS_SIGNAL</code> (F.2.2). If
the return expression of a <code>return</code> statement is evaluated to the
floating-point format of the return type, it is
implementation-defined whether a convertFormat operation is applied
to the result of the return expression.</p>
<p><sup>425)</sup>Where the source and destination formats are the
same, convertFormat operations differ from copy operations in that
convertFormat operations raise the "invalid" floating-point
exception on signaling NaN inputs and do not propagate non-canonical
encodings.</p>
</blockquote>
<p>(C23 F.3 "Operations" paragraph 4.)</p>
<p>According to this, the following may cause floating-point exceptions
(assume <code>__STDC_IEC_60559_BFP__</code> is defined for all of the examples):</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#define __STDC_WANT_IEC_60559_EXT__</span>
<span style="color: #9C6500">#include</span><span style="color: #3D7B7B; font-style: italic"><math.h></span>
<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">main</span>(){
<span style="color: #B00040">double</span><span style="color: #bbbbbb"> </span>d;
setpayloadsig(<span style="color: #666666">&</span>d,<span style="color: #666666">1</span>);
<span style="color: #B00040">double</span><span style="color: #bbbbbb"> </span>e<span style="color: #666666">=</span>d;<span style="color: #3D7B7B; font-style: italic">/* possible floating-point exception */</span>
e<span style="color: #666666">=</span>d;<span style="color: #3D7B7B; font-style: italic">/* possible floating-point exception */</span>
}
</pre></div>
<p>And it seems like this could possibly even be considered to apply to
structures:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#define __STDC_WANT_IEC_60559_EXT__</span>
<span style="color: #9C6500">#include</span><span style="color: #3D7B7B; font-style: italic"><math.h></span>
<span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">S</span>{<span style="color: #B00040">double</span><span style="color: #bbbbbb"> </span>d;};
<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">main</span>(){
<span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">S</span><span style="color: #bbbbbb"> </span>a,b;
setpayloadsig(<span style="color: #666666">&</span>a.d,<span style="color: #666666">1</span>);
b<span style="color: #666666">=</span>a;<span style="color: #3D7B7B; font-style: italic">/* possible floating-point exception */</span>
}
</pre></div>
<p>However, it is less clear how this applies to unions:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#define __STDC_WANT_IEC_60559_EXT__</span>
<span style="color: #9C6500">#include</span><span style="color: #3D7B7B; font-style: italic"><math.h></span>
<span style="color: #008000; font-weight: bold">union</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">U</span>{<span style="color: #B00040">long</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">long</span><span style="color: #bbbbbb"> </span>i;<span style="color: #B00040">double</span><span style="color: #bbbbbb"> </span>d;};
<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">main</span>(){
<span style="color: #008000; font-weight: bold">union</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">U</span><span style="color: #bbbbbb"> </span>a,b,x,y;
x.i<span style="color: #666666">=9218868437227405313</span>;
y<span style="color: #666666">=</span>x;<span style="color: #3D7B7B; font-style: italic">/* no floating-point exception? */</span>
setpayloadsig(<span style="color: #666666">&</span>a.d,<span style="color: #666666">1</span>);
b<span style="color: #666666">=</span>a;<span style="color: #3D7B7B; font-style: italic">/* possible floating-point exception? */</span>
}
</pre></div>
<p>If the second assignment can raise a floating-point exception and the
first assignment cannot raise a float-point exception, then presumably
it needs to somehow keep track of the active member to know when to
attempt to raise a floating-point exception (9218868437227405313 has
an equivalent representation to the signaling NaN chosen here on x86).</p>
<p>Also mentioned in <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1050">issue 1050</a>, there does not appear to
be anything preventing standard library functions from producing
values that are signaling NaNs or contain signaling NaNs in either
opaque types such as <code>mbstate_t</code> or structures with possible extra
members such as <code>struct tm</code>:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#include</span><span style="color: #3D7B7B; font-style: italic"><wchar.h></span>
<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">main</span>(){
<span style="color: #B00040">mbstate_t</span><span style="color: #bbbbbb"> </span>s<span style="color: #666666">=</span>{};
<span style="color: #9C6500">#define S "unspecified data"</span>
mbrlen(S,<span style="color: #008000; font-weight: bold">sizeof</span>(S),<span style="color: #666666">&</span>s);
<span style="color: #B00040">mbstate_t</span><span style="color: #bbbbbb"> </span>c<span style="color: #666666">=</span>s;<span style="color: #3D7B7B; font-style: italic">/* possible floating-point exception? */</span>
}
</pre></div>
<h3>Question 1</h3>
<p>Can assignment involving structures which contain signaling NaNs cause
floating-point exceptions?</p>
<h3>Question 2</h3>
<p>Can assignment involving unions which contain signaling NaNs cause
floating-point exceptions?</p>
<h3>Question 3</h3>
<p>Can standard library functions produce signaling NaNs in either opaque
types or structures with possible extra members, and can they produce
indeterminate values in opaque types? This can even apply to types
such as <code>va_list</code>:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#include</span><span style="color: #3D7B7B; font-style: italic"><stdarg.h></span>
<span style="color: #B00040">void</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">f</span>(<span style="color: #B00040">va_list</span>){}
<span style="color: #B00040">void</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">g</span>(...){
<span style="color: #B00040">va_list</span><span style="color: #bbbbbb"> </span>v;
va_start(v);
f(v);<span style="color: #3D7B7B; font-style: italic">/* possible floating-point exception? */</span>
<span style="color: #3D7B7B; font-style: italic">/* also, possibly undefined behavior? */</span>
va_end(v);
}
<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">main</span>(){
g();
}
</pre></div>
<p>In instances of failure such as conversion failure with <code>mbstate_t</code> or
<code>fgetpos</code> failing with <code>fpos_t</code>, perhaps it is useful to allow such
results.</p>
</div>
<hr>
<hr>
<div id="issue1063">
<h2>Issue 1063: Conversions to signed integer types</h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-05-20<br>
Status: Open</p>
<blockquote>
<p>When a value with integer type is converted to another integer type
other than <code>bool</code>, if the value can be represented by the new type,
it is unchanged.</p>
<p>...</p>
<p>Otherwise, the new type is signed and the value cannot be
represented in it; either the result is implementation-defined or an
implementation-defined signal is raised.</p>
</blockquote>
<p>(C23 6.3.2.3 "Signed and unsigned integers" paragraphs 1 and 3.)</p>
<p>According to this, the following has an implementation-defined result
or causes an implementation-defined signal to be raised (assume <code>char</code>
is signed and eight bits):</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">main</span>(){
<span style="color: #008000; font-weight: bold">return</span>(<span style="color: #B00040">char</span>)<span style="color: #666666">128</span>;
}
</pre></div>
<p>However, this has some effects that seem unintended:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#include</span><span style="color: #3D7B7B; font-style: italic"><stdio.h></span>
<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">main</span>(){
<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>i<span style="color: #666666">=</span>getchar();
<span style="color: #008000; font-weight: bold">if</span>(i<span style="color: #666666">!=</span>EOF){
<span style="color: #B00040">char</span><span style="color: #bbbbbb"> </span>c<span style="color: #666666">=</span>i;<span style="color: #3D7B7B; font-style: italic">/* might not be representable */</span>
}
}
</pre></div>
<p>So the strictly conforming version should actually be doing:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #B00040">char</span><span style="color: #bbbbbb"> </span>c<span style="color: #666666">=</span>i<span style="color: #666666">></span>CHAR_MAX<span style="color: #666666">?</span>i<span style="color: #666666">+</span>CHAR_MIN<span style="color: #666666">+</span>CHAR_MIN<span style="color: #666666">:</span>i;
</pre></div>
<p>I assume the overwhelming majority of programs are not carefully doing
things like this and are implicitly relying on conversions to signed
integers working as expected even when the result is not
representable. More importantly, it appears that some parts in the
standard make the same assumptions.</p>
<h3>Question 1</h3>
<blockquote>
<p>If an integer character constant contains a single character or
escape sequence, its value is the one that results when an object
with type <code>char</code> whose value is that of the single character or
escape sequence is converted to type <code>int</code>.</p>
</blockquote>
<p>(C23 6.4.5.5 "Character constants" paragraph 11.)</p>
<p>With <code>char</code> being eight bits and signed, does <code>'\x80'</code> have an
implementation-defined value or result in an implementation-defined
signal being raised? That is, does "whose value is that of the single
character or escape sequence" mean to do a conversion of the value to
<code>char</code>?</p>
<h3>Question 2</h3>
<p>With <code>char</code> being sixteen bits and unsigned while <code>int</code> is also
sixteen bits, does <code>'\x8000'</code> have an implementation-defined value or
result in an implementation-defined signal being raised?</p>
<h3>Question 3</h3>
<p>If the answer to either of the previous two questions is that integer
character constants with a single character or single escape sequence
can have implementation-defined values or result in
implementation-defined signals being raised, does this also apply to
string literals? For example <code>"\xC3\x80"</code> with <code>char</code> being eight
bits and signed (U+00C0 encoded in UTF-8).</p>
<h3>Question 4</h3>
<p>Can any of the macros in <code><stdckdint.h></code> cause the result to have an
implementation-defined value or raise an implementation-defined
signal? For example:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#include</span><span style="color: #3D7B7B; font-style: italic"><limits.h></span>
<span style="color: #9C6500">#include</span><span style="color: #3D7B7B; font-style: italic"><stdckdint.h></span>
<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">main</span>(){
<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>r;
ckd_add(<span style="color: #666666">&</span>r,INT_MAX,<span style="color: #666666">1</span>);
<span style="color: #008000; font-weight: bold">return</span><span style="color: #bbbbbb"> </span>r;
}
</pre></div>
<blockquote>
<p>Each operation is performed as if both operands were represented in
a signed integer type with infinite range, and the result was then
converted from this integer type to <em>type1</em>.</p>
</blockquote>
<p>(C23 7.20.2 "Checked Integer Operation Type-generic Macros" paragraph 2.)</p>
<blockquote>
<p>If these type-generic macros return <code>false</code>, the value assigned to
<code>*result</code> correctly represents the mathematical result of the
operation. Otherwise, these type-generic macros return <code>true</code>. In
this case, the value assigned to <code>*result</code> is the mathematical
result of the operation wrapped around to the width of <code>*result</code>.</p>
</blockquote>
<p>(C23 7.20.1 "Checked Integer Operation Type-generic Macros" paragraph
5.)</p>
<p>So the infinite precision integer with the value <code>INT_MAX+1</code> is
converted to <code>int</code>, which is by definition not representable. The
paragraph in returns does not seem to clearly circumvent this.
Specifically, "wrapped around" is defined as:</p>
<blockquote>
<p><strong>wraparound</strong></p>
<p>the process by which a value is reduced modulo 2<sup><em>N</em></sup>,
where <em>N</em> is the width of the resulting type</p>
</blockquote>
<p>(C23 3.28 paragraph 1.)</p>
<p><code>INT_MAX+1</code> mod 2<sup><code>INT_WIDTH</code></sup> is by definition <code>INT_MAX+1</code>,
so the wrapped around value might not always be representable. Note
that C++ more carefully says "the unique value of the destination type
that is congruent to the source integer modulo 2<sup><em>N</em></sup>"
[conv.integral] when describing conversion to integer types. As an
aside, the paragraph in returns does not seem to require the value
<code>false</code> to be returned if the mathematical result of the operation is
representable in the result.</p>
<h3>Question 5</h3>
<p>If <code>UCHAR_MAX</code> is greater than <code>INT_MAX</code>, can conversions from
<code>unsigned char</code> to <code>int</code> in functions such as <code>fgetc</code> cause
implementation-defined results or raise implementation-defined
signals?</p>
<h3>Question 6</h3>
<p>Can conversions from <code>wchar_t</code> to <code>wint_t</code> or vice versa in functions
such as <code>fgetwc</code> or <code>printf</code> (<code>%lc</code>) cause implementation-defined
results or raise implementation-defined signals?</p>
<h3>Question 7</h3>
<p>What would it mean for an implementation-defined signal to be raised
in a constant expression? For example:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #008000; font-weight: bold">static_assert</span>((<span style="color: #B00040">int</span>)<span style="color: #666666">-1U*0==0</span>);
</pre></div>
</div>
<hr>
<hr>
<div id="issue1064">
<h2>Issue 1064: <code>__VA_OPT__()</code> hypothetical substitution</h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-05-20<br>
Status: Open</p>
<p>GCC and Clang disagree about the validity of the following program
(preprocessing only):</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#define F()</span>
<span style="color: #9C6500">#define G(...)__VA_OPT__()</span>
G(F(...))
</pre></div>
<p>That is, whether or not <code>__VA_OPT__()</code> causes an expansion of the argument:</p>
<blockquote>
<p>The preprocessing token sequence for the corresponding argument of a
va-opt-replacement is defined as follows. If a (hypothetical)
substitution of <code>__VA_ARGS__</code> as neither an operand of <code>#</code> nor <code>##</code>
consists of no preprocessing tokens, the argument consists of a
single placemarker preprocessing token (6.10.5.4, 6.10.5.5).
Otherwise, the argument consists of the results of the expansion of
the contained pp-tokens as the replacement list of the current
function-like macro before removal of placemarker tokens,
rescanning, and further replacement.</p>
</blockquote>
<p>(C23 6.10.5.2 "Argument substitution" paragraph 7.)</p>
<p>If a hypothetical substitution is invalid, is the program invalid?
Since the substitution is hypothetical, does it need to happen when
the result of the substitution does not matter? This difference is
also visible with C2Y <code>__COUNTER__</code>:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#define G(...)__VA_OPT__()</span>
G(__COUNTER__)
<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>main(){
<span style="color: #008000; font-weight: bold">return</span><span style="color: #bbbbbb"> </span>__COUNTER__;
}
</pre></div>
<p>There is no disagreement about <code>__VA_OPT__(E)</code> if <code>E</code> is defined as:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#define E</span>
</pre></div>
<p>In the context of C2Y <code>__COUNTER__</code>, it seems useful to not require
expansion here:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#define H(...)__VA_ARGS__##__VA_OPT__()</span>
<span style="color: #3D7B7B; font-style: italic">/* do nothing macro, not even an extra expansion */</span>
<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>x<span style="color: #666666">=</span>H(__COUNTER__);
<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>y<span style="color: #666666">=</span>H(__COUNTER__);
<span style="color: #3D7B7B; font-style: italic">/* 0 1 with Clang, 1 3 with GCC */</span>
</pre></div>
</div>
<hr>
<hr>
<div id="issue1065">
<h2>Issue 1065: More issues with <code>noreturn</code></h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-05-21<br>
Status: Open<br>
Cross-references: <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1037">1037</a></p>
<p>All of the following questions will be referencing:</p>
<blockquote>
<p>The first declaration of a function shall specify the <code>noreturn</code>
attribute if any declaration of that function specifies the
<code>noreturn</code> attribute. If a function is declared with the <code>noreturn</code>
attribute in one translation unit and the same function is declared
without the <code>noreturn</code> attribute in another translation unit, the
behavior is undefined.</p>
</blockquote>
<p>(C23 6.7.13.7 "The <code>noreturn</code> and <code>_Noreturn</code> attributes" paragraph 3.)</p>
<h3>Question 1</h3>
<p>Do the following two translation units cause undefined behavior?</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #3D7B7B; font-style: italic">/* TU 1*/</span>
[[<span style="color: #008000; font-weight: bold">noreturn</span>]]<span style="color: #B00040">void</span><span style="color: #bbbbbb"> </span>foo();
</pre></div>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #3D7B7B; font-style: italic">/* TU 2 */</span>
[[<span style="color: #008000; font-weight: bold">noreturn</span>]]<span style="color: #B00040">void</span><span style="color: #bbbbbb"> </span>foo();
<span style="color: #B00040">void</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">foo</span>();
</pre></div>
<p>The second translation unit in isolation is fine, but the first
translation unit declares the function with <code>noreturn</code> and the second
translation unit declares it without <code>noreturn</code> in its second
declaration. Therefore it appears that redeclarations are required to
use <code>noreturn</code> too if any other translation unit declares the
function, though that does not seem intended.</p>
<h3>Question 2</h3>
<p>For standard library functions that are specified with <code>noreturn</code>, is
it required that manual declarations specify <code>noreturn</code> too? For
example:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #B00040">void</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">exit</span>(<span style="color: #B00040">int</span>);<span style="color: #3D7B7B; font-style: italic">/* OK in C11, UB in C23? */</span>
<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">main</span>(){
exit(<span style="color: #666666">0</span>);
}
</pre></div>
<p>If the answer to question one is that those translation units are not
valid, then this would also apply to redeclarations after including
the appropriate standard header:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#include</span><span style="color: #3D7B7B; font-style: italic"><stdlib.h></span>
<span style="color: #B00040">void</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">exit</span>(<span style="color: #B00040">int</span>);<span style="color: #3D7B7B; font-style: italic">/* is noreturn needed here? */</span>
</pre></div>
<h3>Question 3</h3>
<p>If the answer to question two is that such functions need not be
manually declared with <code>noreturn</code>, must they be manually declared
without <code>noreturn</code>?</p>
<p>Some existing implementations (for example newlib) define <code>noreturn</code>
functions introduced in C11 using the <code>_Noreturn</code> function specifier
instead of the <code>noreturn</code> attribute, even in C23 which precludes using
<code>noreturn</code> attributes.</p>
</div>
<hr>
<hr>
<div id="issue1066">
<h2>Issue 1066: Duplicate macro definitions with variadic macros</h2>
<p>Authors: Joseph Myers<br>
Date: 2026-05-21<br>
Status: Fixed (pending integration in working draft)<br>
Fixed in: C2Y</p>
<p>C23 6.10.5.1 (Macro replacement) says:</p>
<blockquote>
<p>Likewise, an identifier currently defined as a function-like macro
shall not be redefined by another <code>#define</code> preprocessing directive
unless the second definition is a function-like macro definition
that has the same number and spelling of parameters, and the two
replacement lists are identical.</p>
</blockquote>
<p>This fails to say explicitly that both definitions must be variadic or
both must not be variadic.</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#define F(x)</span>
<span style="color: #9C6500">#define F(x, ...)</span>
</pre></div>
<p>By contrast, for compatibility of function types, 6.7.7.4 says "the
parameter type lists shall agree in the number of parameters and in
use of the final ellipsis".</p>
<h3>Suggested correction</h3>
<p>In C23 6.10.5.1 (Macro replacement), insert text as follows.</p>
<blockquote>
<p>Likewise, an identifier currently defined as a function-like macro
shall not be redefined by another <code>#define</code> preprocessing directive
unless the second definition is a function-like macro definition
that has the same number and spelling of parameters, <ins>the two
definitions agree in use of the final ellipsis,</ins> and the two
replacement lists are identical.</p>
</blockquote>
<hr>
<p>Comment from Issues list maintainer on 2026-08-19:</p>
<p>This issue was handled at the August 2026 (Ottawa) meeting of WG14 via
processing the
<a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3908.htm">N3908</a>
paper rather than through the issue handling process. That paper was
adopted into C2y.</p>
</div>
<hr>
<hr>
<div id="issue1067">
<h2>Issue 1067: Bitwise operators on signed types</h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-05-26<br>
Status: Open</p>
<blockquote>
<p>Some operators (the unary operator <code>~</code>, and the binary operators
<code><<</code>, <code>>></code>, <code>&</code>, <code>^</code>, and <code>|</code>, collectively described as <em>bitwise
operators</em>) are required to have operands that have integer type.
These operators yield values that depend on the internal
representations of integers, and have implementation-defined and
undefined aspects for signed types.</p>
</blockquote>
<p>(C23 6.5.1 "General" paragraph 4.)</p>
<p>This paragraph appears to be a holdover from when ones' complement and
sign magnitude were valid integer representations. Before C23 the
representations of negative values could be different which led to
implementation-defined results from bitwise operators, and attempting
to generate negative zero from bitwise operators would lead to
undefined behavior if it was not supported. Since the representation
is strictly defined and negative zero cannot exist, these issues
cannot exist anymore. Before C23 it was also valid for a two's
complement representation to not support all value bits as zero with a
sign bit of one (the minimum value when supported), which presumably
would cause undefined behavior when attempting to form such a value.
That possibility has similarly been removed.</p>
<h3>Suggested correction</h3>
<p>Delete C23 6.5.1 paragraph 4.</p>
<p>Modify C23 J.3.6 paragraph 1:</p>
<blockquote>
<p>The results of <del>some bitwise
operations</del><ins>right-shifts</ins> on <ins>negative
</ins>signed integers<ins>, including right-shifts of zero</ins>
(6.5.<del>1</del><ins>8</ins>).</p>
</blockquote>
</div>
<hr>
<hr>
<div id="issue1068">
<h2>Issue 1068: Standard pragmas after labels</h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-05-27<br>
Status: Open</p>
<p>All of the standard pragmas contain wording to require use in specific
contexts:</p>
<blockquote>
<p>The pragma can occur either outside external declarations or
preceding all explicit declarations and statements inside a compound
statement.</p>
</blockquote>
<p>(C23 7.3.4 "The <code>CX_LIMITED_RANGE</code> pragma" paragraph 2.)</p>
<blockquote>
<p>The pragma shall occur either outside external declarations or
preceding all explicit declarations and statements inside a compound
statement.</p>
</blockquote>
<p>(C23 7.6.2 "The <code>FENV_ACCESS</code> pragma" paragraph 2.)</p>
<blockquote>
<p>The pragma shall occur either outside external declarations or
before all explicit declarations and statements inside a compound
statement.</p>
</blockquote>
<p>(C23 7.6.3 "The <code>FENV_ROUND</code> pragma" paragraph 2.)</p>
<blockquote>
<p>Each pragma can occur either outside external declarations or
preceding all explicit declarations and statements inside a compound
statement.</p>
</blockquote>
<p>(C23 7.12.3 "The <code>FP_CONTRACT</code> pragma" paragraph 2.)</p>
<p>Before C23, "all explicit declarations and statements" meant that
nothing could be used before these pragmas in a compound statement.
In C23 the definition of block items in a compound statement was
changed so that labels can be used at the end of a block without any
following statement, and can be used preceding a declaration
(<a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2508.pdf">N2508</a>).
Consequently it appears the following is now valid:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">main</span>(){
<span style="color: #767600">label</span>:
<span style="color: #9C6500">#pragma STDC FENV_ACCESS OFF</span>
}
</pre></div>
<p>While even using a null statement before is undefined. It seems
unintended to allow labels to be used like this while placing
restrictions on other block items.</p>
<h3>Suggested correction</h3>
<p>Modify C23 7.3.4 paragraph 2:</p>
<blockquote>
<p>The pragma can occur either outside external declarations or
preceding all <del>explicit declarations and
statements</del><ins>block items</ins> inside a compound statement.</p>
</blockquote>
<p>Modify C23 7.6.2 paragraph 2:</p>
<blockquote>
<p>The pragma shall occur either outside external declarations or
preceding all <del>explicit declarations and
statements</del><ins>block items</ins> inside a compound statement.</p>
</blockquote>
<p>Modify C23 7.6.3 paragraph 2:</p>
<blockquote>
<p>The pragma shall occur either outside external declarations or
before all <del>explicit declarations and statements</del><ins>block
items</ins> inside a compound statement.</p>
</blockquote>
<p>Modify C23 7.12.3 paragraph 2:</p>
<blockquote>
<p>Each pragma can occur either outside external declarations or
preceding all <del>explicit declarations and
statements</del><ins>block items</ins> inside a compound statement.</p>
</blockquote>
<p>Modify C23 J.2 paragraph 1:</p>
<blockquote>
<p>The <code>CX_LIMITED_RANGE</code>, <code>FENV_ACCESS</code><ins>, <code>FENV_ROUND</code>,
<code>FENV_DEC_ROUND</code></ins>, or <code>FP_CONTRACT</code> pragma is used in any
context other than outside all external declarations or preceding
all <del>explicit declarations and statements</del><ins>block
items</ins> inside a compound statement (7.3.4, 7.6.2<ins>, 7.6.3,
7.6.4</ins>, 7.12.3).</p>
</blockquote>
<p>Note: Each of the standard pragmas express these requirements
differently. Since the result is supposed to be undefined if the
requirements are not met, they should probably all use the "shall"
wording.</p>
</div>
<hr>
<hr>
<div id="issue1069">
<h2>Issue 1069: Placemarker preprocessing token concatenation and expansion</h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-05-28<br>
Status: Open</p>
<p>Implementations disagree about the meaning of the following text,
specifically when concatenating a placemarker preprocessing token with
an identifier that was disabled from being expanded:</p>
<blockquote>
<p>For both object-like and function-like macro invocations, before the
replacement list is reexamined for more macro names to replace, each
instance of a <code>##</code> preprocessing token in the replacement list (not
from an argument) is deleted and the preceding preprocessing token
is concatenated with the following preprocessing token. Placemarker
preprocessing tokens are handled specially: concatenation of two
placemarkers results in a single placemarker preprocessing token,
and concatenation of a placemarker with a non-placemarker
preprocessing token results in the non-placemarker preprocessing
token. If the result is not a valid preprocessing token, the
behavior is undefined. The resulting token is available for further
macro replacement. The order of evaluation of <code>##</code> operators is
unspecified.</p>
</blockquote>
<p>(C23 6.10.5.4 "The <code>##</code> operator" paragraph 3.)</p>
<p>Consider the following macros:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#define FOO()FOO</span>
<span style="color: #9C6500">#define CAT(X,Y,...)__VA_OPT__(X)##__VA_OPT__(Y)</span>
</pre></div>
<p><code>FOO()</code> will expand to <code>FOO</code>, but the resulting identifier cannot be
expanded again. Therefore <code>FOO()()</code> will expand to <code>FOO()</code> rather
than <code>FOO</code>. <code>CAT(FOO(),,,)()</code> does the same as <code>FOO()()</code>, but it
concatenates the resulting identifier with a placemarker preprocessing
token before attempting to expand it again. If "The resulting token
is available for further macro replacement." is interpreted as
applying to this concatenation, then it should expand to <code>FOO</code>.
Otherwise, it should expand to <code>FOO()</code>. GCC and EDG expand it to
<code>FOO</code>, but Clang and MSVC expand it to <code>FOO()</code>. The interpretation of
this wording by GCC is not consistent however, see also <a href="https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125145">GCC issue
125145</a>.</p>
<p>I believe the intent here is that concatenating with a placemarker
preprocessing should be effectless, meaning that the result of
<code>CAT(FOO(),,,)()</code> should be <code>FOO()</code>. It would be useful to add
wording to clarify what the result here is.</p>
<h3>Suggested correction</h3>
<p>Modify C23 6.10.5.4 paragraph 3:</p>
<blockquote>
<p>The resulting token is available for further macro replacement<ins>
if neither of the two concatenated tokens are placemarker
preprocessing tokens</ins>.</p>
</blockquote>
</div>
<hr>
<hr>
<div id="issue1070">
<h2>Issue 1070: Evaluation of <code>[static]</code> parameter array lengths</h2>
<p>Authors: Joseph Myers<br>
Date: 2026-05-28<br>
Status: Open<br>
Cross-references: <a href="https://www.open-std.org/jtc1/sc22/wg14/issues/c99/issue0237.html">0237</a>, <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1013">1013</a></p>
<p>C23 6.7.7.4 specifies the meaning of <code>static</code> in parameter array
declarators:</p>
<blockquote>
<p>If the keyword <code>static</code> also appears within the <code>[</code> and <code>]</code> of the
array type derivation, then for each call to the function, the value
of the corresponding actual argument shall provide access to the
first element of an array with at least as many elements as
specified by the size expression.</p>
</blockquote>
<p>The resolution to <a href="https://www.open-std.org/jtc1/sc22/wg14/issues/c99/issue0237.html">issue 0237</a> says that the largest size
value specified by any declaration of that function using <code>static</code> in
the program (not necessary visible at the call) is the one that
applies. However, it is unclear what this means for declarations that
are not definitions of the function, where a non-constant size
expression is treated as replaced by <code>*</code> (note that <code>[static *]</code> is
not valid syntax for an array declarator), because an expression only
has a meaningful value if evaluated at some point in the execution of
the program and there is no point at which such expressions are
evaluated. This covers both obvious cases such as</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #B00040">void</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">f</span>(<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>n,<span style="color: #bbbbbb"> </span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>x[<span style="color: #008000; font-weight: bold">static</span><span style="color: #bbbbbb"> </span>n]);
</pre></div>
<p>from <a href="https://www.open-std.org/jtc1/sc22/wg14/issues/c99/issue0237.html">issue 0237</a> where the precise timing of evaluation
may not be problematic, but also</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #B00040">void</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">f</span>(<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>n,<span style="color: #bbbbbb"> </span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>x[<span style="color: #008000; font-weight: bold">static</span><span style="color: #bbbbbb"> </span><span style="color: #666666">++</span>n]);
</pre></div>
<p>where the side effects from evaluation of <code>++n</code> do not occur, and
block-scope declarations such as</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #B00040">void</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">g</span>()
{
<span style="color: #bbbbbb"> </span><span style="color: #008000; font-weight: bold">if</span><span style="color: #bbbbbb"> </span>(<span style="color: #666666">0</span>)
<span style="color: #bbbbbb"> </span><span style="color: #008000; font-weight: bold">for</span><span style="color: #bbbbbb"> </span>(<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>m<span style="color: #bbbbbb"> </span><span style="color: #666666">=</span><span style="color: #bbbbbb"> </span><span style="color: #666666">1</span>;<span style="color: #bbbbbb"> </span>m<span style="color: #bbbbbb"> </span><span style="color: #666666"><</span><span style="color: #bbbbbb"> </span><span style="color: #666666">10</span>;<span style="color: #bbbbbb"> </span>m<span style="color: #666666">++</span>)<span style="color: #bbbbbb"> </span>{
<span style="color: #bbbbbb"> </span><span style="color: #B00040">void</span><span style="color: #bbbbbb"> </span>f(<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>x[<span style="color: #008000; font-weight: bold">static</span><span style="color: #bbbbbb"> </span>m]);
<span style="color: #bbbbbb"> </span>}
}
</pre></div>
<p>where the <code>static</code> is meant to apply to all calls to <code>f</code> in the
program, but execution never passes through the declaration so there
is never a meaningful value of <code>m</code>.</p>
<h3>Question 1</h3>
<p>Is a length given with <code>static</code> in a parameter array declaration ever
relevant in any context other than a declaration of a function with
that parameter? Some examples of this, including cases where <code>typeof</code>
or a typedef name are used in declaring a function rather than
directly declaring it with a function declarator, are:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span>typeof<span style="color: #bbbbbb"> </span>(<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>(<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>n,<span style="color: #bbbbbb"> </span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>x[<span style="color: #008000; font-weight: bold">static</span><span style="color: #bbbbbb"> </span>n]))<span style="color: #bbbbbb"> </span>f1;
<span style="color: #008000; font-weight: bold">typedef</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">T</span>(<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>n,<span style="color: #bbbbbb"> </span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>x[<span style="color: #008000; font-weight: bold">static</span><span style="color: #bbbbbb"> </span>n]);
T<span style="color: #bbbbbb"> </span>f2;
<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>(<span style="color: #666666">*</span>p3)(<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>n,<span style="color: #bbbbbb"> </span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>x[<span style="color: #008000; font-weight: bold">static</span><span style="color: #bbbbbb"> </span>n]);
</pre></div>
<p>If it is ever relevant (contrary to the direction from <a href="https://www.open-std.org/jtc1/sc22/wg14/issues/c99/issue0237.html">issue
0237</a>) then there would be issues with defining composite
types, as well as the "same type" question from <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1013">issue
1013</a> question 3.</p>
<h3>Question 2</h3>
<p>Is a length given with <code>static</code> that is not an integer constant
expression, in a declaration of a function that is not a definition of
that function (so considered to be replaced by <code>*</code>), ever relevant?
If it is, when is the array length expression considered to be
evaluated (taking into account that the expression may involve side
effects and that objects referenced in that expression may not exist
at the point of the call)?</p>
</div>
<hr>
<hr>
<div id="issue1071">
<h2>Issue 1071: Header names, <code>__has_include</code>, and <code>__has_embed</code></h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-06-02<br>
Status: Open</p>
<p>For this issue, assume the following macros are always defined:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#define E</span>
<span style="color: #9C6500">#define S <</span>
<span style="color: #9C6500">#define C(A,B)A##B</span>
<span style="color: #9C6500">#define H __has_include</span>
<span style="color: #9C6500">#define G __has_include(</span>
<span style="color: #9C6500">#define L (</span>
<span style="color: #9C6500">#define X Y</span>
<span style="color: #9C6500">#define Z <X></span>
</pre></div>
<p>Additionally, assume that the implementation has the header name <code><X></code>
identify a file named <code>X</code> and has the three preprocessing tokens <code><</code>,
<code>Y</code>, and <code>></code> with no whitespace between identify a file named <code>Y</code> when
used in place of a header name. GCC, Clang, MSVC, and EDG all agree
on the behavior of the following:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#include</span><span style="color: #3D7B7B; font-style: italic"><X></span>
<span style="color: #9C6500">#include Z</span>
</pre></div>
<p>Which includes a file named <code>X</code> and then a file named <code>Y</code>. <code><X></code> in
the first <code>#include</code> directive forms a header name, but the second
<code>#include</code> directive does not since the <code><X></code> is not present in the
<code>#include</code> directive. Since the second <code>#include</code> directive does not
form a header name the <code>X</code> inside of the angle brackets gets expanded
to become <code>Y</code>. The macro <code>X</code> here is used to test if a header name is
formed which contains <code>X</code>. Header name formation is also visible with
sequences of characters that can form preprocessing tokens other than
<code><</code> and <code>></code> punctuators:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#include</span><span style="color: #3D7B7B; font-style: italic"><-></span>
<span style="color: #9C6500">#define HYPHEN <-></span>
<span style="color: #9C6500">#include HYPHEN</span>
</pre></div>
<p>The first <code>#include</code> directive can be valid, but the second <code>#include</code>
directive is not valid because <code>HYPHEN</code> gets lexed as two
preprocessing tokens <code><</code> and <code>-></code> rather than three preprocessing
tokens <code><</code>, <code>-</code>, and <code>></code>. Implementations sometimes do not reject
using preprocessing tokens other than <code><</code> and <code>></code> at the beginning and
ending respectively, but the intent seems clear enough that other
punctuator preprocessing tokens cannot be used. In <a href="https://cplusplus.github.io/CWG/issues/3015.html">C++ CWG
3015</a>
and <a href="https://cplusplus.github.io/CWG/issues/3078.html">C++ CWG
3078</a>
the parsing of header names has been clarified there, but no compilers
seem to actually implement those defect reports yet. Most of the
following questions will be using <code>#include</code> and <code>__has_include</code>, but
the same issues exist for <code>#embed</code> and <code>__has_embed</code> as well. In the
following questions, assume that any included file exists and is
valid.</p>
<h3>Question 1</h3>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#include</span><span style="color: #3D7B7B; font-style: italic"><X>E</span>
</pre></div>
<p>Is this valid? That is, if an <code>#include</code> directive does not include
just a header name can the preprocessing tokens inside of it expand to
a header name? GCC, Clang, MSVC, and EDG all accept this as including
a file named <code>X</code>. All further questions assume that this is valid.</p>
<h3>Question 2</h3>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#include E<X></span>
</pre></div>
<p>Does this include a file named <code>X</code> or a file named <code>Y</code>? GCC and EDG
include a file named <code>Y</code>, Clang and MSVC include a file named <code>X</code>.
The wording "within <code>#include</code> and <code>#embed</code> preprocessing directives,
in <code>__has_include</code> and <code>__has_embed</code> expressions" (C23 6.4.1 paragraph
4) is not clear about whether this counts as within the preprocessing
directive. This also applies to <code>__has_include</code>:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#if __has_include(E<X>)</span>
<span style="color: #666666">1</span>
<span style="color: #9C6500">#else</span>
<span style="color: #666666">0</span>
<span style="color: #9C6500">#endif</span>
</pre></div>
<p>Does this test for the existence of a file named <code>X</code> or a file named
<code>Y</code>? GCC and EDG test for the existence of a file named <code>Y</code>, Clang
and MSVC test for the existence of a file named <code>X</code>.</p>
<h3>Question 3</h3>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#include S<X></span>
</pre></div>
<p>If the answer to question two is that <code>#include E<X></code> includes a file
named <code>X</code>, is this valid or invalid and does it expand <code>X</code>? If a
header name is formed, it appears that the result would be invalid.
GCC, Clang, and EDG all accept this as valid and do expand <code>X</code>. MSVC
with its old preprocessor accepts this as valid and does not expand
<code>X</code>. MSVC with its new preprocessor rejects this as invalid. This
also applies to <code>__has_include</code>:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#if __has_include(S<X>)</span>
<span style="color: #666666">1</span>
<span style="color: #9C6500">#else</span>
<span style="color: #666666">0</span>
<span style="color: #9C6500">#endif</span>
</pre></div>
<p>If the answer to question two is that <code>__has_include(E<X>)</code> tests for
the existence of a file named <code>X</code>, is this valid or invalid and does
it expand <code>X</code>? If a header name is formed, it appears that the result
would be invalid. GCC, Clang, and EDG all accept this as valid and do
expand <code>X</code>. MSVC with its old preprocessor accepts this as valid and
does not expand <code>X</code>. MSVC with its new preprocessor rejects this as
invalid.</p>
<h3>Question 4</h3>
<p>Can token concatenation form header names? For example:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#include C(<=,>)</span>
</pre></div>
<p>Does this form the header name <code><=></code> in token concatenation? GCC,
Clang, MSVC, and EDG all do not allow this but the wording in the
standard does not clearly forbid it. If it is possible, the following
is an exhaustive list of all possible header names that could be
formed from concatenation: <code><-></code>, <code><:></code>, <code><%></code>, <code><=></code>, <code><=-></code>, <code><=:></code>,
<code><=%></code>, <code><<></code>, <code><<-></code>, <code><<:></code>, <code><<%></code>, <code><<=></code>, <code><<=-></code>, <code><<=:></code>,
<code><<=%></code>, <code><:-></code>, <code><::></code>, <code><:%></code>, <code><%-></code>, <code><%:></code>, and <code><%%></code>.</p>
<h3>Question 5</h3>
<p>Can <code>__has_include</code>, <code>__has_embed</code>, and <code>__has_c_attribute</code>
expressions be the result of macro expansions?</p>
<blockquote>
<p>The identifiers <code>__has_include</code>, <code>__has_embed</code>, and
<code>__has_c_attribute</code> shall not appear in any context not mentioned in
this subclause.</p>
</blockquote>
<p>(C23 6.10.2 "Conditional inclusion" paragraph 11.)</p>
<p>GCC, Clang, MSVC, and EDG all do not reject macros like <code>H</code>, though it
seems like the above sentence can be construed as making <code>H</code>
undefined. If it should be interpreted as making <code>H</code> undefined, then
in C++ which uses the same wording it should be ill-formed there due
to the different meaning of "shall". Note that there is a significant
amount of code which does roughly the following:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#ifdef __has_include</span>
<span style="color: #9C6500">#define MY_HAS_INCLUDE(...)__has_include(__VA_ARGS__)</span>
<span style="color: #9C6500">#else</span>
<span style="color: #9C6500">#define MY_HAS_INCLUDE(...)0</span>
<span style="color: #9C6500">#endif</span>
</pre></div>
<h3>Question 6</h3>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#if H(<X>)</span>
<span style="color: #666666">1</span>
<span style="color: #9C6500">#else</span>
<span style="color: #666666">0</span>
<span style="color: #9C6500">#endif</span>
</pre></div>
<p>If the answer to question five is that <code>__has_include</code> can be the
result of macro expansions, does this test for the existence of a file
named <code>X</code> or a file named <code>Y</code>? GCC, Clang, MSVC, and EDG all agree
that this tests for the existence of a file named <code>X</code>, even though
reaching such a result requires that translation phase three knows
about macro expansion.</p>
<h3>Question 7</h3>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#if G<X>)</span>
<span style="color: #666666">1</span>
<span style="color: #9C6500">#else</span>
<span style="color: #666666">0</span>
<span style="color: #9C6500">#endif</span>
</pre></div>
<p>If the answer to question five is that <code>__has_include</code> can be the
result of macro expansions, does this test for the existence of a file
named <code>X</code> or a file named <code>Y</code>? GCC, MSVC, and EDG test for the
existence of a file named <code>X</code>, Clang tests for the existence of a file
named <code>Y</code>.</p>
<h3>Question 8</h3>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#if __has_include L<X>)</span>
<span style="color: #666666">1</span>
<span style="color: #9C6500">#else</span>
<span style="color: #666666">0</span>
<span style="color: #9C6500">#endif</span>
</pre></div>
<p>Does this test for the existence of a file named <code>X</code> or a file named
<code>Y</code>? Clang, MSVC, and EDG test for the existence of a file named <code>X</code>,
GCC tests for the existence of a file named <code>Y</code>.</p>
<h3>Question 9</h3>
<p>Depending upon how previous questions are answered, if lexing depends
upon macro definitions then this creates awkward situations in skipped
preprocessing directives:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#if 1</span>
<span style="color: #9C6500">#elif __has_include("\"")</span>
<span style="color: #9C6500">#elif H("\"")</span>
<span style="color: #9C6500">#endif</span>
</pre></div>
<p>Does the skipped <code>__has_include("\"")</code> attempt to form the invalid
header name <code>"\"</code> and then the invalid incomplete string literal? The
wording does not seem to make any distinction of lexing in skipped
preprocessing directives, but GCC and Clang seem to try to form string
literals here despite <code>__has_include</code> being used. MSVC and EDG will
accept any sequence of characters inside of skipped preprocessing
directives, even those that do not form valid preprocessing tokens.
Since <code>H</code> cannot be expanded here, it seems like <code>H("\"")</code> must be
lexed as containing a string literal <code>"\""</code>.</p>
<h3>Question 10</h3>
<p>Can <code>__has_include</code>, <code>__has_embed</code>, and <code>__has_c_attribute</code> expressions be
passed as arguments to macros, and if they can are header names still
formed in <code>__has_include</code> and <code>__has_embed</code>? If it is possible and header
names are still formed, then those header names can be extracted:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#define HEADER__has_include(...)__VA_ARGS__</span>
<span style="color: #9C6500">#define HEADER(...)HEADER##__VA_ARGS__</span>
<span style="color: #9C6500">#if __has_include(HEADER(__has_include(<X>)))</span>
<span style="color: #666666">1</span>
<span style="color: #9C6500">#else</span>
<span style="color: #666666">0</span>
<span style="color: #9C6500">#endif</span>
</pre></div>
<p>GCC, MSVC with its old preprocessor, and EDG test for the existence of
a file named <code>Y</code>, Clang and MSVC with its new preprocessor test for the
existence of a file named <code>X</code>. With the following slight variation:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#define HEADER__has_include</span>
<span style="color: #9C6500">#define HEADER(...)HEADER##__VA_ARGS__</span>
<span style="color: #9C6500">#if __has_include HEADER(__has_include(<X>))</span>
<span style="color: #666666">1</span>
<span style="color: #9C6500">#else</span>
<span style="color: #666666">0</span>
<span style="color: #9C6500">#endif</span>
</pre></div>
<p>MSVC will test for a file named <code>Y</code> in both its old preprocessor and
new preprocessor. GCC, Clang, and EDG all behave the same in this
variation. If header names can be used in arguments to macros, then
they can also be subject to stringization and concatenation. In C++
header names are conditionally allowed to contain backslashes and
quotes, so stringization there mentions header names as needing
escaping. It appears that quoted header names can be concatenated
with an encoding prefix to form a string literal. Header name
formation is also visible in this context with header names such as
<code><)></code> or <code><,></code> since they would otherwise affect how the arguments to
a function-like macro are identified.</p>
<h3>Question 11</h3>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#if __has_embed("something"limit(defined __has_embed))</span>
<span style="color: #666666">1</span>
<span style="color: #9C6500">#else</span>
<span style="color: #666666">0</span>
<span style="color: #9C6500">#endif</span>
</pre></div>
<p>Is this valid? That is, does the defined macro expression get
replaced inside of the <code>__has_embed</code> expression considering it gets
replaced first:</p>
<blockquote>
<p>After all replacements due to macro expansion and evaluations of
defined macro expressions, has_include expressions, has_embed
expressions, and has_c_attribute expressions have been performed,
all remaining identifiers other than <code>true</code> (including those
lexically identical to keywords such as <code>false</code>) are replaced with
the pp-number <code>0</code>, <code>true</code> is replaced with pp-number <code>1</code>, and then
each preprocessing token is converted into a token.</p>
</blockquote>
<p>(C23 6.10.2 "Conditional inclusion" paragraph 13.)</p>
<p>GCC and Clang reject this as invalid, MSVC and EDG do not support
<code>__has_embed</code> yet. C++ explicitly disallows this and it seems like
N3811 wants to disallow it. Though the wording in N3811 would not
actually disallow it if defined macro expressions in <code>__has_embed</code>
expressions get replaced before they are considered.</p>
</div>
<hr>
<hr>
<div id="issue1072">
<h2>Issue 1072: Initialization with string literals</h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-06-03<br>
Status: Open<br>
Cross-references: <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1036">1036</a></p>
<blockquote>
<p>An array of character type can be initialized by a character string
literal or UTF-8 string literal, optionally enclosed in braces.
Successive bytes of the string literal (including the terminating
null character if there is room or if the array is of unknown size)
initialize the elements of the array.</p>
<p>An array with element type compatible with a qualified or
unqualified <code>wchar_t</code>, <code>char16_t</code>, or <code>char32_t</code> can be initialized
by a wide string literal with the corresponding encoding prefix
(<code>L</code>, <code>u</code>, or <code>U</code>, respectively), optionally enclosed in braces.
Successive wide characters of the wide string literal (including the
terminating null wide character if there is room or if the array is
of unknown size) initialize the elements of the array.</p>
</blockquote>
<p>(C23 6.7.11 "Initialization" paragraphs 15 and 16.)</p>
<p>The second quoted paragraph goes out of its way to mention qualified
or unqualified types, so it is clear that:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#include</span><span style="color: #3D7B7B; font-style: italic"><stddef.h></span>
<span style="color: #008000; font-weight: bold">const</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">wchar_t</span><span style="color: #bbbbbb"> </span>x[]<span style="color: #666666">=</span><span style="color: #BA2121">L""</span>;
<span style="color: #B00040">_Atomic</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">wchar_t</span><span style="color: #bbbbbb"> </span>y[]<span style="color: #666666">=</span><span style="color: #BA2121">L""</span>;
</pre></div>
<p>Using <code>const</code> or <code>volatile</code> is valid when initializing with a
<code>wchar_t</code> string literal, but using <code>_Atomic</code> is not valid. The first
quoted paragraph says that the element type of an array type must be a
character type for it to be able to be initialized with a character
string literal or UTF-8 string literal.</p>
<blockquote>
<p>The three types <code>char</code>, <code>signed char</code>, and <code>unsigned char</code> are
collectively called the <em>character types</em>.</p>
</blockquote>
<p>(C23 6.2.5 "Types" paragraph 20.)</p>
<p>If this definition is to be used, then the following is not valid:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #008000; font-weight: bold">const</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">char</span><span style="color: #bbbbbb"> </span>z[]<span style="color: #666666">=</span><span style="color: #BA2121">""</span>;
</pre></div>
<p>Though that clearly is not intended, otherwise it would be impossible
to define any function without <code>__func__</code> being predefined in this
invalid way. Other parts of the standard use the phrasing "qualified
or unqualified character type" and "non-atomic character type" both to
refer to the same set of types, so "character type" on its own is
unclear.</p>
<h3>Question 1</h3>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #008000; font-weight: bold">const</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">char</span><span style="color: #bbbbbb"> </span>a[]<span style="color: #666666">=</span><span style="color: #BA2121">""</span>;
</pre></div>
<p>Is this declaration valid?</p>
<h3>Question 2</h3>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #B00040">_Atomic</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">char</span><span style="color: #bbbbbb"> </span>b[]<span style="color: #666666">=</span><span style="color: #BA2121">""</span>;
</pre></div>
<p>Is this declaration valid? Only MSVC accepts this as being valid, but
MSVC also accepts the clearly invalid <code>_Atomic wchar_t y[]=L"";</code>.</p>
<h3>Question 3</h3>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#include</span><span style="color: #3D7B7B; font-style: italic"><uchar.h></span>
<span style="color: #008000; font-weight: bold">const</span><span style="color: #bbbbbb"> </span>char16_t<span style="color: #bbbbbb"> </span>c[]<span style="color: #666666">=</span><span style="color: #BA2121">u""</span>;
</pre></div>
<p>Is this declaration valid? That is, does "qualified or unqualified
<code>wchar_t</code>, <code>char16_t</code>, or <code>char32_t</code>" mean to include qualified
versions of <code>char16_t</code> and qualified versions of <code>char32_t</code>?</p>
<h3>Question 4</h3>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #B00040">char</span><span style="color: #bbbbbb"> </span>d[]<span style="color: #666666">=</span>{<span style="color: #BA2121">""</span>,};
</pre></div>
<p>Is this declaration valid? See also <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1036">Issue 1036</a>.</p>
<h3>Question 5</h3>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#include</span><span style="color: #3D7B7B; font-style: italic"><uchar.h></span>
<span style="color: #008000; font-weight: bold">enum</span><span style="color: #bbbbbb"> </span>E<span style="color: #666666">:</span>char16_t{e};
<span style="color: #008000; font-weight: bold">enum</span><span style="color: #bbbbbb"> </span>F<span style="color: #666666">:</span>char32_t{f};
<span style="color: #008000; font-weight: bold">enum</span><span style="color: #bbbbbb"> </span>G<span style="color: #666666">:</span>char8_t{g};
<span style="color: #008000; font-weight: bold">enum</span><span style="color: #bbbbbb"> </span>E<span style="color: #bbbbbb"> </span>h[]<span style="color: #666666">=</span><span style="color: #BA2121">u""</span>;
<span style="color: #008000; font-weight: bold">enum</span><span style="color: #bbbbbb"> </span>F<span style="color: #bbbbbb"> </span>i[]<span style="color: #666666">=</span><span style="color: #BA2121">U""</span>;
<span style="color: #008000; font-weight: bold">enum</span><span style="color: #bbbbbb"> </span>G<span style="color: #bbbbbb"> </span>j[]<span style="color: #666666">=</span><span style="color: #BA2121">u8""</span>;
</pre></div>
<p>Is it intended that specifically the last declaration is invalid here?
The wording clearly forbids it but perhaps this discrepancy was not
intended.</p>
</div>
<hr>
<hr>
<div id="issue1073">
<h2>Issue 1073: <code>char</code><em>N</em><code>_t</code> in freestanding</h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-06-03<br>
Status: Open</p>
<p>The header <code><uchar.h></code> is not required to be supported on freestanding
implementations, so the types therein do not need to be defined on
freestanding implementations. However, character constants and string
literals which use those types are still available on freestanding
implementations. Without <code><uchar.h></code> being provided it is not clear
what the types of those expressions should be:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#include</span><span style="color: #3D7B7B; font-style: italic"><stdint.h></span>
<span style="color: #008000; font-weight: bold">typedef</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">uint_least16_t</span><span style="color: #bbbbbb"> </span>T;
<span style="color: #008000; font-weight: bold">typedef</span><span style="color: #bbbbbb"> </span>typeof(<span style="color: #BA2121">u' '</span>)T;
</pre></div>
<p>On a hosted implementation this must be valid, must it also be valid
on a freestanding implementation? If this does not need to be valid
on a freestanding implementation, what is the meaning of a character
constant or a string literal which in either case uses one of the
encoding prefixes <code>u8</code>, <code>u</code>, or <code>U</code>?</p>
</div>
<hr>
<hr>
<div id="issue1074">
<h2>Issue 1074: Feature test macros and freestanding</h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-06-04<br>
Status: Open</p>
<blockquote>
<p>The strictly conforming programs that shall be accepted by a
conforming freestanding implementation that defines
<code>__STDC_IEC_60559_BFP__</code> or <code>__STDC_IEC_60559_DFP__</code> can also use
features in the contents of the standard headers <code><fenv.h></code>,
<code><math.h></code>, and the <code>strto*</code> floating-point numeric conversion
functions (7.24.2) of the standard header <code><stdlib.h></code>, provided the
program does not set the state of the <code>FENV_ACCESS</code> pragma to "on".</p>
</blockquote>
<p>(C23 4 "Conformance" paragraph 8.)</p>
<p>This text is here so that freestanding implementations that define
either <code>__STDC_IEC_60559_BFP__</code> or <code>__STDC_IEC_60559_DFP__</code> must
provide library features associated with those feature test macros.
However, many of the other feature test macros do not have similar
wording. <code>__STDC_IEC_60559_TYPES__</code> can only be defined if
<code>__STDC_IEC_60559_BFP__</code> is defined, <code>__STDC_IEC_60559_DFP__</code> is
defined, or both are defined so this text will also apply.</p>
<h3>Question 1</h3>
<p>If a freestanding implementation does not define
<code>__STDC_NO_COMPLEX__</code>, is it only necessary for the types to be
supported but not the header <code><complex.h></code>? If
<code>__STDC_IEC_60559_COMPLEX__</code> is defined in addition to
<code>__STDC_NO_COMPLEX__</code> not being defined, is it still not necessary for
a freestanding implementation to provide <complex.h>?</p>
<h3>Question 2</h3>
<p>If a freestanding implementation defines <code>__STDC_LIB_EXT1__</code>, is it
only necessary to support <code>rsize_t</code> in <code><stddef.h></code> and <code><string.h></code>
(but not in <code><stdio.h></code>, <code><time.h></code>, or even <code><stdlib.h></code>),
<code>RSIZE_MAX</code> in <code><stdint.h></code>, and the additional functions in
<code><string.h></code>? Notably, it appears that <code>strerror_s</code> and
<code>strerrorlen_s</code> would require support despite <code>strerror</code> not needing
to be supported because it depends upon the locale.</p>
<h3>Question 3</h3>
<p>If a freestanding implementation does not define
<code>__STDC_NO_ATOMICS__</code>, is it only necessary for atomic types to be
supported but not the header <code><stdatomic.h></code>? If so, what would
<code>memory_order_seq_cst</code> semantics on loads and stores mean without
<code><stdatomic.h></code> being provided?</p>
<h3>Question 4</h3>
<p>If a freestanding implementation does not define
<code>__STDC_NO_THREADS__</code>, does that impose no requirements?</p>
<blockquote>
<p>Under a hosted implementation that does not define
<code>__STDC_NO_THREADS__</code>, a program can have more than one <em>thread of
execution</em> (or <em>thread</em>) running concurrently.</p>
</blockquote>
<p>(C23 5.2.2.5 "Multi-threaded executions and data races" paragraph 1.)</p>
<p>It seems like freestanding with multithreading is simply not a
possibility acknowledged by the standard. Note that <code><threads.h></code>
includes <code><time.h></code>, which freestanding implementations also do not
need to support.</p>
<h3>Question 5</h3>
<p>If <tgmath.h> is included on a hosted implementation while
<code>__STDC_NO_COMPLEX__</code> is defined, what happens?</p>
<blockquote>
<p>The header includes the headers <code><math.h></code> and <code><complex.h></code> and
defines several type-generic macros.</p>
</blockquote>
<p>(C23 7.27 "Type-generic math <code><tgmath.h></code>" paragraph 1.)</p>
<p><code><complex.h></code> might not be provided, so might it be invalid to include
<code><tgmath.h></code>? Note that freestanding implementations which define
<code>__STDC_IEC_60559_BFP__</code> or <code>__STDC_IEC_60559_DFP__</code> do not need to
provide <code><tgmath.h></code>, even though <code><math.h></code> is required to be
provided.</p>
<h3>Question 6</h3>
<blockquote>
<p>provided the program does not set the state of the <code>FENV_ACCESS</code>
pragma to "on"</p>
</blockquote>
<p>(C23 4 "Conformance" paragraph 8.)</p>
<p>Does setting the <code>FENV_ACCESS</code> pragma to "default" when the default is
"on" get considered the same as setting the <code>FENV_ACCESS</code> pragma to
"on"? If so, would the default <code>FENV_ACCESS</code> pragma being "on" at the
start be considered the same as setting the <code>FENV_ACCESS</code> pragma to
"on"?</p>
<p>If the <code>FENV_ACCESS</code> pragma was set to "on", would it preclude using
the previously specified features only while it is set to "on" or
would it being set to "on" once preclude using the previously
specified features for the whole translation unit?</p>
</div>
<hr>
<hr>
<div id="issue1075">
<h2>Issue 1075: Empty structure types as standard library types</h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-06-05<br>
Status: Open<br>
Cross-references: <a href="https://www.open-std.org/jtc1/sc22/wg14/issues/c99/issue0212.html">0212</a></p>
<p>Some compilers such as GCC support empty structure types:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">S</span>{};<span style="color: #3D7B7B; font-style: italic">//GCC extension</span>
</pre></div>
<p>Since the standard does not exhaustively define what complete object
types are, it appears that implementation specific types can be
considered complete object types. For example:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">_mbstate</span>{};<span style="color: #3D7B7B; font-style: italic">//GCC extension</span>
<span style="color: #008000; font-weight: bold">typedef</span><span style="color: #bbbbbb"> </span><span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">_mbstate</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">mbstate_t</span>;
</pre></div>
<p>If this definition is used, then the following is not valid:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#include</span><span style="color: #3D7B7B; font-style: italic"><wchar.h></span>
<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">main</span>(){
<span style="color: #B00040">mbstate_t</span><span style="color: #bbbbbb"> </span>s<span style="color: #666666">=</span>{<span style="color: #666666">0</span>};
}
</pre></div>
<p>With GCC specifically since it makes the size zero perhaps it cannot
be considered a complete object type due to:</p>
<blockquote>
<p>Except for bit-fields, objects are composed of contiguous sequences of
one or more bytes, the number, order, and encoding of which are either
explicitly specified or implementation-defined.</p>
</blockquote>
<p>(C23 6.2.6.1 "General" paragraph 2.)</p>
<p>But an implementation which adds at least one padding byte could
definitely consider this to be a complete object type. Were any
constraints on implementation specific types used in standard library
types intended? Note that <a href="https://www.open-std.org/jtc1/sc22/wg14/issues/c99/issue0212.html">DR 212</a> suggests <code>{0}</code> should
be a valid initializer for <code>mbstate_t</code>. Since implementation specific
types are outside of the scope of the standard, there does not appear
to be any specific requirements on their behavior.</p>
</div>
<hr>
<hr>
<div id="issue1076">
<h2>Issue 1076: Bit-field storage issues</h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-06-09<br>
Status: Open<br>
Cross-references: <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1077">1077</a></p>
<h3>Question 1</h3>
<p>Unsigned bit-fields have their representation described as such:</p>
<blockquote>
<p>Values stored in unsigned bit-fields and objects of type <code>unsigned char</code> shall be represented using a pure binary notation.</p>
</blockquote>
<p>(C23 6.2.6.1 "General" paragraph 3.)</p>
<p>However there is no equivalent wording for signed bit-fields, is this
omission intentional? For example, would a gray code representation
of signed bit-fields be valid? More importantly, there does not seem
to be anything guaranteeing that setting all of the bytes of a
structure to zero by using <code>memset</code> will result in its signed
bit-fields each having the value zero.</p>
<h3>Question 2</h3>
<blockquote>
<p>Values stored in bit-fields consist of <em>m</em> bits, where <em>m</em> is the
size specified for the bit-field. The object representation is the
set of <em>m</em> bits the bit-field comprises in the addressable storage
unit holding it.</p>
</blockquote>
<p>(C23 6.2.6.1 "General" paragraph 4.)</p>
<p>What does the addressable storage unit holding a bit-field mean if the
bit-field straddles multiple storage units?</p>
<h3>Question 3</h3>
<blockquote>
<p>The order of allocation of bit-fields within a unit (high-order to
low-order or low-order to high-order) is implementation-defined.</p>
</blockquote>
<p>(C23 6.7.3.2 "Structure and union specifiers" paragraph 13.)</p>
<p>Are the two orders listed here in the parentheses exhaustive? That
is, can other orders be used?</p>
<h3>Question 4</h3>
<blockquote>
<p>A pointer to a structure object, suitably converted, points to its
initial member (or if that member is a bit-field, then to the unit
in which it resides), and vice versa.</p>
</blockquote>
<p>(C23 6.7.3.2 "Structure and union specifiers" paragraph 17.)</p>
<p>For strictly conforming programs, is it even possible to know what the
type of the storage unit is? If not, is there any purpose in trying
to define this?</p>
<p>If the initial member is an unnamed bit-field of width zero, what
storage unit does it reside in? If the first member is an unnamed
bit-field of width zero and the second member is not a bit-field,
there does not even appear to be any storage unit for it to reside in.
In that scenario, perhaps it should be required for a pointer to an
object with that structure type to also point to its second member
when suitably converted.</p>
<h3>Question 5</h3>
<p>Do the bits in the storage units containing a bit-field which are not
part of its object representation matter when accessing its value? For
example:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">main</span>(){
<span style="color: #008000; font-weight: bold">struct</span>{<span style="color: #B00040">unsigned</span><span style="color: #bbbbbb"> </span>x<span style="color: #666666">:1</span>;}a;
<span style="color: #666666">*</span>(<span style="color: #B00040">unsigned</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">char</span><span style="color: #666666">*</span>)<span style="color: #666666">&</span>a<span style="color: #666666">=0</span>;
<span style="color: #008000; font-weight: bold">return</span><span style="color: #bbbbbb"> </span>a.x;
}
</pre></div>
<p>Assume that the one bit used is stored in the first byte, and that the
size of the storage unit containing the bit-field is more than one
byte. Is this guaranteed to return zero, or is it undefined?</p>
<h3>Question 6</h3>
<p>If the answer to question five is that other bits do not matter, how
does copying around structures containing bit-fields by the object
representations work? For example:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">B</span>{<span style="color: #B00040">bool</span><span style="color: #bbbbbb"> </span>b<span style="color: #666666">:1</span>;};
<span style="color: #008000; font-weight: bold">static_assert</span>(<span style="color: #008000; font-weight: bold">sizeof</span>(<span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">B</span>)<span style="color: #666666">==1</span>);
<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">main</span>(){
<span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">B</span><span style="color: #bbbbbb"> </span>c,d;
c.b<span style="color: #666666">=0</span>;
<span style="color: #B00040">unsigned</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">char</span><span style="color: #bbbbbb"> </span>e<span style="color: #666666">=*</span>(<span style="color: #B00040">unsigned</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">char</span><span style="color: #666666">*</span>)<span style="color: #666666">&</span>c;
<span style="color: #666666">*</span>(<span style="color: #B00040">unsigned</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">char</span><span style="color: #666666">*</span>)<span style="color: #666666">&</span>d<span style="color: #666666">=</span>e;
<span style="color: #008000; font-weight: bold">return</span><span style="color: #bbbbbb"> </span>d.b;
}
</pre></div>
<p>If only one bit in <code>c</code> has a defined zero value and the other bits are
indeterminate, it appears that <code>e</code> would have an indeterminate value.
The standard does not have an idea of a partially indeterminate value,
so it appears that the whole object representation of <code>d</code> is
indeterminate making the program undefined if the other bits in <code>c</code>
can be indeterminate. If that were the case, it would break using
<code>memcpy</code> here so I assume it is not the intent.</p>
<h3>Question 7</h3>
<blockquote>
<p>If the value 0 or 1 is stored into a nonzero-width bit-field of type
<code>bool</code>, the value of the bit-field shall compare equal to the value
stored; a <code>bool</code> bit-field has the semantics of a <code>bool</code>.</p>
</blockquote>
<p>(C23 6.7.3.2 "Structure and union specifiers" paragraph 12.)</p>
<p>Should a bit-field of enumerated type compatible with <code>bool</code> have the
same semantics as <code>bool</code>?</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #008000; font-weight: bold">struct</span>{<span style="color: #008000; font-weight: bold">enum</span><span style="color: #666666">:</span><span style="color: #B00040">bool</span>{f}g<span style="color: #666666">:1</span>;}h;
<span style="color: #3D7B7B; font-style: italic">/* assume this bit-field is supported */</span>
<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">main</span>(){
h.g<span style="color: #666666">=2</span>;
<span style="color: #008000; font-weight: bold">return</span><span style="color: #bbbbbb"> </span>h.g;
<span style="color: #3D7B7B; font-style: italic">/* is zero or one returned? */</span>
}
</pre></div>
</div>
<hr>
<hr>
<div id="issue1077">
<h2>Issue 1077: Bit-field expression issues</h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-06-10<br>
Status: Open<br>
Cross-references: <a href="https://www.open-std.org/jtc1/sc22/wg14/issues/c90/issue0120.html">0120</a>, <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1076">1076</a></p>
<p>There have been previous issues raised regarding expressions which use
the values of bit-fields outside of contexts which they occur in
promotions, but those do not seem to be resolved. See also
<a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2958.htm">N2958</a>.</p>
<h3>Question 1</h3>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span>typeof(<span style="color: #666666">0</span>,(<span style="color: #008000; font-weight: bold">struct</span>{<span style="color: #B00040">unsigned</span><span style="color: #bbbbbb"> </span>y<span style="color: #666666">:1</span>;}){}.y)x;
</pre></div>
<p>Is this declaration valid? That is, if the right operand of a comma
operator is a bit-field should the resulting expression be a bit-field
too? This also applies to assignment operators where the left operand
is a bit-field.</p>
<h3>Question 2</h3>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #008000; font-weight: bold">struct</span>{<span style="color: #B00040">unsigned</span><span style="color: #bbbbbb"> </span>z<span style="color: #666666">:1</span>;}s;
<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">main</span>(){
<span style="color: #008000; font-weight: bold">auto</span><span style="color: #bbbbbb"> </span>a<span style="color: #666666">=</span>s.z;
}
</pre></div>
<p>Is this declaration in <code>main</code> valid? That is, should <code>auto</code> type
deduction be valid for bit-fields?</p>
<h3>Question 3</h3>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #008000; font-weight: bold">struct</span>{<span style="color: #B00040">unsigned</span><span style="color: #bbbbbb"> </span>w<span style="color: #666666">:1</span>;}r;
<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">main</span>(){
<span style="color: #008000; font-weight: bold">return</span><span style="color: #bbbbbb"> </span><span style="color: #008000; font-weight: bold">_Generic</span>(r.w,<span style="color: #B00040">int</span><span style="color: #666666">:1</span>,<span style="color: #B00040">unsigned</span><span style="color: #666666">:2</span>,<span style="color: #008000; font-weight: bold">default</span><span style="color: #666666">:3</span>);
}
</pre></div>
<p>What value should be returned from this program? <code>_Generic</code> is the
only context currently which can inspect the types of bit-field
expressions regardless of the answers to the previous questions. GCC
returns three, Clang and MSVC return two.</p>
<h3>Question 4</h3>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#include</span><span style="color: #3D7B7B; font-style: italic"><stdbit.h></span>
<span style="color: #9C6500">#include</span><span style="color: #3D7B7B; font-style: italic"><stdckdint.h></span>
<span style="color: #008000; font-weight: bold">struct</span>{<span style="color: #B00040">unsigned</span><span style="color: #bbbbbb"> </span>b<span style="color: #666666">:1</span>;}a;
<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>c;
<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">main</span>(){
stdc_leading_zeros(a.b);
ckd_add(<span style="color: #666666">&</span>c,a.b,a.b);
}
</pre></div>
<p>Is this program valid? That is, should generic functions be expected
to handle bit-fields? I assume that the <code><tgmath.h></code> functions should
be able to handle bit-fields, since there are no issues with
implementing that. GCC has <code>stdc_leading_zeros</code> here return one,
while Clang has it return <code>UINT_WIDTH</code>.</p>
<h3>Question 5</h3>
<blockquote>
<p>A bit-field is interpreted as having a signed or unsigned integer
type consisting of the specified number of bits.</p>
</blockquote>
<p>(C23 6.7.3.2 "Structure and union specifiers" paragraph 12.)</p>
<p>Must this signed or unsigned integer type have the same signedness as
the type specified in the bit-field declaration? There does not
appear to be anything requiring it, but it would result in a large
change to the range of representable values.</p>
<p>If the type specified in the bit-field declaration is not <code>bool</code> and
the width is one, can this signed or unsigned integer type be <code>bool</code>?
This difference is observable in whether or not conversion to the
bit-field type in assignment will convert using the semantics of
<code>bool</code>. In C2Y this possibility is removed, but it also disallows a
<code>bool</code> bit-field from using the type <code>bool</code> which seems unintended.
Note that GCC still uses the type <code>bool</code> when attempting to observe
the type of a <code>bool</code> bit-field using <code>_Generic</code>, even in C2Y.</p>
<p>Though this does not cause any issues, it may be useful to add
"nonzero-width" to this text like in the next sentence to avoid
implying that an unnamed zero width bit-field has an integer type with
a width of zero.</p>
<h3>Question 6</h3>
<p>If the answers to question one and question two are that those
declarations are valid, then what category of integer type do the
types of bit-fields belong to (standard, extended, or bit-precise)?
For example, would the following be valid?</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #008000; font-weight: bold">typedef</span><span style="color: #bbbbbb"> </span>typeof(<span style="color: #666666">0</span>,(<span style="color: #008000; font-weight: bold">struct</span>{<span style="color: #B00040">unsigned</span><span style="color: #bbbbbb"> </span>d<span style="color: #666666">:1</span>;}){}.d)T;
<span style="color: #008000; font-weight: bold">enum</span><span style="color: #bbbbbb"> </span>E<span style="color: #666666">:</span>T{e};
</pre></div>
<p>Additionally, should <code><stdbit.h></code> and <code><stdckdint.h></code> be expected to
work with <code>T</code>?</p>
<h3>Question 7</h3>
<p>If the answers to question one and question two are that those
declarations are valid, then does the bit-field propagate when using
the type of a bit-field? For example</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">S</span>{<span style="color: #B00040">unsigned</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">_BitInt</span>(<span style="color: #666666">3</span>)<span style="color: #767600">f</span>:<span style="color: #666666">2</span>;};
<span style="color: #008000; font-weight: bold">typedef</span><span style="color: #bbbbbb"> </span>typeof(<span style="color: #666666">0</span>,(<span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">S</span>){}.f)U;
<span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">R</span>{U<span style="color: #bbbbbb"> </span>u;};
<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">main</span>(){
<span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">S</span><span style="color: #bbbbbb"> </span>v<span style="color: #666666">=</span>{};
U<span style="color: #bbbbbb"> </span>g<span style="color: #666666">=</span>{};
<span style="color: #008000; font-weight: bold">typedef</span><span style="color: #bbbbbb"> </span>typeof(<span style="color: #666666">+</span>v.f)V;
<span style="color: #008000; font-weight: bold">typedef</span><span style="color: #bbbbbb"> </span>typeof(<span style="color: #666666">+</span>g)V;
}
</pre></div>
<p>Is the member <code>u</code> of <code>R</code> considered a bit-field? Is <code>typeof(+g)</code>
equivalent to <code>unsigned _BitInt(3)</code> because it gets promoted like a
bit-field? GCC does not seem to do it but, but it is unclear how
<code>typeof(+v.f)</code> should at the same time result in <code>unsigned _BitInt(3)</code>
since it undergoes lvalue conversions which results in the type <code>U</code>
being promoted just like <code>typeof(+g)</code>.</p>
<h3>Question 8</h3>
<p>If the answers to question one and question two are that those
declarations are valid, then is the following valid?</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #008000; font-weight: bold">typedef</span><span style="color: #bbbbbb"> </span>typeof(<span style="color: #666666">0</span>,(<span style="color: #008000; font-weight: bold">struct</span>{<span style="color: #B00040">unsigned</span><span style="color: #bbbbbb"> </span>q<span style="color: #666666">:1</span>;}){}.q)W;
<span style="color: #008000; font-weight: bold">typedef</span><span style="color: #bbbbbb"> </span>typeof(<span style="color: #666666">0</span>,(<span style="color: #008000; font-weight: bold">struct</span>{<span style="color: #B00040">unsigned</span><span style="color: #bbbbbb"> </span>p<span style="color: #666666">:1</span>;}){}.p)W;
</pre></div>
<p>That is, must the same type be generated for these two different
bit-fields? If not, would there be any common initial sequence
between these two structure types?</p>
<h3>Question 9</h3>
<p>If the answers to question one and question two are that those
declarations are valid, then do bit-fields whose type is the type of a
<code>bool</code> bit-field have the same semantics as <code>bool</code>?</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #008000; font-weight: bold">struct</span>{typeof(<span style="color: #666666">0</span>,(<span style="color: #008000; font-weight: bold">struct</span>{<span style="color: #B00040">bool</span><span style="color: #bbbbbb"> </span>m<span style="color: #666666">:1</span>;}){}.m)l<span style="color: #666666">:1</span>;}k;
<span style="color: #3D7B7B; font-style: italic">/* assume this bit-field is supported */</span>
<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">main</span>(){
k.l<span style="color: #666666">=2</span>;
<span style="color: #008000; font-weight: bold">return</span><span style="color: #bbbbbb"> </span>k.l;
<span style="color: #3D7B7B; font-style: italic">/* is zero or one returned? */</span>
}
</pre></div>
<p>See also <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1076">issue 1076</a>, which discusses this but for
enumerated types compatible with <code>bool</code>.</p>
<p>I think it is also worth mentioning that C and C++ diverge on a few
aspects of bit-fields other than just the bit-field type. The program
in <a href="https://www.open-std.org/jtc1/sc22/wg14/issues/c90/issue0120.html">DR 120</a> in C++ may print "0 0", "0 1", "1 0", or "1
1". C++ clearly makes initializations and assignments with values
that are not representable by the bit-field after conversion result in
unspecified values. Note that a <code>bool</code> bit-field in C++ never has
this condition apply, since the conversion happens first before
initialization or assignment so the value will always be
representable. Additionally, C++ makes the following undefined:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #008000; font-weight: bold">struct</span>{<span style="color: #B00040">bool</span><span style="color: #bbbbbb"> </span>h<span style="color: #666666">:1</span>,i<span style="color: #666666">:1</span>;}j;
<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">main</span>(){
(j.h<span style="color: #666666">=1</span>)<span style="color: #666666">+</span>(j.i<span style="color: #666666">=1</span>);
}
</pre></div>
<p>Since it defines unsequenced accesses in terms of memory locations,
and these two bit-fields are part of the same memory location.</p>
</div>
<hr>
<hr>
<div id="issue1078">
<h2>Issue 1078: Valid locations for <code>__VA_ARGS__</code> and <code>__VA_OPT__</code></h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-06-11<br>
Status: Open</p>
<blockquote>
<p>The identifiers <code>__VA_ARGS__</code> and <code>__VA_OPT__</code> shall occur only in
the replacement-list of a function-like macro that uses the ellipsis
notation in the parameters.</p>
</blockquote>
<p>(C23 6.10.5 "Macro replacement" paragraph 5.)</p>
<p>Consider the following program:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#if 1</span>
<span style="color: #9C6500">#elif __VA_ARGS__</span>
__VA_ARGS__
<span style="color: #9C6500">#define A __VA_ARGS__</span>
<span style="color: #9C6500">#define B(...)__VA_ARGS__</span>
<span style="color: #9C6500">#endif</span>
</pre></div>
<p>Are any of these uses of <code>__VA_ARGS__</code> valid? GCC, MSVC, and EDG
accept all of them. Clang rejects only the first use in the skipped
<code>#elif</code> directive, though it accepts the others. GCC will even accept
<code>__VA_ARGS__</code> in <code>#elif</code> directives that are not skipped, see also
<a href="https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125655">GCC issue
125655</a>. The
wording appears to forbid all four uses of <code>__VA_ARGS__</code>, though I
doubt that it is intended for the last use to be invalid. Since the
directive syntax is relaxed for skipped directives, the fourth use of
<code>__VA_ARGS__</code> does not appear to be in a replacement-list. Also, does
concatenation producing <code>__VA_ARGS__</code> or <code>__VA_OPT__</code> count as them
occurring?</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#define X Y##__VA##_ARGS__</span>
<span style="color: #9C6500">#define Y__VA_ARGS__</span>
X
</pre></div>
<p>That is, is it unspecified whether or not this is valid?</p>
</div>
<hr>
<hr>
<div id="issue1079">
<h2>Issue 1079: <code>restrict</code>, <code>_Atomic</code>, and multidimensional arrays</h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-06-12<br>
Status: Open</p>
<blockquote>
<p>Types other than pointer types whose referenced type is an object
type and (possibly multi-dimensional) array types with such pointer
types as element type shall not be restrict-qualified.</p>
</blockquote>
<p>(C23 6.7.4.1 "General" paragraph 2.)</p>
<p>This text does not clearly define whether the following is valid:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #B00040">int</span><span style="color: #666666">*</span><span style="color: #008000; font-weight: bold">restrict</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">_Atomic</span><span style="color: #bbbbbb"> </span>p;
</pre></div>
<p>GCC and MSVC accept it, Clang rejects it. I assume the intent is to
allow it. See also <a href="https://github.com/llvm/llvm-project/issues/24825">LLVM issue
24825</a>, <a href="https://github.com/llvm/llvm-project/issues/37206">LLVM issue
37206</a>, and <a href="https://github.com/llvm/llvm-project/issues/173106">LLVM
issue 173106</a>.
Additionally, it does not seem to allow:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #B00040">int</span><span style="color: #666666">*</span><span style="color: #008000; font-weight: bold">restrict</span><span style="color: #bbbbbb"> </span>q[<span style="color: #666666">1</span>][<span style="color: #666666">1</span>];
</pre></div>
<p>The type <code>int*restrict[1][1]</code> is an array type, but its element type
is not a pointer type. Note that the wording "possibly
multi-dimensional" in parentheses is not modifying the meaning of
element type.</p>
<h3>Suggested correction</h3>
<p>The following suggested correction assumes that "pointer type" does
not include atomic types. Another solution would be to clearly define
"pointer type" as including atomic types, and changing other type
categories in the same way.</p>
<p>Replace C23 6.7.4.1 paragraph 2:</p>
<blockquote>
<p>Types other than:</p>
<ul>
<li>atomic, qualified, or unqualified pointer types whose referenced
types are object types,</li>
<li>and array types whose element types satisfy the previous bullet or
this bullet, recursively</li>
</ul>
<p>shall not be restrict-qualified.(new footnote)</p>
<p>(new footnote) This constraint can also be violated by a conditional
operator (6.5.16) if it attempts to form the type restrict-qualified
<code>void</code>.</p>
</blockquote>
</div>
<hr>
<hr>
<div id="issue1080">
<h2>Issue 1080: <code>_Generic</code> and VLA type compatibility</h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-06-16<br>
Status: Open</p>
<p>According to
<a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3348.pdf">N3348</a>
the following is undefined:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">main</span>(){
<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>n<span style="color: #666666">=2</span>;
<span style="color: #B00040">int</span>(<span style="color: #666666">*</span>v)[n];
<span style="color: #008000; font-weight: bold">_Generic</span>(v,<span style="color: #B00040">int</span>(<span style="color: #666666">*</span>)[<span style="color: #666666">3</span>]<span style="color: #666666">:1</span>);
}
</pre></div>
<p>Presumably, because of the following:</p>
<blockquote>
<p>If the two array types are used in a context which requires them to
be compatible, it is undefined behavior if the two size specifiers
evaluate to unequal values.</p>
</blockquote>
<p>(C23 6.7.7.3 "Array declarators" paragraph 6.)</p>
<p>In this context if they were not compatible the program would be
invalid, so it appears that it is undefined. However, if a default
generic association was added with the exact same expression as the
other generic association:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">main</span>(){
<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>n<span style="color: #666666">=2</span>;
<span style="color: #B00040">int</span>(<span style="color: #666666">*</span>v)[n];
<span style="color: #008000; font-weight: bold">_Generic</span>(v,<span style="color: #B00040">int</span>(<span style="color: #666666">*</span>)[<span style="color: #666666">3</span>]<span style="color: #666666">:1</span>,<span style="color: #008000; font-weight: bold">default</span><span style="color: #666666">:1</span>);
}
</pre></div>
<p>Then even if the types were not compatible, the result would be
exactly the same. Therefore it appears to be defined, since the types
being compatible has no effect. If the expressions of the generic
associations are different and both valid in the surrounding context
is it less clear whether or not it is undefined, since type
compatibility does not affect the validity of the generic selection
but still does affect the result.</p>
<p>Was it intended for the validity (in terms of the behavior being
defined) of the previous two programs to be different, or should they
both be the same? Note that the following is defined, because the
controlling expression is unevaluated:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">main</span>(){
<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>n<span style="color: #666666">=2</span>;
<span style="color: #008000; font-weight: bold">_Generic</span>((<span style="color: #B00040">int</span>(<span style="color: #666666">*</span>)[n])<span style="color: #666666">0</span>,<span style="color: #B00040">int</span>(<span style="color: #666666">*</span>)[<span style="color: #666666">3</span>]<span style="color: #666666">:1</span>);
}
</pre></div>
</div>
<hr>
<hr>
<div id="issue1081">
<h2>Issue 1081: Limitations on extended integer constant expressions</h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-06-16<br>
Status: Open<br>
Cross-references: <a href="https://www.open-std.org/jtc1/sc22/wg14/issues/c90/issue0032.html">0032</a></p>
<blockquote>
<p>An implementation may accept other forms of constant expressions,
called <em>extended constant expressions</em>. It is
implementation-defined whether extended constant expressions are
usable in the same manner as the constant expressions defined in
this document, including whether or not extended integer constant
expressions are considered to be integer constant expressions.</p>
</blockquote>
<p>(C23 6.6 "Constant expressions" paragraph 14.)</p>
<p>This wording does not clearly define limitations on what the
implementation can consider extended integer constant expressions
(beyond the implied requirement that it has to always evaluate to one
value). <a href="https://www.open-std.org/jtc1/sc22/wg14/issues/c90/issue0032.html">DR 32</a> was resolved as comma operators not being
allowed, though the response "The intent of the statement ... is to
allow an implementation to accept syntactic forms, such as might be
generated by the <code>offsetof</code> macro, that may not otherwise be
semantically allowed." does not seem entirely accurate now
considering:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>arr_or_vla[(<span style="color: #B00040">int</span>)<span style="color: #666666">+1.0</span>];
</pre></div>
<p>This is explicitly mentioned as an example of when extended integer
constant expressions can change the semantics, despite not being of a
syntactic form outside of the standard. Was it intended for there to
be any limitations on what can be considered an extended integer
constant expression? Consider:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#include</span><span style="color: #3D7B7B; font-style: italic"><errno.h></span>
<span style="color: #B00040">void</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">other</span>();
<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">main</span>(){
<span style="color: #B00040">char</span>(<span style="color: #666666">*</span>p)[errno<span style="color: #666666">+1</span>];
<span style="color: #008000; font-weight: bold">return</span><span style="color: #bbbbbb"> </span><span style="color: #008000; font-weight: bold">sizeof</span><span style="color: #666666">*</span>(other(),p);
}
</pre></div>
<p>Suppose the implementation knows that <code>main</code> is never named in other
translation units, therefore <code>main</code> can never be reentered. Would it
be valid therefore to treat <code>errno+1</code> as an integer constant
expression since it has a definite result of one? Moreover, even if
other did set <code>errno</code> to one and reenter <code>main</code> could treating
<code>errno+1</code> as an integer constant expression be justified by the fact
that by doing so it removes the possibility of <code>main</code> being reentered?
Also, consider:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#include</span><span style="color: #3D7B7B; font-style: italic"><stdio.h></span>
<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">main</span>(<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>n,<span style="color: #B00040">char</span><span style="color: #666666">**</span>){
<span style="color: #B00040">char</span>(<span style="color: #666666">*</span>q)[n<span style="color: #666666">?</span>n<span style="color: #666666">:1</span>];
<span style="color: #008000; font-weight: bold">sizeof</span><span style="color: #666666">*</span>(puts(<span style="color: #BA2121">"is executed"</span>),q);
}
</pre></div>
<p>If the implementation could somehow guarantee an exact value of <code>n</code>,
could it therefore treat <code>n?n:1</code> as an integer constant expression and
skip printing "is executed"? Another location where this is visible
is the formation of null pointer constants:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#include</span><span style="color: #3D7B7B; font-style: italic"><errno.h></span>
<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">main</span>(){
<span style="color: #B00040">int</span><span style="color: #666666">*</span>r<span style="color: #666666">=</span>errno;
}
</pre></div>
<p>Can an implementation accept <code>errno</code> here as a null pointer constant?</p>
</div>
<hr>
<hr>
<div id="issue1082">
<h2>Issue 1082: Dollar signs in nondigits</h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-06-17<br>
Status: Open</p>
<blockquote>
<p>It is implementation-defined if a <code>$</code> (U+0024, DOLLAR SIGN) may be
used as a nondigit character.</p>
</blockquote>
<p>(C23 6.4.3.1 "General" paragraph 2.)</p>
<p>This is intended to allow dollar signs optionally in identifiers, and
presumably also preprocessing numbers so that they can be used in
concatenation:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#define C(X)X##0$</span>
</pre></div>
<p>However, nondigit is used in other places such as n-char-sequence
which means that:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#include</span><span style="color: #3D7B7B; font-style: italic"><stdio.h></span>
<span style="color: #9C6500">#include</span><span style="color: #3D7B7B; font-style: italic"><stdlib.h></span>
<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">main</span>(){
<span style="color: #B00040">char</span><span style="color: #666666">*</span>p;
strtod(<span style="color: #BA2121">"nan($)."</span>,<span style="color: #666666">&</span>p);
puts(p);
}
</pre></div>
<p>Should have three possible outputs "nan($)." (quiet NaN is not
supported in double), "($)." (quiet NaN is supported in double but
dollar signs are not allowed in nondigits), and "." (quiet NaN is
supported in double and dollar signs are allowed in nondigits). I do
not think it was intended for the parsing of <code>nan(...)</code> to be altered
by allowing dollar signs in identifiers. nondigit is also referenced
in the requirements of a unique mapping in header names, I do not
think that meant to possibly include dollar signs.</p>
<p>GCC, Clang, and MSVC disagree about when dollar signs are allowed in
preprocessing numbers. See also <a href="https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123057">GCC issue
123057</a> and <a href="https://github.com/llvm/llvm-project/issues/171190">LLVM
issue 171190</a>.</p>
<h3>Suggested correction</h3>
<p>Modify C23 6.4.3.1 paragraphs 1 and 2:</p>
<blockquote>
<p><em>identifier-start</em>:</p>
<p><em>nondigit</em><ins><em>-identifier</em></ins></p>
<p>XID_Start character</p>
<p>universal character name of class XID_Start</p>
</blockquote>
<blockquote>
<p><em>identifier-continue</em>:</p>
<p><em>digit</em></p>
<p><em>nondigit</em><ins><em>-identifier</em></ins></p>
<p>XID_Continue character</p>
<p>universal character name of class XID_Continue</p>
</blockquote>
<blockquote>
<p><em>nondigit</em>:</p>
<p>one of</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span>_ a b c d e f g h i j k l m
n o p q r s t u v w x y z
A B C D E F G H I J K L M
N O P Q R S T U V W X Y Z
</pre></div>
</blockquote>
<blockquote>
<p><ins><em>nondigit-identifier</em>:</ins></p>
<p><ins><em>nondigit</em></ins></p>
<p><ins><code>$</code> (if supported)</ins></p>
</blockquote>
<blockquote>
<p>...</p>
</blockquote>
<blockquote>
<p>It is implementation-defined if a <code>$</code> (U+0024, DOLLAR SIGN) may be
used as a nondigit<ins>-identifier</ins> character.</p>
</blockquote>
<p>Modify C23 6.4.9 paragraph 1:</p>
<blockquote>
<p><em>pp-number</em>:</p>
<p><em>digit</em></p>
<p><code>.</code> <em>digit</em></p>
<p><em>pp-number</em> <em>identifier-continue</em></p>
<p><em>pp-number</em> <code>'</code> <em>digit</em></p>
<p><em>pp-number</em> <code>'</code> <em>nondigit</em><ins><em>-identifier</em></ins></p>
<p><em>pp-number</em> <code>e</code> <em>sign</em></p>
<p><em>pp-number</em> <code>E</code> <em>sign</em></p>
<p><em>pp-number</em> <code>p</code> <em>sign</em></p>
<p><em>pp-number</em> <code>P</code> <em>sign</em></p>
<p><em>pp-number</em> <code>.</code></p>
</blockquote>
<p>Note: This change keeps <code>0'$</code> valid, there does not appear to be any
reason to forbid it.</p>
<p>Note: C23 J.5.3 has not been properly updated since initial
standardization to consider that XID_Start characters and XID_Continue
characters are allowed in identifiers, and that <code>$</code> is in the basic
source character set.</p>
</div>
<hr>
<hr>
<div id="issue1083">
<h2>Issue 1083: Whitespace in macro expansions</h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-06-19<br>
Status: Open</p>
<p>For this issue, assume the following macro is always defined:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#define S(...)#__VA_OPT__(__VA_ARGS__)</span>
</pre></div>
<p>There are two contexts where the interaction of macro expansion with
whitespace is visible. The first is how whitespace is handled when
attempting to form header names from sequences of preprocessing
tokens. This is intentionally implementation-defined, so it is up to
the implementation in how it handles this. The second is whitespace
in stringization, and the handling of whitespace is defined clearly
here. For example:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#define X 1+2</span>
<span style="color: #9C6500">#define Y 1 + 2</span>
S(X)
S(Y)
</pre></div>
<p>This results in <code>"1+2"</code> and <code>"1 + 2"</code>. The standard is clear about
this, but implementations disagree about how to handle whitespace when
interacting with arguments or macros which in either case expand to no
preprocessing tokens. GCC, Clang, MSVC, and EDG all agree that when
invoking a macro its arguments do not contain surrounding whitespace:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#define Z(...)__VA_ARGS__</span>
S((Z(<span style="color: #bbbbbb"> </span><span style="color: #666666">1</span><span style="color: #bbbbbb"> </span>)))<span style="color: #3D7B7B; font-style: italic">/* "(1)" not "( 1 )" */</span>
</pre></div>
<h3>Question 1</h3>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#define E</span>
<span style="color: #9C6500">#define F(X,Y)X Y X</span>
<span style="color: #9C6500">#define G(...)__VA_OPT__(E E)__VA_OPT__(__VA_ARGS__)__VA_OPT__(E E)</span>
<span style="color: #9C6500">#define H(X,...)__VA_OPT__(X X)__VA_OPT__(__VA_ARGS__)__VA_OPT__(X X)</span>
<span style="color: #9C6500">#define I(...)__VA_OPT__() __VA_ARGS__ __VA_OPT__()</span>
<span style="color: #9C6500">#define J(...)__VA_OPT__(E) __VA_ARGS__ __VA_OPT__(E)</span>
<span style="color: #9C6500">#define K(X,...)__VA_OPT__(X) __VA_ARGS__ __VA_OPT__(X)</span>
S((E<span style="color: #bbbbbb"> </span><span style="color: #666666">1</span><span style="color: #bbbbbb"> </span>E<span style="color: #666666">+</span>F(,<span style="color: #666666">2</span>)<span style="color: #666666">+</span>G(<span style="color: #666666">3</span>)<span style="color: #666666">+</span>H(,<span style="color: #666666">4</span>)<span style="color: #666666">+</span>I(<span style="color: #666666">5</span>)<span style="color: #666666">+</span>J(<span style="color: #666666">6</span>)<span style="color: #666666">+</span>K(,<span style="color: #666666">7</span>)<span style="color: #666666">+</span>K(<span style="color: #666666">8</span>,<span style="color: #666666">-</span>)))
S((E<span style="color: #bbbbbb"> </span>E)(F(,))(G())(H())(I())(J())(K()))
</pre></div>
<p>What should be the result of these? This is several test cases
combined into one, for simplicity. Here are what different compilers
generate (MSVC only using its new preprocessor):</p>
<ul>
<li>GCC: <code>"( 1 + 2 + 3 + 4 + 5 + 6 + 7 +8 - 8)"</code> and <code>"( )( )()()( )( )( )"</code>.</li>
<li>Clang: <code>"( 1 +2 + 3 +4 +5 + 6 +7 +8 - 8)"</code> and <code>"( )( )( )( )( )( )( )"</code>.</li>
<li>MSVC currently: <code>"( 1 + 2 + 3 + 4 + 5+ 6+ 7+8 -8)"</code> and <code>"( )( )()()( )( )( )"</code>.</li>
<li>MSVC previously: <code>"( 1+2+3+4+5+ 6+7+8 -8)"</code> and <code>"()()()()()()()"</code>.</li>
<li>EDG: <code>"(1 +2 +3+4 +5 +6 +7 +8 - 8)"</code> and <code>"()()()()()()()"</code>.</li>
</ul>
<h3>Question 2</h3>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#define L(X,...)__VA_OPT__(X X)##1##__VA_OPT__(X X)</span>
<span style="color: #9C6500">#define M(X,...)__VA_OPT__(X X)## 1 ##__VA_OPT__(X X)</span>
<span style="color: #9C6500">#define N(X,...)__VA_OPT__(X)##1##__VA_OPT__(X)</span>
<span style="color: #9C6500">#define O(X,...)__VA_OPT__(X)## 1 ##__VA_OPT__(X)</span>
<span style="color: #9C6500">#define P(...)__VA_OPT__()##1##__VA_OPT__()</span>
<span style="color: #9C6500">#define Q(...)__VA_OPT__()## 1 ##__VA_OPT__()</span>
<span style="color: #9C6500">#define R(X,...)X##1##X</span>
<span style="color: #9C6500">#define T(X,...)X## 1 ##X</span>
S((L(,,))(L(,))(M(,,))(M(,))(N(,,))(N(,))(O(,,))(O(,))(P(,))(P())(Q(,))(Q())(R(,))(T(,)))
</pre></div>
<p>What should be the result of this? Here are what different compilers
generate (MSVC only using its new preprocessor):</p>
<ul>
<li>GCC: <code>"( 1 )(1)( 1 )(1)(1)(1)(1)(1)(1)(1)(1)(1)(1)(1)"</code>.</li>
<li>Clang: <code>"(1 )(1 )(1 )(1 )(1)(1)(1)(1)(1)(1)(1)(1)(1)(1)"</code>.</li>
<li>MSVC currently: <code>"(1 )(1)( 1 )( 1)(1)(1)( 1)( 1)(1)(1)( 1)( 1)(1)( 1)"</code>.</li>
<li>MSVC previously: <code>"(1)(1)(1)(1)(1)(1)(1)(1)(1)(1)(1)(1)(1)(1)"</code>.</li>
<li>EDG: <code>"(1 )(1)(1 )(1)(1)(1)(1)(1)(1)(1)(1)(1)(1)(1)"</code>.</li>
</ul>
<p>See also <a href="https://cplusplus.github.io/CWG/issues/1625.html">C++ CWG
1625</a>
and <a href="https://cplusplus.github.io/CWG/issues/2522.html">C++ CWG
2522</a>.</p>
<h3>Question 3</h3>
<p>For macros such as <code>__STDC__</code> or <code>__FILE__</code> which have a defined
expansion of a single token, can whitespace be inserted around them?
For example:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span>S((__STDC__))
</pre></div>
<p>Must this expand to <code>"(1)"</code>, or can it expand to any of <code>"( 1)"</code>, <code>"(1 )"</code>,
and <code>"( 1 )"</code> as well?</p>
</div>
<hr>
<hr>
<div id="issue1084">
<h2>Issue 1084: Unspecified evaluation order of <code>#</code> and <code>##</code></h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-06-19<br>
Status: Open</p>
<blockquote>
<p>The order of evaluation of <code>#</code> and <code>##</code> operators is unspecified.</p>
</blockquote>
<p>(C23 6.10.5.3 "The <code>#</code> operator" paragraph 4.)</p>
<p>This intends to make the following unspecified:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#define F(X,Y)X###Y</span>
</pre></div>
<p>However, the way this works if <code>##</code> is evaluated first is unclear.
For the following questions assume that <code>F</code> and the following macro
are always defined:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#define S(...)#__VA_OPT__(__VA_ARGS__)</span>
</pre></div>
<h3>Question 1</h3>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span>S(F(,<span style="color: #666666">0</span>))
</pre></div>
<p>If <code>#</code> is evaluated first the result is clear, a placemarker
preprocessing token is concatenated with <code>"0"</code> which results in <code>"0"</code>
so stringizing that results in <code>"\"0\""</code>. If the <code>##</code> is evaluated
first then the placemarker preprocessing token is concatenated with a
<code>#</code> punctuator preprocessing token producing a <code>#</code> punctuator
preprocessing token. However, since the parameter <code>Y</code> was preceded by
a <code>#</code> punctuator preprocessing token in the replacement-list it will
not be expanded as usual and will instead be subject to stringization:</p>
<blockquote>
<p>If, in the replacement list, a parameter is immediately preceded by
a <code>#</code> preprocessing token, both are replaced by a single character
string literal preprocessing token that contains the spelling of the
preprocessing token sequence for the corresponding argument
(excluding placemarker tokens).</p>
</blockquote>
<p>(C23 6.10.5.3 "The <code>#</code> operator" paragraph 2.)</p>
<p>This does not make an exception for when the <code>#</code> punctuator
preprocessing token was concatenated, so it appears the <code>"0"</code> is still
formed. It is less clear if the <code>#</code> punctuator preprocessing token
created from concatenation should be removed too. If the <code>##</code> is
evaluated first, should the result be <code>"\"0\""</code>, <code>"#\"0\""</code>, or
something else?</p>
<h3>Question 2</h3>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span>S(F(<span style="border: 1px solid #FF0000">#</span>,<span style="color: #666666">0</span>))
</pre></div>
<p>Assume the <code>##</code> is evaluated first for this question. Should the
result be <code>"#\"0\""</code>, <code>"##\"0\""</code>, or something else?</p>
</div>
<hr>
<hr>
<div id="issue1085">
<h2>Issue 1085: Non-finite values in arithmetic constant expressions</h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-06-23<br>
Status: Open<br>
Cross-references: <a href="https://www.open-std.org/jtc1/sc22/wg14/issues/c90/issue0025.html">0025</a></p>
<blockquote>
<p>Each constant expression shall evaluate to a constant that is in the
range of representable values for its type.</p>
</blockquote>
<p>(C23 6.6 "Constant expressions" paragraph 4.)</p>
<p>The range of representable values of a floating type is defined as
such:</p>
<blockquote>
<p>The minimum range of representable values for a floating type is the
most negative finite floating-point number representable in that type
through the most positive finite floating-point number representable
in that type. In addition, if negative infinity is representable in a
type, the range of that type is extended to all negative real numbers;
likewise, if positive infinity is representable in a type, the range
of that type is extended to all positive real numbers.</p>
</blockquote>
<p>(C23 5.3.5.3.3 "Characteristics of floating types" paragraph 19.)</p>
<p>The range of representable values is only described as including real
numbers, which infinities and NaNs are by definition not. Therefore
it appears that an expression with a non-finite value cannot be used
in a context which requires constant expressions. I assume this is
not the intent though, since <code>INFINITY</code> and <code>NAN</code> are required to be
arithmetic constant expressions if they are defined.</p>
<p>A correction should also consider clarifying if "its type" refers to
the semantic type or the type considering <code>FTL_EVAL_METHOD</code>. That is,
if the extra range can be used when the semantic type does not support
infinities.</p>
</div>
<hr>
<hr>
<div id="issue1086">
<h2>Issue 1086: Questions about infinity</h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-06-23<br>
Status: Open</p>
<p>There is a notion of an unsigned infinity:</p>
<blockquote>
<p>In addition, floating types may be able to contain other kinds of
floating-point numbers, such as subnormal floating-point numbers and
unnormalized floating-point numbers, and values that are not
floating-point numbers, such as NaNs and (signed and unsigned)
infinities.</p>
</blockquote>
<p>(C23 5.3.5.3.3 "Characteristics of floating types" paragraph 8.)</p>
<p>However, the meaning of an unsigned infinity does not seem to have
been considered throughout the standard. Second, it appears that
negative infinity and positive infinity can be supported
independently:</p>
<blockquote>
<p>In addition, if negative infinity is representable in a type, the
range of that type is extended to all negative real numbers;
likewise, if positive infinity is representable in a type, the range
of that type is extended to all positive real numbers.</p>
</blockquote>
<p>(C23 5.3.5.3.3 "Characteristics of floating types" paragraph 19.)</p>
<p>If both had to be supported at the same time, then it would not make
sense to mention each individually here.</p>
<h3>Question 1</h3>
<p>If positive infinity is supported in <code>float</code> but negative infinity is
not supported in <code>float</code>, what does trying to negate positive infinity
or using <code>copysign</code> to attempt to create negative infinity yield?
This also applies to <code>strtod("-inf",0)</code> if <code>double</code> supports positive
infinity but not negative infinity.</p>
<h3>Question 2</h3>
<p>If negative infinity is supported in <code>float</code> but positive infinity is
not supported in <code>float</code>, what does trying to negate negative infinity
or using <code>copysign</code> to attempt to create positive infinity yield?
Additionally, what would the result of <code>strtod("inf",0)</code> be if
<code>double</code> supports negative infinity but not positive infinity? Though
the wording does just say:</p>
<blockquote>
<p>A character sequence <code>INF</code> or <code>INFINITY</code> is interpreted as an
infinity, if representable in the return type, else like a floating
constant that is too large for the range of the return type.</p>
</blockquote>
<p>(C23 7.24.2.6 "The <code>strtod</code>, <code>strtof</code>, and <code>strtold</code> functions" paragraph 5.)</p>
<p>Which does not specify the sign of the infinity, even if both signs
are supported. If it results in negative infinity, then
<code>strtod("-inf",0)</code> instead will attempt to form positive infinity.</p>
<h3>Question 3</h3>
<p>Can signed infinities and an unsigned infinity be representable at the
same time? If so, that would lead to lots of questions about whether
signed or unsigned infinities should be used in contexts such as
<code>INFINITY</code>. For all following questions, assume that the only
infinity supported in both <code>float</code> and <code>double</code> is unsigned infinity.</p>
<h3>Question 4</h3>
<p>As previously quoted, the range of representable values is affected by
signed infinities. Was it meant to be affected by unsigned infinity
as well? For example, this affects whether <code>int</code> to <code>float</code>
conversions are defined when the <code>int</code> has a value greater than
<code>FLT_MAX</code>.</p>
<h3>Question 5</h3>
<p>How does unsigned infinity work in comparisons? In particular, can
unsigned infinity be negative by comparing less than zero?</p>
<h3>Question 6</h3>
<blockquote>
<p>The <code>isinf</code> macro determines whether its argument value is (positive
or negative) infinity.</p>
</blockquote>
<p>(C23 7.12.4.5 "The <code>isinf</code> macro" paragraph 2.)</p>
<p>Should <code>isinf(INFINITY)</code> be zero since it does not mention unsigned
infinity? Note that <code>iszero</code> says "(positive, negative, or unsigned)
zero" instead to clearly include unsigned zero.</p>
<h3>Question 7</h3>
<p>Should <code>%f</code> with unsigned infinity contain a minus sign or not? Is it
unspecified? It appears the result of <code>signbit(INFINITY)</code> is
implementation-defined, so perhaps it should be
implementation-defined.</p>
</div>
<hr>
<hr>
<div id="issue1087">
<h2>Issue 1087: Reentering variably modified declaration</h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-06-24<br>
Status: Open</p>
<p>Considering the following program:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#include</span><span style="color: #3D7B7B; font-style: italic"><stddef.h></span>
<span style="color: #B00040">char</span>(<span style="color: #666666">**</span>foo(<span style="color: #B00040">size_t</span><span style="color: #bbbbbb"> </span>x))[]{
<span style="color: #008000; font-weight: bold">static</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">char</span>(<span style="color: #666666">*</span>p)[x];
<span style="color: #008000; font-weight: bold">return</span><span style="color: #666666">&</span>p;
}
<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>main(){
<span style="color: #B00040">char</span>(<span style="color: #666666">**</span>a)[<span style="color: #666666">1</span>]<span style="color: #666666">=</span>foo(<span style="color: #666666">1</span>);
<span style="color: #666666">*</span>a;<span style="color: #3D7B7B; font-style: italic">/* lengths match, valid */</span>
<span style="color: #B00040">char</span>(<span style="color: #666666">**</span>b)[<span style="color: #666666">2</span>]<span style="color: #666666">=</span>foo(<span style="color: #666666">2</span>);
<span style="color: #666666">*</span>b;<span style="color: #3D7B7B; font-style: italic">/* ? */</span>
<span style="color: #666666">*</span>a;<span style="color: #3D7B7B; font-style: italic">/* ? */</span>
}
</pre></div>
<p>The first time the declaration of <code>p</code> is reached, <code>x</code> has value one so
it creates a pointer to an array of one <code>char</code>. The first <code>*a</code> should
therefore be valid, since the length expressions have the same value.
The second time the declaration of <code>p</code> is reached, <code>x</code> has a value two
which is different than the previous time the declaration of <code>p</code> was
reached. The result of that is unclear, the following are some
possible results:</p>
<ul>
<li>The behavior is undefined by calling <code>foo(2)</code>.</li>
<li>The old length is preserved in the effective type, <code>*b</code> is undefined
and the second <code>*a</code> is valid.</li>
<li>The new length is used in the effective type, <code>*b</code> is valid and the
second <code>*a</code> is undefined.</li>
<li>Both lengths are considered valid, <code>*b</code> is valid and the second <code>*a</code> is valid.</li>
</ul>
<p>The first interpretation could be justified by:</p>
<blockquote>
<p>All declarations that refer to the same object or function shall have
compatible type; otherwise, the behavior is undefined.</p>
</blockquote>
<p>(C23 6.2.7 "Compatible type and composite type" paragraph 2.)</p>
<p>Though this text was present in initial standardization before
variable length arrays existed, and presumably is intended to apply to
identifiers with linkage rather than this scenario. It would also
make being able to use variably modified types with static storage
duration or thread storage duration almost entirely useless. What is
the intended result of this program? This is also observable with
automatic storage duration when using <code>goto</code>:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">main</span>(){
<span style="color: #B00040">char</span>(<span style="color: #666666">**</span>c)[<span style="color: #666666">1</span>],(<span style="color: #666666">**</span>d)[<span style="color: #666666">2</span>];
<span style="color: #767600">l</span>:;
<span style="color: #B00040">char</span>(<span style="color: #666666">*</span>q)[<span style="color: #666666">++</span>(<span style="color: #008000; font-weight: bold">static</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">int</span>){}];
<span style="color: #008000; font-weight: bold">if</span>(<span style="color: #008000; font-weight: bold">sizeof</span>(<span style="color: #666666">*</span>q)<span style="color: #666666">==1</span>){
c<span style="color: #666666">=&</span>q;
<span style="color: #666666">*</span>c;<span style="color: #3D7B7B; font-style: italic">/* lengths match, valid */</span>
<span style="color: #008000; font-weight: bold">goto</span><span style="color: #bbbbbb"> </span>l;
}<span style="color: #008000; font-weight: bold">else</span>{
d<span style="color: #666666">=&</span>q;
<span style="color: #666666">*</span>d;<span style="color: #3D7B7B; font-style: italic">/* ? */</span>
<span style="color: #666666">*</span>c;<span style="color: #3D7B7B; font-style: italic">/* ? */</span>
}
}
</pre></div>
<p>Note that the object must have variably modified but not variable
length array type for this scenario, an object with variable length
array type does not exist for the entire block that contains it.</p>
</div>
<hr>
<hr>
<div id="issue1088">
<h2>Issue 1088: Objects with temporary lifetime sharing storage</h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-06-25<br>
Status: Open<br>
Cross-references: <a href="https://www.open-std.org/jtc1/sc22/wg14/issues/c11c17/issue0452.html">0452</a></p>
<p>This issue comes from <a href="https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121376">GCC issue
121376</a>.
Consider the following program:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">main</span>(){
<span style="color: #008000; font-weight: bold">struct</span>{<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>x[<span style="color: #666666">1</span>];}x<span style="color: #666666">=</span>{};
<span style="color: #B00040">int</span><span style="color: #666666">*</span>p;
<span style="color: #008000; font-weight: bold">return</span><span style="color: #bbbbbb"> </span>p<span style="color: #666666">=</span>(<span style="color: #666666">0</span>,x).x,<span style="color: #666666">*</span>x.x<span style="color: #666666">=1</span>,<span style="color: #666666">*</span>p;
}
</pre></div>
<p>A structure object <code>x</code> containing an array of one integer with the
value zero is created. A structure object with temporary lifetime
whose value is the same as <code>x</code> is created by the expression <code>(0,x)</code>.
A pointer <code>p</code> is created which refers to the integer object inside of
the structure object with temporary lifetime. The integer object
inside of <code>x</code> is assigned the value one. The value of the object
pointed to by <code>p</code> is returned from <code>main</code>. Following these steps it
appears that the result should be zero, which is what Clang returns.
GCC and MSVC instead return one, because they do not give different
addresses to the structure object with temporary lifetime and <code>x</code>.
<a href="https://www.open-std.org/jtc1/sc22/wg14/issues/c11c17/issue0452.html">DR 452</a> considered the case of comparing the addresses,
which is inconsequential so it added the wording:</p>
<blockquote>
<p>An object with temporary lifetime behaves as if it were declared with
the type of its value for the purposes of effective type. Such an
object may not have a unique address.</p>
</blockquote>
<p>(C23 6.2.4 "Storage durations of objects" paragraph 8.)</p>
<p>The structure object with temporary lifetime does not have a unique
address, but <code>x</code> does have a unique address. So it appears that they
cannot share addresses, otherwise the uniquity of <code>x</code> would be
violated. Regardless, the response to <a href="https://www.open-std.org/jtc1/sc22/wg14/issues/c11c17/issue0452.html">DR 452</a> indicates
that they actually can share addresses. Though doing so in this
scenario causes a mutable object to overlap with another object, which
in combination with:</p>
<blockquote>
<p>Any attempt to modify an object with temporary lifetime results in
undefined behavior.</p>
</blockquote>
<p>(C23 6.2.4 "Storage durations of objects" paragraph 8.)</p>
<p>It appears that modifying <code>x</code> could be considered modifying the
structure object with temporary lifetime, causing undefined behavior.</p>
<h3>Question 1</h3>
<p>Can objects with temporary lifetime overlap with objects other than
string literals, objects created from compound literals with <code>const</code>
qualified type, and other objects with temporary lifetime?</p>
<h3>Question 2</h3>
<p>If the answer to question one is that objects with temporary lifetime
can overlap with those objects, does mutating an object which it
overlaps with cause undefined behavior?</p>
<h3>Question 3</h3>
<p>If the answer to question one is that objects with temporary lifetime
can overlap with those objects, are there any limitations on what
objects can be overlapped with? For example:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#include</span><span style="color: #3D7B7B; font-style: italic"><stdio.h></span>
<span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">X</span>{<span style="color: #B00040">char</span><span style="color: #bbbbbb"> </span>x[<span style="color: #666666">32</span>];};
<span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">X</span><span style="color: #bbbbbb"> </span>get(){
<span style="color: #008000; font-weight: bold">return</span>(<span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">X</span>){<span style="color: #BA2121">"a string"</span>};
}
<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>main(){
puts(get().x);
}
</pre></div>
<p>Is there anything preventing the structure object with temporary
lifetime here from overlapping with some object that gets modified
during the execution of <code>puts</code>?</p>
</div>
<hr>
<hr>
<div id="issue1089">
<h2>Issue 1089: <code>offsetof</code> and <code>va_arg</code> handling of commas outside of parentheses</h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-06-26<br>
Status: Open</p>
<p><code>offsetof</code> contains wording to forbid the following:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#include</span><span style="color: #3D7B7B; font-style: italic"><stddef.h></span>
<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">main</span>(){
offsetof(<span style="color: #008000; font-weight: bold">struct</span>{<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>x,y;},y);
}
</pre></div>
<blockquote>
<p><code>offsetof(</code><em>type</em><code>,</code> <em>member-designator</em><code>)</code></p>
<p>which expands to an integer constant expression that has type
<code>size_t</code>, the value of which is the offset in bytes, to the
subobject (designated by <em>member-designator</em>), from the beginning of
any object of type <em>type</em>. The type and member designator shall be
such that given</p>
<p><code>static</code> <em>type</em> <code>t;</code></p>
<p>then the expression <code>&(t.</code><em>member-designator</em><code>)</code> evaluates to an
address constant. If the specified type name contains a comma not
between matching parentheses or if the specified member is a
bit-field, the behavior is undefined.</p>
</blockquote>
<p>(C23 7.21 "Common definitions <code><stddef.h></code>" paragraph 4.)</p>
<p>However, there does not appear to be any equivalent wording for
<code>va_arg</code>:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#include</span><span style="color: #3D7B7B; font-style: italic"><stdarg.h></span>
<span style="color: #B00040">void</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">f</span>(...){
<span style="color: #B00040">va_list</span><span style="color: #bbbbbb"> </span>v;
va_start(v);
va_arg(v,<span style="color: #008000; font-weight: bold">struct</span>{<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>a,b;});<span style="color: #3D7B7B; font-style: italic">/* OK? */</span>
va_arg(v,<span style="color: #B00040">char</span>(<span style="color: #666666">*</span>)[<span style="color: #666666">0?1</span>,<span style="color: #666666">2:3</span>]);<span style="color: #3D7B7B; font-style: italic">/* OK? */</span>
va_arg(v,<span style="color: #B00040">char</span>(<span style="color: #666666">*</span>)[(constexpr<span style="color: #bbbbbb"> </span><span style="color: #B00040">int</span>){<span style="color: #666666">1</span>,}]);<span style="color: #3D7B7B; font-style: italic">/* OK? */</span>
va_arg(v,<span style="color: #B00040">int</span>[[,]]);<span style="color: #3D7B7B; font-style: italic">/* OK? */</span>
va_end(v);
}
</pre></div>
<p>And <code>offsetof</code> does not have wording to forbid commas outside of
parentheses in the member-designator:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#include</span><span style="color: #3D7B7B; font-style: italic"><stddef.h></span>
<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">main</span>(){
<span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">S</span>{<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>z[<span style="color: #666666">4</span>];};
offsetof(<span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">S</span>,z[<span style="color: #666666">0?1</span>,<span style="color: #666666">2:3</span>]);<span style="color: #3D7B7B; font-style: italic">/* OK? */</span>
offsetof(<span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">S</span>,z[(constexpr<span style="color: #bbbbbb"> </span><span style="color: #B00040">int</span>){<span style="color: #666666">1</span>,}]);<span style="color: #3D7B7B; font-style: italic">/* OK? */</span>
}
</pre></div>
<p>Existing implementations reject both of these uses just like commas
outside of parentheses in the type of <code>offsetof</code>. I assume the intent
is to not allow these uses. A correction should consider that macros
can expand to include commas outside of parentheses as well:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#include</span><span style="color: #3D7B7B; font-style: italic"><stdarg.h></span>
<span style="color: #9C6500">#define T int[[,]]</span>
<span style="color: #B00040">void</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">g</span>(...){
<span style="color: #B00040">va_list</span><span style="color: #bbbbbb"> </span>w;
va_start(w);
va_arg(w,T);
va_end(w);
}
</pre></div>
<p>This would break with a definition of <code>va_arg</code> such as:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#define __va_arg(list,type)</span><span style="color: #3D7B7B; font-style: italic">/*...*/</span>
<span style="color: #9C6500">#define va_arg(list,type)__va_arg(list,type)</span>
</pre></div>
<p>Since <code>T</code> will already be expanded by the time <code>__va_arg</code> begins
expansion. It may also be useful to add wording that clearly forbids
expressions from containing commas outside of parentheses, for any
standard library macro (other than <code>assert</code>). This has always been
implied, but does not actually appear to be stated.</p>
</div>
<hr>
<hr>
<div id="issue1090">
<h2>Issue 1090: Pointer arithmetic involving flexible array members</h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-06-30<br>
Status: Open<br>
Cross-references: <a href="https://www.open-std.org/jtc1/sc22/wg14/issues/c99/issue0282.html">0282</a>, <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1104">1104</a></p>
<p>Consider the following:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">S</span>{<span style="color: #B00040">char</span><span style="color: #bbbbbb"> </span>x,y[];};
<span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">S</span><span style="color: #bbbbbb"> </span>s;
<span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">S</span><span style="color: #666666">*</span>p<span style="color: #666666">=&</span>s<span style="color: #666666">+1</span>;
</pre></div>
<blockquote>
<p>For the purposes of these operators, a pointer to an object that is
not an element of an array behaves the same as a pointer to the
first element of an array of length one with the type of the object
as its element type.</p>
</blockquote>
<p>(C23 6.5.7 "Additive operators" paragraph 8.)</p>
<p>This wording assumes that for any object of type <em>T</em> which is not part
of an array, there can exist an object whose type is <em>T</em><code>[1]</code>.
However, this assumption is broken with flexible array members:</p>
<blockquote>
<p>A structure or union shall not contain a member with incomplete or
function type (hence, a structure shall not contain an instance of
itself, but may contain a pointer to an instance of itself), except
that the last member of a structure with more than one named member
may have incomplete array type; such a structure (and any union
containing, possibly recursively, a member that is such a structure)
shall not be a member of a structure or an element of an array.</p>
</blockquote>
<p>(C23 6.7.3.2 "Structure and union specifiers" paragraph 3.)</p>
<p>Moreover, for a pointer one past the end of this hypothetical array to
be formed it would need to know the true size of the flexible array
member. GCC, Clang, and MSVC all allow the original example but
obviously cannot do this so they just advance by the size of the
structure. The consequence of this is that the resulting pointer can
end up pointing into the flexible array of the object which it should
be pointing one past.</p>
<p>No suggested correction is provided due to significant wording changes
in <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3517.htm">N3517</a>
and
<a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3322.pdf">N3322</a>.
The following is a possible resolution to this issue without any
specific wording:</p>
<ul>
<li>Let <em>s</em> be any type such that <code>typeof_unqual(</code><em>s</em><code>)</code> is a complete structure
type or complete union type which in either case cannot be the element
type of an array type.</li>
<li>Let <em>a</em> be any valid value of type <em>s</em><code>*</code> that points to an object of type <em>s</em>.</li>
<li>Let <em>b</em> be any valid value of type <em>s</em><code>*</code> which is unequal to <em>a</em>.</li>
<li>Let <em>n</em> be any nonzero integer.</li>
<li><em>a</em><code>+0</code>, <code>0+</code><em>a</em>, and <em>a</em><code>-0</code> are always defined and result in <em>a</em>.</li>
<li><em>a</em><code>+</code><em>n</em>, <em>n</em><code>+</code><em>a</em>, and <em>a</em><code>-</code><em>n</em> are always undefined.</li>
<li><em>a</em><code>-</code><em>a</em> is always defined and results in zero.</li>
<li><em>a</em><code>-</code><em>b</em> and <em>b</em><code>-</code><em>a</em> are always undefined.</li>
<li><em>a</em><code>[0]</code> and <code>0[</code><em>a</em><code>]</code> are always defined and are equivalent to <code>*</code><em>a</em>.</li>
<li><em>a</em><code>[</code><em>n</em><code>]</code> and <em>n</em><code>[</code><em>a</em><code>]</code> are always undefined.</li>
</ul>
<p>Preserving pointer arithmetic with zero seems useful, at least to
continue to keep <em>a</em><code>[0]</code> valid as used in the idiom <code>&</code><em>a</em><code>[0]</code>.
Additionally with
<a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3322.pdf">N3322</a>
being accepted, it would not make sense to forbid this when even null
pointers allow for pointer arithmetic with zero. Allowing <em>a</em><code>+1</code> with
the current behavior given by GCC, Clang, and MSVC does not seem
useful however. For some context, consider the following:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#include</span><span style="color: #3D7B7B; font-style: italic"><stddef.h></span>
<span style="color: #9C6500">#include</span><span style="color: #3D7B7B; font-style: italic"><stdlib.h></span>
<span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">T</span>{<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>i;<span style="color: #B00040">short</span><span style="color: #bbbbbb"> </span>s;<span style="color: #B00040">char</span><span style="color: #bbbbbb"> </span>c[];};
<span style="color: #008000; font-weight: bold">static_assert</span>(<span style="color: #008000; font-weight: bold">sizeof</span>(<span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">T</span>)<span style="color: #666666">==8</span>);
<span style="color: #008000; font-weight: bold">static_assert</span>(offsetof(<span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">T</span>,c)<span style="color: #666666">==6</span>);
<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">main</span>(){
<span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">T</span><span style="color: #666666">*</span>q<span style="color: #666666">=</span>malloc(<span style="color: #3D7B7B; font-style: italic">/* ? */</span>);
<span style="color: #008000; font-weight: bold">if</span>(q){
<span style="color: #666666">*</span>q<span style="color: #666666">-></span>c<span style="color: #666666">=0</span>;
free(q);
}
}
</pre></div>
<p>Suppose these <code>static_assert</code> declarations succeed, what is the minimum
size to ensure that the behavior of this program is defined? Here
would be three ways of calculating that size:</p>
<ol>
<li><code>offsetof(struct T,c)+1</code> which says the minimum size is seven.</li>
<li><code>offsetof(struct T,c)+1<sizeof(struct T)?sizeof(struct T):offsetof(struct T,c)+1</code> which says the minimum size is eight.</li>
<li><code>sizeof(struct T)+1</code> which says the minimum size is nine.</li>
</ol>
<p>The third approach seems definitely safe, as the standard provides
multiple examples using this style. The second approach appears fine
too, though the standard provides the following example in C23
6.7.3.2 (<code>sizeof(double)==8</code> is assumed to be true):</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">s</span><span style="color: #bbbbbb"> </span>{<span style="color: #bbbbbb"> </span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>n;<span style="color: #bbbbbb"> </span><span style="color: #B00040">double</span><span style="color: #bbbbbb"> </span>d[];<span style="color: #bbbbbb"> </span>};
<span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">s</span><span style="color: #bbbbbb"> </span><span style="color: #666666">*</span>s1;
<span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">s</span><span style="color: #bbbbbb"> </span><span style="color: #666666">*</span>s2;
s1<span style="color: #bbbbbb"> </span><span style="color: #666666">=</span><span style="color: #bbbbbb"> </span>malloc(<span style="color: #008000; font-weight: bold">sizeof</span>(<span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">s</span>)<span style="color: #bbbbbb"> </span><span style="color: #666666">+</span><span style="color: #bbbbbb"> </span><span style="color: #666666">10</span>);
s2<span style="color: #bbbbbb"> </span><span style="color: #666666">=</span><span style="color: #bbbbbb"> </span>malloc(<span style="color: #008000; font-weight: bold">sizeof</span>(<span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">s</span>)<span style="color: #bbbbbb"> </span><span style="color: #666666">+</span><span style="color: #bbbbbb"> </span><span style="color: #666666">6</span>);
<span style="color: #B00040">double</span><span style="color: #bbbbbb"> </span><span style="color: #666666">*</span>dp;
dp<span style="color: #bbbbbb"> </span><span style="color: #666666">=</span><span style="color: #bbbbbb"> </span><span style="color: #666666">&</span>(s1<span style="color: #666666">-></span>d[<span style="color: #666666">0</span>]);<span style="color: #bbbbbb"> </span><span style="color: #3D7B7B; font-style: italic">// valid</span>
<span style="color: #666666">*</span>dp<span style="color: #bbbbbb"> </span><span style="color: #666666">=</span><span style="color: #bbbbbb"> </span><span style="color: #666666">42</span>;<span style="color: #bbbbbb"> </span><span style="color: #3D7B7B; font-style: italic">// valid</span>
dp<span style="color: #bbbbbb"> </span><span style="color: #666666">=</span><span style="color: #bbbbbb"> </span><span style="color: #666666">&</span>(s2<span style="color: #666666">-></span>d[<span style="color: #666666">0</span>]);<span style="color: #bbbbbb"> </span><span style="color: #3D7B7B; font-style: italic">// valid</span>
<span style="color: #666666">*</span>dp<span style="color: #bbbbbb"> </span><span style="color: #666666">=</span><span style="color: #bbbbbb"> </span><span style="color: #666666">42</span>;<span style="color: #bbbbbb"> </span><span style="color: #3D7B7B; font-style: italic">// undefined behavior</span>
</pre></div>
<p>This is really multiple examples combined, since there are multiple
examples which refer back to previous examples. It is stated that the
last <code>*dp=42</code> is undefined behavior, though it is not clear why it
would be undefined if <code>sizeof(struct s)-offsetof(struct s,d)>=2</code> is
true. Though such an implementation would be uncommon, perhaps it was
just forgotten as a possibility. The first approach seems to be the
most useful and is also commonly used, but it would not work with
<code>q+1</code> using the semantics given by GCC, Clang, and MSVC. It would
also not work with assignment to the whole <code>struct T</code> for example
<code>*q=*q</code>, but assignments involving flexible array members do not
actually copy the whole flexible array member so they are useless even
though it is possible to do. And as mentioned in another example,
some of the bytes in the destination flexible array member can even
become indeterminate after copying. If the first approach is
sufficient for the access to <code>*q->c</code> to be valid, it would create a
strange edge case to allow <code>q+1</code> but not for this specific scenario.</p>
</div>
<hr>
<hr>
<div id="issue1091">
<h2>Issue 1091: Issues with external definitions</h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-08-25<br>
Status: Open</p>
<p>Consider the following:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #008000; font-weight: bold">inline</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">void</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">foo</span>(){}
<span style="color: #008000; font-weight: bold">inline</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">void</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">foo</span>(){}
</pre></div>
<p>In C23 6.9.1 there is wording to forbid multiple definitions with
internal linkage and to forbid multiple external definitions, but
there does not appear to be any wording forbidding multiple inline
definitions. This is surely not intended to be valid, however. A
correction should consider whether this should be undefined behavior
or a constraint violation.</p>
<p>Second, consider the following two translation units:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #3D7B7B; font-style: italic">/* TU 1 */</span>
<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">bar</span>();
<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">main</span>(){
<span style="color: #008000; font-weight: bold">return</span><span style="color: #bbbbbb"> </span>bar();
}
</pre></div>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #3D7B7B; font-style: italic">/* TU 2 */</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><span style="color: #0000FF">bar</span>(){
<span style="color: #008000; font-weight: bold">return</span><span style="color: #bbbbbb"> </span><span style="color: #666666">0</span>;
}
</pre></div>
<blockquote>
<p>An <em>external definition</em> is an external declaration that is also a
definition of a function (other than an inline definition) or an
object. If an identifier declared with external linkage is used in
an expression (other than as part of the operand of a typeof
operator whose result is not a variably modified type, part of the
controlling expression of a generic selection, part of the
expression in a generic association that is not the result
expression of its generic selection, or part of a <code>sizeof</code> or
<code>alignof</code> operator whose result is an integer constant expression),
somewhere in the entire program there shall be exactly one external
definition for the identifier; otherwise, there shall be no more
than one.</p>
</blockquote>
<p>(C23 6.9.1 "General" paragraph 5.)</p>
<p>The definition in the second translation unit is an external
definition of the same identifier <code>bar</code>, so this requirement appears
to be satisfied. This is surely not intended to be valid, however.
Additionally, if the first translation unit did provide a definition
for <code>bar</code> then this would be undefined because there would be two
external definitions for the identifier <code>bar</code>. That is also surely
not intended to be invalid, as it would defeat the whole purpose of
internal linkage. A fix to both of these cases would be to specify
"with external linkage" before the semicolon.</p>
</div>
<hr>
<hr>
<div id="issue1092">
<h2>Issue 1092: Strictly conforming programs using <code>argv</code> and handling errors</h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-08-25<br>
Status: Open<br>
Cross-references: <a href="https://www.open-std.org/jtc1/sc22/wg14/issues/c90/issue0065.html">0065</a></p>
<p>In <a href="https://www.open-std.org/jtc1/sc22/wg14/issues/c90/issue0065.html">DR 65</a> wording was needed to ensure that using locales
did not make programs not strictly conforming. However, there are
many other things that are unspecified or implementation-defined which
ought to be allowed in strictly conforming programs. For example:</p>
<blockquote>
<p>If the value of <code>argc</code> is greater than zero, the array members
<code>argv[0]</code> through <code>argv[argc-1]</code> inclusive shall contain pointers to
strings, which are given implementation-defined values by the host
environment prior to program startup.</p>
</blockquote>
<p>(C23 5.2.2.3.2 "Program startup" paragraph 2.)</p>
<p>The values of the strings in <code>argv</code> are implementation-defined, so it
appears that strictly conforming programs cannot use them in a way
that affects the observable behavior. Moreover, <code>argc</code> is not defined
nor stated to be implementation-defined so it appears to be
unspecified and therefore cannot be used in a way that affects the
observable behavior by strictly conforming programs:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">main</span>(<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>argc,<span style="color: #B00040">char</span><span style="color: #666666">**</span>){
<span style="color: #008000; font-weight: bold">return</span><span style="color: #bbbbbb"> </span>argc;
}
</pre></div>
<p>The result of this program depends upon what <code>argc</code> is, which is
unspecified so it appears this program is not strictly conforming.
For functions that can fail such as <code>malloc</code> it is also unspecified
whether or not they succeed:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#include</span><span style="color: #3D7B7B; font-style: italic"><stdio.h></span>
<span style="color: #9C6500">#include</span><span style="color: #3D7B7B; font-style: italic"><stdlib.h></span>
<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">main</span>(){
<span style="color: #B00040">char</span><span style="color: #666666">*</span>p<span style="color: #666666">=</span>malloc(<span style="color: #666666">2</span>);
<span style="color: #008000; font-weight: bold">if</span>(p){
<span style="color: #666666">*</span>p<span style="color: #666666">=</span><span style="color: #BA2121">'h'</span>;
p[<span style="color: #666666">1</span>]<span style="color: #666666">=0</span>;
puts(p);
free(p);
}<span style="color: #008000; font-weight: bold">else</span>{
puts(<span style="color: #BA2121">"malloc failed"</span>);
}
}
</pre></div>
<p>The output depends upon whether <code>malloc(2)</code> succeeds, which is
unspecified so it appears this program is also not strictly
conforming. <code>puts</code> can also fail, so even just the following program
appears to not be strictly conforming:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#include</span><span style="color: #3D7B7B; font-style: italic"><stdio.h></span>
<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">main</span>(){
puts(<span style="color: #BA2121">"h"</span>);
}
</pre></div>
<p>If <code>puts("h")</code> fails, the output would be different than if it
succeeded. Surely it is not intended for these three programs to not
be strictly conforming.</p>
</div>
<hr>
<hr>
<div id="issue1093">
<h2>Issue 1093: Compatibility of array types completed by initialization</h2>
<p>Authors: Grant Jurgensen<br>
Date: 2026-08-25<br>
Status: Open</p>
<p>Consider the two array objects <code>x</code> and <code>y</code> with the following
declarations:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>x[]<span style="color: #bbbbbb"> </span><span style="color: #666666">=</span><span style="color: #bbbbbb"> </span>{<span style="color: #666666">0</span>,<span style="color: #bbbbbb"> </span><span style="color: #666666">1</span>};
<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>y[]<span style="color: #bbbbbb"> </span><span style="color: #666666">=</span><span style="color: #bbbbbb"> </span>{<span style="color: #666666">0</span>,<span style="color: #bbbbbb"> </span><span style="color: #666666">1</span>,<span style="color: #bbbbbb"> </span><span style="color: #666666">2</span>};
</pre></div>
<p>Are the types of <code>x</code> and <code>y</code> compatible? My strict reading of C23
suggests they <em>would</em> be. 6.7.7.3 paragraph 6 says:</p>
<blockquote>
<p>For two array types to be compatible, [...] if both size specifiers
are present, and are integer constant expressions, then both size
specifiers shall have the same constant value.</p>
</blockquote>
<p>I interpret "size specifiers are present" and especially "are integer
constant expressions" as <em>syntactic</em> claims. While sizes of both
array types have been determined by the initializer (6.7.11 paragraph
23), neither are provided syntactically and therefore would not seem
to be "present".</p>
<p>However, this interpretation conflicts with existing implementations.
GCC, Clang, and CompCert all indicate that the two types are
<em>incompatible</em>, citing their differences in size (i.e. number of
elements).</p>
</div>
<hr>
<hr>
<div id="issue1095">
<h2>Issue 1095: Inconsistent usage of "based on"</h2>
<p>Authors: Joseph Myers<br>
Date: 2026-08-26<br>
Status: Open</p>
<p>The definition of "based on" in C23 6.7.4.2 defines when a pointer
expression is based on a pointer object.</p>
<p>However, in 6.7.13.8.1 (Standard attributes for function types:
general), "based on" is used four times in a way inconsistent with how
it is defined, referring to an lvalue (or an access) that is based on,
or not based on, a pointer parameter, when consistency would mean
referring to the <em>address</em> of that lvalue being based on a pointer
parameter. Care should be taken in fixing this to consider whether
there are any issues with non-addressable lvalues.</p>
</div>
<hr>
<hr>
<div id="issue1102">
<h2>Issue 1102: Conditions for when types are inferred</h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-09-01<br>
Status: Open</p>
<blockquote>
<p>If <code>auto</code> appears with another storage-class specifier, or if it
appears in a declaration at file scope, it is ignored for the
purposes of determining a storage duration or linkage. In this
case, it indicates only that the declared type can be inferred.</p>
</blockquote>
<p>(C23 6.7.2 "Storage-class specifiers" paragraph 15.)</p>
<p>Consider the following:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">main</span>(){
constexpr<span style="color: #bbbbbb"> </span><span style="color: #008000; font-weight: bold">auto</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>x<span style="color: #666666">=0</span>;
}
</pre></div>
<p>This should probably be invalid, but there does not appear to be any
wording that actually prohibits this. Specifically, the type is
inferred because another storage-class specifier appears with <code>auto</code>
but there does not appear to be any prohibition on type inference with
a type specifier. Additionally, consider the following:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">main</span>(){
<span style="color: #008000; font-weight: bold">auto</span><span style="color: #bbbbbb"> </span>y<span style="color: #666666">=0</span>;
}
</pre></div>
<p>This declaration does not have another storage-class specifier and
does not appear at file scope, so it appears that the type is not
inferred and therefore violates a constraint for not having a type
specifier. I assume that it was not intended for this to be invalid.</p>
<p>There is a proposal
<a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3579.htm">N3579</a>
currently that should fix these issues. The current text avoids
actually defining when type inference happens, just defining when type
inference can happen and applying constraints based off of if type
inference happens. The following is a minimal correction that I
believe will fix these issues.</p>
<h3>Suggested correction</h3>
<p>Modify C23 6.7.2 paragraph 15:</p>
<blockquote>
<p>If <code>auto</code> appears with <del>another storage-class specifier, or if it
appears in a declaration at file scope</del><ins>no type
specifier</ins>, it is ignored for the purposes of determining a
storage duration or linkage. In this case, it indicates only that
the declared type can be inferred.</p>
</blockquote>
<hr>
<p>Comment from Issues list maintainer on 2026-09-09:</p>
<p>In <a href="https://www.open-std.org/jtc1/sc22/wg14/37789">reflector message
37789</a>, Jens Gustedt
suggested alternative wording in 6.7.2 paragraph 15:</p>
<blockquote>
<p>If <code>auto</code> appears with another storage-class specifier, or if it
appears in a declaration at file scope, it is ignored for the
purposes of determining a storage duration or linkage. In this
case, it indicates <del>only</del> that the declared type
<del>can</del> <ins>is to</ins> be inferred.</p>
</blockquote>
<p>This would be taken together with a change to Constraints in 6.7.10
paragraph 1:</p>
<blockquote>
<p>A declaration for which the type is inferred shall contain the
storage-class specifier <code>auto</code><ins> and shall not contain any type
specifiers`</ins>.</p>
</blockquote>
<p>In <a href="https://www.open-std.org/jtc1/sc22/wg14/37793">reflector message
37793</a>, Joseph Myers
suggested there should be an actual definition in italics of
<em>inferred</em> or <em>inferred type</em>.</p>
<hr>
<p>Comment from Jay Ghiron on 2026-09-14:</p>
<p>Paragraph fifteen is the only place that defines when type inference
can happen, so presumably everything else will never have the type
inferred. I am not sure how the current text can be interpreted as
allowing <code>auto y=0;</code> at block scope. The wording being different from
paragraph four makes more sense, <code>auto</code> with a type specifier does not
mean to infer the type and <code>auto</code> without a type specifier does mean
to infer the type. In paragraph four the wording there forbids the
combination of a type specifier (or multiple type specifiers), <code>auto</code>,
and either file scope or another storage-class specifier. Uses of
<code>auto</code> other than to infer the type have no effect so there is no
wording to describe any behavior. The correction I have proposed
should make it state exactly this.</p>
</div>
<hr>
<hr>
<div id="issue1103">
<h2>Issue 1103: Contradictory requirements of linkage</h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-09-01<br>
Status: Open</p>
<p>Consider the second declaration in the following:</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>x;
<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>x;
</pre></div>
<blockquote>
<p>For an identifier declared with the storage-class specifier <code>extern</code>
in a scope in which a prior declaration of that identifier is
visible, if the prior declaration specifies internal or external
linkage, the linkage of the identifier at the later declaration is
the same as the linkage specified at the prior declaration. If no
prior declaration is visible, or if the prior declaration specifies
no linkage, then the identifier has external linkage.</p>
</blockquote>
<p>(C23 6.2.2 "Linkages of identifiers" paragraph 4.)</p>
<p>There is a prior declaration visible with internal linkage, so
according to this paragraph the linkage should be internal.</p>
<blockquote>
<p>If the declaration of an identifier for a function has no
storage-class specifier, its linkage is determined exactly as if it
were declared with the storage-class specifier <code>extern</code>. If the
declaration of an identifier for an object has file scope and does
not contain the storage-class specifier <code>static</code> or <code>constexpr</code>, its
linkage is external.</p>
</blockquote>
<p>(C23 6.2.2 "Linkages of identifiers" paragraph 5.)</p>
<p>The second declaration does have file scope and does not contain
either of the storage-class specifiers <code>static</code> or <code>constexpr</code>, so
according to this paragraph the linkage is external.</p>
<p>This wording was changed in C23 to work with type inference and
<code>thread_local</code> correctly, but it incorrectly also now covers the case
where <code>extern</code> is used.</p>
<h3>Suggested correction</h3>
<p>Modify C23 6.2.2 paragraph 5:</p>
<blockquote>
<p>If the declaration of an identifier for a function has no
storage-class specifier, its linkage is determined exactly as if it
were declared with the storage-class specifier <code>extern</code>. If the
declaration of an identifier for an object has file scope and does
not contain <ins>any of </ins>the storage-class specifier<ins>s
<code>extern</code>,</ins> <code>static</code><ins>,</ins> or <code>constexpr</code>, its linkage is
external.</p>
</blockquote>
<hr>
<p>Comment from Issues list maintainer on 2026-09-09:</p>
<p>In <a href="https://www.open-std.org/jtc1/sc22/wg14/37790">reflector message
37790</a>, Jens Gustedt
suggested alternative wording changes.</p>
<blockquote>
<p><ins>If an identifier for a function or object is declared with the
storage class specifier <code>extern</code> where a prior declaration with
linkage of that identifier is visible, the linkage of the identifier
is the same as for the prior declaration.</ins> If the declaration
of an identifier for a function has no storage-class specifier, its
linkage is determined exactly as if it were declared with the
storage-class specifier <code>extern</code>. If the declaration of an
identifier for an object has file scope and does not contain the
storage-class specifier <code>static</code> or <code>constexpr</code>, its linkage is
external.</p>
</blockquote>
<hr>
<p>Comment from Jay Ghiron on 2026-09-14:</p>
<p>This does not seem to fix the issue. The added text would be a copy
of the text in the preceding paragraph and does not resolve the
linkage being defined multiple times with contradictory answers.</p>
</div>
<hr>
<hr>
<div id="issue1104">
<h2>Issue 1104: Flexible array members and alignment</h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-09-03<br>
Status: Open<br>
Cross-references: <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1090">1090</a></p>
<p>Consider the following program:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#include</span><span style="color: #3D7B7B; font-style: italic"><stddef.h></span>
<span style="color: #9C6500">#include</span><span style="color: #3D7B7B; font-style: italic"><stdlib.h></span>
<span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">S</span>{<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>x;<span style="color: #B00040">short</span><span style="color: #bbbbbb"> </span>y;<span style="color: #B00040">char</span><span style="color: #bbbbbb"> </span>z[];};
<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">main</span>(){
<span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">S</span><span style="color: #666666">*</span>p<span style="color: #666666">=</span>malloc(offsetof(<span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">S</span>,z)<span style="color: #666666">+1</span>);
<span style="color: #3D7B7B; font-style: italic">/* ... */</span>
free(p);
}
</pre></div>
<p>Before C23 this was surely valid, but with
<a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2293.htm">N2293</a> it
appears that if all of the following are true then it would be
possible for it to be invalid:</p>
<ul>
<li><code>sizeof(struct S)-offsetof(struct S,z)>2</code> is true.</li>
<li><code>alignof(struct S)>alignof(int)</code> is true.</li>
<li><code>alignof(struct S)>alignof(short)</code> is true.</li>
<li>There does not exist any complete object type <em>T</em> such that
<code>sizeof(</code><em>T</em><code>)<=offsetof(struct S,z)+1&&alignof(</code><em>T</em><code>)>=alignof(struct S)&&alignof(</code><em>T</em><code>)<=alignof(max_align_t)</code> is true.</li>
</ul>
<p>If all of these are true, then it would not be guaranteed that the
pointer resulting from <code>malloc</code> will be aligned sufficiently for
<code>struct S*</code>. See also <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1090">issue 1090</a> which discusses an
example similar to this. If this should be a valid way to allocate
space sufficient for an object of type <code>struct S</code> whose <code>z</code> member is
an array of one, then it should be sufficient to obtain the proper
alignment too. A second case where this issue with alignment can
arise without the structure having an unnecessary greater alignment
requirement is:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#include</span><span style="color: #3D7B7B; font-style: italic"><stddef.h></span>
<span style="color: #9C6500">#include</span><span style="color: #3D7B7B; font-style: italic"><stdlib.h></span>
<span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">U</span>{<span style="color: #B00040">char</span><span style="color: #bbbbbb"> </span>a;<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>b[];};
<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">main</span>(){
<span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">U</span><span style="color: #666666">*</span>q<span style="color: #666666">=</span>malloc(offsetof(<span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">U</span>,b));<span style="color: #3D7B7B; font-style: italic">/* array of zero */</span>
<span style="color: #3D7B7B; font-style: italic">/* ... */</span>
free(q);
}
</pre></div>
<p>Before C23 this was surely valid, but with N2293 it appears that if
all of the following are true then it would be possible for it to be
invalid:</p>
<ul>
<li><code>sizeof(int)>alignof(int)</code> is true.</li>
<li><code>alignof(int)>1</code> is true.</li>
<li><code>offsetof(struct U,b)<sizeof(int)</code> is true.</li>
<li><code>offsetof(struct U,b)!=sizeof(struct U)</code> is true.</li>
<li>There does not exist a complete object type <em>T</em> such that
<code>sizeof(</code><em>T</em><code>)<=offsetof(struct U,b)&&alignof(</code><em>T</em><code>)>=alignof(struct U)&&alignof(</code><em>T</em><code>)<=alignof(max_align_t)</code> is true.</li>
</ul>
<p>If all of these are true, then it would not be guaranteed that the
pointer resulting from <code>malloc</code> will be aligned sufficiently for
<code>struct U*</code>. If this should be a valid way to allocate space
sufficient for an object of type <code>struct U</code> whose <code>b</code> member is an
array of zero, then it should be sufficient to obtain the proper
alignment too. Another issue with alignment and flexible array
members is:</p>
<blockquote>
<p>As a special case, the last member of a structure with more than one
named member can have an incomplete array type; this is called a
<em>flexible array member</em>. In most situations, the flexible array
member is ignored. In particular, the size of the structure is as
if the flexible array member were omitted except that it may have
more trailing padding than the omission would imply. However, when
a <code>.</code> (or <code>-></code>) operator has a left operand that is (a pointer to) a
structure with a flexible array member and the right operand names
that member, it behaves as if that member were replaced with the
longest array (with the same element type) that would not make the
structure larger than the object being accessed; the offset of the
array shall remain that of the flexible array member, even if this
would differ from that of the replacement array. If this array
would have no elements, it behaves as if it had one element but the
behavior is undefined if any attempt is made to access that element
or to generate a pointer one past it.</p>
</blockquote>
<p>(C23 6.7.3.2 "Structure and union specifiers" paragraph 20.)</p>
<p>It is mentioned that the size of a structure may be different due to a
flexible array member, but it is never stated that the alignment
requirements may be different. No implementations avoid changing the
alignment requirements when flexible array members are used, since it
would imply that every structure needs to have the maximum possible
alignment requirement.</p>
<p>The following three points should fix these issues, and it seems
unlikely that implementations would have trouble implementing them:</p>
<ol>
<li>For any valid fundamental alignment <em>N</em>, <code>malloc(</code><em>M</em><code>)</code> is
guaranteed to return a pointer sufficiently aligned for <em>N</em> if <em>M</em>
is greater than or equal to <em>N</em> (null is considered sufficiently
aligned for any alignment). This would impose no further
requirements on implementations where for each such <em>N</em> there
exists a complete object type <em>T</em> such that
<code>alignof(</code><em>T</em><code>)==</code><em>N</em><code>&&sizeof(</code><em>T</em><code>)==</code><em>N</em>.</li>
<li>The alignment requirements of structures and unions are defined
exactly as: the maximum of the alignment requirements of the types
specified in the members and the alignments of any alignment
specifiers which apply to the members.</li>
<li>Update 6.7.3.2 paragraph 20 to mention that the alignment may be
different with flexible array members.</li>
</ol>
<p>Alternatively, if the second point is not possible then strengthening
the requirements of <code>malloc</code> further should also work. That is,
<code>malloc(offsetof(</code><em>T</em><code>,</code><em>m</em><code>))</code> is guaranteed to be sufficiently
aligned for any complete structure type or complete union type <em>T</em>
where <em>m</em> names a flexible array member in <em>T</em>.</p>
<p>Atomic structure types and atomic union types are intentionally not
discussed, since it is not possible to access the flexible array
members in them.</p>
</div>
<hr>
<hr>
<div id="issue1105">
<h2>Issue 1105: Issues with atomic integer types in <code><stdatomic.h></code></h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-09-09<br>
Status: Open</p>
<p>The types <code>intptr_t</code> and <code>uintptr_t</code> are optional, but there does not
seem to be any wording that makes <code>atomic_intptr_t</code> and
<code>atomic_uintptr_t</code> optional as well. <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1073">Issue 1073</a> would
also apply to <code>atomic_char</code><em>N</em><code>_t</code> if <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1074">issue 1074</a> is
resolved as requiring freestanding implementations to support
<code><stdatomic.h></code> if <code>__STDC_NO_ATOMICS__</code> is not defined.</p>
<p>There also does not appear to be any wording that actually requires
the <code>atomic_*</code> types other than <code>atomic_flag</code> to actually be atomic or
integer types. The name of the subclause "Atomic integer types" is
nonnormative, as far as I understand. Is there any reason to not say
that the atomic type names are the same as the direct types, and
instead just require equivalent representations and alignment
requirements? The following paragraph that describes conversions to
<code>atomic_bool</code> also would not make sense if <code>atomic_bool</code> was not an
integer type or an atomic integer type.</p>
<p>Note that C++ also provides <code>atomic_int8_t</code>, <code>atomic_int16_t</code>,
<code>atomic_int32_t</code>, <code>atomic_int64_t</code>, <code>atomic_uint8_t</code>,
<code>atomic_uint16_t</code>, <code>atomic_uint32_t</code>, and <code>atomic_uint64_t</code> if the
corresponding non-atomic types are provided.</p>
</div>
<hr>
<hr>
<div id="issue1106">
<h2>Issue 1106: Questions about translation limits</h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-09-10<br>
Status: Open</p>
<blockquote>
<p>A <em>strictly conforming program</em> shall use only those features of the
language and library specified in this document. It shall not
produce output dependent on any unspecified, undefined, or
implementation-defined behavior, and shall not exceed any minimum
implementation limit.</p>
</blockquote>
<p>(C23 4 "Conformance" paragraph 5.)</p>
<blockquote>
<p>A <em>conforming hosted implementation</em> shall accept any strictly
conforming program.</p>
</blockquote>
<p>(C23 4 "Conformance" paragraph 7.)</p>
<blockquote>
<p>The implementation shall be able to translate and execute a program
that uses but does not exceed the following limitations for these
constructs and entities:</p>
<ul>
<li>127 nesting levels of blocks</li>
<li>63 nesting levels of conditional inclusion</li>
<li>12 pointer, array, and function declarators (in any combinations)
modifying an arithmetic, structure, union, or <code>void</code> type in a
declaration</li>
<li>63 nesting levels of parenthesized declarators within a full declarator</li>
<li>63 nesting levels of parenthesized expressions within a full expression</li>
<li>63 significant initial characters in an internal identifier or a
macro name (each universal character name or extended source character
is considered a single character)</li>
<li>31 significant initial characters in an external identifier (each
universal character name specifying a short identifier of 00FFFF or
less is considered 6 characters, each universal character name
specifying a short identifier of 010000 or more is considered 10
characters, and each extended source character is considered the same
number of characters as the corresponding universal character name, if
any)</li>
<li>4095 external identifiers in one translation unit</li>
<li>511 identifiers with block scope declared in one block</li>
<li>4095 macro identifiers simultaneously defined in one preprocessing
translation unit</li>
<li>127 parameters in one function definition</li>
<li>127 arguments in one function call</li>
<li>127 parameters in one macro definition</li>
<li>127 arguments in one macro invocation</li>
<li>4095 characters in a logical source line</li>
<li>4095 characters in a string literal (after concatenation)</li>
<li>32767 bytes in an object (in a hosted environment only)</li>
<li>15 nesting levels for <code>#include</code>d files</li>
<li>1023 <code>case</code> labels for a <code>switch</code> statement (excluding those for any
nested <code>switch</code> statements)</li>
<li>1023 members in a single structure or union</li>
<li>1023 enumeration constants in a single enumeration</li>
<li>63 levels of nested structure or union definitions in a single
member declaration list</li>
</ul>
</blockquote>
<p>(C23 5.3.5.2 "Translation limits" paragraph 1.)</p>
<h3>Question 1</h3>
<p>Must a conforming hosted implementation accept all strictly conforming
programs, including those that reach all of these limits at the same
time? Note that the C99 Rationale says the following:</p>
<blockquote>
<p>The requirement that a conforming implementation be able to
translate and execute at least one program that reaches each of the
stated limits is not meant to excuse the implementation from doing
the best it can to translate and execute other programs. It was
deemed infeasible to require successful translation and execution of
<em>all</em> programs not exceeding those limits. Many of these limits
require resources such as memory that a reasonable implementation
might allocate from a shared pool; so there is no requirement that
all the limits be attained <em>simultaneously</em>. Requiring just one
acceptable program that attains each limit is simply meant to ensure
conformance with these requirements.</p>
</blockquote>
<p>(Section 5.2.4.1 "Translation limits" paragraph 4 C99 Rationale.)</p>
<p>Which suggests not, but the wording appears to require it if "shall
not exceed any minimum implementation limit" is interpreted as
referring to the limits described in "Translation limits". All of the
following questions assume that "any minimum implementation limit"
does refer to the limits described in "Translation limits", since it
is not clear what the meaning could be otherwise. Note that several
sections have portions labeled "Implementation limits" which refer to
"Translation limits".</p>
<h3>Question 2</h3>
<p>How are levels of nesting counted? Consider the following:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">main</span>(){{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
</pre></div>
<p>This has exactly one hundred twenty eight sets of braces. Does that
count as one hundred twenty seven levels of nesting because there are
one hundred twenty seven sets of braces surrounding the innermost set
of braces, or does it count as one hundred twenty eight levels of
nesting by including the innermost set of braces as well?</p>
<h3>Question 3</h3>
<p>How do standard headers interact with these translation limits? For
example, suppose a standard header is included at a point where
headers can be included but those headers cannot include any further
headers without exceeding the minimum implementation limits. Would
including the standard header at that point possibly exceed the
minimum implementation limits? If it would, then how many nested
inclusions can standard headers perform?</p>
<h3>Question 4</h3>
<p>How do standard library macros interact with these translation units?
For example, suppose a standard library macro is expanded at a point
where no parenthesized expressions can be used without exceeding the
minimum implementation limits. Would expanding the standard library
macro at that point possibly exceed the minimum implementation limits?
If it would, then how many nested parenthesized expressions, nested
parenthesized declarators, nested structure definitions, and nested
union definitions can be used by standard library macros?</p>
<h3>Question 5</h3>
<p>The following can be nested infinitely, but there does not seem to be
any minimum implementation limits:</p>
<ul>
<li>generic selections,</li>
<li>function calls,</li>
<li>array subscripts,</li>
<li>member access operators,</li>
<li>compound literals,</li>
<li>all unary operators that take an expression operand,</li>
<li>all binary operators that take two expression operands,</li>
<li>conditional expressions,</li>
<li><code>sizeof</code> expressions that use parenthesized type names,</li>
<li><code>alignof</code> expressions,</li>
<li>cast operators,</li>
<li><code>_BitInt</code> type specifiers,</li>
<li>typeof operators,</li>
<li>atomic type specifiers,</li>
<li>alignment specifiers,</li>
<li>array declarator operators,</li>
<li>function declarator operators,</li>
<li>enumerated types,</li>
<li>braced initializers,</li>
<li>designators in initializer lists,</li>
<li>parenthesized abstract declarators,</li>
<li>declarator operators in abstract declarators or parameter declarations,</li>
<li>declarator operators in declarations where the types in the
declaration specifiers are not arithmetic types, structure types,
union types, or void types,</li>
<li>labeled statements,</li>
<li><code>__has_embed</code> expressions,</li>
<li><code>__has_embed</code> parameter pp-balanced-tokens, and</li>
<li>attribute balanced-tokens.</li>
</ul>
<p>Some of these cannot be directly nested but require other constructs
to nest, for example <code>_BitInt((_BitInt(3))2)</code>. Note that selection
statements and iteration statements create blocks so they are already
covered by the existing wording. The following can be repeated
infinitely without nesting multiple times, but there does not seem to
be any minimum implementation limits:</p>
<ul>
<li>statements,</li>
<li>labels,</li>
<li>function parameters not in function definitions,</li>
<li>generic associations,</li>
<li>attributes in attribute lists,</li>
<li>commas in attribute lists,</li>
<li>function specifiers,</li>
<li>type qualifiers including <code>_Atomic</code>,</li>
<li>alignment specifiers,</li>
<li>static assertions,</li>
<li>attribute declarations,</li>
<li>initializers in initializer lists,</li>
<li>designators in initializer lists,</li>
<li>declarations at file scope which declare no identifiers with
external linkage (other than the previously mentioned static
assertions and attribute declarations),</li>
<li>preprocessing directives,</li>
<li>preprocessing parameters for embed,</li>
<li>logical source lines,</li>
<li>line splicing where the whole physical source line is just a single backslash,</li>
<li>preprocessing tokens, and</li>
<li>tokens.</li>
</ul>
<p>Whitespace (including comments) can be of infinite length and done
infinite times, but is intentionally omitted because it is easy for
implementations to skip. Was it intended for there to be some
restrictions on these? No implementations are actually capable of
accepting programs of unbounded length. Perhaps there should also be
limits on the complexity that macros can achieve.</p>
<h3>Question 6</h3>
<p>Does "511 identifiers with block scope declared in one block" include
the implicitly defined <code>__func__</code>?</p>
<h3>Question 7</h3>
<p>Does "4095 macro identifiers simultaneously defined in one
preprocessing translation unit" include the implicitly defined macros
such as <code>__STDC__</code> or macros defined in standard headers? Moreover,
does it include implementation specific predefined macros that use
reserved identifiers or implementation specific macros defined in
standard headers that use reserved identifiers or one of the reserved
prefixes?</p>
<h3>Question 8</h3>
<p>Does "4095 external identifiers in one translation unit" include
identifiers declared in standard headers with external linkage?
Moreover, does it include implementation specific identifiers declared
in standard headers with external linkage?</p>
<h3>Question 9</h3>
<p>Does "12 pointer, array, and function declarators (in any
combinations) modifying an arithmetic, structure, union, or void type
in a declaration" mean to include <code>nullptr_t</code>? Also:</p>
<blockquote>
<p>As discussed in 5.3.5.2, an implementation may limit the number of
pointer, array, and function declarators that modify an arithmetic,
structure, union, or <code>void</code> type, either directly or via one or more
<code>typedef</code>s.</p>
</blockquote>
<p>(C23 6.7.7.1 "General" paragraph 7.)</p>
<p>Here it is suggested that this applies to any construction of a type,
but it seems clearly limited to declarations and there is no mention
of <code>typedef</code>s.</p>
</div>
<hr>
<hr>
<div id="issue1107">
<h2>Issue 1107: <code>decimal_point</code> and <code>thousands_sep</code> issues</h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-09-10<br>
Status: Open<br>
Cross-references: <a href="https://www.open-std.org/jtc1/sc22/wg14/issues/c90/issue0066.html">0066</a>, <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1108">1108</a></p>
<p>In the response to <a href="https://www.open-std.org/jtc1/sc22/wg14/issues/c90/issue0066.html">DR 66</a> it was mentioned that
<code>decimal_point</code> and <code>thousands_sep</code> must both be at most 1 byte, and
for <code>decimal_point</code> it must not be empty. There is also the general
requirement that these strings begin and end in the initial shift
sequence. However, there seems to be some requirements that ought to
be in place but are not. Consider the following printf invocation:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span>printf(<span style="color: #BA2121">"%.1f</span><span style="color: #AA5D1F; font-weight: bold">\n</span><span style="color: #BA2121">"</span>,<span style="color: #666666">0.</span>);
</pre></div>
<p>This prints the character <code>0</code>, the current <code>decimal_point</code>, and then
the character <code>0</code>. Was it intended that this may print "<code>000</code>",
"<code>010</code>", "<code>0a0</code>", "<code>0z0</code>", "<code>0 0</code>", or possibly even two lines "<code>0</code>"
and "<code>0</code>" because the current <code>decimal_point</code> is <code>"\n"</code>? That is,
should there be any constraints on <code>decimal_point</code> and <code>thousands_sep</code>
to prevent them from being something other than punctuation
characters? It should also be considered if redundant shift sequences
that preserve the initial shift state can be used in <code>decimal_point</code>
and <code>thousands_sep</code>, and whether or not that counts as pointing to
<code>""</code>. If punctuation characters are required, note that <code>ispunct</code>
does not imply that <code>iswpunct</code> will be true for the same character.</p>
</div>
<hr>
<hr>
<div id="issue1108">
<h2>Issue 1108: <code>grouping</code> and <code>mon_grouping</code> questions</h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-09-11<br>
Status: Open<br>
Cross-references: <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1107">1107</a></p>
<blockquote>
<p>The elements of <code>grouping</code> and <code>mon_grouping</code> are interpreted
according to the following:</p>
<table>
<thead>
<tr>
<th align="left"></th>
<th align="left"></th>
</tr>
</thead>
<tbody>
<tr>
<td align="left"><code>CHAR_MAX</code></td>
<td align="left">No further grouping is to be performed.</td>
</tr>
<tr>
<td align="left"><code>0</code></td>
<td align="left">The previous element is to be repeatedly used for the remainder of the digits.</td>
</tr>
<tr>
<td align="left"><em>other</em></td>
<td align="left">The integer value is the number of digits that compose the current group. The next element is examined to determine the size of the next group of digits before the current group.</td>
</tr>
</tbody>
</table>
</blockquote>
<p>(C23 7.11.3.1 "The <code>localeconv</code> function" paragraph 4.)</p>
<p>All of the following questions are about <code>grouping</code> and
<code>mon_grouping</code>. Some questions discuss possibilities that should
perhaps be forbidden.</p>
<h3>Question 1</h3>
<p>Can there be nonzero bytes after a <code>CHAR_MAX</code>? If so, are they
meaningless?</p>
<h3>Question 2</h3>
<p>Can the first byte be <code>CHAR_MAX</code>? If so, is it equivalent to an empty
string?</p>
<h3>Question 3</h3>
<p>For an empty string, what does it mean to repeat the previous element?
An empty string can indicate that the field is of zero length, so it
appears that the previously quoted text might still need to be
considered.</p>
<h3>Question 4</h3>
<p>What does it mean if <code>grouping</code> or <code>mon_grouping</code> has a first byte
that is not zero and not <code>CHAR_MAX</code>, while <code>thousands_sep</code> or
<code>mon_thousands_sep</code> respectively points to <code>""</code>? Should it separate
with nothing as requested, or perhaps use a placeholder such as a
comma?</p>
<h3>Question 5</h3>
<p>Can <code>thousands_sep</code> and <code>mon_thousands_sep</code> point to something other
than <code>""</code> if <code>grouping</code> and <code>mon_grouping</code> respectively have first
bytes that are zero or <code>CHAR_MAX</code>?</p>
<p>See also <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1107">issue 1107</a> which discusses whether or not a
string composed entirely of shift sequences that in combination
preserve the initial shift state counts as pointing to <code>""</code>.</p>
</div>
<hr>
<hr>
<div id="issue1111">
<h2>Issue 1111: Inconsistent definitions of version macros</h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-09-17<br>
Status: Open</p>
<p>Consider the following two macros:</p>
<blockquote>
<p>The macro</p>
<p><code>__STDC_VERSION_ASSERT_H__</code></p>
<p>is an integer constant expression with a value equivalent to
<code>202311L</code>.</p>
</blockquote>
<p>(C23 7.2.1 "General" paragraph 4.)</p>
<blockquote>
<p>The feature test macro <code>__STDC_VERSION_FENV_H__</code> expands to the
token <code>202311L</code>.</p>
</blockquote>
<p>(C23 7.6.1 "General" paragraph 5.)</p>
<p>These two macros are specified differently, the former requiring a
particular value while the latter requires an exact sequence of
tokens. Is there any reason to specify these differently? Outside of
preprocessing, the only observable difference is that the type of the
former might not be <code>long</code>. The following are all macros specified
with an exact sequence of tokens of the form <em>yyyymm</em><code>L</code>:</p>
<ul>
<li><code>__STDC_VERSION__</code></li>
<li><code>__STDC_ISO_10646__</code></li>
<li><code>__STDC_IEC_60559_BFP__</code></li>
<li><code>__STDC_IEC_60559_DFP__</code></li>
<li><code>__STDC_IEC_60559_COMPLEX__</code></li>
<li><code>__STDC_IEC_60559_TYPES__</code></li>
<li><code>__STDC_LIB_EXT1__</code></li>
<li><code>__STDC_VERSION_FENV_H__</code></li>
<li><code>__STDC_VERSION_MATH_H__</code></li>
<li><code>__STDC_VERSION_STDINT_H__</code></li>
<li><code>__STDC_VERSION_STDLIB_H__</code></li>
<li><code>__STDC_VERSION_TGMATH_H__</code></li>
<li><code>__STDC_VERSION_TIME_H__</code></li>
</ul>
<p>The following are all macros specified to be integer constant
expressions with the same value as an integer constant of the form
<em>yyyymm</em><code>L</code>:</p>
<ul>
<li><code>__STDC_VERSION_ASSERT_H__</code></li>
<li><code>__STDC_VERSION_COMPLEX_H__</code></li>
<li><code>__STDC_VERSION_FLOAT_H__</code></li>
<li><code>__STDC_VERSION_INTTYPES_H__</code></li>
<li><code>__STDC_VERSION_LIMITS_H__</code></li>
<li><code>__STDC_VERSION_SETJMP_H__</code></li>
<li><code>__STDC_VERSION_STDARG_H__</code></li>
<li><code>__STDC_VERSION_STDATOMIC_H__</code></li>
<li><code>__STDC_VERSION_STDBIT_H__</code></li>
<li><code>__STDC_VERSION_STDCKDINT_H__</code></li>
<li><code>__STDC_VERSION_STDDEF_H__</code></li>
<li><code>__STDC_VERSION_STDIO_H__</code></li>
<li><code>__STDC_VERSION_STRING_H__</code></li>
<li><code>__STDC_VERSION_UCHAR_H__</code></li>
<li><code>__STDC_VERSION_WCHAR_H__</code></li>
</ul>
<p>C2Y also adds <code>__STDC_VERSION_STDCOUNTOF_H__</code> and
<code>__STDC_VERSION_STDMCHAR_H__</code> which are defined by value rather than a
specific sequence of tokens.</p>
</div>
<hr>
<hr>
<div id="issue1112">
<h2>Issue 1112: Undefined behavior from uninitialized reads</h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-09-18<br>
Status: Open<br>
Cross-references: <a href="https://www.open-std.org/jtc1/sc22/wg14/issues/c99/issue0338.html">0338</a></p>
<blockquote>
<p>If the lvalue designates an object of automatic storage duration
that could have been declared with the <code>register</code> storage class
(never had its address taken), and that object is uninitialized (not
declared with an initializer and no assignment to it has been
performed prior to use), the behavior is undefined.</p>
</blockquote>
<p>(C23 6.3.3.1 "Lvalues, arrays, and function designators" paragraph 2.)</p>
<p>This definition of uninitialized has many issues. First:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">S</span>{<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>x;};
<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">main</span>(){
<span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">S</span><span style="color: #bbbbbb"> </span>s;
s.x<span style="color: #666666">=0</span>;
<span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">S</span><span style="color: #bbbbbb"> </span>t<span style="color: #666666">=</span>s;
}
</pre></div>
<p>This appears to be undefined behavior because the address of <code>s</code> was
never taken, <code>s</code> does not have an initializer, and no assignment to
<code>s</code> has been done. Surely it is not intended for this to be
undefined. The reverse scenario of assigning to a whole structure but
never directly assigning to a member appears to be fine, assigning to
a structure will assign to all members (recursively) as far as I
understand. The following seem to be permitted even though the intent
is probably to not allow them:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">main</span>(){
<span style="color: #008000; font-weight: bold">goto</span><span style="color: #bbbbbb"> </span>l;
<span style="color: #B00040">char</span><span style="color: #bbbbbb"> </span>a<span style="color: #666666">=0</span>;
<span style="color: #767600">l</span>:<span style="color: #3D7B7B; font-style: italic">/* initialization skipped */</span>
<span style="color: #B00040">char</span><span style="color: #bbbbbb"> </span>b<span style="color: #666666">=</span>a;<span style="color: #3D7B7B; font-style: italic">/* not uninitialized from this wording */</span>
}
</pre></div>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">main</span>(){
<span style="color: #B00040">char</span><span style="color: #bbbbbb"> </span>c<span style="color: #666666">=</span>c;<span style="color: #3D7B7B; font-style: italic">/* not uninitialized from this wording */</span>
}
</pre></div>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">main</span>(){
<span style="color: #008000; font-weight: bold">goto</span><span style="color: #bbbbbb"> </span>m;
<span style="color: #767600">n</span>:
<span style="color: #B00040">char</span><span style="color: #bbbbbb"> </span>d;<span style="color: #3D7B7B; font-style: italic">/* indeterminate again */</span>
<span style="color: #B00040">char</span><span style="color: #bbbbbb"> </span>e<span style="color: #666666">=</span>d;<span style="color: #3D7B7B; font-style: italic">/* not uninitialized from this wording */</span>
<span style="color: #008000; font-weight: bold">return</span><span style="color: #bbbbbb"> </span><span style="color: #666666">0</span>;
<span style="color: #767600">m</span>:
d<span style="color: #666666">=0</span>;<span style="color: #3D7B7B; font-style: italic">/* assignment to d */</span>
<span style="color: #008000; font-weight: bold">goto</span><span style="color: #bbbbbb"> </span>n;
}
</pre></div>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">main</span>(){
<span style="color: #B00040">char</span><span style="color: #bbbbbb"> </span>f,g;
f<span style="color: #666666">=*&</span>g;<span style="color: #3D7B7B; font-style: italic">/* assignment to indeterminate value */</span>
<span style="color: #B00040">char</span><span style="color: #bbbbbb"> </span>h<span style="color: #666666">=</span>f;<span style="color: #3D7B7B; font-style: italic">/* not uninitialized from this wording */</span>
}
</pre></div>
<p>Note that <code>char</code> does not have any non-value representations so it is
valid to copy an indeterminate value. The wording has been adjusted
in C2Y, but the meaning of uninitialized was not changed.</p>
<hr>
<p>Comment from Jay Ghiron on 2026-10-09:</p>
<p>The proposal
<a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3972.pdf">N3972</a> if
accepted would resolve this issue by removing the wording in question.</p>
</div>
<hr>
<hr>
<div id="issue1113">
<h2>Issue 1113: Questions about character constants</h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-09-25<br>
Status: Open<br>
Cross-references: <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1122">1122</a></p>
<h3>Question 1</h3>
<blockquote>
<p>This includes interpreting character constants, which can involve
converting escape sequences into execution character set members.
Whether the numeric value for these character constants matches the
value obtained when an identical character constant occurs in an
expression (other than within a <code>#if</code> or <code>#elif</code> directive) is
implementation-defined. Whether a single-character character
constant may have a negative value is implementation-defined.</p>
</blockquote>
<p>(C23 6.10.2 "Conditional inclusion" paragraph 13.)</p>
<p>Does this apply to UTF-8 character constants, UTF-16 character
constants, and UTF-32 character constants? For example:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#if u'0'!=48</span>
<span style="color: #9C6500">#error</span>
<span style="color: #9C6500">#endif</span>
</pre></div>
<p>Can this condition be true and cause an error? Note that C++ removed
all wording which allowed character constants in conditional
expression inclusion preprocessing directives to be different (see
also <a href="https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2316r2.pdf">C++
P2316</a>).</p>
<h3>Question 2</h3>
<p>If <code>__STDC_MB_MIGHT_NEQ_WC__</code> is not defined and the implementation
uses a different encoding in conditional expression inclusion
preprocessing directives for integer character constants and <code>wchar_t</code>
character constants, must the implementation give equivalent values in
conditional expression inclusion preprocessing directives for integer
character constants and <code>wchar_t</code> character constants which both
contain one character which is the same and is in the basic character
set? For example:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#ifndef __STDC_MB_MIGHT_NEQ_WC__</span>
<span style="color: #9C6500">#if'x'!=L'x'</span>
<span style="color: #9C6500">#error</span>
<span style="color: #9C6500">#endif</span>
<span style="color: #9C6500">#endif</span>
</pre></div>
<p>Can these conditions be true and cause an error?</p>
<h3>Question 3</h3>
<p>If <code>__STDC_MB_MIGHT_NEQ_WC__</code> is defined, can the implementation give
<code>wchar_t</code> character constants which contain one character in the basic
character set a negative value if they occur outside of conditional
expression inclusion preprocessing directives? For example:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #008000; font-weight: bold">static_assert</span>(<span style="color: #BA2121">L'x'</span><span style="color: #666666">>0</span>);
</pre></div>
<p>Can this condition be false and cause an error? Note that C++
requires such <code>wchar_t</code> character constants to have nonnegative
values.</p>
<h3>Question 4</h3>
<p>If <code>__STDC_MB_MIGHT_NEQ_WC__</code> is defined, do the requirements on
decimal digits <code>0</code> through <code>9</code> being contiguous still apply to
<code>wchar_t</code> character constants which contain one character that is a
decimal digit if they occur outside of conditional expression
inclusion preprocessing directives? For example:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #008000; font-weight: bold">static_assert</span>(<span style="color: #BA2121">L'1'</span><span style="color: #666666">-</span><span style="color: #BA2121">L'0'</span><span style="color: #666666">==1</span>);
</pre></div>
<p>Can this condition be false and cause an error? The same question
would apply in C2Y to the hexadecimal digits <code>a</code> through <code>f</code>, and
separately the hexadecimal digits <code>A</code> through <code>F</code>.</p>
<h3>Question 5</h3>
<p>If the implementation uses a different encoding in conditional
expression inclusion preprocessing directives for character constants,
do the same requirements on contiguous ranges of characters (such as
decimal digits <code>0</code> through <code>9</code>) also apply to character constants
within conditional expression inclusion preprocessing directives?
This applies to UTF-8 character constants, UTF-16 character constants,
and UTF-32 character constants if question one is resolved as allowing
different encodings for those character constants when inside of
conditional expression inclusion preprocessing directives. If
question four is resolved as not requiring contiguous ranges with
<code>wchar_t</code> character constants outside of conditional expression
inclusion preprocessing directives when <code>__STDC_MB_MIGHT_NEQ_WC__</code> is
defined, then this question would not apply to <code>wchar_t</code> character
constants. For example:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#if'1'-'0'!=1</span>
<span style="color: #9C6500">#error</span>
<span style="color: #9C6500">#endif</span>
</pre></div>
<p>Can this condition be true and cause an error?</p>
<h3>Question 6</h3>
<p>Can a character in the basic character set have a value in <code>char</code> that
is not representable in <code>int</code>? This can only occur with
<code>CHAR_MAX>INT_MAX</code> because of the requirements on <code>char</code>. If so, what
would be the value of an integer character constant that contains such
a character? Note that a negative value might make using it with one
of the <code><ctype.h></code> functions undefined. Additionally, if
<code>'0'==INT_MAX</code> is true then the decimal digits being contiguous would
lose meaning since <code>'0'+1=='1'</code> would be undefined.</p>
<h3>Question 7</h3>
<blockquote>
<p>Character constants, when evaluated in <code>#if</code> expressions, may be
interpreted in the source character set, the execution character
set, or some other implementation-defined character set. This
latitude reflects the diversity of existing practice, especially in
cross-compilers.</p>
</blockquote>
<p>(Section 6.6 "Constant expressions" paragraph 3 C99 Rationale.)</p>
<p>The intent is to allow the source character set to be used for integer
character constants and <code>wchar_t</code> character constants (other character
constants did not exist in C99), but the source basic character set is
smaller than the execution basic character set. Was it intended that
<code>'\a'</code>, <code>'\b'</code>, <code>'\n'</code>, <code>'\r'</code>, and the equivalent <code>wchar_t</code> character
constants must be valid despite the source basic character set not
including them?</p>
<h3>Question 8</h3>
<p>If <code>__STDC_MB_MIGHT_NEQ_WC__</code> is defined, is the encoding of the
execution basic character set in <code>wchar_t</code> not locale-specific? That
is, is <code>L'x'</code> valid for all locales?</p>
</div>
<hr>
<hr>
<div id="issue1114">
<h2>Issue 1114: Requirements on <code>RSIZE_MAX</code></h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-09-25<br>
Status: Open</p>
<h3>Question 1</h3>
<blockquote>
<p>The macro is</p>
<p><code>RSIZE_MAX</code></p>
<p>which expands to a value of type <code>size_t</code>. It can be an expression
that is not constant.</p>
</blockquote>
<p>(C23 K.3.4 "Integer types <code><stdint.h></code>" paragraph 2.)</p>
<p>Does "not constant" mean that throughout a program execution, the
value of <code>RSIZE_MAX</code> can change?</p>
<h3>Question 2</h3>
<p>Was it intended that there is no minimum value for <code>RSIZE_MAX</code>? There
does not appear to be anything forbidding a value of zero.</p>
<p>Currently, it seems like <code>RSIZE_MAX</code> may be arbitrarily changed to any
value including to zero at any point in time. Therefore any usage of
an Annex K function that forbids sizes in bytes greater <code>RSIZE_MAX</code>
may fail unless the size used is zero.</p>
</div>
<hr>
<hr>
<div id="issue1115">
<h2>Issue 1115: Directives partially contained in multiline macro invocations</h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-09-28<br>
Status: Open</p>
<p>See also <a href="https://cplusplus.github.io/CWG/issues/3224.html">C++ CWG 3224</a>:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#define FOO(...)</span>
FOO(
<span style="color: #9C6500">#if )</span>
</pre></div>
<p>C++ is changing its wording to clarify that this is invalid, should
the wording in C be changed as well to clarify that this is invalid?</p>
<h3>Suggested correction</h3>
<p>Modify C23 6.10.5.1 paragraph 11:</p>
<blockquote>
<p>If there <del>are sequences of preprocessing tokens</del><ins>is
whitespace containing at least one new-line character immediately
followed by a <code>#</code> preprocessing token</ins> within the list of
arguments<del> that would otherwise act as preprocessing
directives</del>, the behavior is undefined.</p>
<p><del>(footnote) Despite the name, a non-directive is a preprocessing
directive.</del></p>
</blockquote>
</div>
<hr>
<hr>
<div id="issue1116">
<h2>Issue 1116: Requirements on array parameters</h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-09-29<br>
Status: Open</p>
<blockquote>
<p>If a function argument is described as being an array, the pointer
passed to the function shall have a value such that all address
computations and accesses to objects (that would be valid if the
pointer did point to the first element of such an array) are valid.</p>
</blockquote>
<p>(C23 7.1.4 "Use of library functions" paragraph 1.)</p>
<p>This wording is not very clear about what counts as being an array.
Some functions such as <code>encodedecd32</code> are specified with array
parameter types, so they are clearly included. Other functions such
as the <code><string.h></code> functions are described as being required to point
to arrays so they are clearly included:</p>
<blockquote>
<p>Various methods are used for determining the lengths of the arrays,
but in all cases a <code>char *</code> or <code>void *</code> argument points to the
initial (lowest addressed) character of the array. If an array is
accessed beyond the end of an object, the behavior is undefined.</p>
</blockquote>
<p>(C23 7.26.1 "String function conventions" paragraph 1.)</p>
<p>However, there are less clear cases such as <code>%s</code> in a call to a
<code>*printf</code> function which are not explicitly described as being an
array. Which makes it unclear if <code>%s</code> can be provided a pointer to
storage without a null terminator if a conversion failure occurred
earlier. There are also cases such as <code>mbsrtowcs</code> which indirectly
access an array, so the wording does not appear to apply to them.
Perhaps it would make more sense to talk about arrays accessed using a
function argument, rather than the function argument being an array.</p>
</div>
<hr>
<hr>
<div id="issue1117">
<h2>Issue 1117: Effective type object access requirements</h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-10-01<br>
Status: Open</p>
<blockquote>
<p>An object shall have its stored value accessed only by an lvalue
expression that has one of the following types:</p>
<ul>
<li>a type compatible with the effective type of the object,</li>
<li>a qualified version of a type compatible with the effective type
of the object,</li>
<li>the signed or unsigned type compatible with the underlying type
of the effective type of the object,</li>
<li>the signed or unsigned type compatible with a qualified version of
the underlying type of the effective type of the object,</li>
<li>an aggregate or union type that includes one of the aforementioned
types among its members (including, recursively, a member of a
subaggregate or contained union), or</li>
<li>a character type.</li>
</ul>
</blockquote>
<p>(C23 6.5.1 "General" paragraph 7.)</p>
<p>This paragraph has two issues. First, consider the following:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#include</span><span style="color: #3D7B7B; font-style: italic"><wchar.h></span>
<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">main</span>(){
<span style="color: #008000; font-weight: bold">const</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">wchar_t</span><span style="color: #bbbbbb"> </span>s[]<span style="color: #666666">=</span><span style="color: #BA2121">L"1?"</span>;
<span style="color: #B00040">wchar_t</span><span style="color: #666666">*</span>p;
wcstol(s,<span style="color: #666666">&</span>p,<span style="color: #666666">10</span>);
putwchar(<span style="color: #666666">*</span>p);
putwchar(<span style="color: #BA2121">L'\n'</span>);
}
</pre></div>
<p>This ought to be fine, but none of the bullets seem to allow it.
Specifically, removing qualifiers never appears to be permitted though
it was always the intent to be able to remove <code>const</code> while not
actually modifying the object. Removing <code>volatile</code> is also
specifically forbidden, though that goes even further and forbids
forming the lvalue rather than just accessing the object. Removing
<code>restrict</code> should have no effect. Second, consider the following:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#include</span><span style="color: #3D7B7B; font-style: italic"><stdio.h></span>
<span style="color: #008000; font-weight: bold">enum</span><span style="color: #bbbbbb"> </span>E<span style="color: #666666">:</span><span style="color: #B00040">int</span>;
<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">main</span>(){
<span style="color: #008000; font-weight: bold">enum</span><span style="color: #bbbbbb"> </span>E<span style="color: #bbbbbb"> </span>a<span style="color: #666666">=0</span>;
printf(<span style="color: #BA2121">"%u</span><span style="color: #AA5D1F; font-weight: bold">\n</span><span style="color: #BA2121">"</span>,<span style="color: #666666">*</span>(<span style="color: #B00040">unsigned</span><span style="color: #666666">*</span>)<span style="color: #666666">&</span>a);
<span style="color: #B00040">unsigned</span><span style="color: #bbbbbb"> </span>b<span style="color: #666666">=0</span>;
printf(<span style="color: #BA2121">"%i</span><span style="color: #AA5D1F; font-weight: bold">\n</span><span style="color: #BA2121">"</span>,<span style="color: #666666">*</span>(<span style="color: #008000; font-weight: bold">enum</span><span style="color: #bbbbbb"> </span>E<span style="color: #666666">*</span>)<span style="color: #666666">&</span>b);
}
</pre></div>
<p>The third bullet and fourth bullet are worded weirdly by saying
"compatible with" instead of "corresponding to", though this has been
fixed in C2Y. However, the intent appears to be that a signed integer
type or unsigned integer type can be accessed using the corresponding
integer type of the opposite signedness. In C23 the wording was
changed to specify the underlying type, which means that the first
call to <code>printf</code> is defined since it is the corresponding integer type
of the opposite signedness to the underlying type of <code>E</code>. There is
nothing that allows the reverse though, so the second call to <code>printf</code>
is undefined. I assume that it was not intended for these bullets to
be unidirectional in this case, and that both calls to <code>printf</code> should
have the same validity.</p>
<p>No suggested correction is provided because the proposal
<a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3907.htm">N3907</a>
intends on significantly changing this wording. Though if
<a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3931.htm">N3931</a>
also gets accepted, that could be used in this paragraph which would
be like what C++ does.</p>
</div>
<hr>
<hr>
<div id="issue1118">
<h2>Issue 1118: Flexible array member layout</h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-10-09<br>
Status: Open</p>
<blockquote>
<p>EXAMPLE 3 After the declaration:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">s</span><span style="color: #bbbbbb"> </span>{<span style="color: #bbbbbb"> </span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>n;<span style="color: #bbbbbb"> </span><span style="color: #B00040">double</span><span style="color: #bbbbbb"> </span>d[];<span style="color: #bbbbbb"> </span>};
</pre></div>
<p>the structure <code>struct s</code> has a flexible array member <code>d</code>. A typical
way to use this is:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>m<span style="color: #bbbbbb"> </span><span style="color: #666666">=</span><span style="color: #bbbbbb"> </span><span style="color: #3D7B7B; font-style: italic">/* some value */</span>;
<span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">s</span><span style="color: #bbbbbb"> </span><span style="color: #666666">*</span>p<span style="color: #bbbbbb"> </span><span style="color: #666666">=</span><span style="color: #bbbbbb"> </span>malloc(<span style="color: #008000; font-weight: bold">sizeof</span>(<span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">s</span>)<span style="color: #bbbbbb"> </span><span style="color: #666666">+</span><span style="color: #bbbbbb"> </span><span style="color: #008000; font-weight: bold">sizeof</span>(<span style="color: #B00040">double</span><span style="color: #bbbbbb"> </span>[m]));
</pre></div>
<p>and assuming that the call to <code>malloc</code> succeeds, the object pointed
to by <code>p</code> behaves, for most purposes, as if <code>p</code> had been declared
as:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span>{<span style="color: #bbbbbb"> </span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>n;<span style="color: #bbbbbb"> </span><span style="color: #B00040">double</span><span style="color: #bbbbbb"> </span>d[m];<span style="color: #bbbbbb"> </span>}<span style="color: #bbbbbb"> </span><span style="color: #666666">*</span>p;
</pre></div>
<p>(there are circumstances in which this equivalence is broken; in
particular, the offsets of member <code>d</code> can sometimes not be the
same).</p>
</blockquote>
<p>(C23 6.7.3.2 "Structure and union specifiers" paragraph 23.)</p>
<p>This example suggests that the offsets of the array members can be
different, however this seems to conflict with:</p>
<blockquote>
<p>One special guarantee is made to simplify the use of unions: if a
union contains several structures that share a common initial
sequence (see following sentence), and if the union object currently
contains one of these structures, it is permitted to inspect the
common initial part of any of them anywhere that a declaration of
the completed type of the union is visible. Two structures share a
<em>common initial sequence</em> if corresponding members have compatible
types (and, for bit-fields, the same widths) for a sequence of one
or more initial members.</p>
</blockquote>
<p>(C23 6.5.3.4 "Structure and union members" paragraph 6.)</p>
<p>The array members are part of the common initial sequence because the
array types are compatible and all prior members are the same. Was it
the intent to require that flexible array members can be corresponding
members in common initial sequences with complete array members, and
by extension require the same offset?</p>
</div>
<hr>
<hr>
<div id="issue1119">
<h2>Issue 1119: Meaning of <code>TSS_DTOR_ITERATIONS</code></h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-10-09<br>
Status: Open</p>
<blockquote>
<p><code>TSS_DTOR_ITERATIONS</code></p>
<p>which expands to an integer constant expression representing the
maximum number of times that destructors will be called when a
thread terminates.</p>
</blockquote>
<p>(C23 7.28.1 "Introduction" paragraph 3.)</p>
<blockquote>
<p>For every thread-specific storage key which was created with a
non-null destructor and for which the value is non-null, <code>thrd_exit</code>
sets the value associated with the key to a null pointer value and
then invokes the destructor with its previous value. The order in
which destructors are invoked is unspecified.</p>
<p>If after this process there remain keys with both non-null
destructors and values, the implementation repeats this process up
to <code>TSS_DTOR_ITERATIONS</code> times.</p>
</blockquote>
<p>(C23 7.28.5.5 "The <code>thrd_exit</code> function" paragraphs 2 and 3.)</p>
<h3>Question 1</h3>
<p>In the definition of <code>TSS_DTOR_ITERATIONS</code> it is stated that
<code>TSS_DTOR_ITERATIONS</code> represents the maximum number of times that
destructors will be called, while in the definition of <code>thrd_exit</code> it
is stated that <code>TSS_DTOR_ITERATIONS</code> represents the maximum number of
times that destructors being called will be repeated. Those
definitions give contradictory maxima, which was the intent? For
example, if <code>TSS_DTOR_ITERATIONS</code> is defined as one would it be valid
to repeat calling the destructors?</p>
<h3>Question 2</h3>
<p>Can <code>TSS_DTOR_ITERATIONS</code> be negative? There does not appear to be
anything specifically forbidding it, though the meaning of the text
defining <code>TSS_DTOR_ITERATIONS</code> would be unclear with such a
definition.</p>
<h3>Question 3</h3>
<p>If the answer to question one is that the maximum described in the
definition of <code>TSS_DTOR_ITERATIONS</code> is correct, can
<code>TSS_DTOR_ITERATIONS</code> be zero?</p>
</div>
<hr>
<hr>
<div id="issue1120">
<h2>Issue 1120: Full expressions, declarators, and abstract declarators</h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-10-13<br>
Status: Open<br>
Cross-references: <a href="https://www.open-std.org/jtc1/sc22/wg14/issues/c11c17/issue0439.html">0439</a>, <a href="https://www.open-std.org/jtc1/sc22/wg14/issues/c11c17/issue0495.html">0495</a></p>
<p>This is related to <a href="https://www.open-std.org/jtc1/sc22/wg14/issues/c11c17/issue0439.html">DR 439</a> part D and <a href="https://www.open-std.org/jtc1/sc22/wg14/issues/c11c17/issue0495.html">DR
495</a>. Those focused on expressions not belonging to any
full expression, but did not clarify how variably modified abstract
declarators in the declaration specifiers of a declaration interact
with variably modified declarators in the same declaration. All
following examples assume that the implementation does not support any
extended integer constant expressions that would change their
behavior. This issue focuses on <code>typeof</code>, but the same issues also
apply to atomic type specifiers.</p>
<blockquote>
<p>A <em>full expression</em> is an expression that is not part of another
expression, nor part of a declarator or abstract declarator. There
is also an implicit full expression in which the non-constant size
expressions for a variably modified type are evaluated; within that
full expression, the evaluation of different size expressions are
unsequenced with respect to one another. There is a sequence point
between the evaluation of a full expression and the evaluation of
the next full expression to be evaluated.</p>
</blockquote>
<p>(C23 6.8.1 "General" paragraph 4.)</p>
<p>Consider the following:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#include</span><span style="color: #3D7B7B; font-style: italic"><stdio.h></span>
<span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">S</span>{<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>a[<span style="color: #666666">1</span>];};
<span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">S</span><span style="color: #bbbbbb"> </span>f(){
<span style="color: #008000; font-weight: bold">return</span>(<span style="color: #008000; font-weight: bold">struct</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF; font-weight: bold">S</span>){};
}
<span style="color: #B00040">int</span><span style="color: #666666">*</span>p;
<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">g</span>(<span style="color: #B00040">int</span><span style="color: #666666">*</span>q){
p<span style="color: #666666">=</span>q;
<span style="color: #008000; font-weight: bold">return</span><span style="color: #bbbbbb"> </span><span style="color: #666666">1</span>;
}
<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">h</span>(){
printf(<span style="color: #BA2121">"%i</span><span style="color: #AA5D1F; font-weight: bold">\n</span><span style="color: #BA2121">"</span>,p<span style="color: #666666">?*</span>p<span style="color: #666666">:1</span>);
<span style="color: #008000; font-weight: bold">return</span><span style="color: #bbbbbb"> </span><span style="color: #666666">1</span>;
}
<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">main</span>(){
typeof(<span style="color: #B00040">char</span>[g(f().a)])b[h()];
}
</pre></div>
<p>What should the behavior of this program be? If the calls to <code>g</code> and
<code>h</code> belong to different full expressions, then the behavior appears to
be undefined because the lifetime of the object with temporary
lifetime would have ended before the call to <code>h</code> had begun. If the
calls to <code>g</code> and <code>h</code> belong to the same full expression, then it
appears the result is unspecified: either zero or one can be printed.
Note that the nonnormative list of full expressions after the quoted
paragraph does not include a separate full expression for the call to
<code>g</code>, but also says that the full declarator for <code>b</code> is a full
expression which would mean that the call to <code>g</code> is not part of it.
This should also be considered in the context of <code>typeof</code> with an
expression:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#include</span><span style="color: #3D7B7B; font-style: italic"><stdio.h></span>
<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">main</span>(){
typeof(putchar(<span style="color: #BA2121">'A'</span>),(<span style="color: #B00040">char</span>(<span style="color: #666666">*</span>)[putchar(<span style="color: #BA2121">'B'</span>)<span style="color: #666666">||1</span>])<span style="color: #666666">0</span>)c[putchar(<span style="color: #BA2121">'C'</span>)<span style="color: #666666">||1</span>];
putchar(<span style="color: #BA2121">'\n'</span>);
}
</pre></div>
<p>This appears to be well defined since the expression in the <code>typeof</code>
satisfies the definition of a full expression. However,
implementations do not all seem to agree with this. GCC prints ABC,
while Clang prints CAB. TCC prints BC, though that is obviously
nonconforming. Parameter declarations, including unnamed parameters
should also be considered. Note that in type names that are inside of
expressions full expressions would not be created so there does not
appear to be any sequencing guarantees. If the intent in the first
example is that the calls to <code>g</code> and <code>h</code> belong to different full
expressions, it should be considered if nested <code>typeof</code> operators can
create further full expressions. Lastly, any correction should
consider that in a declaration the type specified in the declaration
specifiers is visible from all declarators in the same declaration
except the first and all initializers in the same declaration.</p>
</div>
<hr>
<hr>
<div id="issue1121">
<h2>Issue 1121: Bitwise representation of unsigned integer types</h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-10-13<br>
Status: Open</p>
<blockquote>
<p>The values of any padding bits are unspecified. A valid object
representation of a signed integer type where the sign bit is zero
is a valid object representation of the corresponding unsigned type,
and shall represent the same value. For any integer type, the object
representation where all the bits are zero shall be a representation
of the value zero in that type.</p>
</blockquote>
<p>(C23 6.2.6.2 "Integer types" paragraph 3.)</p>
<p>This paragraph says that any nonnegative value in a signed integer
type shall be a valid object representation of the same value in the
corresponding unsigned integer type. For example:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">main</span>(){
<span style="color: #008000; font-weight: bold">union</span>{<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>i;<span style="color: #B00040">unsigned</span><span style="color: #bbbbbb"> </span>u;}u<span style="color: #666666">=</span>{};
<span style="color: #008000; font-weight: bold">return</span><span style="color: #bbbbbb"> </span>u.u;
}
</pre></div>
<p>The first member is initialized, but the object representation is
guaranteed to be valid in both types and it is guaranteed the value
represented in both types is the same. However, there is nothing
saying the reverse:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">main</span>(){
<span style="color: #008000; font-weight: bold">union</span>{<span style="color: #B00040">unsigned</span><span style="color: #bbbbbb"> </span>U;<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span>I;}U<span style="color: #666666">=</span>{};
<span style="color: #008000; font-weight: bold">return</span><span style="color: #bbbbbb"> </span>U.I;
}
</pre></div>
<p>It appears that this could be undefined because the representation of
zero in <code>unsigned</code> corresponds to a non-value representation in <code>int</code>.
I do not think this was the intent, considering that <code>va_arg</code> allows
this conversion.</p>
<h3>Suggested correction</h3>
<p>Modify C23 6.2.6.2 paragraph 3:</p>
<blockquote>
<p>The values of any padding bits are unspecified. A valid object
representation of a signed integer type where the sign bit is zero
is a valid object representation of the corresponding unsigned type,
and shall represent the same value.<ins> A valid object
representation of an unsigned integer type where the most
significant bit is zero is a valid object representation of the
corresponding signed type, if any, and shall represent the same
value.</ins> For any integer type, the object representation where
all the bits are zero shall be a representation of the value zero in
that type.</p>
</blockquote>
<p>Note: In C2Y the text ", if any" can be deleted.</p>
</div>
<hr>
<hr>
<div id="issue1122">
<h2>Issue 1122: Constraints on string literals and character constants</h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-10-14<br>
Status: Open<br>
Cross-references: <a href="https://www.open-std.org/jtc1/sc22/wg14/issues/c99/issue0265.html">0265</a>, <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1113">1113</a></p>
<p>For the following questions assume that the following macro is always
defined:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#define IGNORE(...)</span>
</pre></div>
<h3>Question 1</h3>
<blockquote>
<p>The same considerations apply to each element of the sequence in a
string literal as if it were in an integer character constant (for a
character or UTF-8 string literal) or a wide character constant (for
a wide string literal), except that the single-quote <code>'</code> is
representable either by itself or by the escape sequence <code>\'</code>, but
the double-quote <code>"</code> shall be represented by the escape sequence
<code>\"</code>.</p>
</blockquote>
<p>(C23 6.4.6 "String literals" paragraph 4.)</p>
<p>This appears to apply the constraints of octal escape sequences and
hexadecimal escape sequences as specified earlier for character
constants to string literals. Does this apply the constraints before
string literal concatenation or after string literal concatenation?
For example:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #008000; font-weight: bold">const</span><span style="color: #bbbbbb"> </span>typeof(<span style="color: #BA2121">u' '</span>)a[]<span style="color: #666666">=</span><span style="color: #BA2121">u"""</span><span style="color: #AA5D1F; font-weight: bold">\400</span><span style="color: #BA2121">"</span>;
</pre></div>
<p>If <code>CHAR_BIT</code> is eight, it is unclear whether or not this declaration
has a constraint violation.</p>
<h3>Question 2</h3>
<p>Do the constraints on octal escape sequences and hexadecimal escape
sequences apply to preprocessing tokens which are never converted to
tokens? For example:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span>IGNORE(<span style="color: #BA2121">'\400'</span>)
IGNORE(<span style="color: #BA2121">"</span><span style="color: #AA5D1F; font-weight: bold">\400</span><span style="color: #BA2121">"</span>)
<span style="color: #9C6500">#if 0</span>
<span style="color: #3D7B7B; font-style: italic">'\400'</span>
<span style="color: #3D7B7B; font-style: italic">"\400"</span>
<span style="color: #9C6500">#endif</span>
</pre></div>
<p>Must these invalid octal escape sequences be rejected if <code>CHAR_BIT</code> is
eight? If question one is resolved as applying the constraints after
string literal concatenation, then the answer for string literals is
obvious.</p>
<h3>Question 3</h3>
<p>Do the constraints on universal character names apply to string
literal preprocessing tokens and character constant preprocessing
tokens which in either case are never converted to tokens? For
example:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span>IGNORE(<span style="border: 1px solid #FF0000">'</span>\uD800<span style="border: 1px solid #FF0000">'</span>)
IGNORE(<span style="color: #BA2121">"</span><span style="color: #AA5D1F; font-weight: bold">\uD800</span><span style="color: #BA2121">"</span>)
<span style="color: #9C6500">#if 0</span>
<span style="color: #3D7B7B; font-style: italic">'\uD800'</span>
<span style="color: #3D7B7B; font-style: italic">"\uD800"</span>
<span style="color: #9C6500">#endif</span>
</pre></div>
<p>GCC, Clang, MSVC, and EDG all accept this and the example in question
two. Inside of skipped groups there is disagreement about whether the
constraints apply to identifiers and preprocessing numbers: GCC and
Clang reject, while MSVC and EDG accept.</p>
<h3>Question 4</h3>
<blockquote>
<p>For the purposes of this token conversion and evaluation, all signed
integer types and all unsigned integer types act as if they have the
same representation as, respectively, the types <code>intmax_t</code> and
<code>uintmax_t</code> defined in the header <code><stdint.h></code>. This includes
interpreting character constants, which can involve converting
escape sequences into execution character set members.</p>
</blockquote>
<p>(C23 6.10.2 "Conditional inclusion" paragraph 13.)</p>
<p>Does this mean that inside of conditional expression inclusion
preprocessing directives the constraints on character constants are
based on <code>uintmax_t</code>? For example:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#if'\400'</span>
<span style="color: #9C6500">#endif</span>
</pre></div>
<p>Is this valid when <code>CHAR_BIT</code> is eight? If the range of <code>char</code> is
interpreted as being affected because both <code>signed char</code> and <code>unsigned char</code> are affected, then it appears that this could also affect the
resulting value:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#if'\377'==-1</span>
<span style="color: #9C6500">#error</span>
<span style="color: #9C6500">#endif</span>
</pre></div>
<p>Is this valid for any value of <code>CHAR_MAX</code>? GCC, Clang, MSVC, and EDG
all reject both of the previous examples in this question. It should
also be considered if character constants that contain a single
character or a single escape sequence which in either case is in the
basic character set (source or execution depending upon how <a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3977.htm#issue1113">issue
1113</a> is resolved) can have a value not normally possible:</p>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#include</span><span style="color: #3D7B7B; font-style: italic"><limits.h></span>
<span style="color: #9C6500">#if'a'>CHAR_MAX</span>
<span style="color: #9C6500">#error</span>
<span style="color: #9C6500">#endif</span>
</pre></div>
<p>Can this be invalid? See also <a href="https://www.open-std.org/jtc1/sc22/wg14/issues/c99/issue0265.html">DR 265</a>.</p>
</div>
<hr>
<hr>
<div id="issue1123">
<h2>Issue 1123: <code>fopen</code> and <code>restrict</code> qualified parameters</h2>
<p>Authors: Jay Ghiron<br>
Date: 2026-10-15<br>
Status: Open</p>
<p>Normally, standard library functions only have <code>restrict</code> qualifiers
added in cases where it is important. However, there is one exception:</p>
<blockquote>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#include</span><span style="color: #bbbbbb"> </span><span style="color: #3D7B7B; font-style: italic"><stdio.h></span>
<span style="color: #B00040">FILE</span><span style="color: #bbbbbb"> </span><span style="color: #666666">*</span><span style="color: #0000FF">fopen</span>(<span style="color: #008000; font-weight: bold">const</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">char</span><span style="color: #bbbbbb"> </span><span style="color: #666666">*</span><span style="color: #bbbbbb"> </span><span style="color: #008000; font-weight: bold">restrict</span><span style="color: #bbbbbb"> </span>filename,<span style="color: #bbbbbb"> </span><span style="color: #008000; font-weight: bold">const</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">char</span><span style="color: #bbbbbb"> </span><span style="color: #666666">*</span><span style="color: #bbbbbb"> </span><span style="color: #008000; font-weight: bold">restrict</span><span style="color: #bbbbbb"> </span>mode);
</pre></div>
</blockquote>
<p>(C23 7.23.5.3 "The <code>fopen</code> function" paragraph 1.)</p>
<p>These <code>restrict</code> qualifiers are useless, since there is nothing
mutable that the pointers can alias with. Note that it is not
possible to validly form a pointer into a <code>FILE</code> object before said
object exists. Other functions that cannot have mutable aliasing,
even those that take the same arguments as <code>fopen</code> do not use
<code>restrict</code> qualifiers:</p>
<blockquote>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#include</span><span style="color: #bbbbbb"> </span><span style="color: #3D7B7B; font-style: italic"><string.h></span>
<span style="color: #B00040">int</span><span style="color: #bbbbbb"> </span><span style="color: #0000FF">strcmp</span>(<span style="color: #008000; font-weight: bold">const</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">char</span><span style="color: #bbbbbb"> </span><span style="color: #666666">*</span>s1,<span style="color: #bbbbbb"> </span><span style="color: #008000; font-weight: bold">const</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">char</span><span style="color: #bbbbbb"> </span><span style="color: #666666">*</span>s2);
</pre></div>
</blockquote>
<p>(C23 7.26.4.3 "The strcmp function" paragraph 1.)</p>
<p>Using <code>restrict</code> qualifiers in the declaration of <code>fopen</code> only serves
to create confusion about the meaning of <code>restrict</code> qualifiers in
function parameters of standard library functions. Perhaps the
<code>restrict</code> qualifiers could be interpreted as preventing aliasing with
<code>errno</code>, though if that were the intent many more functions should
have <code>restrict</code> qualifiers added.</p>
<h3>Suggested correction</h3>
<p>Replace C23 7.23.5.3 paragraph 1:</p>
<blockquote>
<div class="highlight" style="background: #f8f8f8"><pre style="line-height: 125%;"><span></span><span style="color: #9C6500">#include</span><span style="color: #bbbbbb"> </span><span style="color: #3D7B7B; font-style: italic"><stdio.h></span>
<span style="color: #B00040">FILE</span><span style="color: #bbbbbb"> </span><span style="color: #666666">*</span><span style="color: #0000FF">fopen</span>(<span style="color: #008000; font-weight: bold">const</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">char</span><span style="color: #bbbbbb"> </span><span style="color: #666666">*</span>filename,<span style="color: #bbbbbb"> </span><span style="color: #008000; font-weight: bold">const</span><span style="color: #bbbbbb"> </span><span style="color: #B00040">char</span><span style="color: #bbbbbb"> </span><span style="color: #666666">*</span>mode);
</pre></div>
</blockquote>
<p>Note: Annex B should be updated to remove the <code>restrict</code> qualifiers
too.</p>
</div>
<hr>
</body></html>