Skip to content

Commit 54613f7

Browse files
committed
COMP: Remove default -Wno-deprecated from the ITK warning flags
-Wno-deprecated was added in 2009 (a33ca7a, Bill Lorensen) inside a CMAKE_COMPILER_IS_GNUCXX guard to silence GCC warnings about deprecated C++ standard headers (<strstream>, <ext/hash_map>, <backward/*>). Those headers are long gone. In 2011 (8a135bc) the flag was folded into the cross-compiler cxx_flags warning set, so it has since applied to all compilers, not just GCC. The [[deprecated]] attribute did not exist until C++14, so this flag was never intended to mask attribute-based deprecations. On Clang, -Wno-deprecated also disables -Wdeprecated-declarations, so it silently hides [[deprecated]] API warnings on Clang while GCC (where the two are independent) still emits them -- an inconsistent, surprising default that hides ITK's own and vendored deprecations from Clang builds. Remove it so deprecation warnings surface uniformly across compilers. ITK_CXX_WARNING_FLAGS remains available to override the warning set.
1 parent b3f7244 commit 54613f7

1 file changed

Lines changed: 0 additions & 1 deletion

File tree

CMake/ITKSetStandardCompilerFlags.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ function(check_compiler_warning_flags c_warning_flags_var cxx_warning_flags_var)
133133
# Check this list on C++ compiler only
134134
set(
135135
cxx_flags
136-
-Wno-deprecated
137136
-Wno-invalid-offsetof
138137
-Wno-undefined-var-template # suppress invalid warning when explicitly instantiated in another translation unit
139138
-Woverloaded-virtual

0 commit comments

Comments
 (0)