#include <stdio.h>#include <stdarg.h> void test (const char *fmt, ...) __attribute__((format (printf, 1, 2))){ va_list ap; va_start(ap, fmt); vfprintf(stderr, fmt, ap);} int main (){ test("%d\n", 0); test("\n"); test("%d"); return 0;}
Standard input is empty
prog.c:5:1: error: expected ‘,’ or ‘;’ before ‘{’ token prog.c: In function ‘main’: prog.c:15:5: warning: format ‘%d’ expects a matching ‘int’ argument [-Wformat]
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!