mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-29 02:21:44 +00:00
[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:
@@ -8,6 +8,10 @@ cppSrcFileInclude {
|
|||||||
\.cpp$
|
\.cpp$
|
||||||
}
|
}
|
||||||
|
|
||||||
|
modifiableFileExclude {
|
||||||
|
\.patch$
|
||||||
|
}
|
||||||
|
|
||||||
generatedFileExclude {
|
generatedFileExclude {
|
||||||
src/main/native/cpp/drake/
|
src/main/native/cpp/drake/
|
||||||
src/main/native/eigeninclude/
|
src/main/native/eigeninclude/
|
||||||
|
|||||||
15
wpimath/eigen-maybe-uninitialized.patch
Normal file
15
wpimath/eigen-maybe-uninitialized.patch
Normal 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__
|
||||||
@@ -61,6 +61,10 @@
|
|||||||
// See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89325
|
// See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89325
|
||||||
#pragma GCC diagnostic ignored "-Wattributes"
|
#pragma GCC diagnostic ignored "-Wattributes"
|
||||||
#endif
|
#endif
|
||||||
|
#if __GNUC__==11
|
||||||
|
// This warning is a false positive
|
||||||
|
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined __NVCC__
|
#if defined __NVCC__
|
||||||
|
|||||||
@@ -187,6 +187,10 @@ def main():
|
|||||||
os.makedirs(dest_dir)
|
os.makedirs(dest_dir)
|
||||||
shutil.copyfile(f, dest_file)
|
shutil.copyfile(f, dest_file)
|
||||||
|
|
||||||
|
# Apply patches
|
||||||
|
os.chdir(cwd)
|
||||||
|
subprocess.check_output(["git", "apply", "eigen-maybe-uninitialized.patch"])
|
||||||
|
|
||||||
# Comment out missing headers
|
# Comment out missing headers
|
||||||
for f in files:
|
for f in files:
|
||||||
dest_file = os.path.join(include_root, f)
|
dest_file = os.path.join(include_root, f)
|
||||||
|
|||||||
Reference in New Issue
Block a user