Topic

C

C programming discussions covering systems programming, memory management, and embedded development. Our digest aggregates undefined behavior, compiler optimizations, and embedded systems from developer communities.

What this topic tracks

  • Language releases and proposals
  • Libraries, tooling, and ecosystem updates
  • Performance, idioms, and production lessons

C · 248 stories

Recent stories

Each story's summary, with the places it was discussed.

Summaries are written by AI from the linked sources. Open the source for full context.

20 stories

Dr. Dobb's Developer Library DVD 6

archive.org · 5 Apr

C · Programming Languages · Computer Science

The DDJ Developer Library DVD-ROM provides an extensive archive of programming articles, source code, and auxiliary files from Dr.

Dobb's Journal, C/C++ Users Journal, SysAdmin, and The Perl Journal, spanning 1988 to 2008. The collection is accessible via standard web browsers on any platform supporting ISO 9660-format DVD-ROMs.

Coccinelle: Source-to-source transformation tool

github.com · 21 Feb

C · Python · Open Source

Coccinelle is an open-source tool designed for C source code transformations and refactoring.

It enables programmers to perform complex, style-preserving changes using the Semantic Patch Language (SmPL). Developed by Inria, the repository provides installation guides, usage instructions for the spatch tool, and guidelines for contributing via signed patches.

Show HN: TUI for managing XDG default applications

github.com · 25 Jan

C · Linux · TUI

xdgctl is a specialized Terminal User Interface (TUI) tool written in C, leveraging the GLib/GIO libraries and termbox2 to simplify the management of XDG default applications on Linux systems.

Instead of interacting with the often complex xdg-mime command directly, users can utilize this utility to browse file categories such as Browsers and Text Editors and set their preferred default programs through an intuitive keyboard-driven interface. The tool requires dependencies like glib-2.0 and gio-2.0 for compilation and provides a streamlined alternative to manual editing of mimeapps.list files. By utilizing Desktop Entry standards, xdgctl ensures that transitions between different applications are handled correctly across the desktop environment, making it a valuable productivity tool for users who prefer working within the terminal.

linux 0-day, access root-owned files as an unprivileged user

github.com · 14 May

Cybersecurity · C · Linux

A critical Linux kernel vulnerability, CVE-2026-46333, allows unprivileged users to read root-owned files by exploiting a race condition in pidfd_getfd.

Vulnerable programs like ssh-keysign and chage enable root file exfiltration via FD-theft. The issue persists across major Linux distributions, highlighting a long-standing flaw in process exit synchronization.

Musashi: Motorola 680x0 emulator written in C

github.com · 15 Jul

C · Open Source · Computer Science

Musashi is a high-performance and portable emulation engine for the Motorola 680x0 series, written in ANSI C89 and C9X specifications.

This mature library supports a wide range of processors, including the 68000, 68010, 68020, 68030, and 68040. Developed by Karl Stenerud and widely used in the MAME project, Musashi offers extensive configuration options for memory access, interrupt handling, and function codes. It supports advanced features such as instruction prefetch, PMMU translation, and multiple CPU instances. Developers can integrate Musashi by implementing standard memory read/write functions and managing context switching for complex hardware simulations.

Why we write our own C and C++ inference engines

localai.io · 31 Jul

C · C++ · Performance

LocalAI develops custom C and C++ engine ports to replace heavy Python dependencies.

These ports offer small binaries with predictable memory usage and near-identical performance to upstream implementations. By prioritizing numerical parity through rigorous testing before optimization, the team creates drop-in, efficient replacements for models where Python dependencies are prohibitive or unnecessarily complex for production deployment.

A Compiler Writing Journey

github.com · 24 Mar

C · Programming Languages · Open Source

This project documents a practical, step-by-step journey to build a self-compiling compiler for a C subset.

Covering everything from lexical scanning to ARM assembly and QBE backend integration, the author offers a detailed guide for developers. Following the completion of this project, the author has transitioned to developing a new language, alic.

your c is not standard c

sebsite.pw · 12 Oct

C · Programming Languages

Real-world C with GCC/Clang and glibc/musl diverges from the C and POSIX standards in several documented ways.

GCC and Clang enable `asm` by default; GCC hardcodes `FLT_ROUNDS` and ignores standard floating-point pragmas; glibc’s `initstate` fails to return `NULL` as POSIX requires; Clang treats qualified function return types as incompatible; and musl’s outdated `va_start` prevents C23’s single-argument form. These mismatches affect portability, runtime behavior, and access to newer language features.

C's Flexible Integer Sizes Were Not a Design Mistake

pikuma.com · 25 Sept

