compiler: header for compiler-specific wrappers.
[ccan] / ccan / compiler / test / compile_fail-printf.c
1 #include <ccan/compiler/compiler.h>
2
3 static void PRINTF_ATTRIBUTE(2,3) my_printf(int x, const char *fmt, ...)
4 {
5 }
6
7 int main(int argc, char *argv[])
8 {
9         unsigned int i = 0;
10
11         my_printf(1, "Not a pointer "
12 #ifdef FAIL
13                   "%p",
14 #if !HAVE_ATTRIBUTE_PRINTF
15 #error "Unfortunately we don't fail if !HAVE_ATTRIBUTE_PRINTF."
16 #endif
17 #else
18                   "%i",
19 #endif
20                   i);
21         return 0;
22 }