5–7 Oct 2026
Europe/Prague timezone

Upgrading Runtime Leaks to Compile-Time Errors: Adopting Clang’s require_explicit_initialization

5 Oct 2026, 15:30
30m
"South Hall 1 B" (Prague Congress Centre)

"South Hall 1 B"

Prague Congress Centre

158
Toolchains Track Toolchains Track

Speaker

Ian Rogers (Google)

Description

The Linux kernel makes heavy use of aggregate struct initializers to configure subsystem interfaces, driver registries, and object lifecycles (such as struct kobj_type and struct device_type). However, omitting mandatory struct members—such as a kobject's release callback—may result in silent memory leaks or deferred runtime panics.

Clang offers a static alternative attribute ‘require_explicit_initialization’, which triggers the -Wuninitialized-explicit-init warning if a designated field is left uninitialized during aggregate construction . This talk is proposed as a collaborative discussion to brainstorm how we can adopt this safety mechanism in kernel headers (e.g., via a macro like __required_init) . We will discuss the candidate structures that would benefit most, evaluate the engineering friction of enforcing this across cross-tree refactors, and address compiler parity issues—specifically how to handle GCC fallback and whether a similar diagnostic can be proposed for GCC.

Author

Ian Rogers (Google)

Presentation materials

There are no materials yet.