Blame gcc11_2.patch

Scott Talbert 2ebf89
From b47189b945cfaff9870ca5b38c8083fec7c9bb40 Mon Sep 17 00:00:00 2001
Scott Talbert 2ebf89
From: Ian McInerney <ian.s.mcinerney@ieee.org>
Scott Talbert 2ebf89
Date: Thu, 22 Apr 2021 19:22:32 +0100
Scott Talbert 2ebf89
Subject: [PATCH 1/2] Don't enable warnings in the system headers during all
Scott Talbert 2ebf89
 headers test
Scott Talbert 2ebf89
Scott Talbert 2ebf89
This warning flag is really only used for stdlib debugging/writing,
Scott Talbert 2ebf89
and is off by default so that normal users of the library don't see
Scott Talbert 2ebf89
any warnings generated by the library (since they have no control
Scott Talbert 2ebf89
over it).
Scott Talbert 2ebf89
---
Scott Talbert 2ebf89
 tests/allheaders.cpp | 4 +++-
Scott Talbert 2ebf89
 1 file changed, 3 insertions(+), 1 deletion(-)
Scott Talbert 2ebf89
Scott Talbert 2ebf89
diff --git a/tests/allheaders.cpp b/tests/allheaders.cpp
Scott Talbert 2ebf89
index 575d38fbfb8..70f43e63d1a 100644
Scott Talbert 2ebf89
--- a/tests/allheaders.cpp
Scott Talbert 2ebf89
+++ b/tests/allheaders.cpp
Scott Talbert 2ebf89
@@ -119,6 +119,9 @@
Scott Talbert 2ebf89
     //  - Globally replace HANDLE_GCC_WARNING with GCC_TURN_ON.
Scott Talbert 2ebf89
     //  - Add v6 check for -Wabi, gcc < 6 don't seem to support turning it off
Scott Talbert 2ebf89
     //    once it's turned on and gives it for the standard library symbols.
Scott Talbert 2ebf89
+    //  - Remove GCC_TURN_ON(system-headers) from the list because this option
Scott Talbert 2ebf89
+    //    will enable the warnings to be thrown inside the system headers that
Scott Talbert 2ebf89
+    //    should instead be ignored.
Scott Talbert 2ebf89
     // {{{
Scott Talbert 2ebf89
 #if CHECK_GCC_VERSION(6,1)
Scott Talbert 2ebf89
     GCC_TURN_ON(abi)
Scott Talbert 2ebf89
@@ -307,7 +310,6 @@
Scott Talbert 2ebf89
     GCC_TURN_ON(switch-default)
Scott Talbert 2ebf89
     GCC_TURN_ON(switch-enum)
Scott Talbert 2ebf89
     GCC_TURN_ON(synth)
Scott Talbert 2ebf89
-    GCC_TURN_ON(system-headers)
Scott Talbert 2ebf89
 #if CHECK_GCC_VERSION(6,1)
Scott Talbert 2ebf89
     GCC_TURN_ON(templates)
Scott Talbert 2ebf89
 #endif // 6.1
Scott Talbert 2ebf89
Scott Talbert 2ebf89
From e0005c1d93afde5e0fc6400984459ebdcfdbc519 Mon Sep 17 00:00:00 2001
Scott Talbert 2ebf89
From: Ian McInerney <ian.s.mcinerney@ieee.org>
Scott Talbert 2ebf89
Date: Thu, 22 Apr 2021 19:23:48 +0100
Scott Talbert 2ebf89
Subject: [PATCH 2/2] No longer include the system headers first
Scott Talbert 2ebf89
Scott Talbert 2ebf89
With the Wsystem-headers warning removed, these are no longer needed
Scott Talbert 2ebf89
and can instead be included on first-use again.
Scott Talbert 2ebf89
---
Scott Talbert 2ebf89
 tests/allheaders.cpp | 49 --------------------------------------------
Scott Talbert 2ebf89
 1 file changed, 49 deletions(-)
Scott Talbert 2ebf89
Scott Talbert 2ebf89
diff --git a/tests/allheaders.cpp b/tests/allheaders.cpp
Scott Talbert 2ebf89
index 70f43e63d1a..522885b636d 100644
Scott Talbert 2ebf89
--- a/tests/allheaders.cpp
Scott Talbert 2ebf89
+++ b/tests/allheaders.cpp
Scott Talbert 2ebf89
@@ -33,55 +33,9 @@
Scott Talbert 2ebf89
         _Pragma(STRINGIZE(GCC diagnostic ignored STRINGIZE(CONCAT(-W,warn))))
