Skip to content

Commit 226f647

Browse files
committed
COMP: suppress 5 clang warnings from eigen headers
These 5 warnings occur nowhere else in the ITK codebase, so suppressing them here allows them to be enabled on CI.
1 parent 9b8963e commit 226f647

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

Modules/ThirdParty/Eigen3/src/itk_eigen.h.in

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,23 @@ target_link_libraries(main PUBLIC Eigen3::Eigen)
7575
#define ITK_EIGEN(x) ITK_EIGEN_STR(itkeigen/Eigen/x)
7676
#endif
7777

78+
// Disable these warnings which occur only in Eigen and not elsewhere in ITK.
79+
#if defined(__clang__) && defined(__has_warning)
80+
#if __has_warning("-Walloca")
81+
#pragma clang diagnostic ignored "-Walloca"
82+
#endif
83+
#if __has_warning("-Wused-but-marked-unused")
84+
#pragma clang diagnostic ignored "-Wused-but-marked-unused"
85+
#endif
86+
#if __has_warning("-Wunused-template")
87+
#pragma clang diagnostic ignored "-Wunused-template"
88+
#endif
89+
#if __has_warning("-Wmissing-noreturn")
90+
#pragma clang diagnostic ignored "-Wmissing-noreturn"
91+
#endif
92+
#if __has_warning("-Wzero-as-null-pointer-constant")
93+
#pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant"
94+
#endif
95+
#endif
96+
7897
#endif

0 commit comments

Comments
 (0)