While making a project compile across both GCC and Clang, I've noticed that functions like fabs
were causing compilation issues on GCC, since I had never included <cmath>
myself. I was developing on Clang, so I never noticed this, since the llvm <cstdlib>
header file I was using includes <cmath>
itself, seemingly without doing anything with it, while the GCC version does not.
Is there any reason for this? and is there anything I can do to make sure my code will compile across multiple standard libraries besides just trying it?