Scott Talbert 2ebf89
 #endif
Scott Talbert 2ebf89
 
Scott Talbert 2ebf89
-// Due to what looks like a bug in gcc, some warnings enabled after including
Scott Talbert 2ebf89
-// the standard headers still result in warnings being given when instantiating
Scott Talbert 2ebf89
-// some functions defined in these headers later and we need to explicitly
Scott Talbert 2ebf89
-// disable these warnings to avoid them, even if they're not enabled yet.
Scott Talbert 2ebf89
-#ifdef GCC_TURN_OFF
Scott Talbert 2ebf89
-    #pragma GCC diagnostic push
Scott Talbert 2ebf89
-
Scott Talbert 2ebf89
-    GCC_TURN_OFF(aggregate-return)
Scott Talbert 2ebf89
-    GCC_TURN_OFF(conversion)
Scott Talbert 2ebf89
-    GCC_TURN_OFF(format)
Scott Talbert 2ebf89
-    GCC_TURN_OFF(padded)
Scott Talbert 2ebf89
-    GCC_TURN_OFF(parentheses)
Scott Talbert 2ebf89
-    GCC_TURN_OFF(sign-compare)
Scott Talbert 2ebf89
-    GCC_TURN_OFF(sign-conversion)
Scott Talbert 2ebf89
-    GCC_TURN_OFF(unused-parameter)
Scott Talbert 2ebf89
-    GCC_TURN_OFF(zero-as-null-pointer-constant)
Scott Talbert 2ebf89
-#endif
Scott Talbert 2ebf89
-
Scott Talbert 2ebf89
 // We have to include this one first in order to check for HAVE_XXX below.
Scott Talbert 2ebf89
 #include "wx/setup.h"
Scott Talbert 2ebf89
 
Scott Talbert 2ebf89
-// Include all standard headers that are used in wx headers before enabling the
Scott Talbert 2ebf89
-// warnings below.
Scott Talbert 2ebf89
-#include <algorithm>
Scott Talbert 2ebf89
-#include <cmath>
Scott Talbert 2ebf89
-#include <exception>
Scott Talbert 2ebf89
-#include <functional>
Scott Talbert 2ebf89
-#include <iomanip>
Scott Talbert 2ebf89
-#include <iostream>
Scott Talbert 2ebf89
-#include <list>
Scott Talbert 2ebf89
-#include <locale>
Scott Talbert 2ebf89
-#include <map>
Scott Talbert 2ebf89
-#include <set>
Scott Talbert 2ebf89
-#include <sstream>
Scott Talbert 2ebf89
-#include <string>
Scott Talbert 2ebf89
-#include <vector>
Scott Talbert 2ebf89
-
Scott Talbert 2ebf89
-#if defined(HAVE_STD_UNORDERED_MAP)
Scott Talbert 2ebf89
-    #include <unordered_map>
Scott Talbert 2ebf89
-#endif
Scott Talbert 2ebf89
-#if defined(HAVE_STD_UNORDERED_SET)
Scott Talbert 2ebf89
-    #include <unordered_set>
Scott Talbert 2ebf89
-#endif
Scott Talbert 2ebf89
-
Scott Talbert 2ebf89
-#if defined(HAVE_DLOPEN)
Scott Talbert 2ebf89
-    #include <dlfcn.h>
Scott Talbert 2ebf89
-#endif
Scott Talbert 2ebf89
-#include <fcntl.h>
Scott Talbert 2ebf89
-
Scott Talbert 2ebf89
 #include "catch.hpp"
Scott Talbert 2ebf89
 
Scott Talbert 2ebf89
 #if defined(__WXMSW__)
Scott Talbert 2ebf89
@@ -99,9 +53,6 @@
Scott Talbert 2ebf89
     #include <QtGui/QFont>
Scott Talbert 2ebf89
 #endif
Scott Talbert 2ebf89
 
Scott Talbert 2ebf89
-#ifdef GCC_TURN_OFF
Scott Talbert 2ebf89
-    #pragma GCC diagnostic pop
Scott Talbert 2ebf89
-#endif
Scott Talbert 2ebf89
 
Scott Talbert 2ebf89
 // Enable max warning level for headers if possible, using gcc pragmas.
Scott Talbert 2ebf89
 #ifdef GCC_TURN_ON