home.social

#c23 — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #c23, aggregated by home.social.

  1. OK, #C23 #stdckdint #ckd_add () and friends look pretty freaking cool. I spam my own code as copypasta for detecting #wraparound with unsigned integer types in network protocol sequence number spaces, but the #semantics are pretty much lifted straight from #rfc3626 anyway. Maybe I should give it the C23 and C++26 template method treatment. gustedt.gitlabpages.inria.fr/c @JensGustedt @wdtz #languagelawyering

  2. @JensGustedt @wdtz So #C23 adds #memalignment (), defined in <stdlib.h> as a regular function (think side-effects and correctness); it takes the 2's complement negation of the input expressed as a #uintptr_t and masks it against the input. cgit.freebsd.org/src/tree/lib/ #FreeBSD picks it up in #libc from 15.1 and up, so it won't be in the man index until the release: freebsd.org/releases/15.1R/sch #languagelawyering

  3. Thanks to @JensGustedt TIL that C++26 also introduces native support for #C23 checked #integer #arithmetic functions, as defined in the <stdckdint.h> compatibility header. These are peripherally related to the (bleeding edge) #saturation arithmetic functions defined in the C+26 version of the <numeric> header: en.cppreference.com/cpp/numeric (You might not find these in your system headers unless you have a seriously up to date #LLVM or #GCC ) @wdtz #languagelawyering

  4. Thanks to @JensGustedt TIL that C++26 also introduces native support for #C23 checked #integer #arithmetic functions, as defined in the <stdckdint.h> compatibility header. These are peripherally related to the (bleeding edge) #saturation arithmetic functions defined in the C+26 version of the <numeric> header: en.cppreference.com/cpp/numeric (You might not find these in your system headers unless you have a seriously up to date #LLVM or #GCC ) @wdtz #languagelawyering

  5. Thanks to @JensGustedt TIL that C++26 also introduces native support for #C23 checked #integer #arithmetic functions, as defined in the <stdckdint.h> compatibility header. These are peripherally related to the (bleeding edge) #saturation arithmetic functions defined in the C+26 version of the <numeric> header: en.cppreference.com/cpp/numeric (You might not find these in your system headers unless you have a seriously up to date #LLVM or #GCC ) @wdtz #languagelawyering

  6. Thanks to @JensGustedt TIL that C++26 also introduces native support for #C23 checked #integer #arithmetic functions, as defined in the <stdckdint.h> compatibility header. These are peripherally related to the (bleeding edge) #saturation arithmetic functions defined in the C+26 version of the <numeric> header: en.cppreference.com/cpp/numeric (You might not find these in your system headers unless you have a seriously up to date #LLVM or #GCC ) @wdtz #languagelawyering

  7. Thanks to @JensGustedt TIL that C++26 also introduces native support for #C23 checked #integer #arithmetic functions, as defined in the <stdckdint.h> compatibility header. These are peripherally related to the (bleeding edge) #saturation arithmetic functions defined in the C+26 version of the <numeric> header: en.cppreference.com/cpp/numeric (You might not find these in your system headers unless you have a seriously up to date #LLVM or #GCC ) @wdtz #languagelawyering

  8. Visual Studio 2026 18.6.0


    Visual Studio 2026 在 2026 年五月的例行性更新推出了,這次的版本推進到了 18.6.0,官方的更新紀錄可以參考 release note

    這次更新的項目,包括了:

    • IDE 介面:與系統同步淺色/深色主題
    • GitHub Copilot
      • 檢視、管理 Agent Skill
      • 多檔案變更摘要
      • Context Window 使用指標
      • 計畫模式
    • Git tooling
      • 把 Git Commit 丟給 Copilot Chat
      • 提交訊息自訂指示現在改為使用 Copilot 指示檔
    • C++
      • 針對 iterative build 進行最佳化改善
      • 支援、預設使用 Segment Heap
      • MSVC Build Tools v14.51

    按照慣例,更新比較多的還是和 GitHub Copilot 相關的東西。以往由於 Heresy 沒在訂閱、再加上免費版本的 GitHub Copilot 用量非常有限,所以 Heresy 都沒認真玩;不過最近由於有開始透過串接自有 LLM 伺服器來使用,所以以後應該也會來記錄相關的變更吧。

    MSVC Build Tools v14.51

    三月份的 18.3、微軟就推出了 MSVC Build Tools 14.51 預覽版、號稱題更了更好的 C++23 相容性、必提升了效能。而在這次的 18.6,則是釋出了 14.51 的正式版本了~這次的官方紀錄是《MSVC Build Tools version 14.51 (GA) now available》。

    至於新版的變動,主要是要看之前 RC 版的介紹《MSVC Build Tools Version 14.51 Release Candidate Now Available》,裡面的變更算是相當多。

    至於正式版和 RC 差別、似乎只有加入 Intel APX (Advanced Performance Extensions) 指令集? 不過,現在有處理器有支援嗎?

    不過,14.51 的 C++23 標準目前還是標記成預覽版、使用的設定是 /std:c++23preview;要變成正是支援,應該還是要等到之後的 14.52 了(參考參考)。

    GitHub Copilot 支援 Ollama

    雖然更新紀錄沒有寫,但是 GitHub Copilot 的「管理模型」的功能,現在加入了「Ollama」的設定了!

    和其他的提供者不同,他不需要輸入金鑰,而是要直接輸入端點 URL;而且也不要 Azure 一樣只支援可認證的 https。

    不過實際上…在新增模型的時候,還是可以另外指定端點,所以技術上應該是可以對應多個伺服器。

    雖然他寫的是 Ollama,但是它實際上走的應該還是 OpenAI 相容 API,Heresy 自己嘗試用LM Studio 來跑也是沒問題的~不過考慮到他不能設定金鑰,所以基本上就只能對應私有的內部服務了。

    考慮到小型模型在開發上的能力…恩,個人應該不太會用吧。

    計畫模式

    Visual Studio GitHub Copilot 以往主要的模式只有「agent」和「ask」(話說,之前都還有中文翻譯、現在又都變英文了),如果想要讓他規劃的話,通常是使用詢問模式避免他直些修改;而現在終於正式加入一個「plan」模式了。

    官方建議使用的時機是:

    • 大型功能的開發
    • 不熟系的程式庫
    • 團隊協助、讓大家確認計畫

    根據官方的說法,他會透過下面兩個步驟來處理:

    • 探索並釐清
    • 草擬並完善

    理論上 Copilot 會將計畫以 Markdown 的形式儲存成 .copilot/plans/plan-{title}.md 這樣的檔案,方便後續編輯、確認;不過個人覺得很謎的,是他這邊產生的路徑居然是個人資料夾、而不是專案資料夾…

    在開始撰寫計畫書前,可能會先詢問開發者一些需要釐清的問題,之後在而計劃書完善後,會有一個「實作計畫」的按鈕,按下去就會切換到 agent 模式、根據計畫書開始實作了。

    下面就是一個測試用的計畫:

    在他繼續實作的時候,還會去改變裡面的進度、也會在下方的「計畫步驟」前面打勾作狀態的修改;這樣整個流程會變得可以更直覺、明確地看到大型任務的進度,個人覺得還滿棒的。

    而除了手動使用 plan 模式外,現在在 agent 模式要做 AI 模型覺得比較大幅度的改動的時候,似乎也會主動建立一個類似 plan 模式的計畫書、然後再直接開始實作;這個狀況下其實和 plan 模式很像,只是缺少的檢查計畫書的時間。

    不過 Heresy 這邊有一個問題:使用者目錄下的這些檔案是要自己去刪除嗎?感覺計畫完成他就留在那了啊…感覺如果是在專案目錄還好,但是全部都是在個人目錄下啊…

    另外,不知道他是不是會挑模型?gpt-5.4、gpt-5.4-mini 看來都可以正常對應這個流程,但是有的內部模型測試的時候,似乎會跳出這個流程?所以如果使用非官方模型、可能也是要試試看才知道了。

    Context Window 使用指標

    現在聊天框的右上角會有一個顯示目前 context window(內容視窗)使用量的圓環,點下去會顯示目前的使用狀況:

    再點下去也可以展開系統、使用者內容的細節。

    如果 context window 被塞滿的話,他可能就會忘記之前的內容、進而造成奇怪的問題。所以如果這個發現這個圈快滿了、也可以點選「摘要交談」的按鈕、來針對較早的對話進行內容的分析、壓縮,避免遺失重要的上下文。

    這個按鈕按下去不會輸出摘要後的內容,而是只會顯示「摘要已完成」,然後理論上 context window 的使用比例就會變少了。

    多檔案變更的彙整

    Copilot 在編輯檔案後,會在聊天框上方列出變更過的檔案;以往只能一個一個點開來看改了什麼,不過現在可以點選「開啟變更摘要檢視」、來透過單一文件視窗確認所有的變更了。

    不過老實說,這樣的檢視方式,感覺只適合每個檔案都只改依兩行的狀況?

    Agent Skill 管理

    現在在聊天窗格右下角的工具設定裡面,除了本來的 MCP 外,現在也加入了簡單的 Skill 列表。

    不過這邊的功能現在真的很簡單,只能開啟資料夾和編輯 SKILL.md,並沒有類似建立新的 skill 的輔助工具;微軟目前應該是還在測試建立 Skill 的功能,或許下個月正式版就會有機會看到了吧?(參考《Agent Skills in Visual Studio: Teach Copilot How Your Team Works》)

    至於 Visual Studio 的 Skill 到底要怎麼設定呢?根據官方文件的說法,應該就是要自己撰寫 SKILL.md、然後按照特定的邏輯放在指定的資料夾裡了。

    或者是 awesome-copilot 這個專案裡面放了很多 Skill 可以參考(連結)。

    大概就先這樣了。

    開始認真用 GitHub Copilot 後,發現現在的 GitHub Copilot 真的和以前差很多;而由於最新的高階 LLM 的進步,寫出來的程式的可用性和複雜度也提高相當多了。

    但是,高階的模型的 token 真的燒很快、錢也扣得很兇啊…
    而且開始用了之後,真的覺得人會懶得思考啊…

    #AI #C #C23 #程式設計 #電腦相關 #軟體 #GitHubCopilot #Microsoft #VisualStudio
  9. Im September ist es soweit, dann erscheint mein neues Buch über Programmierung in C beim Rheinwerk-Verlag.
    Wer vorher schon mal reinschauen möchte, kann sich gerne melden.
    #rheinwerkVerlag #rheinwerk #buch #c23 #informatik #programmierung

  10. What a dumb API the C std committee came.up.with for overflow safe operators.
    The three functions are called chk_add etc.

    Checked for what?
    What's the return code?

    Turns out it returns true if the check failed and the results are bad. Ugh!

    en.cppreference.com/w/c/header

    #c #c23 #programming

  11. For your edification, one reason to use C23 instead of those godforsaken older standards:

    Standard library header <stdbit.h> (C23) - cppreference.com en.cppreference.com/w/c/header

    These are functions of enormous use in data structures, in place of bit-twiddling methods, GCC extensions, or reliance on optimizers to recognize idioms.

    Also they are functions whose equivalents already existed in those other languages such as Fortran and Ada.

    (Okay, they are macros. Sue me.)

    #c23 #programming #ATS

  12. Thanks to the #c23 #embed macro, I may have written the world's shortest #quine.
    ```c
    #include<stdio.h>
    int main(){puts((char[]){
    #embed"q.c"
    ,0});}
    ```
    (I doubt that I'm the first to do this)
    We just need to politely ignore the extra `\n` injected by `puts`. Otherwise, replace `puts` with `printf`.

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

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

    habr.com/ru/articles/1000228/

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

  14. [Перевод] Маленький bool, сулящий большие беды

    Признаюсь, я питаю слабость к классическому DOOM. Игре уже 31 год, но благодаря открытому исходному коду она живёт на всём — от смартфонов до осциллографов. В силу разных обстоятельств я стал сопровождать несколько пакетов, связанных с DOOM, в Fedora Linux. Перед каждым релизом Fedora проводит массовую пересборку всех пакетов — и в этот раз chocolate-doom её не пережил. Виновник этому — маленький bool.

    habr.com/ru/companies/cloud4y/

    #c #c23 #gcc #doom #debugging #fedora #open_source #gamedev #linux #programming

  15. 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

  16. So the correct answer is 5 rounding directions, though the last one was added in #C23:

    FP_INT_UPWARD / ceil()
    FP_INT_DOWNWARD / floor()
    FP_INT_TOWARDZERO / trunc()
    FP_INT_TONEARESTFROMZERO / round()
    FP_INT_TONEAREST / roundeven() (C23)

  17. Can you answer without checking: how many rounding directions does the #C standard define, as of #C23?

  18. "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? 🤔🔧"
    dependablec.org/ #DependableC #UndefinedBehavior #SoftwareDevelopment #HackerNews #ngated

  19. Freexian’s September 2025 Debian contributions report covers a variety of interesting work.

    Find the full report here - freexian.com/blog/debian-contr

    You can read about #C23 and old Debian Printing software, work done to decommission packages.qa.debian.org, rebootstrap using *-for-host and more!

    We thank the organizations subscribing to our Long Term Support contracts (freexian.com/lts/?utm_source=m) and consulting services (freexian.com/services/?utm_sou) for making this possible.

    #debian #freexian

  20. Interesting that GCC has a limit to the width of _BitInt of 65535 bits (1 bit short of 8KiB) whereas Clang has that limit set to 8388608 (exactly 1 MiB)

    (Running on x86-64 #Linux; #GCC 14.3.0, #Clang 19.1.7, both from #nixpkgs c2ae88e)

    #c #c23

  21. Ah, yes, #C23 finally blesses us with tag compatibility, because who doesn't love redefining #structs in their spare time? 🥱✨ #GCC and #Clang are here to save us from the horrors of incompatible parameters—truly a thrilling adventure in "do we really need this?" 🚀🔧
    nullprogram.com/blog/2025/06/2 #Cplusplus #TagCompatibility #ProgrammingAdventures #HackerNews #ngated

  22. C23 C language standard made a decision which breaks C functions with arbitrary number of arguments.

    How does one define an *arbitrary* function pointer in C23? (not only variadic, which is a special case)

    gitlab.com/embeddable-common-l

    #c #c23

  23. Безопасная работа с массивами? Нет, не слышали

    Рано или поздно любому разработчику на С-подобном языке приходит в голову идея использовать двумерный массив как одномерный. Причины для этого всегда разные, а вот результат чаще всего один. В этой небольшой заметке разберём эту сомнительную технику и какие проблемы она может привнести в вашу программу.

    habr.com/ru/companies/pvs-stud

    #c++ #c #array #массив #программирование #assembler #ассемблер #c++23 #c23

  24. Ah, the thrilling saga of *C23* – because who wouldn't want to read an epic tale about a programming language update? 😴 Brace yourselves for endless pages of riveting terms and licenses. It's like the Avengers, but for nerdy syntax enthusiasts! 😂 #LivingOnTheEdge
    gustedt.gitlabpages.inria.fr/m #C23 #Update #ProgrammingLanguages #SyntaxNerds #EpicTales #TechHumor #HackerNews #ngated

  25. Habt ihr der #ePA widersprochen? Ich war ja schon skeptisch, gerade als Mensch mit psychischen Erkrankungen. Nachdem aber auf der #c23 gezeigt wurde wie unsicher das ist und sogar die #Bundesärztekammer (#BÄK) und der Berufsverbands der Kinder- und Jugendärztinnen und -ärzte (#BVKJ) #Sorgen geäußert haben war mir klar das ich widerspreche. Wie sieht es bei Euch aus?

  26. 最近C言語の標準のC23が公開されたらしいから日本語版ウィキペディアに英語版を翻訳して記事を作成した
    #jawp #C23
    https://ja.wikipedia.org/wiki/C23