Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/huy-dna/nonvariadic-printf

An implementation of printf + A preprocessor to pass the code through before compiling
https://github.com/huy-dna/nonvariadic-printf

cpp implementation makefile printf python3 speculative

Last synced: 22 days ago
JSON representation

An implementation of printf + A preprocessor to pass the code through before compiling

Awesome Lists containing this project

README

        

# 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`.