From 66501994d31c6e44e1c5210af09a3c5973a7ccc9 Mon Sep 17 00:00:00 2001 From: jak1 Date: Sat, 18 Dec 2021 16:18:46 +0100 Subject: added diagnostic ignore -Warray-bounds to gcc-snapshot (gcc11+ bug) --- src/localconsts.h | 6 ++++++ src/progs/manaplus/actions/actions.cpp | 3 +++ 2 files changed, 9 insertions(+) diff --git a/src/localconsts.h b/src/localconsts.h index c8ac23e46..dc3afad6e 100644 --- a/src/localconsts.h +++ b/src/localconsts.h @@ -210,6 +210,12 @@ #define PRAGMA8(str) #endif // GCC_VERSION > 80000 +#if GCC_VERSION >= 110000 +#define PRAGMA11(str) _Pragma(#str) +#else // GCC_VERSION > 110000 +#define PRAGMA11(str) +#endif // GCC_VERSION > 110000 + #ifdef __clang__ #define PRAGMACLANG(str) _Pragma(#str) #if CLANG_VERSION >= 50000 diff --git a/src/progs/manaplus/actions/actions.cpp b/src/progs/manaplus/actions/actions.cpp index 52eca62d9..92c0f0050 100644 --- a/src/progs/manaplus/actions/actions.cpp +++ b/src/progs/manaplus/actions/actions.cpp @@ -1456,6 +1456,8 @@ impHandler0(serverUnIgnoreAll) PRAGMA6(GCC diagnostic push) PRAGMA6(GCC diagnostic ignored "-Wnull-dereference") +PRAGMA11(GCC diagnostic push) +PRAGMA11(GCC diagnostic ignored "-Warray-bounds") impHandler0(error) { int *const ptr = nullptr; @@ -1463,6 +1465,7 @@ impHandler0(error) // logger->log("test %d", *ptr); exit(1); } +PRAGMA11(GCC diagnostic pop) PRAGMA6(GCC diagnostic pop) impHandler(dumpGraphics) -- cgit v1.2.3-70-g09d2