From 8597b0b8c0b4a3b6b7d6cec90ef90be71abfb86b Mon Sep 17 00:00:00 2001 From: Patrick Pelissier Date: Mon, 18 Jan 2021 18:21:01 +0100 Subject: [PATCH] Fix warning on clang and old gcc --- tests/test-mcore.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test-mcore.c b/tests/test-mcore.c index 7ce0768f..1b95cd27 100644 --- a/tests/test-mcore.c +++ b/tests/test-mcore.c @@ -627,7 +627,7 @@ static void test_M_CSTR(void) _Pragma("GCC diagnostic ignored \"-Wformat-truncation\"") #endif r = strcmp(M_CSTR("Hello %s %c", "World", '!'), "Hello W"); -#ifdef __GNUC__ +#if defined(__GNUC__) && __GNUC__ >= 7 && !defined(__clang__) _Pragma("GCC diagnostic pop") #endif assert (r == 0);