From 10a3cbb9883483d783401bfceebfdfc935fc8a0c Mon Sep 17 00:00:00 2001 From: Snaipe Date: Wed, 23 Sep 2015 21:57:20 +0200 Subject: [PATCH] Conditionally disabled asprintf::invalid on some OSes --- test/asprintf.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/test/asprintf.c b/test/asprintf.c index dd191aa..2640555 100644 --- a/test/asprintf.c +++ b/test/asprintf.c @@ -55,11 +55,16 @@ Theory((struct format_test *fmt), asprintf, valid) { free(actual); } -#if defined(__unix__) && defined(__GNUC__) -# pragma GCC diagnostic ignored "-Wformat" +#if defined(__linux__) || defined(__APPLE__) +# ifdef __GNUC__ +# pragma GCC diagnostic ignored "-Wformat" +# endif +# define ASPRINTF_INVALID_DISABLED 0 +#else +# define ASPRINTF_INVALID_DISABLED 1 +#endif -Test(asprintf, invalid) { +Test(asprintf, invalid, .disabled = ASPRINTF_INVALID_DISABLED) { char *actual; cr_expect_lt(cr_asprintf(&actual, "%"), 0); } -#endif