Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/clementvidon/ft_printf

[documented code / -pedantic -std=c89] - Recode printf function
https://github.com/clementvidon/ft_printf

42 42born2code 42cursus 42projects 42school ftprintf ftprintf42

Last synced: 2 days ago
JSON representation

[documented code / -pedantic -std=c89] - Recode printf function

Awesome Lists containing this project

README

        


FT_PRINTF 42


Summary
·
Usage
·
Tester
·
Tools

## Summary

> *The goal of this project is pretty straightforward. You will recode printf().
> You will mainly learn about using a variable number of arguments.*
> [Subject](https://cdn.intra.42.fr/pdf/pdf/58827/en.subject.pdf)

External functions: `write`, `va_start`, `va_arg`, `va_end`

Code written in accordance with **42 C** coding style, **ANSI C89** compliant and entirely **documented with docstrings**.

## Usage

Compile the library with a simple `make -j` then add `#include "ft_printf.h"` to
your project and compile it with these additional flags:

-I
-L
-l ftprintf

***Makefile rules***

- `make` -- compiles get_next_line.
- `make clean` -- deletes object files.
- `make fclean` -- deletes object files and get_next_line.
- `make re` -- fclean + make.

## Tester

- **[Printfest](test/printfest.c)** will try various, flags, value as well as
undefined behavior cases to make sure that the program does not crash.

Usage: `cd test && make run`

## Tools

- **sanitizer**: `-fsanitize=address`

*Add `-g` flag when compiling with `-fsanitize=address` to print errors line numbers instead of addresses in hexadecimal.*