From 9b955a0f19f10fb2055f43dceb1701bfc8931e09 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Thu, 5 Mar 2026 13:31:39 -0500 Subject: [PATCH] COMP: Suppress deprecated warnings in MSVC wrapping builds Add /wd4996 to MSVC compile flags for SWIG-generated Python wrapper targets. This suppresses C4996 warnings triggered by deprecated VariableLengthVector::AllocateElements calls in auto-generated wrapper code. GCC/Clang wrapping builds already suppress all warnings with -w. --- Wrapping/macro_files/itk_end_wrap_module.cmake | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Wrapping/macro_files/itk_end_wrap_module.cmake b/Wrapping/macro_files/itk_end_wrap_module.cmake index 1cce2f99e22..9e589593a5a 100644 --- a/Wrapping/macro_files/itk_end_wrap_module.cmake +++ b/Wrapping/macro_files/itk_end_wrap_module.cmake @@ -546,12 +546,13 @@ ${DO_NOT_WAIT_FOR_THREADS_CALLS} ) if(MSVC) - # Disables 'conversion from 'type1' to 'type2', possible loss of data warnings + # /wd4244: Disables 'conversion from 'type1' to 'type2', possible loss of data warnings + # /wd4996: Disables deprecated declaration warnings in generated wrapper code set_target_properties( ${lib} PROPERTIES COMPILE_FLAGS - "/wd4244" + "/wd4244 /wd4996" ) endif() else()