You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BUG: TransformIO: Implement explicit template instantiation using "extern".
This commit updates explicit instantiation to use "extern" keyword similarly
to what was done in InsightSoftwareConsortium/ITK@b72726c (BUG: Explicitly
instantiate common MetaDataObjects).
By using the recommended approach for template instantiation, this commit
should also fix TransformReadWriteTest where TransformIO failed to be
successfully instantiated. Here is the error that was reported when the
was compiled on MacOSX using clang-6.0:
libc++abi.dylib: terminating with uncaught exception of type itk::ExceptionObject: /scratch/dashboards/MacOSX-clang6/ITK/Modules/IO/TransformBase/src/itkTransformFileWriterSpecializations.cxx:212:
itk::ERROR: TransformFileWriterTemplate(0x7fa552100f10): The input of writer should be whether a double precision or a single precision transform type. Called from TransformFileWriterTemplate<double,double$
It also updates IOTransformDCMTK remote module to include a similar fix.
Note #1:
To shut up the following warning from gcc, context specific "pragma GCC
diagnostic" preprocessor instructions have been added:
warning: type attributes ignored after type is already defined [-Wattributes]
This is most likely specific to gcc (see issue #39159), and at the time
of this commit there were no resolution or information about gcc version
where the "problem" is addressed.
See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=39159
For that reason, the "pragma GCC diagnostic" is applied in-conditionally
of the gcc version being used.
Note #2:
While "extern" is only part of the c++ standard starting with c++11 (see
section 14.7.2 of the standard), it is supported by Visual Studio 2008,
GCC and Clang using compiler specific extension in earlier version:
* Visual Studio 2008: https://msdn.microsoft.com/en-us/library/by56e477(v=vs.90).aspx
* Gcc: https://gcc.gnu.org/onlinedocs/gcc-4.8.4/gcc/Template-Instantiation.html#Template-Instantiation
* Clang (since v2.9): http://clang.llvm.org/cxx_status.html
For completeness, initial draft of the "extern" keyword were first
introduced in 2003 [1] and then revised in 2006 [2], and ultimately
standardized in c++11 [3]:
[1] N1448: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1448.pdf
[2] N1987: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1987.htm
[3] N3242: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/
See InsightSoftwareConsortium#3393
Suggested-by: Bradley Lowekamp <blowekamp@mail.nih.gov>
Co-authored-by: Bradley Lowekamp <blowekamp@mail.nih.gov>
Change-Id: I2e3ca2843c500b9bb60bbffc5f3629bc5be0a6fd
0 commit comments