From 01845cbcf752c85908929bec1ae7d081a4615f4a Mon Sep 17 00:00:00 2001
From: Stephane Del Pino <stephane.delpino44@gmail.com>
Date: Sat, 24 Aug 2024 00:51:33 +0200
Subject: [PATCH] Suppress bounds checking locally for gcc (14)

This false report is due to a messing according to dynamic (general)
and specialized std::array data. Bound checking failure report
concerns unreachable code...
---
 src/analysis/PyramidGaussQuadrature.cpp | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/analysis/PyramidGaussQuadrature.cpp b/src/analysis/PyramidGaussQuadrature.cpp
index 679f3ded5..e85a74ac1 100644
--- a/src/analysis/PyramidGaussQuadrature.cpp
+++ b/src/analysis/PyramidGaussQuadrature.cpp
@@ -24,6 +24,11 @@ PyramidGaussQuadrature::_buildPointAndWeightLists(const size_t degree)
 
       const double w = (4. / 3) * unit_weight;
 
+      // gcc's bound checking are messed up due to the use of
+      // std::array and the following dynamic/general switch
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Warray-bounds"
+
       switch (id) {
       case 1: {
         Assert(value_list.size() == 1);
@@ -96,6 +101,8 @@ PyramidGaussQuadrature::_buildPointAndWeightLists(const size_t degree)
       }
         // LCOV_EXCL_STOP
       }
+
+#pragma GCC diagnostic pop
     }
   };
 
-- 
GitLab