From 3d0386f27ca66379acf50199e1d1298386eeeeb8 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 6 May 2024 02:55:53 +0200 Subject: Adding upstream version 3.2.1. Signed-off-by: Daniel Baumann --- contrib/ccan/compiler/test/compile_fail-printf.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 contrib/ccan/compiler/test/compile_fail-printf.c (limited to 'contrib/ccan/compiler/test/compile_fail-printf.c') diff --git a/contrib/ccan/compiler/test/compile_fail-printf.c b/contrib/ccan/compiler/test/compile_fail-printf.c new file mode 100644 index 0000000..8f34ae5 --- /dev/null +++ b/contrib/ccan/compiler/test/compile_fail-printf.c @@ -0,0 +1,22 @@ +#include + +static void PRINTF_FMT(2,3) my_printf(int x, const char *fmt, ...) +{ +} + +int main(int argc, char *argv[]) +{ + unsigned int i = 0; + + my_printf(1, "Not a pointer " +#ifdef FAIL + "%p", +#if !HAVE_ATTRIBUTE_PRINTF +#error "Unfortunately we don't fail if !HAVE_ATTRIBUTE_PRINTF." +#endif +#else + "%i", +#endif + i); + return 0; +} -- cgit v1.2.3