Found the following in an old compilation
warning: 'finite' is deprecated: first deprecated in macOS 10.9 - Use isfinite((double)x) instead. [-Wdeprecated-declarations]
Changing finite to isfinite from std solved the problem.
Thanks for your attention.