From 8a24517fb9e5a708e496fc4655ff7dafe1750784 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Sat, 28 May 2022 19:59:38 +0200 Subject: [PATCH] fix: Disable warnings only on GCC 12 and higher --- .../include/hex/helpers/encoding_file.hpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/lib/libimhex/include/hex/helpers/encoding_file.hpp b/lib/libimhex/include/hex/helpers/encoding_file.hpp index 05e0730b4..32e341e4e 100644 --- a/lib/libimhex/include/hex/helpers/encoding_file.hpp +++ b/lib/libimhex/include/hex/helpers/encoding_file.hpp @@ -4,13 +4,16 @@ // TODO: Workaround for weird issue picked up by GCC 12.1.0 and later. This seems like a compiler bug mentioned in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98465 #pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunknown-warning-option" -#pragma GCC diagnostic ignored "-Wpragmas" -#pragma GCC diagnostic ignored "-Wrestrict" -#pragma GCC diagnostic ignored "-Wstringop-overread" -#include -#include -#include + + #if (__GNUC__ >= 12) + #pragma GCC diagnostic ignored "-Wrestrict" + #pragma GCC diagnostic ignored "-Wstringop-overread" + #endif + + #include + #include + #include + #pragma GCC diagnostic pop #include