Repository navigation
STYLE: Remove dead branches for compilers ITK cannot build with - #7121
Merged
hjmjohnson merged 2 commits intoNov 5, 2026
Merged
hjmjohnson merged 2 commits into
hjmjohnson merged 2 commits into
Conversation
hjmjohnson
marked this pull request as ready for review
November 5, 2026 18:24
Contributor
[Medium impact] The PR appears safe to merge; no actionable issues were found.
|
dzenanz
approved these changes
Nov 5, 2026
hjmjohnson
enabled auto-merge
November 5, 2026 23:45
ITK requires C++17 and GCC 7, Clang 5, AppleClang 10, MSVC 19.20, or Intel 19.1. Branches for SunPro, Borland, MetroWerks, SGI MIPSpro, Visual Studio 2008, and GCC older than 4.3 can never be taken, and Cygwin is rejected by the guard that stays in itkMacro.h. ITK_HAS_CPP11_TYPETRAITS was defined for legacy builds and read by nothing in ITK.
The macro was public in legacy builds, so a project that tests it needs to know which branch to keep.
Member
Author
hjmjohnson
force-pushed
the
style-remove-dead-compiler-branches
branch
from
November 5, 2026 23:50
54916e0 to
a2a4375
Compare
hjmjohnson
merged commit Nov 5, 2026
4902ee9
into
InsightSoftwareConsortium:main
12 of 15 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Remove preprocessor and CMake branches for compilers that cannot build ITK, plus one unused legacy macro. First cleanup from the survey in #7120; no behavior changes on any supported compiler.
Each compiler specific test was redundant with the "C++17" minimum standard which fails before those tests are reached.
What is removed
ITK requires C++17 and GCC 7, Clang 5, AppleClang 10, MSVC 19.20, or Intel 19.1.
itkMacro.h: the#errorguards for SunPro, Borland, MetroWerks, and SGI MIPSpro. None of those compilers supports C++17. The guards for the supported compiler families and for Cygwin stay.itkNumericTraits.h: the SunPro 32-bitPrintType = doubleworkaround forlong double.itkMemoryUsageObserver.hand.cxx: the__SUNPRO_CChalf of__SUNPRO_CC || __sun__. The Solaris platform test__sun__stays.itkTestDriver.cxx: the SGI MIPS and Cygwin library-path branches.CMake/ITKModuleMacros.cmake: theBORLANDbranch ofitk_module_warnings_disable.Modules/Core/Common/src/CMakeLists.txt: the probe for-fno-associative-math("GCC 4.3 onwards"). GCC now always gets that flag foritkCompensatedSummation.cxx.Modules/Numerics/Statistics/test/CMakeLists.txt:if(NOT MSVC90)arounditkSampleToHistogramFilterTest4(Visual Studio 2008).itkConfigure.h.in:ITK_HAS_CPP11_TYPETRAITS, defined only withoutITK_LEGACY_REMOVEand read by nothing in ITK. A GitHub code search finds it only in vendored copies of old ITK releases. A second commit notes the removal in the migration guide.Left alone on purpose
#errorinitkMacro.h. Modern GCC on Cygwin could compile C++17, so that guard is a live policy statement, and it is what makes the Cygwin branch initkTestDriver.cxxdead.itkTestDriver.cxxand the other items in Remaining compiler- and flag-dependent conditions in ITK headers (follow-up to #7116) #7120.Local verification (macOS arm64, Homebrew LLVM, C++17)
ITKCommon,itkTestDriver, and the threeITKCommontest drivers build with no compiler warnings; the 8 related tests pass (numeric traits, memory usage and probes, compensated summation, time probes).pre-commit run --all-filespasses.-fno-associative-mathchange, because this compiler is Clang and the branch is GCC-only; theitkSampleToHistogramFilterTest4registration, because the Statistics tests are not in this build tree; and Windows. CI covers all three.AI assistance
Claude Code (Fable 5.1) ran the survey, drafted the change, and ran the local checks. The author reviewed and is responsible for the change.