[glib/ci-update: 4/11] Check GCC version before ignoring diagnostic message



commit eb55d6413de811e86d0b5f3480725b4f87bcc780
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Mon Apr 29 16:53:13 2019 +0100

    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="


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]