Can you elaborate? What fast-math can sneak into a library that disabled fast-math at compile time?
> fast-math enables some dynamic initialization of the library that changes the floating point environment in some ways.
I wasn’t aware of this, I would love to see some documentation discussing exactly what happens, can you send a link?
A lot of library code is in headers (especially in C++!). The code in headers is compiled by your compiler using your compile options.
But yeah, it's probably a good idea to not put code which breaks under -ffast-math in headers if possible.
Turn on fast-math, it flips the FTZ/DAZ bit for the entire application. Even if you turned it on for just a shared library!