nasa / LC

The Core Flight System (cFS) Limit Checker (LC) application.
Apache License 2.0
30 stars 21 forks source link

Obsolete C libraries may not provide isnan/isfinite macros #95

Closed jphickey closed 1 year ago

jphickey commented 1 year ago

Checklist (Please check before submitting)

Describe the bug Although the isnan and isfinite macros have been specified by ISO C for over 2 decades, there are still some (obsolete) C libraries in use that do not provide these.

To Reproduce Compile LC on VxWorks 6.9, error is reported:

apps/lc/fsw/src/lc_watch.c: In function 'LC_FloatCompare':
apps/lc/fsw/src/lc_watch.c:680: error: implicit declaration of function 'isnan'
apps/lc/fsw/src/lc_watch.c: In function 'LC_ValidateWDT':
apps/lc/fsw/src/lc_watch.c:1016: error: implicit declaration of function 'isfinite'

Expected behavior Should build successfully

System observed on: VxWorks 6.9, GNU C compiler version 4.3

Additional context This appears to be a bug in the math.h header. It has these macros defined, but they are conditional on GNUC version <= 2. As this is using GNU C version 4.3, it does not provide them. But nothing else does, either.

Reporter Info Joseph Hickey, Vantage Systems, Inc.