{"id":36813,"date":"2022-08-19T15:56:50","date_gmt":"2022-08-19T19:56:50","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=36813"},"modified":"2022-08-18T09:39:51","modified_gmt":"2022-08-18T13:39:51","slug":"c23-is-finished","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2022\/08\/19\/c23-is-finished\/","title":{"rendered":"C23 Is Finished"},"content":{"rendered":"<p><a href=\"https:\/\/thephd.dev\/c23-is-coming-here-is-what-is-on-the-menu\">Bj&ouml;rkus Dorkus<\/a> (<a href=\"https:\/\/twitter.com\/__phantomderp\/status\/1555446785245601793\">tweet<\/a>):<\/p>\n<blockquote cite=\"https:\/\/thephd.dev\/c23-is-coming-here-is-what-is-on-the-menu\"><p>What&rsquo;s in C23? Well, it&rsquo;s everything [&#8230;] present in <a href=\"https:\/\/www.open-std.org\/jtc1\/sc22\/wg14\/www\/docs\/n3047.pdf\">N3047<\/a>.<\/p><p>[&#8230;]<\/p><p><a href=\"#the-new-constexpr-keyword-for-c-means-you-don&rsquo;t-have-to-guess-at\"><\/a>The new <code>constexpr<\/code> keyword for C means you don&rsquo;t have to guess at whether that is a constant expression, or hope your compiler&rsquo;s optimizer or frontend is powerful enough to treat it like one to get the code generation you want if VLAs with other extensions are on-by-default. You are guaranteed that this object is a constant expression, and if it is not the compiler will loudly yell at you.<\/p><p>[&#8230;]<\/p><p>While default, plain compound literals have &ldquo;block scope&rdquo; (C) or &ldquo;temporary r-value scope&rdquo; (C++), with the new storage-class specification feature, you can control that.<\/p><p>[&#8230;]<\/p><p><a href=\"#go-read-this-to-find-out-all-about-the-feature-and-how-much-of-a\"><\/a>Go read <a href=\"https:\/\/thephd.dev\/finally-embed-in-c23\">this<\/a> to find out all about the feature and how much of a bloody pyrrhic victory [<code>#embed<\/code>] was.<\/p><p>[&#8230;]<\/p><p><a href=\"#nullptr-and-the-associated-nullptr_t-type-in-stddef-h-fixes-that\"><\/a><code>nullptr<\/code> and the associated <code>nullptr_t<\/code> type in <code>&lt;stddef.h&gt;<\/code> fixes that problem. You can specify <code>nullptr<\/code>, and it&rsquo;s required to have the same underlying representation as the null pointer constant in <code>char*<\/code> or <code>void*<\/code> form. This means it will always be passed correctly, for all ABIs, and you won&rsquo;t read garbage bits.<\/p><p>[&#8230;]<\/p><p>If you ever used <code>__auto_type<\/code> from GCC: this is that, with the name <code>auto<\/code>.<\/p><\/blockquote>\n\n<p>Previously:<\/p>\n<ul>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2014\/02\/12\/embedding-resource-files-in-a-cocoa-foundation-command-line-tool\/\">Embedding Resource Files in a Cocoa Foundation Command Line Tool<\/a><\/li>\n<\/ul>","protected":false},"excerpt":{"rendered":"<p>Bj&ouml;rkus Dorkus (tweet): What&rsquo;s in C23? Well, it&rsquo;s everything [&#8230;] present in N3047.[&#8230;]The new constexpr keyword for C means you don&rsquo;t have to guess at whether that is a constant expression, or hope your compiler&rsquo;s optimizer or frontend is powerful enough to treat it like one to get the code generation you want if VLAs [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"2022-08-19T19:56:57Z","apple_news_api_id":"4a3de83e-e3cc-4505-965f-53959c1a10b9","apple_news_api_modified_at":"2022-08-19T19:56:57Z","apple_news_api_revision":"AAAAAAAAAAD\/\/\/\/\/\/\/\/\/\/w==","apple_news_api_share_url":"https:\/\/apple.news\/ASj3oPuPMRQWWX1OVnBoQuQ","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[45,46,71],"class_list":["post-36813","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-c","tag-languagedesign","tag-programming"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/36813","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=36813"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/36813\/revisions"}],"predecessor-version":[{"id":36814,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/36813\/revisions\/36814"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=36813"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=36813"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=36813"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}