From ba64b9328cd96e64e8fed1a0df213f89d51b0480 Mon Sep 17 00:00:00 2001 From: Jost Migenda Date: Thu, 28 Mar 2024 14:45:49 +0000 Subject: [PATCH 1/4] =?UTF-8?q?don=E2=80=99t=20replace=20"Werror"=20in=20c?= =?UTF-8?q?omments=20This=20would=20make=20some=20comments=20contradictory?= =?UTF-8?q?=20or=20confusing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- v2018.04.2/SRC_UBUNTU2004_CXX9.patch | 80 ---------------------------- 1 file changed, 80 deletions(-) diff --git a/v2018.04.2/SRC_UBUNTU2004_CXX9.patch b/v2018.04.2/SRC_UBUNTU2004_CXX9.patch index 45b534c..2e643f4 100644 --- a/v2018.04.2/SRC_UBUNTU2004_CXX9.patch +++ b/v2018.04.2/SRC_UBUNTU2004_CXX9.patch @@ -1,22 +1,3 @@ -diff --git a/CMake/mitkFunctionCheckCompilerFlags.cmake b/CMake/mitkFunctionCheckCompilerFlags.cmake -index a6081c4467..5380858f89 100644 ---- a/CMake/mitkFunctionCheckCompilerFlags.cmake -+++ b/CMake/mitkFunctionCheckCompilerFlags.cmake -@@ -83,12 +83,12 @@ function(mitkFunctionCheckCAndCXXCompilerFlags FLAG_TO_TEST C_RESULT_VAR CXX_RES - # the HAS_CXX_FLAG and HAS_C_FLAG variable. This suffix is created using a 'clean version' of the - # flag to test. The value of HAS_C(XX)_FLAG_${suffix} additonally needs to be a valid - # pre-processor token because CHECK_CXX_COMPILER_FLAG adds it as a definition to the compiler -- # arguments. An invalid token triggers compiler warnings, which in case of the "-Werror" flag -+ # arguments. An invalid token triggers compiler warnings, which in case of the "-Wno-error" flag - # leads to false-negative checks. - string(REGEX REPLACE "[/-]" "_" suffix ${FLAG_TO_TEST}) - string(REGEX REPLACE "[, \\$\\+\\*\\{\\}\\(\\)\\#]" "" suffix ${suffix}) - -- # workaround for gcc's strange behaviour on -Wno-... options in combination with -Werror -+ # workaround for gcc's strange behaviour on -Wno-... options in combination with -Wno-error - # we test the flag without the "no-" prefix because that is more reliable - string(REGEX REPLACE "^-Wno-" "-W" FLAG_TO_TEST_FIXED ${FLAG_TO_TEST}) - diff --git a/CMake/mitkFunctionCreateModule.cmake b/CMake/mitkFunctionCreateModule.cmake index ce984559eb..1301840198 100644 --- a/CMake/mitkFunctionCreateModule.cmake @@ -30,15 +11,6 @@ index ce984559eb..1301840198 100644 # The flag "c++0x-static-nonintegral-init" has been renamed in newer Clang # versions to "static-member-init", see -@@ -364,7 +364,7 @@ function(mitk_create_module) - # - # So instead of using -Wno-* we use -Wno-error=*, which will be properly rejected by - # the compiler and if applicable, prints the specific warning as a real warning and -- # not as an error (although -Werror was given). -+ # not as an error (although -Wno-error was given). - - mitkFunctionCheckCAndCXXCompilerFlags("-Wno-error=c++0x-static-nonintegral-init" module_c_flags module_cxx_flags) - mitkFunctionCheckCAndCXXCompilerFlags("-Wno-error=static-member-init" module_c_flags module_cxx_flags) diff --git a/CMake/mitkFunctionCreatePlugin.cmake b/CMake/mitkFunctionCreatePlugin.cmake index 1c5faf618e..4c2f60e8fa 100644 --- a/CMake/mitkFunctionCreatePlugin.cmake @@ -65,55 +37,3 @@ index afcc73d72e..3a3363fcea 100644 -Wwrite-strings -Woverloaded-virtual -Wnon-virtual-dtor -Wold-style-cast -Wstrict-null-sentinel -Wsign-promo -fdiagnostics-show-option) usFunctionCheckCompilerFlags(${_cxxflag} US_CXX_FLAGS) -diff --git a/Modules/CppMicroServices/cmake/usFunctionCheckCompilerFlags.cmake b/Modules/CppMicroServices/cmake/usFunctionCheckCompilerFlags.cmake -index 0ec97da19f..2ce565ee22 100644 ---- a/Modules/CppMicroServices/cmake/usFunctionCheckCompilerFlags.cmake -+++ b/Modules/CppMicroServices/cmake/usFunctionCheckCompilerFlags.cmake -@@ -55,7 +55,7 @@ function(usFunctionCheckCompilerFlags FLAG_TO_TEST RESULT_VAR) - # the HAS_CXX_FLAG variable. This suffix is created using a 'clean version' of the - # flag to test. The value of HAS_CXX_FLAG_${suffix} additonally needs to be a valid - # pre-processor token because CHECK_CXX_COMPILER_FLAG adds it as a definition to the compiler -- # arguments. An invalid token triggers compiler warnings, which in case of the "-Werror" flag -+ # arguments. An invalid token triggers compiler warnings, which in case of the "-Wno-error" flag - # leads to false-negative checks. - string(REGEX REPLACE "[/-]" "_" suffix ${FLAG_TO_TEST}) - string(REGEX REPLACE "[, \\$\\+\\*\\{\\}\\(\\)\\#]" "" suffix ${suffix}) -diff --git a/Modules/QtOverlays/CMakeLists.txt b/Modules/QtOverlays/CMakeLists.txt -index 152ef26666..8ddd0043e9 100644 ---- a/Modules/QtOverlays/CMakeLists.txt -+++ b/Modules/QtOverlays/CMakeLists.txt -@@ -3,7 +3,7 @@ - # In file included from /Users/Cordes/developing/src/MITK-Master/Modules/Overlays/QmitkScalarBar.cpp:20: - # In file included from /Users/Cordes/dartclients/toolkits/qt-4.8.4-Build/include/QtGui/QPaintEvent:1: - # In file included from /Users/Cordes/dartclients/toolkits/qt-4.8.4-Build/include/QtGui/qevent.h:52: --# /Users/Cordes/dartclients/toolkits/qt-4.8.4-Build/include/QtGui/qmime.h:119:10: error: private field 'type' is not used [-Werror,-Wunused-private-field] -+# /Users/Cordes/dartclients/toolkits/qt-4.8.4-Build/include/QtGui/qmime.h:119:10: error: private field 'type' is not used [-Wno-error,-Wunused-private-field] - # char type; - # ^ - # 1 error generated. -diff --git a/Wrapping/Python/PackageUtility/imagefiles/imagefiles/install-gcc.sh b/Wrapping/Python/PackageUtility/imagefiles/imagefiles/install-gcc.sh -index b36458f281..832012e294 100755 ---- a/Wrapping/Python/PackageUtility/imagefiles/imagefiles/install-gcc.sh -+++ b/Wrapping/Python/PackageUtility/imagefiles/imagefiles/install-gcc.sh -@@ -469,7 +469,7 @@ for ar in ${ARS[@]} ; do - case "$d" in - binutils-*) - # Binutils will not compile with strict error -- # checking on so I disabled -Werror by setting -+ # checking on so I disabled -Wno-error by setting - # --disable-werror. - CONF_ARGS=( - --disable-cloog-version-check -diff --git a/Wrapping/Python/PackageUtility/imagefiles/install-gcc.sh b/Wrapping/Python/PackageUtility/imagefiles/install-gcc.sh -index b36458f281..832012e294 100755 ---- a/Wrapping/Python/PackageUtility/imagefiles/install-gcc.sh -+++ b/Wrapping/Python/PackageUtility/imagefiles/install-gcc.sh -@@ -469,7 +469,7 @@ for ar in ${ARS[@]} ; do - case "$d" in - binutils-*) - # Binutils will not compile with strict error -- # checking on so I disabled -Werror by setting -+ # checking on so I disabled -Wno-error by setting - # --disable-werror. - CONF_ARGS=( - --disable-cloog-version-check From 3932f331f774e4106ff7e5e4af2b146f3c2c3e94 Mon Sep 17 00:00:00 2001 From: Jost Migenda Date: Thu, 28 Mar 2024 14:49:42 +0000 Subject: [PATCH 2/4] =?UTF-8?q?move=20changes=20from=20Ubuntu-specific=20p?= =?UTF-8?q?atch=20into=20SRC=5FBASE.patch,=20since=20they=E2=80=99re=20als?= =?UTF-8?q?o=20necessary=20under=20macOS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- v2018.04.2/SRC_BASE.patch | 39 ++++++++++++++++++++++++++++ v2018.04.2/SRC_UBUNTU2004_CXX9.patch | 39 ---------------------------- 2 files changed, 39 insertions(+), 39 deletions(-) delete mode 100644 v2018.04.2/SRC_UBUNTU2004_CXX9.patch diff --git a/v2018.04.2/SRC_BASE.patch b/v2018.04.2/SRC_BASE.patch index d5b0321..10fa413 100644 --- a/v2018.04.2/SRC_BASE.patch +++ b/v2018.04.2/SRC_BASE.patch @@ -11,6 +11,45 @@ index 96d4a8abb8..7383d69b3c 100644 option(MITK_BUILD_APP_Diffusion "Build the MITK Diffusion executable" OFF) # This variable is fed to ctkFunctionSetupPlugins() macro in the +diff --git a/CMake/mitkFunctionCreateModule.cmake b/CMake/mitkFunctionCreateModule.cmake +index ce984559eb..1301840198 100644 +--- a/CMake/mitkFunctionCreateModule.cmake ++++ b/CMake/mitkFunctionCreateModule.cmake +@@ -350,7 +350,7 @@ function(mitk_create_module) + # reactivated after https://gitlab.kitware.com/cmake/cmake/issues/17904 has been fixed. + # mitkFunctionCheckCAndCXXCompilerFlags("/w34100" module_c_flags module_cxx_flags) + else() +- mitkFunctionCheckCAndCXXCompilerFlags(-Werror module_c_flags module_cxx_flags) ++ mitkFunctionCheckCAndCXXCompilerFlags(-Wno-error module_c_flags module_cxx_flags) + + # The flag "c++0x-static-nonintegral-init" has been renamed in newer Clang + # versions to "static-member-init", see +diff --git a/CMake/mitkFunctionCreatePlugin.cmake b/CMake/mitkFunctionCreatePlugin.cmake +index 1c5faf618e..4c2f60e8fa 100644 +--- a/CMake/mitkFunctionCreatePlugin.cmake ++++ b/CMake/mitkFunctionCreatePlugin.cmake +@@ -207,7 +207,7 @@ function(mitk_create_plugin) + if(MSVC_VERSION) + mitkFunctionCheckCAndCXXCompilerFlags("/WX" plugin_c_flags plugin_cxx_flags) + else() +- mitkFunctionCheckCAndCXXCompilerFlags(-Werror plugin_c_flags plugin_cxx_flags) ++ mitkFunctionCheckCAndCXXCompilerFlags(-Wno-error plugin_c_flags plugin_cxx_flags) + mitkFunctionCheckCAndCXXCompilerFlags("-Wno-error=c++0x-static-nonintegral-init" plugin_c_flags plugin_cxx_flags) + mitkFunctionCheckCAndCXXCompilerFlags("-Wno-error=static-member-init" plugin_c_flags plugin_cxx_flags) + mitkFunctionCheckCAndCXXCompilerFlags("-Wno-error=unknown-warning" plugin_c_flags plugin_cxx_flags) +diff --git a/Modules/CppMicroServices/CMakeLists.txt b/Modules/CppMicroServices/CMakeLists.txt +index afcc73d72e..3a3363fcea 100644 +--- a/Modules/CppMicroServices/CMakeLists.txt ++++ b/Modules/CppMicroServices/CMakeLists.txt +@@ -169,7 +169,7 @@ endif() + + # Set C++ compiler flags + if(NOT MSVC) +- foreach(_cxxflag -Werror -Wall -Wextra -Wpointer-arith -Winvalid-pch -Wcast-align ++ foreach(_cxxflag -Wno-error -Wall -Wextra -Wpointer-arith -Winvalid-pch -Wcast-align + -Wwrite-strings -Woverloaded-virtual -Wnon-virtual-dtor -Wold-style-cast + -Wstrict-null-sentinel -Wsign-promo -fdiagnostics-show-option) + usFunctionCheckCompilerFlags(${_cxxflag} US_CXX_FLAGS) diff --git a/Plugins/org.blueberry.core.jobs/src/internal/berryJobManager.cpp b/Plugins/org.blueberry.core.jobs/src/internal/berryJobManager.cpp index 507bf6ab28..92421a018f 100644 --- a/Plugins/org.blueberry.core.jobs/src/internal/berryJobManager.cpp diff --git a/v2018.04.2/SRC_UBUNTU2004_CXX9.patch b/v2018.04.2/SRC_UBUNTU2004_CXX9.patch deleted file mode 100644 index 2e643f4..0000000 --- a/v2018.04.2/SRC_UBUNTU2004_CXX9.patch +++ /dev/null @@ -1,39 +0,0 @@ -diff --git a/CMake/mitkFunctionCreateModule.cmake b/CMake/mitkFunctionCreateModule.cmake -index ce984559eb..1301840198 100644 ---- a/CMake/mitkFunctionCreateModule.cmake -+++ b/CMake/mitkFunctionCreateModule.cmake -@@ -350,7 +350,7 @@ function(mitk_create_module) - # reactivated after https://gitlab.kitware.com/cmake/cmake/issues/17904 has been fixed. - # mitkFunctionCheckCAndCXXCompilerFlags("/w34100" module_c_flags module_cxx_flags) - else() -- mitkFunctionCheckCAndCXXCompilerFlags(-Werror module_c_flags module_cxx_flags) -+ mitkFunctionCheckCAndCXXCompilerFlags(-Wno-error module_c_flags module_cxx_flags) - - # The flag "c++0x-static-nonintegral-init" has been renamed in newer Clang - # versions to "static-member-init", see -diff --git a/CMake/mitkFunctionCreatePlugin.cmake b/CMake/mitkFunctionCreatePlugin.cmake -index 1c5faf618e..4c2f60e8fa 100644 ---- a/CMake/mitkFunctionCreatePlugin.cmake -+++ b/CMake/mitkFunctionCreatePlugin.cmake -@@ -207,7 +207,7 @@ function(mitk_create_plugin) - if(MSVC_VERSION) - mitkFunctionCheckCAndCXXCompilerFlags("/WX" plugin_c_flags plugin_cxx_flags) - else() -- mitkFunctionCheckCAndCXXCompilerFlags(-Werror plugin_c_flags plugin_cxx_flags) -+ mitkFunctionCheckCAndCXXCompilerFlags(-Wno-error plugin_c_flags plugin_cxx_flags) - mitkFunctionCheckCAndCXXCompilerFlags("-Wno-error=c++0x-static-nonintegral-init" plugin_c_flags plugin_cxx_flags) - mitkFunctionCheckCAndCXXCompilerFlags("-Wno-error=static-member-init" plugin_c_flags plugin_cxx_flags) - mitkFunctionCheckCAndCXXCompilerFlags("-Wno-error=unknown-warning" plugin_c_flags plugin_cxx_flags) -diff --git a/Modules/CppMicroServices/CMakeLists.txt b/Modules/CppMicroServices/CMakeLists.txt -index afcc73d72e..3a3363fcea 100644 ---- a/Modules/CppMicroServices/CMakeLists.txt -+++ b/Modules/CppMicroServices/CMakeLists.txt -@@ -169,7 +169,7 @@ endif() - - # Set C++ compiler flags - if(NOT MSVC) -- foreach(_cxxflag -Werror -Wall -Wextra -Wpointer-arith -Winvalid-pch -Wcast-align -+ foreach(_cxxflag -Wno-error -Wall -Wextra -Wpointer-arith -Winvalid-pch -Wcast-align - -Wwrite-strings -Woverloaded-virtual -Wnon-virtual-dtor -Wold-style-cast - -Wstrict-null-sentinel -Wsign-promo -fdiagnostics-show-option) - usFunctionCheckCompilerFlags(${_cxxflag} US_CXX_FLAGS) From f7eba78d8f0bbc5791438d4ad24a60f9017e0a2d Mon Sep 17 00:00:00 2001 From: Jost Migenda Date: Thu, 28 Mar 2024 14:53:16 +0000 Subject: [PATCH 3/4] macOS: include unistd.h in mitkIpPic.h, to resolve compilation error --- v2018.04.2/SRC_BASE_MACOS.patch | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/v2018.04.2/SRC_BASE_MACOS.patch b/v2018.04.2/SRC_BASE_MACOS.patch index 2835999..dfd7104 100644 --- a/v2018.04.2/SRC_BASE_MACOS.patch +++ b/v2018.04.2/SRC_BASE_MACOS.patch @@ -42,3 +42,15 @@ index 8bbe3a2d8a..581d281ed8 100644 struct ServiceListenerCompare : std::binary_function { +diff --git a/Utilities/IpPic/mitkIpPic.h b/Utilities/IpPic/mitkIpPic.h +index 0cc63aa766..4e16191c1e 100644 +--- a/Utilities/IpPic/mitkIpPic.h ++++ b/Utilities/IpPic/mitkIpPic.h +@@ -231,9 +231,7 @@ + #include + #include + +-#ifdef sun +-# include +-#endif ++#include From 3a0b13b18d77813cdb059c5216f7d2ee79e02587 Mon Sep 17 00:00:00 2001 From: Jost Migenda Date: Fri, 12 Apr 2024 13:41:24 +0100 Subject: [PATCH 4/4] fix missing whitespace at end of SRC_BASE_MACOS.patch --- v2018.04.2/SRC_BASE_MACOS.patch | 3 +++ 1 file changed, 3 insertions(+) diff --git a/v2018.04.2/SRC_BASE_MACOS.patch b/v2018.04.2/SRC_BASE_MACOS.patch index dfd7104..cb7b0f6 100644 --- a/v2018.04.2/SRC_BASE_MACOS.patch +++ b/v2018.04.2/SRC_BASE_MACOS.patch @@ -54,3 +54,6 @@ index 0cc63aa766..4e16191c1e 100644 -# include -#endif +#include + + +