From 6d246202fe10155abf310d0f26760285e4a5de80 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Wed, 1 May 2024 10:42:17 -0400 Subject: [PATCH] COMP: GCC 13 CastXML vector include workaround Addresses: ``` FAILED: Wrapping/castxml_inputs/itkImageSource.xml /home/matt/bin/ITK-Wrap-Release/Wrapping/castxml_inputs/itkImageSource.xml cd /home/matt/bin/ITK-Wrap-Release/Wrapping/Modules/ITKCommon && /home/matt/bin/ITK-Wrap-Release/Wrapping/Generators/CastXML/castxml/bin/castxml -o /home/matt/bin/ITK-Wrap-Release/Wrapping/castxml_inputs/itkImageSource.xml --castxml-gccxml --castxml-start _wrapping_ --castxml-cc-gnu "(" /usr/bin/c++ -Wall -Wcast-align -Wdisabled-optimization -Wextra -Wformat=2 -Winvalid-pch -Wno-format-nonliteral -Wpointer-arith -Wshadow -Wunused -Wwrite-strings -Wno-strict-overflow -Wno-deprecated -Wno-invalid-offsetof -Woverloaded-virtual -Wctad-maybe-unsupported -Wstrict-null-sentinel -fno-sized-deallocation -msse2 -fno-sized-deallocation -msse2 -std=c++17 ")" -w -c @/home/matt/bin/ITK-Wrap-Release/Wrapping/castxml_inputs/.castxml.inc /home/matt/bin/ITK-Wrap-Release/Wrapping/castxml_inputs/itkImageSource.cxx In file included from /home/matt/bin/ITK-Wrap-Release/Wrapping/castxml_inputs/itkImageSource.cxx:1: In file included from /home/matt/src/ITK/Modules/Core/Common/include/itkCommand.h:21: In file included from /home/matt/src/ITK/Modules/Core/Common/include/itkObject.h:31: In file included from /home/matt/src/ITK/Modules/Core/Common/include/itkLightObject.h:21: In file included from /home/matt/src/ITK/Modules/Core/Common/include/itkMacro.h:51: In file included from /home/matt/src/ITK/Modules/Core/Common/include/itkPrintHelper.h:24: In file included from /usr/include/c++/13/vector:67: /usr/include/c++/13/bits/stl_bvector.h:190:35: error: expected string literal as argument of '__assume__' attribute 190 | __attribute__ ((__assume__ (__ofst < unsigned(_S_word_bit)))); | ^ ``` See also: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112467 --- Modules/Core/Common/include/itkPrintHelper.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Modules/Core/Common/include/itkPrintHelper.h b/Modules/Core/Common/include/itkPrintHelper.h index 51ad12b4c26..00b5209b925 100644 --- a/Modules/Core/Common/include/itkPrintHelper.h +++ b/Modules/Core/Common/include/itkPrintHelper.h @@ -21,8 +21,16 @@ #include #include -#include +// Workaround for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112467 +#if defined(ITK_WRAPPING_PARSER) && defined(__GNUC__) && !defined(__clang__) +# define __clang__ +# define ITK_CASTXML_GCC_VECTOR_WORKAROUND +#endif +#include +#if defined(ITK_CASTXML_GCC_VECTOR_WORKAROUND) +# undef __clang__ +#endif namespace itk {