I’ve just tried building ITK master with C++17 enabled with Apple’s latest compiler Apple LLVM version 10.0.0 (clang-1000.11.45.2) and I get the following error:
In file included from ../Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib.h:5:
../Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c.h:29:14: error: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
void sig_die(register char *s, int kill);
I’ll try compiling ITK with a lower C++ standard, but that has produced warnings for me before. I am aware that ITK has only just made it onto C++11, but when I tried if constexpr it simplified a class of mine so much I decided it was worth sticking with.
As register keyword was an optimization hint since it was introduced, just removing it from the code is probably the best solution? Of course, submit the patch to VNL and then update ITK’s copy of it.
@matt.mccormick There wasn’t anything special about this compilation - I configured with -DCMAKE_CXX_STANDARD=17 and then compiled. Apple updated Clang last week with better C++17 compliance.
As I can make this work by dropping back to C++14/11 to compile ITK, I don’t really want to go through the process of submitting a patch to VNL. If I spent anytime in that direction, I’d prefer it to be on getting Eigen into ITK.
I think we agreed we wanted Eigen to replace VNL. But I am afraid we estimated that to be quite an effort. And minor cleanup of VNL to be C++17 compatible is a sneeze compared to a switch to Eigen.