From Wikipedia, the free encyclopedia
Content deleted Content added
| Line 13: | Line 13: | ||
|
====Existing functions==== |
====Existing functions==== |
||
|
* For functions <code>strtol()</code>, <code>strtoll()</code>, <code>strtoul()</code>, <code>strtoull()</code>, and their wide counterparts <code>wcstol()</code>, <code>wcstoll()</code>, <code>wcstoul()</code>, <code>wcstoull()</code> |
* For functions <code>strtol()</code>, <code>strtoll()</code>, <code>strtoul()</code>, <code>strtoull()</code>, and their wide counterparts <code>wcstol()</code>, <code>wcstoll()</code>, <code>wcstoul()</code>, <code>wcstoull()</code> if the value of base is 8 (octal), the characters <code>0o</code> or <code>0O</code> may optionally precede the sequence of letters and digits. If a sign is present, the <code>0o</code> or <code>0O</code> follows the sign.<ref name=”N3353″/> |
||
|
===Constants=== |
===Constants=== |
||
Revision as of 18:21, 27 October 2025
C programming language standard draft, next revision
C2Y is an informal name for the next revision of the C programming language after C23. The first “C Language Working Group 14” (WG14) meeting primarily about the C2Y draft was held in February 2025.[1] Changes have already started to be integrated in popular C/C++ compilers: GCC 15 and Clang 19.[2][3][4]
Features
The following are changes integrated into the latest working draft of C2Y.[5][6] Note: This section is not complete. Changes listed in the History section will be incrementally migrated into section.
Standard Library
New functions
Existing functions
- For functions
strtol(),strtoll(),strtoul(),strtoull(), and their wide counterpartswcstol(),wcstoll(),wcstoul(),wcstoull(), if the value of base is 8 (octal), the characters0oor0Omay optionally precede the sequence of letters and digits. If a sign is present, the0oor0Ofollows the sign.[7]
Constants
- Add new style of octal literals that start with
0oand0O; such as0o137and0O247.[7] - Add delimited escape sequences
\u{}for universal character name (using hexadecimal),\x{}for hexadecimal escape sequence,\o{}for octal escape sequence; such as\u{123},\x{123},\o{123}. This was previously added to the C++23 standard.[7]
Obsolete features
Obsolete C programming language features removed or deprecated from the working draft of C2Y:[5][6]
- Remove
_Imaginaryfrom the list of keywords.[8] - Octal literals, such as
052with a leading zero, will be retained but marked as obsolescent to avoid breaking existing code. Compilers should output a warning that will hopefully encourage rewrites. As of N3353, there will be no changes toprintf(), but WG14 would like to see a future paper that propose changes.[7]
Compiler support
The following compilers implement an experimental compiler flag to support C2Y:
History
January 2024
The following changes were made after the January 2024 WG14 meeting:[5][6]
- N3192 – “Sequential hexdigits”.
- Editorial – Adjusted a footnote in Annex K from “reserved” to “potentially reserved”.
June 2024
The following changes were made after the June 2024 WG14 meeting:[5][6]
- N3064 – “Writing to multibyte character files”.
- N3232 – “Round-trip rounding”.
- N3233 – “Recommendation for printf rounding”.
- N3239 – “Some constants are literally literals, v2”.
- N3242 – “Problematic use of “correctly rounded”.
- N3244 – “Slay Some Earthly Demons I”.
- N3247 – “fopen “p” and bring fopen’s mode closer to POSIX 202x”.
- N3254 – “Accessing byte arrays, v4”.
- N3259 – “Support ++ and — on complex values”.
- N3260 – “_Generic selection expression with a type operand”.
- N3273 – “alignof of an incomplete array type”.
- N3274 – “Remove imaginary types, v3”.
- Editorial – “may” -> “can” for alignment with ISO/IEC directives.
- Editorial – Table headings changed to match ISO/IEC directives.
September 2024
The following changes were made after the September/October 2024 WG14 meeting:[5][6]
- N3272 – “strftime broken-down structure usage (Option 1 – “Undefined Behavior)”.
- N3286 – “Floating-point exception for Macro Replacements”.
- N3287 – “Nonsensical Parenthetical in Mathematics Specification”.
- N3291 – “Decimal Floating-Point Number Term Misuse”.
- N3298 – “Introduce Complex Literals”.
- N3303 – “HUGE_VAL Corrections”.
- N3305 – “Leftover WANT_… Macros for <math.h> and Decimal Floating-Point”.
- N3312 – “Relax Atomic Alignment Requirements”.
- N3322 – “Allow Zero Length operations on Null Pointers (Including in the Library)”.
- N3323 – “How Do You Add One To Something? (By Using The Proper Type)”.
- N3324 – “‘pole-error’ Wording Fix”.
- N3326 – “Standardize strnlen and wcsnlen”.
- N3340 – “Slay Some Earthly Demons II”.
- N3341 – “Slay Some Earthly Demons III”.
- N3342 – “Slay Some Earthly Demons IV”.
- N3344 – “Slay Some Earthly Demons VI”.
- N3345 – “Slay Some Earthly Demons VII”.
- N3346 – “Slay Some Earthly Demons VIII”.
- N3349 – “abs Without Undefined Behavior”.
- N3353 – “Obsolete Octal and Provide New, Proper Escape Sequences”.
- N3355 – “Named/Labeled Loops”.
- N3356 – “if Declarations”.
- N3364 – “SNAN Initialization”.
- N3366 – “Restartable Functions for Efficient Character Conversions”.
- N3367 – “More Modern Bit Utilities”.
- N3369 – “The _Lengthof Operator”.
- N3370 – “Case Ranges in switch Statements”.
- N3461 – “range error definition followup”.
February 2025
The following changes were made after the February 2025 WG14 meeting:[5][6]
- N3363 – “<stdarg.h> Wording”.
- N3401 – “SIGFPE and I/O (v2)”.
- N3405 – “Improved Wording for Treatment of Error Conditions in <math.h>”.
- N3409 – “Slay Some Earthly Demons X”.
- N3410 – “Slay Some Earthly Demons XI”.
- N3411 – “Slay Some Earthly Demons XII”.
- N3418 – “Slay Some Earthly Demons XIV”.
- N3447 – “Chasing Ghost I – “Constant Expressions”.
- N3448 – “Chasing Ghosts II – “Accessing Allocated Storage”.
- N3451 – “Initialization of Anonymous Structures and Unions (v2)”.
- N3452 – “Complex Literals Warning”.
- N3459 – “Integer and Arithmetic Constant Expressions”.
- N3460 – “Complex Operators”.
- N3466 – “Clarifications on Null Pointers in the Library”.
- N3469 – “Big Array Size Survey (_Lengthof -> _Countof, and <stdcountof.h> header)”.
- N3478 – “Slay Some Earthly Demons XIII”.
- N3481 – “Slay Some Earthly Demons XVI”.
- N3482 – “Slay Some Earthly Demons XVII”.
- N3492 – “Improved treatment of error conditions for functions that round result”.
- N3496 – “Clarify the Specification of the Width Macros”.
- N3505 – “Preprocessor integer expressions, II”.
See also
References
- ^ “WG14-N3583: Draft Minutes for 24–28 February, 2025”. open-std.org. February 28, 2025. Archived from the original on September 20, 2025.
- ^ a b “GCC 15 Release Series”. GNU.org. Archived from the original on October 27, 2025.
- ^ a b “LLVM Clang 19 Adds Initial “-std=c2y” Support For The Next C Standard”. Phoronix.com. July 2, 2024. Archived from the original on October 27, 2025.
- ^ a b “C Support in Clang – C2Y implementation status”. LLVM.org. Archived from the original on October 27, 2025.
- ^ a b c d e f “WG14-N3550: Working Draft for ISO/IEC 9899:202Y” (PDF). open-std.org. May 4, 2025. Archived (PDF) from the original on October 11, 2025.
- ^ a b c d e f “WG14 Document Repository”. open-std.org. Archived from the original on September 30, 2025.
- ^ a b c d “WG14-N3353: Obsolete implicitly octal literals and add delimited escape sequences”. open-std.org. October 18, 2024. Archived from the original on October 3, 2025.
- ^ “WG14-N3274: Remove imaginary types” (PDF). open-std.org. June 14, 2024. Archived (PDF) from the original on August 24, 2025.
Further reading
- N3550 (first working draft with C2Y changes); WG14; May 2025. (free download)
- N3220 (first working draft after C23; differs from final C23 draft N3219 only in one footnote); WG14; February 2024. (free download)

