EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: isfinite() on Linux
From: Ralph Lange <[email protected]>
To: EPICS Core-Talk <[email protected]>
Date: Tue, 22 Jul 2014 16:55:12 +0200
Hi Andrew,

On 22/07/2014 16:35, Andrew Johnson wrote:
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.

Note also that - at least according to [1] - the definitions of isfinite() and finite() differ: According to that page, finite(NaN) is TRUE, while isfinite(NaN) is FALSE. Which doesn't make sense and doesn't match the Linux man page, but...

~Ralph

[1] http://www.gnu.org/software/libc/manual/html_node/Floating-Point-Classes.html




References:
isfinite() on Linux Ralph Lange
Re: isfinite() on Linux Andrew Johnson

Navigate by Date:
Prev: Re: isfinite() on Linux Andrew Johnson
Next: Build failed in Jenkins: epics-base-3.15-win64 #39 APS Jenkins
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: isfinite() on Linux Andrew Johnson
Next: Build failed in Jenkins: epics-base-3.15-win64 #39 APS Jenkins
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 23 Jul 2014 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·