C · Low-Level Programming · Programming Languages

C’s flexible integer sizes were deliberate: `int` represents a machine’s natural integer width rather than a fixed 32 bits, enabling efficient operation across historical architectures with diverse word sizes, byte widths, pointer models, and signed representations.

Minimum ranges and `<limits.h>` preserve portability, while `<stdint.h>` supplies exact widths when required. Lua demonstrates this approach.

Your code is fast – if you're lucky

tiki.li · 11 Jul

C · Performance · Programming Languages

Optimizing a branchless Quicksort implementation in C revealed that coding style significantly impacts compiler optimization.

By replacing explicit pointer-based assignments with compact idioms, Clang triggers the generation of branch-free instructions like CMOVE/CSEL, resulting in a 6x performance increase—outperforming std::sort by nearly twice—while GCC remains limited to branch-based code.

A blueprint for formal verification of Apple corecrypto

security.apple.com · 22 May

Cybersecurity · C · Encryption

Apple has integrated quantum-secure ML-KEM and ML-DSA algorithms into its corecrypto library to combat future quantum threats.

To ensure implementation correctness, Apple developed rigorous formal verification methods, using tools like Isabelle, SAW, and Cryptol to mathematically prove that its optimized C and ARM64 assembly code faithfully matches FIPS specifications.

Case study: recovery of a corrupted 12 TB multi-device pool

github.com · 5 Apr

Cybersecurity · C · Linux

This case study details the successful recovery of a severely corrupted 12 TB btrfs multi-device pool following a power failure.

The process required creating 14 custom C tools to repair the extent and free space trees, resulting in minimal data loss. The author proposes nine specific improvements to btrfs-progs to enhance reliability and recovery procedures.

Emulator for Symbolics XL-1200 Lisp machine

unya.github.io · 30 Nov

C · Hardware · Low-Level Programming

The XL1200 Hardware Emulator recreates the Symbolics XL-1200 Lisp machine with a 40-bit Ivory Rev 4 CPU, Merlin-II hardware, virtual peripherals, and Genera 8.3 boot support.

A portable C11 core reaches about 150 MIPS on Zen 4 using AVX-512 and supports hot reload, checkpoints, scripting, debugging, and live control. SDL3 and microui provide a Linux and Windows workbench, while the included Boot PROM supports SCSI disks, CD-ROMs, networking, serial I/O, and video capture.

Building Principia for Windows XP

voxelmanip.se · 28 Jun

C · Programming Languages · Windows

The author successfully restored Windows XP compatibility for the open-source game Principia.

By building a custom GCC toolchain, resolving dependency conflicts, and addressing legacy API issues, they created a functional build tested on original hardware. This project highlights the challenges of modern software development on aging operating systems and ensures legacy support for the game.

wolfSSL releases a new product; wolfCOSE a zero alloc C embbedded COSE stack

github.com · 30 May

Cybersecurity · C · Encryption

wolfCOSE is a lightweight, zero-allocation C library for CBOR and COSE implementation.

Relying on wolfSSL for cryptography, it features 40 algorithms, supports post-quantum signing, and has a footprint as small as 7.5 KB. It provides full RFC 9052 message support, ensuring high performance and MISRA C compliance for secure, resource-constrained environments.

Macsurf, "modern" web browser for macOS 9

github.com · 30 May

C · JavaScript · macOS

MacSurf is a native web browser for Classic Mac OS 9 that enables modern HTTPS and ES5 JavaScript on vintage PowerPC hardware.

By implementing TLS 1.3 and a native rendering stack, it allows G3/G4 Macs to access modern websites without proxies, supporting features like CSS Grid, animations, and transparency on hardware from 1999.

Show HN: A modern Music Player Daemon based on Rockbox firmware

github.com · 9 May

C · GraphQL · Rust

Rockbox Zig is a modern evolution of the Rockbox audio player, leveraging Rust and Zig to expose its engine via gRPC, GraphQL, and HTTP.

It supports multi-room audio through AirPlay, Snapcast, and Squeezelite, featuring native support for over 20 codecs, gapless playback, and a React-based web interface, all packaged in a single high-performance binary.

Printf-Tac-Toe

github.com · 8 Mar

C · Programming Languages · Computer Science

A core implementation of Tic-Tac-Toe for IOCCC 2020 achieved through a single printf call.

Leveraging the Turing completeness of printf, the author uses complex format specifiers like %hhn, %s, and positional arguments to simulate binary logic, compute game states, and generate a dynamic UI directly in memory.

Where it came fromHacker NewsLobstersCreate a Snapbyte.dev digest and choose C as one of your topics.Build your digest