{{Short description|C programming language standard draft planned for release in 2029}} {{C language revisions}}
'''C29''' is the upcoming revision of the C programming language after C23 that is planned for release in late 2029,<ref>{{Cite web |last=Seacord |first=Robert |title=C2Y Schedule |url=https://open-std.org/JTC1/SC22/WG14/www/docs/n3827.pdf |url-status=live |archive-url=https://web.archive.org/web/20260422123529/https://open-std.org/JTC1/SC22/WG14/www/docs/n3827.pdf |archive-date=2026-04-22}}</ref> informally named '''C2Y'''. Early working drafts of C29 were released after the January 2024 WG14 meeting. The current working draft N3854 was released in March 2026.<ref name="WG14-Doc-Repository"/> Changes have already started to be integrated in popular C/C++ compilers: GCC 15 and Clang 19.<ref name="GNU-GCC-1"/><ref name="LLVM-Clang-1"/><ref name="LLVM-Clang-2"/>
==Features== The following are changes integrated into the latest working draft of C29.<ref name="C29-Latest">{{cite web |title=WG14-N3685: Working Draft for ISO/IEC 9899:202Y |date=September 28, 2025 |website=open-std.org |url=https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3685.pdf |archive-url=https://web.archive.org/web/20251031182213/https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3685.pdf |archive-date=October 31, 2025 |url-status=live}}</ref><ref name="WG14-Doc-Repository">{{cite web |title=WG14 Document Repository |date= |website=open-std.org |url=https://www.open-std.org/jtc1/sc22/wg14/www/wg14_document_log.htm |archive-url=https://web.archive.org/web/20250930192538/https://www.open-std.org/jtc1/sc22/wg14/www/wg14_document_log.htm |archive-date=September 30, 2025 |url-status=live}}</ref> The following changes are still is the draft stage, thus anything may change before the final ratification.
''Note: This section is not complete. Changes listed in the History section will be incrementally migrated into this section over time.''
===Constants=== * Add <code>0o</code> and <code>0O</code> octal prefix for literal constants; such as <code>0o137</code> and <code>0O247</code>.<ref name="N3353"/> This change is similar to the <code>0b</code> and <code>0B</code> binary prefixes that were previously added in the C23 & C++14 standards,<ref name="N2630">{{cite web |title=WG14-N2630: Formatted input/output of binary integer numbers (rev3) (for C23) |date=January 1, 2021 |website=open-std.org |url=https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2630.pdf |archive-url=https://web.archive.org/web/20221214154315/https://open-std.org/JTC1/SC22/WG14/www/docs/n2630.pdf |archive-date=December 14, 2022 |url-status=live}}</ref> and earlier established <code>0x</code> and <code>0X</code> hexadecimal prefixes. * Add <code>{}</code> delimited escape sequences for C strings: <code>\o{}</code> for octal (arbitrary number of octal digits), <code>\x{}</code> for hexadecimal (arbitrary number of hex digits), <code>\u{}</code> for universal character name (sequence of hex digits that represents a valid Unicode character); such as {{code|"\o{110}\x{65}llo"}} which creates a string identical to "Hello" (in ASCII), and <code>"\u{2021}"</code> which is the Unicode value of a double dagger "‡" character, creating that character.<ref name="N3353"/> This change was previously added in the C++23 standard.<ref name="p2290">{{cite web |title=WG21-p2290r3: Delimited escape sequences (for C++23) |date=February 25, 2022 |website=open-std.org |url=http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2290r3.pdf |archive-url=https://web.archive.org/web/20251011142846/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2290r3.pdf |archive-date=October 11, 2025 |url-status=live}}</ref> The <code>\u{}</code> format is an established syntax in Rust and JavaScript computer languages too.
===Operators=== * Add <code>_Countof</code> keyword & operator, and <code>countof()</code> macro in the new <code><stdcountof.h></code> header of the C standard library to determine the number of elements of an array, such as {{code|2=c|1=long baudrate[22]; size_t n = countof(baudrate);}} means <code>n</code> is 22.<ref name="N3369">{{cite web |title=WG14-N3369: New _Lengthof() operator (v4) |date=October 1, 2021 |website=open-std.org |url=https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3369.pdf |archive-url=https://web.archive.org/web/20250831052828/https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3369.pdf |archive-date=August 31, 2025 |url-status=live}}</ref><ref name="N3469">{{cite web |title=WG14-N3469: The Big Array Size Survey |date=February 3, 2025 |website=open-std.org |url=https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3469.htm |archive-url=https://web.archive.org/web/20251007021323/https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3469.htm |archive-date=October 7, 2025 |url-status=live}}</ref><ref>{{cite web |title=The Big Array Size Survey for C |date=November 6, 2024 |website=thephd.dev |url=https://thephd.dev/the-big-array-size-survey-for-c |archive-url=https://web.archive.org/web/20250404092018/https://thephd.dev/the-big-array-size-survey-for-c |archive-date=April 4, 2025 |url-status=live}}</ref> This is already possible in C++ using the <code>std::size()</code> function.<ref>{{Cite web|title=std::size, std::ssize|url=https://en.cppreference.com/w/cpp/iterator/size.html|website=cppreference.com|publisher=cppreference.com|author=cppreference.com|access-date=14 December 2025}}</ref>
===Statements=== * Add the <code>defer</code> keyword and {{mono|defer}} blocks and statements.<ref>{{Cite web|title=Programming - C - defer, a mechanism for general purpose, lexical scope-based undo|url=https://www.open-std.org/JTC1/SC22/WG14/www/docs/n3734.pdf|date=2025|publisher=WG 14|author=JeanHeyd Meneide|website=open-std.org}}</ref> This is similar to Go or Zig which both use <code>defer</code> for cleanup. Compilers like GCC and Clang have implemented this specification.<ref>{{Cite web|title=Clang 22.1.0 Release Notes|url=https://releases.llvm.org/22.1.0/tools/clang/docs/ReleaseNotes.html#id183|website=releases.llvm.org|date=24 February 2026|publisher=LLVM Project|author=LLVM Project}}</ref> * For the <code>if</code> statement, add support for variable declaration, such as {{code|2=c|1=if (int err = xmit_ch('X')) log_err(err);}}, similar to how the <code>for</code> change was added in the C99 standard. The new variable can be used inside the scope of all branches of <code>if</code>, <code>else</code>, <code>else if</code> too. In C++, variable declaration has been allowed since the C++98 standard, further enhanced in the C++17 standard to allow for a second clause so the variable could be used within the condition itself, and C will use the later for C++ compatibility.<ref name="N3356">{{cite web |title=WG14-N3356: 'if' declarations, v3 |date=September 18, 2024 |website=open-std.org |url=https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3356.htm |archive-url=https://web.archive.org/web/20250804074805/https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3356.htm |archive-date=August 4, 2025 |url-status=live}}</ref> * For the <code>switch</code> statement, add support for <code>case</code> ranges by placing <code>...</code> (ellipsis) between two integer constants, such as <code>case 1 ... 3:</code> which would be equivalent to <code>case 1: case 2: case 3:</code>.<ref name="N3370">{{cite web |title=WG14-N3370: Case range expressions, v3.1 |date=October 1, 2024 |website=open-std.org |url=https://www.open-std.org/JTC1/SC22/WG14/www/docs/n3370.htm |archive-url=https://web.archive.org/web/20250804064636/https://www.open-std.org/JTC1/SC22/WG14/www/docs/n3370.htm |archive-date=August 4, 2025 |url-status=live}}</ref> The space between the numbers and the ellipsis is mandatory. * For statements that are iterations and for the <code>switch</code> statement, add naming via labels and transferring control through named <code>break</code> and <code>continue</code> (multi-level breaks). The syntax is the same as in Java.<ref name="N3355">{{cite web |title=WG14-N3355: Named loops, v3 |date=September 18, 2024 |website=open-std.org |url=https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3355.htm |archive-url=https://web.archive.org/web/20251009164647/https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3355.htm |archive-date=October 9, 2025 |url-status=live}}</ref>
===Preprocessor=== * Add <code>__COUNTER__</code> macro. Each time used, the preprocessor expands it into a unique sequential integer literal, starting from 0 and increments by 1 every time it is expanded. Though already in use by many compilers, this change makes it an official standarized macro for C.<ref name="N3457">{{cite web |title=WG14-N3457: The __COUNTER__ predefined macro |date=January 25, 2025 |website=open-std.org |url=https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3457.htm |archive-url=https://web.archive.org/web/20250919170834/https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3457.htm |archive-date=September 19, 2025 |url-status=live}}</ref>
===Standard Library===
====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>, if the value of base is 8 (octal), the characters <code>0o</code> or <code>0O</code> may optionally precede the sequence of digits. If a sign is present, the <code>0o</code> or <code>0O</code> follows the sign.<ref name="N3353"/> * For functions <code>strnlen_s()</code> and <code>wcsnlen_s()</code>, their description was updated to be worded similar to the new <code>strnlen()</code> and <code>wcsnlen()</code> functions (below).<ref name="N3326"/>
====New functions==== * Add <code>strnlen()</code> and <code>wcsnlen()</code> functions, similar to <code>strlen()</code> but instead a specified maximum number of characters will be searched for the end of string character. Both functions have been part of the GNU C library since at least 2001 and later became part of the POSIX.1-2008 standard.<ref name="N3326">{{cite web |title=WG14-N3326: Standardize strnlen and wcsnlen (v3) |date=September 1, 2024 |website=open-std.org |url=https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3326.pdf |archive-url=https://web.archive.org/web/20250421043212/https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3326.pdf |archive-date=April 21, 2025 |url-status=live}}</ref> * Add bit utility functions / macros / types in header <code><stdbit.h></code> to examine many integer types. All start with <code>stdc_</code> to minimize conflict with legacy code and 3rd party libraries.<ref name="N3367">{{cite web |title=WG14-N3367: More Modern Bit Utilities |date=September 4, 2024 |website=open-std.org |url=https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3367.htm |archive-url=https://web.archive.org/web/20251003045904/https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3367.htm |archive-date=October 3, 2025 |url-status=live}}</ref> More bit utility functions were previously added in the C23 standard.<ref name="N3022">{{cite web |title=WG14-N3022: Modern Bit Utilities (for C23) |date=July 6, 2022 |website=open-std.org |url=https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3022.htm |archive-url=https://web.archive.org/web/20221224194734/https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3022.htm |archive-date=December 24, 2022 |url-status=live}}</ref> ** Add <code>stdc_memreverse8()</code> (8-bit) and <code>stdc_memreverse8uN()</code> (exact-width 8-bit) to reverse memory, such as <code>0xAABBCCDDu</code> reversed into <code>0xDDCCBBAAu</code>. For function name suffix: "u" means unsigned, "N" means a multiple of 8, such as 8, 16, 32, ...<ref name="N3367"/> ** Add <code>stdc_rotate_left_uc()</code>, <code>stdc_rotate_left_us()</code>, <code>stdc_rotate_left_ui()</code>, <code>stdc_rotate_left_ul()</code>, <code>stdc_rotate_left_ull()</code>, and generic <code>stdc_rotate_left()</code> to rotate bits left.<ref name="N3367"/> ** Add <code>stdc_rotate_right_uc()</code>, <code>stdc_rotate_right_us()</code>, <code>stdc_rotate_right_ui()</code>, <code>stdc_rotate_right_ul()</code>, <code>stdc_rotate_right_ull()</code>, and generic <code>stdc_rotate_right()</code> to rotate bits right.<ref name="N3367"/> ** Add <code>stdc_load8_leuN()</code>, <code>stdc_load8_beuN()</code>, <code>stdc_load8_aligned_leuN()</code>, <code>stdc_load8_aligned_beuN()</code>, and <code>stdc_load8_lesN()</code>, <code>stdc_load8_besN()</code>, <code>stdc_load8_aligned_lesN()</code>, <code>stdc_load8_aligned_besN()</code> to perform endian-aware 8-bit loads. For function name suffix: "b" means big endian, "l" means little endian, "u" means unsigned, "s" means signed, "N" means a multiple of 8 such as 8, 16, 32, ...<ref name="N3367"/> ** Add <code>stdc_store8_leuN()</code>, <code>stdc_store8_beuN()</code>, <code>stdc_store8_aligned_leuN()</code>, <code>stdc_store8_aligned_beuN()</code>, and <code>stdc_store8_lesN()</code>, <code>stdc_store8_besN()</code>, <code>stdc_store8_aligned_lesN()</code>, <code>stdc_store8_aligned_besN()</code> to perform endian-aware 8-bit stores. For function name suffix: "b" means big endian, "l" means little endian, "u" means unsigned, "s" means signed, "N" means a multiple of 8 such as 8, 16, 32, ...<ref name="N3367"/> * Add text transcoding utilities under the header <code><stdmchar.h></code>.<ref>{{Cite web|title=Standard library header <stdmchar.h>|url=https://en.cppreference.com/c/header/stdmchar|publisher=cppreference.com|website=cppreference.com|author=cppreference.com|access-date=27 April 2026}}</ref>
==Obsolete features== Obsolete C programming language features removed or deprecated in the working draft of C29:<ref name="C29-Latest"/><ref name="WG14-Doc-Repository"/>
===Constants=== * For octal literals, such as <code>057</code>, the leading zero will be marked as obsolescent but retained to avoid breaking existing code. Compilers should output a warning that will hopefully encourage rewrites. As of N3353, there will be no changes to <code>printf()</code>, but WG14 would like to see a future paper that propose changes.<ref name="N3353">{{cite web |title=WG14-N3353: Obsolete implicitly octal literals and add delimited escape sequences |date=October 18, 2024 |website=open-std.org |url=https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3353.htm |archive-url=https://web.archive.org/web/20251003045654/https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3353.htm |archive-date=October 3, 2025 |url-status=live}}</ref>
===Keywords=== * Remove <code>_Imaginary</code> from the list of keywords.<ref name="N3274">{{cite web |title=WG14-N3274: Remove imaginary types |date=June 14, 2024 |website=open-std.org |url=https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3274.pdf |archive-url=https://web.archive.org/web/20250824192019/https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3274.pdf |archive-date=August 24, 2025 |url-status=live}}</ref>
==Compiler support== The following compilers implement an experimental compiler flag to support C29: * GNU GCC 15.<ref name="GNU-GCC-1">{{cite web |title=GCC 15 Release Series |website=GNU.org |url=https://gcc.gnu.org/gcc-15/changes.html |archive-url=https://web.archive.org/web/20251027125127/https://gcc.gnu.org/gcc-15/changes.html |archive-date=October 27, 2025 |url-status=live}}</ref> * LLVM Clang 19.<ref name="LLVM-Clang-1">{{cite web |title=LLVM Clang 19 Adds Initial "-std=c2y" Support For The Next C Standard |date=July 2, 2024 |website=Phoronix.com |url=https://www.phoronix.com/news/LLVM-Clang-19-std-C2Y |archive-url=https://web.archive.org/web/20251027122422/https://www.phoronix.com/news/LLVM-Clang-19-std-C2Y |archive-date=October 27, 2025 |url-status=live}}</ref><ref name="LLVM-Clang-2">{{cite web |title=C Support in Clang - C2Y implementation status |website=LLVM.org |url=https://clang.llvm.org/c_status.html#c2y |archive-url=https://web.archive.org/web/20251027123337/https://clang.llvm.org/c_status.html#c2y |archive-date=October 27, 2025 |url-status=live}}</ref>
==History== The {{Hilite|highlighted}} changes in this section have been summarized in the feature sections above.
===January 2024=== The following changes were made after the January 2024 WG14 meeting:<ref name="C29-Latest"/><ref name="WG14-Doc-Repository"/> * 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:<ref name="C29-Latest"/><ref name="WG14-Doc-Repository"/> * 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". * {{Hilite|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:<ref name="C29-Latest"/><ref name="WG14-Doc-Repository"/> * 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 <nowiki><math.h></nowiki> 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". * {{Hilite|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". * {{Hilite|N3353}} - "Obsolete Octal and Provide New, Proper Escape Sequences". * {{Hilite|N3355}} - "Named/Labeled Loops". * {{Hilite|N3356}} - "if Declarations". * N3364 - "SNAN Initialization". * N3366 - "Restartable Functions for Efficient Character Conversions". * {{Hilite|N3367}} - "More Modern Bit Utilities". * {{Hilite|N3369}} - "The _Lengthof Operator". * {{Hilite|N3370}} - "Case Ranges in switch Statements". * N3461 - "range error definition followup".
===February 2025=== The following changes were made after the February 2025 WG14 meeting:<ref name="C29-Latest"/><ref name="WG14-Doc-Repository"/> * N3363 - "<nowiki><stdarg.h></nowiki> Wording". * N3401 - "SIGFPE and I/O (v2)". * N3405 - "Improved Wording for Treatment of Error Conditions in <nowiki><math.h></nowiki>". * 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". * {{Hilite|N3460}} - "Complex Operators". * N3466 - "Clarifications on Null Pointers in the Library". * {{Hilite|N3469}} - "Big Array Size Survey (_Lengthof -> _Countof, and <nowiki><stdcountof.h></nowiki> 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".
===August 2025=== The following changes were made after the August 2025 WG14 meeting:<ref name="C29-Latest"/><ref name="WG14-Doc-Repository"/> * N3348 - "Matching of Multi-Dimensional Arrays in Generic Selection Expressions". * {{Hilite|N3457}} - "The __COUNTER__ predefined macro". * N3484 - "Slay Some Earthly Demons V". * N3500 - "Clarification for Complex Suffix Specification". * N3511 - "Remove "category" from "type category" in footnote". * N3517 - "Array subscripting without decay". * N3525 - "static_assert without UB". * N3532 - "Member Access of an Incomplete struct Should Not Be Allowed". * N3535 - "frexp and double-double". * N3536 - "Clarify wording of cproj". * N3537 - "Correct and clarify 7.3.1 Introduction of Complex Arithmetic <nowiki><complex.h></nowiki>". * N3544 - "Classification of the register Storage-class Specifier". * N3558 - "Chasing Ghosts I - "Constant Expressions and Objects of Known Constant Size". * N3563 - "Representation of Pointers and nullptr_t". * N3577 - "Rename uimaxabs to umaxabs". * N3598 - "Make text consistent between creal and cimag". * N3623 - "Slay Some Earthly Demons XIV - "Definition of Main". * N3652 - "Composite types v1.3".
===February 2026=== The following changes were integrated at or before the 2026 February Virtual meeting: * N3715 - "static_assert expressions, v2.2 (November 2025 integration from between-meeting strawpolls, approved August 2025)".
==See also== * C++26 * Compatibility of C and C++ * Outline of the C programming language {{clear}}
==References== {{Reflist}}
==Further reading== * [https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3854.pdf N3854] (latest working draft with C29 changes); WG14; March 2026. ''(free download)'' * [https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3220.pdf N3220] (first working draft after C23; differs from final C23 draft N3219 only in one footnote); WG14; February 2024. ''(free download)''
==External links== {{Portal|Computer programming}} * [https://www.open-std.org/jtc1/sc22/wg14/ C Language WG14 (Working Group 14)] :* [https://www.open-std.org/jtc1/sc22/wg14/www/wg14_document_log.htm WG14 Document Repository] :* [https://www.open-std.org/jtc1/sc22/wg14/www/meetings WG14 Meetings] – agenda and minutes
{{S-start}} {{S-bef| before = C23}} {{S-ttl| title = C language standards}} {{S-non| reason = Latest}} {{end}}
{{C programming language}}
Category:C (programming language) Category:Programming language standards