From efc938673e45c17ae20a8c1aa9880c952b84142e Mon Sep 17 00:00:00 2001 From: "Riff, Eric" Date: Mon, 10 Feb 2025 16:52:26 -0300 Subject: [PATCH] Fixes #2506: Disable Warray-bounds check on GCC 12 builds There is a bug on gcc 12 that triggers a false positive array subscript is partly outside array bounds. I checked with compiler explorer and the issue persists on 14.2 so I disabled the check for 12+. Eventually once this is fixed on some future version of GCC this check can be tweaked. --- Eigen/src/Core/util/DisableStupidWarnings.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Eigen/src/Core/util/DisableStupidWarnings.h b/Eigen/src/Core/util/DisableStupidWarnings.h index ab0c542d0..69c81de6b 100644 --- a/Eigen/src/Core/util/DisableStupidWarnings.h +++ b/Eigen/src/Core/util/DisableStupidWarnings.h @@ -81,6 +81,11 @@ // See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89325 #pragma GCC diagnostic ignored "-Wattributes" #endif +#if __GNUC__ >= 12 +// see https://gitlab.com/libeigen/eigen/-/issues/2506 +// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106247 +#pragma GCC diagnostic ignored "-Warray-bounds" +#endif #endif #if defined __NVCC__ && defined __CUDACC__ -- GitLab