[wpimath] Suppress the -Wmaybe-uninitialized warning in Eigen (#3378)

GCC 11 emits a false positive when compiling Eigen and breaks the
build.

Fixes #3363.
This commit is contained in:
Tyler Veness
2021-05-25 10:05:41 -07:00
committed by GitHub
parent a04d1b4f97
commit 484cf9c0e8
4 changed files with 27 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
diff --git a/wpimath/src/main/native/eigeninclude/Eigen/src/Core/util/DisableStupidWarnings.h b/wpimath/src/main/native/eigeninclude/Eigen/src/Core/util/DisableStupidWarnings.h
index 74f74cc42..5fe86fa0d 100644
--- a/wpimath/src/main/native/eigeninclude/Eigen/src/Core/util/DisableStupidWarnings.h
+++ b/wpimath/src/main/native/eigeninclude/Eigen/src/Core/util/DisableStupidWarnings.h
@@ -61,6 +61,10 @@
// See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89325
#pragma GCC diagnostic ignored "-Wattributes"
#endif
+ #if __GNUC__==11
+ // This warning is a false positive
+ #pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
+ #endif
#endif
#if defined __NVCC__