Jonathan Corbet explores the extensive and complex use of the C preprocessor in the Linux kernel, focusing on the min() and max() macros. Initially deemed problematic due to double evaluation, these macros underwent significant changes throughout the kernel’s development, resulting in compilation time issues. Linus Torvalds’ attempts to address this led to the introduction of new, simpler CONST_MIN() and CONST_MAX() macros. Despite lingering issues with complex expansions, these changes offer a glimpse into the challenges of utilizing the C preprocessor. The article highlights the kernel developers’ relentless pursuit of efficiency, showing a classic linux-kernel flame war and the evolving nature of the kernel’s codebase.
https://lwn.net/SubscriberLink/983965/3266dc25bf5c68d7/