From eb55d6413de811e86d0b5f3480725b4f87bcc780 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Mon, 29 Apr 2019 16:53:13 +0100 Subject: [PATCH] Check GCC version before ignoring diagnostic message The `alloc-size-larger-than` warning is available starting with GCC 7, and using it in a pragma will generate a warning on older versions of GCC. --- glib/tests/mem-overflow.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glib/tests/mem-overflow.c b/glib/tests/mem-overflow.c index 5e5dd68c0..64ec0b0cd 100644 --- a/glib/tests/mem-overflow.c +++ b/glib/tests/mem-overflow.c @@ -21,7 +21,7 @@ /* We test for errors in optimize-only definitions in gmem.h */ -#ifdef __GNUC__ +#if defined(__GNUC__) && __GNUC__ > 6 #pragma GCC optimize (1) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Walloc-size-larger-than="