Experimental Physics and Industrial Control System
libCom/osi/os/RTEMS/epicsMath.h
declares 'isnan' and 'isinf' as external functions but C99 demands
that they are macros and newlib-1.15 defines them as such.
Including RTEMS' epicsMath.h from a C++ or C99 source file
causes a compilation error.
The attached kludge fixes this.
In fact, using 'isnan/isinf' from code that claims to be ANSI compliant
(EPICS base is usually compiled (gcc) with -ansi) is wrong. ANSI-C code
should not assume these functions to be present.
-- Till
*** src/libCom/osi/os/RTEMS/epicsMath.h.orig 2007-09-18 12:38:39.000000000 -0700
--- src/libCom/osi/os/RTEMS/epicsMath.h 2007-09-18 12:46:28.000000000 -0700
***************
*** 16,24 ****
extern "C" {
#endif
int isnan(double);
- int finite(double);
int isinf(double);
#ifdef __cplusplus
}
--- 16,29 ----
extern "C" {
#endif
+ /* T.S.; C99 demands that these are macros and newlib-1.15 defines
+ * them as such!
+ */
+ #if defined(STRICT_ANSI) && !defined(__cplusplus)
int isnan(double);
int isinf(double);
+ #endif
+ int finite(double);
#ifdef __cplusplus
}
- Replies:
- Re: ANSI source including epicsMath.h won't compile with newlib 1.15 (RTEMS) Eric Norum
- Navigate by Date:
- Prev:
RE: Deadlock on epicsEvent Jeff Hill
- Next:
Re: ANSI source including epicsMath.h won't compile with newlib 1.15 (RTEMS) Eric Norum
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
<2007>
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
- Navigate by Thread:
- Prev:
RE: Beginer problem Paul Joireman
- Next:
Re: ANSI source including epicsMath.h won't compile with newlib 1.15 (RTEMS) Eric Norum
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
<2007>
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025