C Preprocessor
A component of the preprocessing stage in the C/C++ compilation pipeline, responsible for macro substitution, file inclusion, and conditional compilation. It is essentially a Turing-incomplete text transformation system, and techniques such as nested macros, deferred expansion, and token pasting can be used to simulate loops and metaprogramming.
Timeline (last 90 days)
The C preprocessor is essentially a Turing-incomplete text transformation system that runs before compilation.
The C preprocessor prohibits macros from expanding recursively, either directly or indirectly.
Deferred expansion (defer) and placeholder tricks can bypass the preprocessor's restriction on recursive macro expansion to simulate loop effects.
Different compilers differ in implementation details regarding macro expansion rounds and parameter expansion order, so extra care is needed when porting deferred-expansion macros across compilers.
`#if` and `defined` can be combined to form compile-time boolean logic, used to build simple type checks or configuration selectors.
All Facts (5)
The C preprocessor is essentially a Turing-incomplete text transformation system that runs before compilation.
50%UnverifiedThe C preprocessor prohibits macros from expanding recursively, either directly or indirectly.
50%UnverifiedDeferred expansion (defer) and placeholder tricks can bypass the preprocessor's restriction on recursive macro expansion to simulate loop effects.
50%UnverifiedDifferent compilers differ in implementation details regarding macro expansion rounds and parameter expansion order, so extra care is needed when porting deferred-expansion macros across compilers.
50%Unverified`#if` and `defined` can be combined to form compile-time boolean logic, used to build simple type checks or configuration selectors.
50%