fork download
  1. #include <stdio.h>
  2. #include <stdarg.h>
  3.  
  4. void test (const char *fmt, ...) __attribute__((format (printf, 1, 2)))
  5. {
  6. va_list ap;
  7. va_start(ap, fmt);
  8. vfprintf(stderr, fmt, ap);
  9. }
  10.  
  11. int main ()
  12. {
  13. test("%d\n", 0);
  14. test("\n");
  15. test("%d");
  16. return 0;
  17. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
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]
stdout
Standard output is empty