From 226f6473434a88e10dfbe9d7cca646e962bffd40 Mon Sep 17 00:00:00 2001 From: Sean McBride Date: Wed, 15 May 2024 19:22:47 -0400 Subject: [PATCH] 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. --- Modules/ThirdParty/Eigen3/src/itk_eigen.h.in | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/Modules/ThirdParty/Eigen3/src/itk_eigen.h.in b/Modules/ThirdParty/Eigen3/src/itk_eigen.h.in index 750504a6e91..53fc0e368f8 100644 --- a/Modules/ThirdParty/Eigen3/src/itk_eigen.h.in +++ b/Modules/ThirdParty/Eigen3/src/itk_eigen.h.in @@ -75,4 +75,23 @@ target_link_libraries(main PUBLIC Eigen3::Eigen) #define ITK_EIGEN(x) ITK_EIGEN_STR(itkeigen/Eigen/x) #endif +// Disable these warnings which occur only in Eigen and not elsewhere in ITK. +#if defined(__clang__) && defined(__has_warning) + #if __has_warning("-Walloca") + #pragma clang diagnostic ignored "-Walloca" + #endif + #if __has_warning("-Wused-but-marked-unused") + #pragma clang diagnostic ignored "-Wused-but-marked-unused" + #endif + #if __has_warning("-Wunused-template") + #pragma clang diagnostic ignored "-Wunused-template" + #endif + #if __has_warning("-Wmissing-noreturn") + #pragma clang diagnostic ignored "-Wmissing-noreturn" + #endif + #if __has_warning("-Wzero-as-null-pointer-constant") + #pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant" + #endif +#endif + #endif