At the Kernel Recipes conference in September 2026, Martin Uecker, a professor of biomedical engineering who develops software for magnetic resonance imaging scanners, presented a talk on the ongoing effort to reduce undefined behavior in the C language. He acknowledged C’s age but argued that it remains a valuable language because it is portable across platforms, stable over decades, compiles quickly, and produces machine code that closely follows the programmer’s intent—a principle often summarized as 'what you see is what you get'.

Photo of Martin Uecker speaking at Kernel Recipes 2026
Martin Uecker presenting his talk on reducing undefined behavior in C at Kernel Recipes 2026lwn.net

This image shows the speaker discussed in the first paragraph of the article, Martin Uecker, who gave the talk at Kernel Recipes 2026 about reducing undefined behavior in C.

Uecker explained that undefined behavior arises when a program performs an operation not defined by the C standard, such as reading an uninitialized variable, dividing by zero, or accessing padding bytes in a structure. In those cases the standard imposes no requirements on the compiler, which may produce any result, including erroneous outcomes sometimes described colloquially as invoking 'nasal demons.' He illustrated this with examples: a compiler might eliminate a division‑by‑zero test and simply store a constant, or reorder a division before a store to a volatile variable, changing program behavior when the divisor is zero.

To address these issues, the C standards committee maintains three study groups focused on the memory object model, memory safety, and undefined behavior. Their work has already removed 45 instances of undefined behavior from the roughly 100 present in the current standard, as reflected in the in‑progress C2y draft. Recent improvements include bit‑precise integer types, checked integer operations, case ranges, named for loops, and the _Countof() macro for determining array lengths. However, achieving full memory safety in C remains challenging; Uecker broke the problem into type safety, spatial memory safety (partially aided by bounds checking and the counted_by attribute), and temporal memory safety (where use‑after‑free bugs are difficult to eliminate without expensive run‑time checking or formal verification). He suggested that the most practical near‑term approach combines a restricted language subset with formal‑verification tools.