Долгожданный оператор _Countof

Одно из недооценённых событий уходящего года деревянной змеи - в проекте стандарта языка С появился оператор числа элементов. Как заметил один мудрый товарищ, Алексей Годин, даже полвека ещё не прошло, а наконец, дождались.

https://habr.com/ru/articles/1000228/

#C2Y #C23 #массив #array #c++26

Долгожданный оператор _Countof

"Пять грустных солдат, пять веселых солдат и ефрейтор..." Окуджава Б.Ш., 1961 Содержание Оператор _Countof Этимология названия Реализация Терминология Жизнь до _Countof Идиома количества элементов...

Хабр

As a side project, I am working on a deep redesign of the C standard library and am contemplating blogging about it to give myself some motivation, as well as hopefully getting helpful feedback from interested enthusiasts or experienced programmers. Feel free to share this thread and ask questions, I'll be happy to answer them in my next blog post if this gets enough traction (I will post the link here on mastodon).

#programming #c #libc #c23 #c2y #clang #gcc #unix #windows #macos #plan9 #blog

"Behold, the epic quest for 'Dependable C' - because nothing screams #reliability like undefined behavior and broken VLAs 🤦‍♂️! In a dazzling display of verbosity, they ironically try to fix C with more convoluted #C23 and mythical #C2Y, because adding chaos is the path to safety, right? 🤔🔧"
https://dependablec.org/ #DependableC #UndefinedBehavior #SoftwareDevelopment #HackerNews #ngated
Dependable C

@fanf IMO one of the most interesting papers for #c2y . Releasing a new standard with 'optional' along 'defer' by @thephd would give a total breeze of fresh air to C development.
Couldn't agree more with this paragraph from a #C standard proposal written by Chris Bazley for #c2y. I think this issue should be taken seriously by the #wg14 comitee.
Continuing on my thoughts about the #C language; It is widely known that the "pragma once" directive is supported by most of the compilers in the industry. Why not standardize it for #c2y ?

#Cprogramming #C2y The paper of Javier Múgica (with a little bit of co-authorship by myself) about array subscripting has now been accepted into C2y. It has only marginal direct consequences for your everyday code (except perhaps if you use `register` or `constexpr`), but it helps to make arrays in C a little bit less weird.

https://www.open-std.org/JTC1/SC22/WG14/www/docs/n3517.htm

Array subscripting without decay

🌘 C 字串常數是否應設為 const?
➤ 評估 C2y 標準中字串常數 const 限制的影響
https://gustedt.wordpress.com/2025/04/06/make-c-string-literals-const/
Jens Gustedt 的部落格文章探討了在 C2y 標準中,是否應將字串常數的類型改為 const-qualified 的基本類型,如同 C++ 所做的一樣。雖然編譯器早已支援此功能,甚至有些預設啟用,但這仍屬於標準規範的變更,可能對現有程式碼造成影響。作者呼籲社羣提供回饋,特別是那些已經使用相關選項(如 gcc 的 -Wwrite-strings)或測試過此變更影響的專案,以便評估此變更的影響程度。作者強調需要的是實際數據而非主觀意見,並要求提供專案的相關資訊。
+ 「這個改變聽起來很有道理,能更早發現潛在的錯誤,但不知道會不會影響到一些舊的程式碼。」
+ 「我很好奇有多少專案實際上會受到影響,而且需要花費多少精力來適應這個變更。」
#C 程式語言 #C2y #const 限制
Make C string literals const?

Martin Uecker has started a new initiative to ensure a better const contract for C2y: change the type of string literals to a const-qualified base type, much as it is already the case in C++. Compi…

Jens Gustedt's Blog

Meeting 71 of WG14 (the ISO C committee) is now complete, and I've written a blogpost with an overview of the proposals that were highlights for me: https://www.ethernull.org/blog_posts/2024_10.1_wg14.html

With thanks to @AaronBallman @erisceleste @thephd for writing the proposals I wrote about!

Obviously there were plenty of great papers, these were just a few I particularly liked. C23 is really nice, and I think C2y is already shaping up to be something quite special. :)

#WG14
#C2y
#C

WG14 Meeting Report