An implementation of printf + A pre-preprocessor to pass the code through before compiling.
Please read the blog post at https://blogginginhell.netlify.app/posts/printf-a-speculative-implementation to understand the idea.
- bash
- python3
- GNUMake
- Write a program
main.cpp
usingmy_printf
, the syntax is just like normalprintf
with some limitations in capabilities. - Running
make
to run the pre-preprocessor and compile the program. ./main
to run the program.- Additionally, you can inspect the
main.output.cpp
file to inspect the output generated by the pre-preprocessor.
- Only supports
%d
,%f
,%s
and%p
format specifier. - The
%f
format specifier only works withdouble
.