clemedon / ft_printf

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FT_PRINTF 42

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

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 <path_to_libftprintf_include_dir>
-L <path_to_libftprintf_dir>
-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 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.

About

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


Languages

Language:C 71.0%Language:Makefile 29.0%