On 07/22/2014 04:45 AM, Ralph Lange wrote:
Working on a patch for Base I am having trouble trying to use isfinite()
on Linux (gcc 4.9.0) - isinf() and isnan() work fine, but isfinite()
gets me an "implicit declaration" warning and a missing symbol when
linking.
Any ideas? All these macros should be POSIX and defined in math.h, right?
Looking at all the libCom/osi/os/*/epicsMath.h files, we ensure the
macro finite() should be defined on all architectures. On Darwin and iOS
that expands out to isfinite() but on other posix architectures
isfinite() is only used if the math.h defines it as a macro.
The glibc manpage says it only defines isfinite() when
_XOPEN_SOURCE >= 600 || _ISOC99_SOURCE; or cc -std=c99
which I think is not true for EPICS builds. We do define _BSD_SOURCE
however, which is sufficient to ensure that finite() gets declared.
I note that the manpage for finite() says "these functions are obsolete"
but we do use it quite a lot in Base.