The patch submitted by Atri worked fine with cfitsio 4.00 but fails with 4.01. Looks like the cfitsio developers use 2 rather than 3 digits for the version fields. Fix is to use the code submitted by Anonymous on 2021-11-17 or use this modified version of the patch: https://github.com/hpc4cmb/libconviqt/blob/master/levels/cxxsupport/fitshandle.cc#L814-L828. Personally, I prefer comparing integers rather than floats.