Developer adds debugging macros like __print and __where to custom C preprocessor
David Priver, who is building his own C2Y compiler, interpreter and REPL as a personal project, detailed several custom extensions he added to its C preprocessor component. These include __print(), which writes the expanded value of a macro to stderr for debugging, __where(), which reports where a macro was originally defined, and __map(), designed to apply a transformation across a list of arguments.
GoKawiil's interpretation of the reporting above, not reported fact.
These additions address long-standing pain points in C preprocessor debugging, where tracing how a macro expands or was defined can be notoriously difficult, especially in large codebases relying on complex system headers. The work is a personal, experimental project rather than a production tool, but it illustrates practical ideas that could inform tooling or extensions in other preprocessor implementations.
- A developer is building a custom C2Y compiler/interpreter/REPL as a hobby project.
- New preprocessor extensions __print() and __where() aid macro debugging by showing expansions and definition locations.
- __map() is being developed to apply transformations across preprocessor argument lists.
Source: davidpriver.com, 2026-10-15
Published there as: “Fun Extending the C Preprocessor”
Read the original report → The summary and analysis above are GoKawiil's own, written from reporting by the source above. Facts and quotes belong to the original publisher.