From f6dd46be8a7cd3b39dd03fbe23900d27abddf6aa Mon Sep 17 00:00:00 2001 From: maekclena Date: Thu, 2 May 2019 17:53:14 +0200 Subject: [PATCH 1/4] ENH: Update compiler macros --- Modules/Core/Common/include/itkMacro.h | 119 ++++++++++++------------- 1 file changed, 56 insertions(+), 63 deletions(-) diff --git a/Modules/Core/Common/include/itkMacro.h b/Modules/Core/Common/include/itkMacro.h index eab4c9bbd66..0c6795bd5bf 100644 --- a/Modules/Core/Common/include/itkMacro.h +++ b/Modules/Core/Common/include/itkMacro.h @@ -77,77 +77,60 @@ namespace itk // The following set of defines allows us to suppress false positives // and still track down suspicious code #if defined(__clang__) && defined(__has_warning) -#define CLANG_PRAGMA_PUSH ITK_PRAGMA(clang diagnostic push) -#define CLANG_PRAGMA_POP ITK_PRAGMA(clang diagnostic pop) -#if __has_warning("-Wfloat-equal") -#define CLANG_SUPPRESS_Wfloat_equal ITK_PRAGMA( clang diagnostic ignored "-Wfloat-equal" ) -#else -#define CLANG_SUPPRESS_Wfloat_equal -#endif -#if __has_warning( "-Wc++14-extensions" ) -#define CLANG_SUPPRESS_Wc__14_extensions ITK_PRAGMA( clang diagnostic ignored "-Wc++14-extensions" ) -#else -#define CLANG_SUPPRESS_Wc__14_extensions -#endif + #define CLANG_PRAGMA_PUSH ITK_PRAGMA(clang diagnostic push) + #define CLANG_PRAGMA_POP ITK_PRAGMA(clang diagnostic pop) + #if __has_warning("-Wfloat-equal") + #define CLANG_SUPPRESS_Wfloat_equal ITK_PRAGMA( clang diagnostic ignored "-Wfloat-equal" ) + #else + #define CLANG_SUPPRESS_Wfloat_equal + #endif + #if __has_warning( "-Wc++14-extensions" ) + #define CLANG_SUPPRESS_Wc__14_extensions ITK_PRAGMA( clang diagnostic ignored "-Wc++14-extensions" ) + #else + #define CLANG_SUPPRESS_Wc__14_extensions + #endif #else -#define CLANG_PRAGMA_PUSH -#define CLANG_PRAGMA_POP -#define CLANG_SUPPRESS_Wfloat_equal -#define CLANG_SUPPRESS_Wc__14_extensions + #define CLANG_PRAGMA_PUSH + #define CLANG_PRAGMA_POP + #define CLANG_SUPPRESS_Wfloat_equal + #define CLANG_SUPPRESS_Wc__14_extensions #endif // Intel compiler convenience macros #if defined(__INTEL_COMPILER) -#define INTEL_PRAGMA_WARN_PUSH ITK_PRAGMA(warning push) -#define INTEL_PRAGMA_WARN_POP ITK_PRAGMA(warning pop) -#define INTEL_SUPPRESS_warning_1292 ITK_PRAGMA(warning disable 1292) + #define INTEL_PRAGMA_WARN_PUSH ITK_PRAGMA(warning push) + #define INTEL_PRAGMA_WARN_POP ITK_PRAGMA(warning pop) + #define INTEL_SUPPRESS_warning_1292 ITK_PRAGMA(warning disable 1292) #else -#define INTEL_PRAGMA_WARN_PUSH -#define INTEL_PRAGMA_WARN_POP -#define INTEL_SUPPRESS_warning_1292 + #define INTEL_PRAGMA_WARN_PUSH + #define INTEL_PRAGMA_WARN_POP + #define INTEL_SUPPRESS_warning_1292 #endif // Define ITK_GCC_PRAGMA_DIAG(param1 [param2 [...]]) macro. // -// This macros sets a pragma diagnostic if it supported by the version -// of GCC being used otherwise it is a no-op. +// This macro sets a pragma diagnostic // -// GCC diagnostics pragma supported only with GCC >= 4.2 -#if defined( __GNUC__ ) && !defined( __INTEL_COMPILER ) -# if ( __GNUC__ > 4 ) || (( __GNUC__ >= 4 ) && ( __GNUC_MINOR__ >= 2 )) -# define ITK_GCC_PRAGMA_DIAG(x) ITK_PRAGMA(GCC diagnostic x) -# else -# define ITK_GCC_PRAGMA_DIAG(x) -# endif -#else -# define ITK_GCC_PRAGMA_DIAG(x) -#endif - // Define ITK_GCC_PRAGMA_DIAG_(PUSH|POP) macros. // // These macros respectively push and pop the diagnostic context -// if it is supported by the version of GCC being used -// otherwise it is a no-op. // -// GCC push/pop diagnostics pragma are supported only with GCC >= 4.6 -// -// Define macro ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP if it is supported. +// Define macro ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP #if defined( __GNUC__ ) && !defined( __INTEL_COMPILER ) -# if ( __GNUC__ > 4 ) || (( __GNUC__ >= 4 ) && ( __GNUC_MINOR__ >= 6 )) -# define ITK_GCC_PRAGMA_DIAG_PUSH() ITK_GCC_PRAGMA_DIAG(push) -# define ITK_GCC_PRAGMA_DIAG_POP() ITK_GCC_PRAGMA_DIAG(pop) -# define ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP -# else -# define ITK_GCC_PRAGMA_DIAG_PUSH() -# define ITK_GCC_PRAGMA_DIAG_POP() -# endif + #define ITK_GCC_PRAGMA_DIAG(x) ITK_PRAGMA(GCC diagnostic x) + #define ITK_GCC_PRAGMA_DIAG_PUSH() ITK_GCC_PRAGMA_DIAG(push) + #define ITK_GCC_PRAGMA_DIAG_POP() ITK_GCC_PRAGMA_DIAG(pop) + #define ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP #else -# define ITK_GCC_PRAGMA_DIAG_PUSH() -# define ITK_GCC_PRAGMA_DIAG_POP() + #define ITK_GCC_PRAGMA_DIAG(x) + #define ITK_GCC_PRAGMA_DIAG_PUSH() + #define ITK_GCC_PRAGMA_DIAG_POP() #endif /* - * ITK only supports MSVC++ 7.1 and greater + * ITK only supports MSVC++ 10.0 and greater + * MSVC++ 14.0 _MSVC_VER = 1900 + * MSVC++ 12.0 _MSC_VER = 1800 * MSVC++ 11.0 _MSC_VER = 1700 * MSVC++ 10.0 _MSC_VER = 1600 * MSVC++ 9.0 _MSC_VER = 1500 @@ -157,29 +140,39 @@ namespace itk * MSVC++ 6.0 _MSC_VER = 1200 * MSVC++ 5.0 _MSC_VER = 1100 */ -#if defined( _MSC_VER ) && ( _MSC_VER < 1310 ) -//#error "_MSC_VER < 1310 (MSVC++ 7.1) not supported under ITKv4" +#if defined( _MSC_VER ) && ( _MSC_VER < 1600 ) + #error "MSVC++ < 10.0 is not supported under ITKv5" #endif #if defined( __SUNPRO_CC ) && ( __SUNPRO_CC < 0x590 ) -#error "__SUNPRO_CC < 0x590 not supported under ITKv4" + #error "SUNPro C++ < 0x590 is not supported under ITKv4 and above" #endif #if defined( __CYGWIN__ ) -#error "The Cygwin compiler is not supported in ITKv4 and above" + #error "The Cygwin compiler is not supported in ITKv4 and above" #endif #if defined( __BORLANDC__ ) -#error "The Borland C compiler is not supported in ITKv4 and above" + #error "The Borland C compiler is not supported in ITKv4 and above" #endif #if defined( __MWERKS__ ) -#error "The MetroWerks compiler is not supported in ITKv4 and above" + #error "The MetroWerks compiler is not supported in ITKv4 and above" +#endif +#if defined( __GNUC__ ) && !defined(__clang__) && !defined(__INTEL_COMPILER) && (( __GNUC__ < 4 ) || (( __GNUC__ == 4 ) && ( __GNUC_MINOR__ < 8 ))) + #error "GCC < 4.8 is not supported under ITKv5" #endif -#if defined( __GNUC__ ) && ( __GNUC__ < 3 ) -#error "The __GNUC__ version 2.95 compiler is not supprted under ITKv4 and above" #if defined( __sgi ) -//This is true for IRIX 6.5.18m with MIPSPro 7.3.1.3m. -//TODO: At some future point, it may be necessary to -//define a minimum __sgi version that will work. -#error "The __sgi compiler is not supprted under ITKv4 and above" + //This is true for IRIX 6.5.18m with MIPSPro 7.3.1.3m. + //TODO: At some future point, it may be necessary to + //define a minimum __sgi version that will work. + #error "The SGI compiler is not supprted under ITKv4 and above" +#endif +#if defined(__APPLE__) + #if defined( __clang__ ) && (( __clang_major__ < 8 ) || (( __clang_major__ == 8 ) && ( __clang_minor__ < 1 ))) + #error "Apple LLVM < 8.1 is not supported under ITKv5" + #endif +#elif defined( __clang__ ) && (( __clang_major < 3 ) || (( __clang_major__ == 3 ) && ( __clang_minor__ < 3 ))) + #error "Clang < 3.3 is not supported under ITKv5" #endif +#if defined( __INTEL_COMPILER ) && ( __INTEL_COMPILER < 1600 ) + #error "Intel C++ < 16.0 is not supported under ITKv5" #endif // Setup symbol exports From 2191e42328401fa75100a6f85083d31e5f1fd85c Mon Sep 17 00:00:00 2001 From: maekclena Date: Fri, 3 May 2019 16:30:49 +0200 Subject: [PATCH 2/4] ENH: Address review and clean rest of code base --- .../CMake/itkCheckHasGNUAttributeAligned.cxx | 4 --- Modules/Core/Common/include/itkMacro.h | 24 +++++++---------- .../Core/Common/include/itkMetaDataObject.h | 10 ++----- .../Common/include/itkMultiThreaderBase.h | 10 ++----- .../include/itkSimpleDataObjectDecorator.hxx | 10 ++----- Modules/Core/Common/include/itkStaticAssert.h | 5 ++-- Modules/Core/Common/src/itkLightObject.cxx | 2 -- Modules/Core/Common/src/itkMetaDataObject.cxx | 10 ++----- .../Common/test/itkMetaDataDictionaryTest.cxx | 3 --- .../Core/Common/test/itkNumericTraitsTest.cxx | 2 -- .../Core/Common/test/itkSmartPointerGTest.cxx | 5 ---- .../Core/Transform/include/itkTransformBase.h | 10 ++----- .../Core/Transform/src/itkTransformBase.cxx | 10 ++----- .../test/itkCastImageFilterTest.cxx | 2 -- .../test/itkClampImageFilterTest.cxx | 2 -- .../itkReadWriteImageWithDictionaryTest.cxx | 7 +---- .../include/itkCompositeTransformIOHelper.h | 10 ++----- .../include/itkTransformFileReader.h | 10 ++----- .../include/itkTransformFileWriter.h | 20 +++----------- .../include/itkTransformIOBase.h | 10 ++----- .../include/itkTransformIOFactory.h | 10 ++----- .../src/itkCompositeTransformIOHelper.cxx | 20 +++----------- .../src/itkTransformFileReader.cxx | 10 ++----- .../itkTransformFileWriterSpecializations.cxx | 10 ++----- .../TransformBase/src/itkTransformIOBase.cxx | 10 ++----- .../src/itkTransformIOFactory.cxx | 10 ++----- .../include/itkHDF5TransformIO.h | 10 ++----- .../TransformHDF5/src/itkHDF5TransformIO.cxx | 10 ++----- .../include/itkTxtTransformIO.h | 10 ++----- .../src/itkTxtTransformIO.cxx | 10 ++----- .../include/itkMINCTransformIO.h | 10 ++----- .../TransformMINC/src/itkMINCTransformIO.cxx | 10 ++----- .../include/itkMatlabTransformIO.h | 10 ++----- .../src/itkMatlabTransformIO.cxx | 10 ++----- .../include/itkObjectToObjectOptimizerBase.h | 10 ++----- .../src/itkObjectToObjectOptimizerBase.cxx | 10 ++----- .../itkImageToNeighborhoodSampleAdaptor.h | 2 -- .../test/itkMeasurementVectorTraitsTest.cxx | 4 --- .../Python/PatchedPython27pyconfig.h | 27 ++----------------- 39 files changed, 70 insertions(+), 299 deletions(-) diff --git a/Modules/Core/Common/CMake/itkCheckHasGNUAttributeAligned.cxx b/Modules/Core/Common/CMake/itkCheckHasGNUAttributeAligned.cxx index f96df9f973f..72c3259f656 100644 --- a/Modules/Core/Common/CMake/itkCheckHasGNUAttributeAligned.cxx +++ b/Modules/Core/Common/CMake/itkCheckHasGNUAttributeAligned.cxx @@ -14,10 +14,6 @@ struct B char b; } __attribute__ ((aligned (64))); -// fail for gcc 4.1 -#if __GNUC__ == 4 && __GNUC_MINOR__ == 1 -#error This version of GCC is know to have a internal compilation error with this feature in ITK. -#endif // BUG DETECTION: This following usage may generate a segfault during // compilation. diff --git a/Modules/Core/Common/include/itkMacro.h b/Modules/Core/Common/include/itkMacro.h index 0c6795bd5bf..01ef2c1c2aa 100644 --- a/Modules/Core/Common/include/itkMacro.h +++ b/Modules/Core/Common/include/itkMacro.h @@ -115,12 +115,10 @@ namespace itk // // These macros respectively push and pop the diagnostic context // -// Define macro ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP #if defined( __GNUC__ ) && !defined( __INTEL_COMPILER ) #define ITK_GCC_PRAGMA_DIAG(x) ITK_PRAGMA(GCC diagnostic x) #define ITK_GCC_PRAGMA_DIAG_PUSH() ITK_GCC_PRAGMA_DIAG(push) #define ITK_GCC_PRAGMA_DIAG_POP() ITK_GCC_PRAGMA_DIAG(pop) - #define ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP #else #define ITK_GCC_PRAGMA_DIAG(x) #define ITK_GCC_PRAGMA_DIAG_PUSH() @@ -128,7 +126,7 @@ namespace itk #endif /* - * ITK only supports MSVC++ 10.0 and greater + * ITK only supports MSVC++ 14.0 and greater * MSVC++ 14.0 _MSVC_VER = 1900 * MSVC++ 12.0 _MSC_VER = 1800 * MSVC++ 11.0 _MSC_VER = 1700 @@ -140,11 +138,11 @@ namespace itk * MSVC++ 6.0 _MSC_VER = 1200 * MSVC++ 5.0 _MSC_VER = 1100 */ -#if defined( _MSC_VER ) && ( _MSC_VER < 1600 ) - #error "MSVC++ < 10.0 is not supported under ITKv5" +#if defined( _MSC_VER ) && ( _MSC_VER < 1900 ) + #error "Visual Studio < 2015 is not supported under ITKv5" #endif -#if defined( __SUNPRO_CC ) && ( __SUNPRO_CC < 0x590 ) - #error "SUNPro C++ < 0x590 is not supported under ITKv4 and above" +#if defined( __SUNPRO_CC ) && ( __SUNPRO_CC < 0x5140 ) + #error "SUNPro C++ < 5.14.0 is not supported under ITKv4 and above" #endif #if defined( __CYGWIN__ ) #error "The Cygwin compiler is not supported in ITKv4 and above" @@ -171,8 +169,8 @@ namespace itk #elif defined( __clang__ ) && (( __clang_major < 3 ) || (( __clang_major__ == 3 ) && ( __clang_minor__ < 3 ))) #error "Clang < 3.3 is not supported under ITKv5" #endif -#if defined( __INTEL_COMPILER ) && ( __INTEL_COMPILER < 1600 ) - #error "Intel C++ < 16.0 is not supported under ITKv5" +#if defined( __INTEL_COMPILER ) && ( __INTEL_COMPILER < 1504 ) + #error "Intel C++ < 15.0.4 is not supported under ITKv5" #endif // Setup symbol exports @@ -563,7 +561,7 @@ itkTypeMacro(newexcp, parentexcp); \ #else // Setup compile-time warnings for uses of deprecated methods if // possible on this compiler. -#if defined( __GNUC__ ) && !defined( __INTEL_COMPILER ) && ( __GNUC__ > 3 || ( __GNUC__ == 3 && __GNUC_MINOR__ >= 1 ) ) +#if defined( __GNUC__ ) && !defined( __INTEL_COMPILER ) #define itkLegacyMacro(method) method __attribute__( ( deprecated ) ) #elif defined( _MSC_VER ) #define itkLegacyMacro(method) __declspec(deprecated) method @@ -762,11 +760,7 @@ compilers. * and is beneficial in other cases where a value can be constant. * * \ingroup ITKCommon */ -#if defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__ ) < 405 && !defined( __clang__ ) && !defined( __INTEL_COMPILER ) -# define itkStaticConstMacro(name,type,value) enum { name = value } -#else -# define itkStaticConstMacro(name,type,value) static constexpr type name = value -#endif +#define itkStaticConstMacro(name,type,value) static constexpr type name = value #define itkGetStaticConstMacro(name) (Self::name) diff --git a/Modules/Core/Common/include/itkMetaDataObject.h b/Modules/Core/Common/include/itkMetaDataObject.h index 3c9dfe931e0..35adfc73bd3 100644 --- a/Modules/Core/Common/include/itkMetaDataObject.h +++ b/Modules/Core/Common/include/itkMetaDataObject.h @@ -264,9 +264,7 @@ inline bool ExposeMetaData(const MetaDataDictionary & Dictionary, const std::str namespace itk { -#ifdef ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP - ITK_GCC_PRAGMA_DIAG_PUSH() -#endif +ITK_GCC_PRAGMA_DIAG_PUSH() ITK_GCC_PRAGMA_DIAG(ignored "-Wattributes") extern template class ITKCommon_EXPORT_EXPLICIT MetaDataObject< bool >; @@ -294,11 +292,7 @@ extern template class ITKCommon_EXPORT_EXPLICIT MetaDataObject< Array >; extern template class ITKCommon_EXPORT_EXPLICIT MetaDataObject< Array >; extern template class ITKCommon_EXPORT_EXPLICIT MetaDataObject< Matrix >; -#ifdef ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP - ITK_GCC_PRAGMA_DIAG_POP() -#else - ITK_GCC_PRAGMA_DIAG(warning "-Wattributes") -#endif +ITK_GCC_PRAGMA_DIAG_POP() } // end namespace itk # undef ITKCommon_EXPORT_EXPLICIT diff --git a/Modules/Core/Common/include/itkMultiThreaderBase.h b/Modules/Core/Common/include/itkMultiThreaderBase.h index 8291472d46a..d06da57e0ae 100644 --- a/Modules/Core/Common/include/itkMultiThreaderBase.h +++ b/Modules/Core/Common/include/itkMultiThreaderBase.h @@ -173,9 +173,7 @@ class ITKCommon_EXPORT MultiThreaderBase : public Object * (void *)arg passed into the SetSingleMethod. * * DEPRECATED! Use WorkUnitInfo instead. */ -#ifdef ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP - ITK_GCC_PRAGMA_DIAG_PUSH() -#endif +ITK_GCC_PRAGMA_DIAG_PUSH() ITK_GCC_PRAGMA_DIAG(ignored "-Wattributes") INTEL_PRAGMA_WARN_PUSH INTEL_SUPPRESS_warning_1292 @@ -195,11 +193,7 @@ INTEL_PRAGMA_WARN_POP ThreadFunctionType ThreadFunction; enum { SUCCESS, ITK_EXCEPTION, ITK_PROCESS_ABORTED_EXCEPTION, STD_EXCEPTION, UNKNOWN } ThreadExitCode; }; -#ifdef ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP - ITK_GCC_PRAGMA_DIAG_POP() -#else - ITK_GCC_PRAGMA_DIAG(warning "-Wattributes") -#endif +ITK_GCC_PRAGMA_DIAG_POP() #endif //ITK_LEGACY_REMOVE /** This is the structure that is passed to the thread that is diff --git a/Modules/Core/Common/include/itkSimpleDataObjectDecorator.hxx b/Modules/Core/Common/include/itkSimpleDataObjectDecorator.hxx index a10ac8cce5e..56143e2f3eb 100644 --- a/Modules/Core/Common/include/itkSimpleDataObjectDecorator.hxx +++ b/Modules/Core/Common/include/itkSimpleDataObjectDecorator.hxx @@ -41,18 +41,12 @@ SimpleDataObjectDecorator< T > ::SimpleDataObjectDecorator() { #if defined( __GNUC__ ) && ( __GNUC__ > 6 ) -#ifdef ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP - ITK_GCC_PRAGMA_DIAG_PUSH() -#endif +ITK_GCC_PRAGMA_DIAG_PUSH() ITK_GCC_PRAGMA_DIAG(ignored "-Wmaybe-uninitialized") #endif // defined( __GNUC__ ) && ( __GNUC__ > 6 ) this->m_Component = ComponentType(); // initialize here to avoid Purify UMR #if defined( __GNUC__ ) && ( __GNUC__ > 6 ) -#ifdef ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP - ITK_GCC_PRAGMA_DIAG_POP() -#else - ITK_GCC_PRAGMA_DIAG(warning "-Wmaybe-uninitialized") -#endif +ITK_GCC_PRAGMA_DIAG_POP() #endif // defined( __GNUC__ ) && ( __GNUC__ > 6 ) this->m_Initialized = false; // Still needed since not all objects // are initialized at construction time. diff --git a/Modules/Core/Common/include/itkStaticAssert.h b/Modules/Core/Common/include/itkStaticAssert.h index 8d6ae636ccd..7ede0dbb443 100644 --- a/Modules/Core/Common/include/itkStaticAssert.h +++ b/Modules/Core/Common/include/itkStaticAssert.h @@ -33,9 +33,8 @@ * \ingroup ITKCommon */ # define itkStaticAssert(expr, str) static_assert(expr, str) -#elif defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__ ) >= 403 && !defined(__clang__) && !defined( __INTEL_COMPILER ) -// GCC 4.3 is enough for this trick -// But it restricts the static assertion to non global contexts (-> functions) +#elif defined(__GNUC__) && !defined( __INTEL_COMPILER ) +// This trick restricts the static assertion to non global contexts (-> functions) # define itkStaticAssert(expr,str) \ ({extern int __attribute__((error(str))) StaticAssertFailure(); \ ((void)((expr) ? 0: StaticAssertFailure()), 0); \ diff --git a/Modules/Core/Common/src/itkLightObject.cxx b/Modules/Core/Common/src/itkLightObject.cxx index fb74be2deb1..2ba7f573fe4 100644 --- a/Modules/Core/Common/src/itkLightObject.cxx +++ b/Modules/Core/Common/src/itkLightObject.cxx @@ -20,11 +20,9 @@ #include // Better name demanging for gcc -#if __GNUC__ > 3 || ( __GNUC__ == 3 && __GNUC_MINOR__ > 0 ) #ifndef __EMSCRIPTEN__ #define GCC_USEDEMANGLE #endif -#endif #ifdef GCC_USEDEMANGLE #include diff --git a/Modules/Core/Common/src/itkMetaDataObject.cxx b/Modules/Core/Common/src/itkMetaDataObject.cxx index 08fec4acd4f..93da5502ead 100644 --- a/Modules/Core/Common/src/itkMetaDataObject.cxx +++ b/Modules/Core/Common/src/itkMetaDataObject.cxx @@ -21,9 +21,7 @@ namespace itk { -#ifdef ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP - ITK_GCC_PRAGMA_DIAG_PUSH() -#endif +ITK_GCC_PRAGMA_DIAG_PUSH() ITK_GCC_PRAGMA_DIAG(ignored "-Wattributes") template class ITKCommon_EXPORT MetaDataObject< bool >; @@ -51,10 +49,6 @@ template class ITKCommon_EXPORT MetaDataObject< std::vector >; template class ITKCommon_EXPORT MetaDataObject< std::vector > >; template class ITKCommon_EXPORT MetaDataObject< std::vector > >; -#ifdef ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP - ITK_GCC_PRAGMA_DIAG_POP() -#else - ITK_GCC_PRAGMA_DIAG(warning "-Wattributes") -#endif +ITK_GCC_PRAGMA_DIAG_POP() } // end namespace itk diff --git a/Modules/Core/Common/test/itkMetaDataDictionaryTest.cxx b/Modules/Core/Common/test/itkMetaDataDictionaryTest.cxx index 94e705d5861..4f7399e4552 100644 --- a/Modules/Core/Common/test/itkMetaDataDictionaryTest.cxx +++ b/Modules/Core/Common/test/itkMetaDataDictionaryTest.cxx @@ -72,8 +72,6 @@ int itkMetaDataDictionaryTest(int , char * []) MyDictionary.Print(std::cout); - // Iterator are broken on VS6 -#if !(defined(_MSC_VER) && _MSC_VER < 1300) std::cout << "Exercise the Iterator access" << std::endl; try { @@ -165,7 +163,6 @@ int itkMetaDataDictionaryTest(int , char * []) } -#endif //NOTE: Must clean up memory allocated with char * StrandedMemory=new char[2345]; delete[] StrandedMemory; diff --git a/Modules/Core/Common/test/itkNumericTraitsTest.cxx b/Modules/Core/Common/test/itkNumericTraitsTest.cxx index 3a6164b9884..66c4a34b8c1 100644 --- a/Modules/Core/Common/test/itkNumericTraitsTest.cxx +++ b/Modules/Core/Common/test/itkNumericTraitsTest.cxx @@ -20,11 +20,9 @@ #include // Better name demanging for gcc -#if __GNUC__ > 3 || ( __GNUC__ == 3 && __GNUC_MINOR__ > 0 ) #ifndef __EMSCRIPTEN__ #define GCC_USEDEMANGLE #endif -#endif #ifdef GCC_USEDEMANGLE #include diff --git a/Modules/Core/Common/test/itkSmartPointerGTest.cxx b/Modules/Core/Common/test/itkSmartPointerGTest.cxx index d85e8a8eaa7..1ebab32357a 100644 --- a/Modules/Core/Common/test/itkSmartPointerGTest.cxx +++ b/Modules/Core/Common/test/itkSmartPointerGTest.cxx @@ -143,11 +143,6 @@ TEST(SmartPointer, EmptyAndNull) // EXPECT_TRUE( 0 == ptr ); } -#ifdef ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP - ITK_GCC_PRAGMA_DIAG_POP() -#else - ITK_GCC_PRAGMA_DIAG(warning "-Wconversion-null") -#endif TEST(SmartPointer,Converting) diff --git a/Modules/Core/Transform/include/itkTransformBase.h b/Modules/Core/Transform/include/itkTransformBase.h index 58f498dbdd3..d52a68291cf 100644 --- a/Modules/Core/Transform/include/itkTransformBase.h +++ b/Modules/Core/Transform/include/itkTransformBase.h @@ -165,17 +165,11 @@ using TransformBase = TransformBaseTemplate< double >; # endif namespace itk { -#ifdef ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP - ITK_GCC_PRAGMA_DIAG_PUSH() -#endif +ITK_GCC_PRAGMA_DIAG_PUSH() ITK_GCC_PRAGMA_DIAG(ignored "-Wattributes") extern template class ITKTransform_EXPORT_EXPLICIT TransformBaseTemplate< double >; extern template class ITKTransform_EXPORT_EXPLICIT TransformBaseTemplate< float >; -#ifdef ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP - ITK_GCC_PRAGMA_DIAG_POP() -#else - ITK_GCC_PRAGMA_DIAG(warning "-Wattributes") -#endif +ITK_GCC_PRAGMA_DIAG_POP() } // end namespace itk # undef ITKTransform_EXPORT_EXPLICIT #endif diff --git a/Modules/Core/Transform/src/itkTransformBase.cxx b/Modules/Core/Transform/src/itkTransformBase.cxx index 99e1aa874a1..126c011cd89 100644 --- a/Modules/Core/Transform/src/itkTransformBase.cxx +++ b/Modules/Core/Transform/src/itkTransformBase.cxx @@ -22,18 +22,12 @@ namespace itk { -#ifdef ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP - ITK_GCC_PRAGMA_DIAG_PUSH() -#endif +ITK_GCC_PRAGMA_DIAG_PUSH() ITK_GCC_PRAGMA_DIAG(ignored "-Wattributes") template class ITKTransform_EXPORT TransformBaseTemplate< double >; template class ITKTransform_EXPORT TransformBaseTemplate< float >; -#ifdef ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP - ITK_GCC_PRAGMA_DIAG_POP() -#else - ITK_GCC_PRAGMA_DIAG(warning "-Wattributes") -#endif +ITK_GCC_PRAGMA_DIAG_POP() } // end namespace itk diff --git a/Modules/Filtering/ImageFilterBase/test/itkCastImageFilterTest.cxx b/Modules/Filtering/ImageFilterBase/test/itkCastImageFilterTest.cxx index e0769375342..fe74947b32d 100644 --- a/Modules/Filtering/ImageFilterBase/test/itkCastImageFilterTest.cxx +++ b/Modules/Filtering/ImageFilterBase/test/itkCastImageFilterTest.cxx @@ -28,11 +28,9 @@ // Better name demanging for gcc -#if __GNUC__ > 3 || ( __GNUC__ == 3 && __GNUC_MINOR__ > 0 ) #ifndef __EMSCRIPTEN__ #define GCC_USEDEMANGLE #endif -#endif #ifdef GCC_USEDEMANGLE #include diff --git a/Modules/Filtering/ImageIntensity/test/itkClampImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkClampImageFilterTest.cxx index 25e30705ba8..c651f1f44dc 100644 --- a/Modules/Filtering/ImageIntensity/test/itkClampImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkClampImageFilterTest.cxx @@ -26,11 +26,9 @@ #include // Better name demanging for gcc -#if __GNUC__ > 3 || ( __GNUC__ == 3 && __GNUC_MINOR__ > 0 ) #ifndef __EMSCRIPTEN__ #define GCC_USEDEMANGLE #endif -#endif #ifdef GCC_USEDEMANGLE #include diff --git a/Modules/IO/ImageBase/test/itkReadWriteImageWithDictionaryTest.cxx b/Modules/IO/ImageBase/test/itkReadWriteImageWithDictionaryTest.cxx index bbeffea6359..f7cfb30b208 100644 --- a/Modules/IO/ImageBase/test/itkReadWriteImageWithDictionaryTest.cxx +++ b/Modules/IO/ImageBase/test/itkReadWriteImageWithDictionaryTest.cxx @@ -160,11 +160,7 @@ int itkReadWriteImageWithDictionaryTest(int argc, char* argv[]) std::cout<; extern template class ITKIOTransformBase_EXPORT_EXPLICIT CompositeTransformIOHelperTemplate< float >; -#ifdef ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP - ITK_GCC_PRAGMA_DIAG_POP() -#else - ITK_GCC_PRAGMA_DIAG(warning "-Wattributes") -#endif +ITK_GCC_PRAGMA_DIAG_POP() } // end namespace itk # undef ITKIOTransformBase_EXPORT_EXPLICIT diff --git a/Modules/IO/TransformBase/include/itkTransformFileReader.h b/Modules/IO/TransformBase/include/itkTransformFileReader.h index db793b6cb6d..730e56246bb 100644 --- a/Modules/IO/TransformBase/include/itkTransformFileReader.h +++ b/Modules/IO/TransformBase/include/itkTransformFileReader.h @@ -127,19 +127,13 @@ using TransformFileReader = itk::TransformFileReaderTemplate; namespace itk { -#ifdef ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP - ITK_GCC_PRAGMA_DIAG_PUSH() -#endif +ITK_GCC_PRAGMA_DIAG_PUSH() ITK_GCC_PRAGMA_DIAG(ignored "-Wattributes") extern template class ITKIOTransformBase_EXPORT_EXPLICIT TransformFileReaderTemplate< double >; extern template class ITKIOTransformBase_EXPORT_EXPLICIT TransformFileReaderTemplate< float >; -#ifdef ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP - ITK_GCC_PRAGMA_DIAG_POP() -#else - ITK_GCC_PRAGMA_DIAG(warning "-Wattributes") -#endif +ITK_GCC_PRAGMA_DIAG_POP() } // end namespace itk # undef ITKIOTransformBase_EXPORT_EXPLICIT diff --git a/Modules/IO/TransformBase/include/itkTransformFileWriter.h b/Modules/IO/TransformBase/include/itkTransformFileWriter.h index d60aa0cf728..ad8228f67b5 100644 --- a/Modules/IO/TransformBase/include/itkTransformFileWriter.h +++ b/Modules/IO/TransformBase/include/itkTransformFileWriter.h @@ -117,20 +117,14 @@ class ITKIOTransformBase_TEMPLATE_EXPORT TransformFileWriterTemplate:public Ligh /** This helps to meet backward compatibility */ using TransformFileWriter = itk::TransformFileWriterTemplate; -#ifdef ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP - ITK_GCC_PRAGMA_DIAG_PUSH() -#endif +ITK_GCC_PRAGMA_DIAG_PUSH() ITK_GCC_PRAGMA_DIAG(ignored "-Wattributes") /** Declare specializations */ template<> void ITKIOTransformBase_TEMPLATE_EXPORT TransformFileWriterTemplate< double >::PushBackTransformList(const Object *transObj); template<> void ITKIOTransformBase_TEMPLATE_EXPORT TransformFileWriterTemplate< float >::PushBackTransformList(const Object *transObj); -#ifdef ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP - ITK_GCC_PRAGMA_DIAG_POP() -#else - ITK_GCC_PRAGMA_DIAG(warning "-Wattributes") -#endif +ITK_GCC_PRAGMA_DIAG_POP() } // namespace itk @@ -162,19 +156,13 @@ template<> void ITKIOTransformBase_TEMPLATE_EXPORT TransformFileWriterTemplate< namespace itk { -#ifdef ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP - ITK_GCC_PRAGMA_DIAG_PUSH() -#endif +ITK_GCC_PRAGMA_DIAG_PUSH() ITK_GCC_PRAGMA_DIAG(ignored "-Wattributes") extern template class ITKIOTransformBase_EXPORT_EXPLICIT TransformFileWriterTemplate< double >; extern template class ITKIOTransformBase_EXPORT_EXPLICIT TransformFileWriterTemplate< float >; -#ifdef ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP - ITK_GCC_PRAGMA_DIAG_POP() -#else - ITK_GCC_PRAGMA_DIAG(warning "-Wattributes") -#endif +ITK_GCC_PRAGMA_DIAG_POP() } // end namespace itk # undef ITKIOTransformBase_EXPORT_EXPLICIT diff --git a/Modules/IO/TransformBase/include/itkTransformIOBase.h b/Modules/IO/TransformBase/include/itkTransformIOBase.h index f0dfab3532e..850892ecb7e 100644 --- a/Modules/IO/TransformBase/include/itkTransformIOBase.h +++ b/Modules/IO/TransformBase/include/itkTransformIOBase.h @@ -225,19 +225,13 @@ using TransformIOBase = itk::TransformIOBaseTemplate; namespace itk { -#ifdef ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP - ITK_GCC_PRAGMA_DIAG_PUSH() -#endif +ITK_GCC_PRAGMA_DIAG_PUSH() ITK_GCC_PRAGMA_DIAG(ignored "-Wattributes") extern template class ITKIOTransformBase_EXPORT_EXPLICIT TransformIOBaseTemplate< double >; extern template class ITKIOTransformBase_EXPORT_EXPLICIT TransformIOBaseTemplate< float >; -#ifdef ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP - ITK_GCC_PRAGMA_DIAG_POP() -#else - ITK_GCC_PRAGMA_DIAG(warning "-Wattributes") -#endif +ITK_GCC_PRAGMA_DIAG_POP() } // end namespace itk # undef ITKIOTransformBase_EXPORT_EXPLICIT diff --git a/Modules/IO/TransformBase/include/itkTransformIOFactory.h b/Modules/IO/TransformBase/include/itkTransformIOFactory.h index eeaf26cf9be..b7d830a798b 100644 --- a/Modules/IO/TransformBase/include/itkTransformIOFactory.h +++ b/Modules/IO/TransformBase/include/itkTransformIOFactory.h @@ -93,19 +93,13 @@ using TransformIOFactory = TransformIOFactoryTemplate; namespace itk { -#ifdef ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP - ITK_GCC_PRAGMA_DIAG_PUSH() -#endif +ITK_GCC_PRAGMA_DIAG_PUSH() ITK_GCC_PRAGMA_DIAG(ignored "-Wattributes") extern template class ITKIOTransformBase_EXPORT_EXPLICIT TransformIOFactoryTemplate< double >; extern template class ITKIOTransformBase_EXPORT_EXPLICIT TransformIOFactoryTemplate< float >; -#ifdef ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP - ITK_GCC_PRAGMA_DIAG_POP() -#else - ITK_GCC_PRAGMA_DIAG(warning "-Wattributes") -#endif +ITK_GCC_PRAGMA_DIAG_POP() } // end namespace itk # undef ITKIOTransformBase_EXPORT_EXPLICIT diff --git a/Modules/IO/TransformBase/src/itkCompositeTransformIOHelper.cxx b/Modules/IO/TransformBase/src/itkCompositeTransformIOHelper.cxx index bed96284c41..62207626f70 100644 --- a/Modules/IO/TransformBase/src/itkCompositeTransformIOHelper.cxx +++ b/Modules/IO/TransformBase/src/itkCompositeTransformIOHelper.cxx @@ -32,9 +32,7 @@ namespace return rval; } -#ifdef ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP - ITK_GCC_PRAGMA_DIAG_PUSH() -#endif +ITK_GCC_PRAGMA_DIAG_PUSH() ITK_GCC_PRAGMA_DIAG(ignored "-Wunused-function") template<> std::string GetTransformDimensionAsString<2>() @@ -91,11 +89,7 @@ ITK_GCC_PRAGMA_DIAG(ignored "-Wunused-function") std::string rval("9_9"); return rval; } -#ifdef ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP - ITK_GCC_PRAGMA_DIAG_POP() -#else - ITK_GCC_PRAGMA_DIAG(warning "-Wunused-function") -#endif +ITK_GCC_PRAGMA_DIAG_POP() } @@ -211,18 +205,12 @@ ::InternalSetTransformList(TransformType *transform,TransformListType &transform return 1; } -#ifdef ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP - ITK_GCC_PRAGMA_DIAG_PUSH() -#endif +ITK_GCC_PRAGMA_DIAG_PUSH() ITK_GCC_PRAGMA_DIAG(ignored "-Wattributes") template class ITKIOTransformBase_EXPORT CompositeTransformIOHelperTemplate< double >; template class ITKIOTransformBase_EXPORT CompositeTransformIOHelperTemplate< float >; -#ifdef ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP - ITK_GCC_PRAGMA_DIAG_POP() -#else - ITK_GCC_PRAGMA_DIAG(warning "-Wattributes") -#endif +ITK_GCC_PRAGMA_DIAG_POP() } // end namespace itk diff --git a/Modules/IO/TransformBase/src/itkTransformFileReader.cxx b/Modules/IO/TransformBase/src/itkTransformFileReader.cxx index d93af202bc9..b530dba067d 100644 --- a/Modules/IO/TransformBase/src/itkTransformFileReader.cxx +++ b/Modules/IO/TransformBase/src/itkTransformFileReader.cxx @@ -203,18 +203,12 @@ ::PrintSelf(std::ostream & os, Indent indent) const os << indent << "FileName: " << m_FileName << std::endl; } -#ifdef ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP - ITK_GCC_PRAGMA_DIAG_PUSH() -#endif +ITK_GCC_PRAGMA_DIAG_PUSH() ITK_GCC_PRAGMA_DIAG(ignored "-Wattributes") template class ITKIOTransformBase_EXPORT TransformFileReaderTemplate< double >; template class ITKIOTransformBase_EXPORT TransformFileReaderTemplate< float >; -#ifdef ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP - ITK_GCC_PRAGMA_DIAG_POP() -#else - ITK_GCC_PRAGMA_DIAG(warning "-Wattributes") -#endif +ITK_GCC_PRAGMA_DIAG_POP() } // end namespace itk diff --git a/Modules/IO/TransformBase/src/itkTransformFileWriterSpecializations.cxx b/Modules/IO/TransformBase/src/itkTransformFileWriterSpecializations.cxx index 7cd340b9272..06b84df4602 100644 --- a/Modules/IO/TransformBase/src/itkTransformFileWriterSpecializations.cxx +++ b/Modules/IO/TransformBase/src/itkTransformFileWriterSpecializations.cxx @@ -399,18 +399,12 @@ ::PushBackTransformList(const Object *transObj) } } -#ifdef ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP - ITK_GCC_PRAGMA_DIAG_PUSH() -#endif +ITK_GCC_PRAGMA_DIAG_PUSH() ITK_GCC_PRAGMA_DIAG(ignored "-Wattributes") template class ITKIOTransformBase_EXPORT TransformFileWriterTemplate< double >; template class ITKIOTransformBase_EXPORT TransformFileWriterTemplate< float >; -#ifdef ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP - ITK_GCC_PRAGMA_DIAG_POP() -#else - ITK_GCC_PRAGMA_DIAG(warning "-Wattributes") -#endif +ITK_GCC_PRAGMA_DIAG_POP() } diff --git a/Modules/IO/TransformBase/src/itkTransformIOBase.cxx b/Modules/IO/TransformBase/src/itkTransformIOBase.cxx index 4c7393f6206..d0a50e5ee73 100644 --- a/Modules/IO/TransformBase/src/itkTransformIOBase.cxx +++ b/Modules/IO/TransformBase/src/itkTransformIOBase.cxx @@ -131,18 +131,12 @@ if ( !m_WriteTransformList.empty() ) } } -#ifdef ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP - ITK_GCC_PRAGMA_DIAG_PUSH() -#endif +ITK_GCC_PRAGMA_DIAG_PUSH() ITK_GCC_PRAGMA_DIAG(ignored "-Wattributes") template class ITKIOTransformBase_EXPORT TransformIOBaseTemplate< double >; template class ITKIOTransformBase_EXPORT TransformIOBaseTemplate< float >; -#ifdef ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP - ITK_GCC_PRAGMA_DIAG_POP() -#else - ITK_GCC_PRAGMA_DIAG(warning "-Wattributes") -#endif +ITK_GCC_PRAGMA_DIAG_POP() } // end namespace itk diff --git a/Modules/IO/TransformBase/src/itkTransformIOFactory.cxx b/Modules/IO/TransformBase/src/itkTransformIOFactory.cxx index d9e9b69a432..53c88164e2b 100644 --- a/Modules/IO/TransformBase/src/itkTransformIOFactory.cxx +++ b/Modules/IO/TransformBase/src/itkTransformIOFactory.cxx @@ -64,18 +64,12 @@ ::CreateTransformIO(const char *path, TransformIOFactoryFileModeType mode) return nullptr; } -#ifdef ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP - ITK_GCC_PRAGMA_DIAG_PUSH() -#endif +ITK_GCC_PRAGMA_DIAG_PUSH() ITK_GCC_PRAGMA_DIAG(ignored "-Wattributes") template class ITKIOTransformBase_EXPORT TransformIOFactoryTemplate< double >; template class ITKIOTransformBase_EXPORT TransformIOFactoryTemplate< float >; -#ifdef ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP - ITK_GCC_PRAGMA_DIAG_POP() -#else - ITK_GCC_PRAGMA_DIAG(warning "-Wattributes") -#endif +ITK_GCC_PRAGMA_DIAG_POP() } // end namespace itk diff --git a/Modules/IO/TransformHDF5/include/itkHDF5TransformIO.h b/Modules/IO/TransformHDF5/include/itkHDF5TransformIO.h index 48909fd8087..b38466c0aca 100644 --- a/Modules/IO/TransformHDF5/include/itkHDF5TransformIO.h +++ b/Modules/IO/TransformHDF5/include/itkHDF5TransformIO.h @@ -182,19 +182,13 @@ using HDF5TransformIO = HDF5TransformIOTemplate; # endif namespace itk { -#ifdef ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP - ITK_GCC_PRAGMA_DIAG_PUSH() -#endif +ITK_GCC_PRAGMA_DIAG_PUSH() ITK_GCC_PRAGMA_DIAG(ignored "-Wattributes") extern template class ITKIOTransformHDF5_EXPORT_EXPLICIT HDF5TransformIOTemplate< double >; extern template class ITKIOTransformHDF5_EXPORT_EXPLICIT HDF5TransformIOTemplate< float >; -#ifdef ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP - ITK_GCC_PRAGMA_DIAG_POP() -#else - ITK_GCC_PRAGMA_DIAG(warning "-Wattributes") -#endif +ITK_GCC_PRAGMA_DIAG_POP() } // end namespace itk # undef ITKIOTransformHDF5_EXPORT_EXPLICIT diff --git a/Modules/IO/TransformHDF5/src/itkHDF5TransformIO.cxx b/Modules/IO/TransformHDF5/src/itkHDF5TransformIO.cxx index f7cd13aac41..c93184c5987 100644 --- a/Modules/IO/TransformHDF5/src/itkHDF5TransformIO.cxx +++ b/Modules/IO/TransformHDF5/src/itkHDF5TransformIO.cxx @@ -550,18 +550,12 @@ GetTransformName(int i) return s.str(); } -#ifdef ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP - ITK_GCC_PRAGMA_DIAG_PUSH() -#endif +ITK_GCC_PRAGMA_DIAG_PUSH() ITK_GCC_PRAGMA_DIAG(ignored "-Wattributes") template class ITKIOTransformHDF5_EXPORT HDF5TransformIOTemplate< double >; template class ITKIOTransformHDF5_EXPORT HDF5TransformIOTemplate< float >; -#ifdef ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP - ITK_GCC_PRAGMA_DIAG_POP() -#else - ITK_GCC_PRAGMA_DIAG(warning "-Wattributes") -#endif +ITK_GCC_PRAGMA_DIAG_POP() } // end namespace itk diff --git a/Modules/IO/TransformInsightLegacy/include/itkTxtTransformIO.h b/Modules/IO/TransformInsightLegacy/include/itkTxtTransformIO.h index a7650d7a5c9..ed84404294c 100644 --- a/Modules/IO/TransformInsightLegacy/include/itkTxtTransformIO.h +++ b/Modules/IO/TransformInsightLegacy/include/itkTxtTransformIO.h @@ -107,19 +107,13 @@ using TxtTransformIO = TxtTransformIOTemplate; namespace itk { -#ifdef ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP - ITK_GCC_PRAGMA_DIAG_PUSH() -#endif +ITK_GCC_PRAGMA_DIAG_PUSH() ITK_GCC_PRAGMA_DIAG(ignored "-Wattributes") extern template class ITKIOTransformInsightLegacy_EXPORT_EXPLICIT TxtTransformIOTemplate< double >; extern template class ITKIOTransformInsightLegacy_EXPORT_EXPLICIT TxtTransformIOTemplate< float >; -#ifdef ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP - ITK_GCC_PRAGMA_DIAG_POP() -#else - ITK_GCC_PRAGMA_DIAG(warning "-Wattributes") -#endif +ITK_GCC_PRAGMA_DIAG_POP() } // end namespace itk # undef ITKIOTransformInsightLegacy_EXPORT_EXPLICIT diff --git a/Modules/IO/TransformInsightLegacy/src/itkTxtTransformIO.cxx b/Modules/IO/TransformInsightLegacy/src/itkTxtTransformIO.cxx index 606241206d9..1f9bfee292f 100644 --- a/Modules/IO/TransformInsightLegacy/src/itkTxtTransformIO.cxx +++ b/Modules/IO/TransformInsightLegacy/src/itkTxtTransformIO.cxx @@ -365,18 +365,12 @@ ::Write() out.close(); } -#ifdef ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP - ITK_GCC_PRAGMA_DIAG_PUSH() -#endif +ITK_GCC_PRAGMA_DIAG_PUSH() ITK_GCC_PRAGMA_DIAG(ignored "-Wattributes") template class ITKIOTransformInsightLegacy_EXPORT TxtTransformIOTemplate< double >; template class ITKIOTransformInsightLegacy_EXPORT TxtTransformIOTemplate< float >; -#ifdef ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP - ITK_GCC_PRAGMA_DIAG_POP() -#else - ITK_GCC_PRAGMA_DIAG(warning "-Wattributes") -#endif +ITK_GCC_PRAGMA_DIAG_POP() } // end namespace itk diff --git a/Modules/IO/TransformMINC/include/itkMINCTransformIO.h b/Modules/IO/TransformMINC/include/itkMINCTransformIO.h index 7ae6fe20959..2559d8ed05d 100644 --- a/Modules/IO/TransformMINC/include/itkMINCTransformIO.h +++ b/Modules/IO/TransformMINC/include/itkMINCTransformIO.h @@ -122,19 +122,13 @@ using MINCTransformIO = MINCTransformIOTemplate; namespace itk { -#ifdef ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP - ITK_GCC_PRAGMA_DIAG_PUSH() -#endif +ITK_GCC_PRAGMA_DIAG_PUSH() ITK_GCC_PRAGMA_DIAG(ignored "-Wattributes") extern template class ITKIOTransformMINC_EXPORT_EXPLICIT MINCTransformIOTemplate< double >; extern template class ITKIOTransformMINC_EXPORT_EXPLICIT MINCTransformIOTemplate< float >; -#ifdef ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP - ITK_GCC_PRAGMA_DIAG_POP() -#else - ITK_GCC_PRAGMA_DIAG(warning "-Wattributes") -#endif +ITK_GCC_PRAGMA_DIAG_POP() } // end namespace itk # undef ITKIOTransformMINC_EXPORT_EXPLICIT diff --git a/Modules/IO/TransformMINC/src/itkMINCTransformIO.cxx b/Modules/IO/TransformMINC/src/itkMINCTransformIO.cxx index ca64a5a737a..9bcf32281cb 100644 --- a/Modules/IO/TransformMINC/src/itkMINCTransformIO.cxx +++ b/Modules/IO/TransformMINC/src/itkMINCTransformIO.cxx @@ -355,18 +355,12 @@ ::Write() } } -#ifdef ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP - ITK_GCC_PRAGMA_DIAG_PUSH() -#endif +ITK_GCC_PRAGMA_DIAG_PUSH() ITK_GCC_PRAGMA_DIAG(ignored "-Wattributes") template class ITKIOTransformMINC_EXPORT MINCTransformIOTemplate< double >; template class ITKIOTransformMINC_EXPORT MINCTransformIOTemplate< float >; -#ifdef ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP - ITK_GCC_PRAGMA_DIAG_POP() -#else - ITK_GCC_PRAGMA_DIAG(warning "-Wattributes") -#endif +ITK_GCC_PRAGMA_DIAG_POP() } // end namespace itk diff --git a/Modules/IO/TransformMatlab/include/itkMatlabTransformIO.h b/Modules/IO/TransformMatlab/include/itkMatlabTransformIO.h index 228b93082a2..ed566e8dafc 100644 --- a/Modules/IO/TransformMatlab/include/itkMatlabTransformIO.h +++ b/Modules/IO/TransformMatlab/include/itkMatlabTransformIO.h @@ -95,17 +95,11 @@ using MatlabTransformIO = MatlabTransformIOTemplate; # endif namespace itk { -#ifdef ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP - ITK_GCC_PRAGMA_DIAG_PUSH() -#endif +ITK_GCC_PRAGMA_DIAG_PUSH() ITK_GCC_PRAGMA_DIAG(ignored "-Wattributes") extern template class ITKIOTransformMatlab_EXPORT_EXPLICIT MatlabTransformIOTemplate< double >; extern template class ITKIOTransformMatlab_EXPORT_EXPLICIT MatlabTransformIOTemplate< float >; -#ifdef ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP - ITK_GCC_PRAGMA_DIAG_POP() -#else - ITK_GCC_PRAGMA_DIAG(warning "-Wattributes") -#endif +ITK_GCC_PRAGMA_DIAG_POP() } // end namespace itk # undef ITKIOTransformMatlab_EXPORT_EXPLICIT #endif diff --git a/Modules/IO/TransformMatlab/src/itkMatlabTransformIO.cxx b/Modules/IO/TransformMatlab/src/itkMatlabTransformIO.cxx index 2593116ddad..273a76c6468 100644 --- a/Modules/IO/TransformMatlab/src/itkMatlabTransformIO.cxx +++ b/Modules/IO/TransformMatlab/src/itkMatlabTransformIO.cxx @@ -150,18 +150,12 @@ ::Write() out.close(); } -#ifdef ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP - ITK_GCC_PRAGMA_DIAG_PUSH() -#endif +ITK_GCC_PRAGMA_DIAG_PUSH() ITK_GCC_PRAGMA_DIAG(ignored "-Wattributes") template class ITKIOTransformMatlab_EXPORT MatlabTransformIOTemplate< double >; template class ITKIOTransformMatlab_EXPORT MatlabTransformIOTemplate< float >; -#ifdef ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP - ITK_GCC_PRAGMA_DIAG_POP() -#else - ITK_GCC_PRAGMA_DIAG(warning "-Wattributes") -#endif +ITK_GCC_PRAGMA_DIAG_POP() } // end namespace itk diff --git a/Modules/Numerics/Optimizersv4/include/itkObjectToObjectOptimizerBase.h b/Modules/Numerics/Optimizersv4/include/itkObjectToObjectOptimizerBase.h index ade3e793172..624d0a0af9d 100644 --- a/Modules/Numerics/Optimizersv4/include/itkObjectToObjectOptimizerBase.h +++ b/Modules/Numerics/Optimizersv4/include/itkObjectToObjectOptimizerBase.h @@ -303,19 +303,13 @@ using ObjectToObjectOptimizerBase = ObjectToObjectOptimizerBaseTemplate; namespace itk { -#ifdef ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP - ITK_GCC_PRAGMA_DIAG_PUSH() -#endif +ITK_GCC_PRAGMA_DIAG_PUSH() ITK_GCC_PRAGMA_DIAG(ignored "-Wattributes") extern template class ITKOptimizersv4_EXPORT_EXPLICIT ObjectToObjectOptimizerBaseTemplate; extern template class ITKOptimizersv4_EXPORT_EXPLICIT ObjectToObjectOptimizerBaseTemplate; -#ifdef ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP - ITK_GCC_PRAGMA_DIAG_POP() -#else - ITK_GCC_PRAGMA_DIAG(warning "-Wattributes") -#endif +ITK_GCC_PRAGMA_DIAG_POP() } // end namespace itk # undef ITKOptimizersv4_EXPORT_EXPLICIT diff --git a/Modules/Numerics/Optimizersv4/src/itkObjectToObjectOptimizerBase.cxx b/Modules/Numerics/Optimizersv4/src/itkObjectToObjectOptimizerBase.cxx index a9840c14b2f..a8ff3492306 100644 --- a/Modules/Numerics/Optimizersv4/src/itkObjectToObjectOptimizerBase.cxx +++ b/Modules/Numerics/Optimizersv4/src/itkObjectToObjectOptimizerBase.cxx @@ -21,18 +21,12 @@ namespace itk { -#ifdef ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP - ITK_GCC_PRAGMA_DIAG_PUSH() -#endif +ITK_GCC_PRAGMA_DIAG_PUSH() ITK_GCC_PRAGMA_DIAG(ignored "-Wattributes") template class ITKOptimizersv4_EXPORT ObjectToObjectOptimizerBaseTemplate; template class ITKOptimizersv4_EXPORT ObjectToObjectOptimizerBaseTemplate; -#ifdef ITK_HAS_GCC_PRAGMA_DIAG_PUSHPOP - ITK_GCC_PRAGMA_DIAG_POP() -#else - ITK_GCC_PRAGMA_DIAG(warning "-Wattributes") -#endif +ITK_GCC_PRAGMA_DIAG_POP() } // end namespace itk diff --git a/Modules/Numerics/Statistics/include/itkImageToNeighborhoodSampleAdaptor.h b/Modules/Numerics/Statistics/include/itkImageToNeighborhoodSampleAdaptor.h index 4d6026bc773..899b6138873 100644 --- a/Modules/Numerics/Statistics/include/itkImageToNeighborhoodSampleAdaptor.h +++ b/Modules/Numerics/Statistics/include/itkImageToNeighborhoodSampleAdaptor.h @@ -243,9 +243,7 @@ class ITK_TEMPLATE_EXPORT ImageToNeighborhoodSampleAdaptor : return *this; } -#if !(defined(_MSC_VER) && (_MSC_VER <= 1200)) protected: -#endif //This copy constructor is actually used in Iterator Begin()! Iterator(NeighborhoodIteratorType iter, InstanceIdentifier iid):ConstIterator( iter, iid ) { diff --git a/Modules/Numerics/Statistics/test/itkMeasurementVectorTraitsTest.cxx b/Modules/Numerics/Statistics/test/itkMeasurementVectorTraitsTest.cxx index 215c4ea3a45..0f91207971e 100644 --- a/Modules/Numerics/Statistics/test/itkMeasurementVectorTraitsTest.cxx +++ b/Modules/Numerics/Statistics/test/itkMeasurementVectorTraitsTest.cxx @@ -123,9 +123,7 @@ int itkMeasurementVectorTraitsTest(int, char* [] ) itk::NumericTraits< MeasurementVectorType4b >::SetLength( measure4b, length2 ); // against each other -#if !(defined(_MSC_VER) && (_MSC_VER <= 1200)) itkAssertSameLengthTest( measure1b, measure1b ); -#endif itkAssertSameLengthTest( measure2b, measure2b ); itkAssertSameLengthTest( measure3b, measure3b ); itkAssertSameLengthTest( measure4b, measure4b ); @@ -143,9 +141,7 @@ int itkMeasurementVectorTraitsTest(int, char* [] ) // against each other -#if !(defined(_MSC_VER) && (_MSC_VER <= 1200)) itkAssertLengthExceptionMacro( measure1b, measure1bb ); -#endif itkAssertLengthExceptionMacro( measure2b, measure2bb ); itkAssertLengthExceptionMacro( measure3b, measure3bb ); itkAssertLengthExceptionMacro( measure4b, measure4bb ); diff --git a/Wrapping/Generators/Python/PatchedPython27pyconfig.h b/Wrapping/Generators/Python/PatchedPython27pyconfig.h index 7d94d70ae12..75398e3b576 100644 --- a/Wrapping/Generators/Python/PatchedPython27pyconfig.h +++ b/Wrapping/Generators/Python/PatchedPython27pyconfig.h @@ -233,8 +233,7 @@ typedef int pid_t; #endif /* _MSC_VER */ /* define some ANSI types that are not defined in earlier Win headers */ -#if defined(_MSC_VER) && _MSC_VER >= 1200 -/* This file only exists in VC 6.0 or higher */ +#if defined(_MSC_VER) #include #endif @@ -272,13 +271,6 @@ typedef int pid_t; #if defined(__GNUC__) && defined(_WIN32) /* XXX These defines are likely incomplete, but should be easy to fix. They should be complete enough to build extension modules. */ -/* Suggested by Rene Liebscher to avoid a GCC 2.91.* - bug that requires structure imports. More recent versions of the - compiler don't exhibit this bug. -*/ -#if (__GNUC__==2) && (__GNUC_MINOR__<=91) -#warning "Please use an up-to-date version of gcc! (>2.91 recommended)" -#endif #define COMPILER "[gcc]" #define PY_LONG_LONG long long @@ -366,12 +358,7 @@ Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */ # define SIZEOF_FPOS_T 8 # define SIZEOF_HKEY 4 # define SIZEOF_SIZE_T 4 - /* MS VS2005 changes time_t to a 64-bit type on all platforms */ -# if defined(_MSC_VER) && _MSC_VER >= 1400 -# define SIZEOF_TIME_T 8 -# else # define SIZEOF_TIME_T 4 -# endif #endif #ifdef _DEBUG @@ -388,18 +375,10 @@ Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */ #define SIZEOF_DOUBLE 8 #define SIZEOF_FLOAT 4 -/* VC 7.1 has them and VC 6.0 does not. VC 6.0 has a version number of 1200. - Microsoft eMbedded Visual C++ 4.0 has a version number of 1201 and doesn't - define these. - If some compiler does not provide them, modify the #if appropriately. */ +/* If some compiler does not provide them, modify the #if appropriately. */ #if defined(_MSC_VER) -#if _MSC_VER > 1300 #define HAVE_UINTPTR_T 1 #define HAVE_INTPTR_T 1 -#else -/* VC6, VS 2002 and eVC4 don't support the C99 LL suffix for 64-bit integer literals */ -#define Py_LL(x) x##I64 -#endif /* _MSC_VER > 1200 */ #endif /* _MSC_VER */ #endif @@ -446,9 +425,7 @@ Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */ #define HAVE_COPYSIGN 1 /* Define to 1 if you have the `round' function. */ -#if _MSC_VER >= 1800 #define HAVE_ROUND 1 -#endif /* Define to 1 if you have the `isinf' macro. */ #define HAVE_DECL_ISINF 1 From c3e388ff539cb24e921de5b5a50db298241bda4b Mon Sep 17 00:00:00 2001 From: maekclena Date: Fri, 3 May 2019 18:49:41 +0200 Subject: [PATCH 3/4] BUG: Fix compilation and tests --- Modules/Core/Common/src/itkLightObject.cxx | 2 +- Modules/Core/Common/test/itkMetaDataDictionaryTest.cxx | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Modules/Core/Common/src/itkLightObject.cxx b/Modules/Core/Common/src/itkLightObject.cxx index 2ba7f573fe4..bb689aa5ebe 100644 --- a/Modules/Core/Common/src/itkLightObject.cxx +++ b/Modules/Core/Common/src/itkLightObject.cxx @@ -20,7 +20,7 @@ #include // Better name demanging for gcc -#ifndef __EMSCRIPTEN__ +#if defined( __GNUC__ ) && !defined( __EMSCRIPTEN__ ) #define GCC_USEDEMANGLE #endif diff --git a/Modules/Core/Common/test/itkMetaDataDictionaryTest.cxx b/Modules/Core/Common/test/itkMetaDataDictionaryTest.cxx index 4f7399e4552..9ae96352961 100644 --- a/Modules/Core/Common/test/itkMetaDataDictionaryTest.cxx +++ b/Modules/Core/Common/test/itkMetaDataDictionaryTest.cxx @@ -163,7 +163,6 @@ int itkMetaDataDictionaryTest(int , char * []) } - //NOTE: Must clean up memory allocated with char * StrandedMemory=new char[2345]; delete[] StrandedMemory; From 18c7b28cb2bdd7a92b4a60ae743d42c3cf11ceb5 Mon Sep 17 00:00:00 2001 From: maekclena Date: Mon, 6 May 2019 15:35:59 +0200 Subject: [PATCH 4/4] COMP: Fix errors and comments --- Modules/Core/Common/include/itkMacro.h | 21 +++++++++---------- .../Core/Common/test/itkNumericTraitsTest.cxx | 2 +- .../test/itkCastImageFilterTest.cxx | 2 +- .../test/itkClampImageFilterTest.cxx | 2 +- 4 files changed, 13 insertions(+), 14 deletions(-) diff --git a/Modules/Core/Common/include/itkMacro.h b/Modules/Core/Common/include/itkMacro.h index 01ef2c1c2aa..ef2c6acafa2 100644 --- a/Modules/Core/Common/include/itkMacro.h +++ b/Modules/Core/Common/include/itkMacro.h @@ -127,22 +127,21 @@ namespace itk /* * ITK only supports MSVC++ 14.0 and greater - * MSVC++ 14.0 _MSVC_VER = 1900 - * MSVC++ 12.0 _MSC_VER = 1800 - * MSVC++ 11.0 _MSC_VER = 1700 - * MSVC++ 10.0 _MSC_VER = 1600 - * MSVC++ 9.0 _MSC_VER = 1500 - * MSVC++ 8.0 _MSC_VER = 1400 - * MSVC++ 7.1 _MSC_VER = 1310 - * MSVC++ 7.0 _MSC_VER = 1300 - * MSVC++ 6.0 _MSC_VER = 1200 - * MSVC++ 5.0 _MSC_VER = 1100 + * MSVC++ 14.0 _MSC_VER == 1900 (Visual Studio 2015 version 14.0) + * MSVC++ 14.1 _MSC_VER == 1910 (Visual Studio 2017 version 15.0) + * MSVC++ 14.11 _MSC_VER == 1911 (Visual Studio 2017 version 15.3) + * MSVC++ 14.12 _MSC_VER == 1912 (Visual Studio 2017 version 15.5) + * MSVC++ 14.13 _MSC_VER == 1913 (Visual Studio 2017 version 15.6) + * MSVC++ 14.14 _MSC_VER == 1914 (Visual Studio 2017 version 15.7) + * MSVC++ 14.15 _MSC_VER == 1915 (Visual Studio 2017 version 15.8) + * MSVC++ 14.16 _MSC_VER == 1916 (Visual Studio 2017 version 15.9) + * MSVC++ 14.2 _MSC_VER == 1920 (Visual Studio 2019 Version 16.0) */ #if defined( _MSC_VER ) && ( _MSC_VER < 1900 ) #error "Visual Studio < 2015 is not supported under ITKv5" #endif #if defined( __SUNPRO_CC ) && ( __SUNPRO_CC < 0x5140 ) - #error "SUNPro C++ < 5.14.0 is not supported under ITKv4 and above" + #error "SUNPro C++ < 5.14.0 is not supported under ITKv5 and above" #endif #if defined( __CYGWIN__ ) #error "The Cygwin compiler is not supported in ITKv4 and above" diff --git a/Modules/Core/Common/test/itkNumericTraitsTest.cxx b/Modules/Core/Common/test/itkNumericTraitsTest.cxx index 66c4a34b8c1..3cd5adad39f 100644 --- a/Modules/Core/Common/test/itkNumericTraitsTest.cxx +++ b/Modules/Core/Common/test/itkNumericTraitsTest.cxx @@ -20,7 +20,7 @@ #include // Better name demanging for gcc -#ifndef __EMSCRIPTEN__ +#if defined( __GNUC__ ) && !defined( __EMSCRIPTEN__ ) #define GCC_USEDEMANGLE #endif diff --git a/Modules/Filtering/ImageFilterBase/test/itkCastImageFilterTest.cxx b/Modules/Filtering/ImageFilterBase/test/itkCastImageFilterTest.cxx index fe74947b32d..a01f8379210 100644 --- a/Modules/Filtering/ImageFilterBase/test/itkCastImageFilterTest.cxx +++ b/Modules/Filtering/ImageFilterBase/test/itkCastImageFilterTest.cxx @@ -28,7 +28,7 @@ // Better name demanging for gcc -#ifndef __EMSCRIPTEN__ +#if defined( __GNUC__ ) && !defined( __EMSCRIPTEN__ ) #define GCC_USEDEMANGLE #endif diff --git a/Modules/Filtering/ImageIntensity/test/itkClampImageFilterTest.cxx b/Modules/Filtering/ImageIntensity/test/itkClampImageFilterTest.cxx index c651f1f44dc..a5ce17aedd7 100644 --- a/Modules/Filtering/ImageIntensity/test/itkClampImageFilterTest.cxx +++ b/Modules/Filtering/ImageIntensity/test/itkClampImageFilterTest.cxx @@ -26,7 +26,7 @@ #include // Better name demanging for gcc -#ifndef __EMSCRIPTEN__ +#if defined( __GNUC__ ) && !defined( __EMSCRIPTEN__ ) #define GCC_USEDEMANGLE #endif