Commit 7071c66
committed
COMP: Suppress GCC -Wmaybe-uninitialized false positive on Eigen 5
The warning is purely from the Eigen 5.0.1 update changing instantiation/
inlining. Eigen's own CMakeLists.txt already adds -Wno-maybe-uninitialized
for its own builds (line 444, with a comment that GCC 12+ emits false
positives), and DisableStupidWarnings.h doesn't cover this one. The fix is
to suppress at the ITK consumer site, mirroring Eigen's stance.
GCC 13.3 inlines the analytical 3x3 fast path of Eigen 5's
SelfAdjointEigenSolver into SymmetricEigenAnalysisFixedDimension::
ComputeEigenValues<3, Matrix<float,3,3>, FixedArray<float,3>,
Matrix<float,3,3>>, called transitively from
SymmetricSecondRankTensor<float,3>::ComputeEigenValues. GCC's IPA cannot
prove the third element of solver.m_eivalues is fully written through
Eigen's deeply-templated dispatch and emits [-Wmaybe-uninitialized] on
itkSymmetricEigenAnalysis.h:1033 (auto eigenValues = solver.eigenvalues();).
Add ITK_GCC_SUPPRESS_Wmaybe_uninitialized macro to itkMacro.h alongside
the existing ITK_GCC_SUPPRESS_W* family, and apply ITK_GCC_PRAGMA_PUSH /
ITK_GCC_PRAGMA_POP around the affected lines, with // clang-format off/on
to preserve the macro layout (clang-format otherwise folds the SUPPRESS
macro into the adjacent declaration line and breaks parsing).
Verified locally on Apple Silicon arm64 inside a
ghcr.io/catthehacker/ubuntu:full-24.04 container (gcc 13.3.0, the same
toolchain as the failing CI runner): full ITK build (2539 ninja edges)
goes from 2 -Wmaybe-uninitialized warnings on this line to 0.1 parent a3af97d commit 7071c66
2 files changed
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
| 112 | + | |
112 | 113 | | |
113 | 114 | | |
114 | 115 | | |
115 | 116 | | |
116 | 117 | | |
117 | 118 | | |
| 119 | + | |
118 | 120 | | |
119 | 121 | | |
120 | 122 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1029 | 1029 | | |
1030 | 1030 | | |
1031 | 1031 | | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
1032 | 1038 | | |
1033 | 1039 | | |
| 1040 | + | |
| 1041 | + | |
1034 | 1042 | | |
1035 | 1043 | | |
1036 | 1044 | | |
| |||
0 commit comments