openlibm
openlibm copied to clipboard
Fix fenv_t initializer
I have no idea why previous versions compile on GitHub actions, but they don't on my loongarch64 machine, and there was also someone reported on aarch64 architecture #278 . Initializer of a struct should be a brace-enclosed list. Btw, my gcc version is 14.2.1, it seems that cross-compile gcc version in GitHub actions is old.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 39.03%. Comparing base (
c1e8462) to head (6404565). Report is 9 commits behind head on master.
Additional details and impacted files
@@ Coverage Diff @@
## master #308 +/- ##
=======================================
Coverage 39.02% 39.03%
=======================================
Files 233 233
Lines 6144 6151 +7
Branches 1608 1608
=======================================
+ Hits 2398 2401 +3
- Misses 3393 3397 +4
Partials 353 353
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
It seems that the definition of fenv_t in this repo is not a struct except on x86 (both 32 and 64bit). However, the system one does seem to be a struct. Which one is intended to be used?
(The include guard is such that if one version of fenv is included, the other one won't, at least on Linux)
Thanks for you comment. I didn't notice there are some openlibm_fenv_ARCH.h in the repo before. It is strange that fenv.c of some architectures like arm, amd64 and aarch64 includes openlibm_fenv.h, which uses project's fenv.h, but others like loongarch64 and riscv64 directly includes system's fenv.h
Maybe I should update my PR, to change these two architectures to use openlibm_fenv.h or just revert my changes to other architectures? or should I fix this inconsistence issue?
Maybe this version is ok