Skip to content

Instantly share code, notes, and snippets.

@jacobsapps
Created May 26, 2022 09:17
Show Gist options
  • Save jacobsapps/13fdbd38e0c55e927903ee6baeb017c8 to your computer and use it in GitHub Desktop.
Save jacobsapps/13fdbd38e0c55e927903ee6baeb017c8 to your computer and use it in GitHub Desktop.
C code for printf
// http://sourceware.org/git/?p=glibc.git;a=blob;f=stdio-common/printf.c;h=4c8f3a2a0c38ab27a2eed4d2ff3b804980aa8f9f;hb=3321010338384ecdc6633a8b032bb0ed6aa9b19a
#include <libioP.h>
#include <stdarg.h>
#include <stdio.h>
#undef printf
/* Write formatted output to stdout from the format string FORMAT. */
/* VARARGS1 */
int
__printf (const char *format, ...)
{
va_list arg;
int done;
va_start (arg, format);
done = vfprintf (stdout, format, arg);
va_end (arg);
return done;
}
#undef _IO_printf
ldbl_strong_alias (__printf, printf);
/* This is for libg++. */
ldbl_strong_alias (__printf, _IO_printf);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment