Skip to content

Huy-DNA/nonvariadic-printf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nonvariadic-printf

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.

Requirements

  • bash
  • python3
  • GNUMake

How to use

  • Write a program main.cpp using my_printf, the syntax is just like normal printf 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.

Limitations

  • Only supports %d, %f, %s and %p format specifier.
  • The %f format specifier only works with double.