Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
2 tasks done
jphickey opened this issue Aug 16, 2023 · 0 comments · Fixed by #96
Closed
2 tasks done

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

jphickey opened this issue Aug 16, 2023 · 0 comments · Fixed by #96

Comments

@jphickey
Copy link
Contributor

Checklist (Please check before submitting)

  • I reviewed the Contributing Guide.
  • I performed a cursory search to see if the bug report is relevant, not redundant, nor in conflict with other tickets.

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.

@jphickey jphickey self-assigned this Aug 16, 2023
jphickey added a commit to jphickey/LC that referenced this issue Aug 16, 2023
In case the system-provided math.h header does not provide an
implementation if isnan or isfinite, use a local workaround.
dzbaker added a commit that referenced this issue Aug 17, 2023
Fix #95, add local isnan, isfinite macros
@dmknutsen dmknutsen added this to the Equuleus milestone Aug 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants