WebAssembly / WebAssembly/wabt
`HUGE_VAL` and `HUGE_VALF` are not constant expressions on AIX
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 8.1k
- Forks
- 827
- Avg merge
- 4d 6h
- Merged PRs (30d)
- 18
Description
Even though HUGE_VAL and HUGE_VALF are defined to be described as constant expressions, on AIX they lean on reinterpret casts to a static variable, preventing them from being constant expressions. This is the only issue that prevents wabt from building on AIX.
[ 18%] Building CXX object CMakeFiles/wabt.dir/src/literal.cc.o
In file included from /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/12/include/c++/cmath:45,
from /home/tcr/wabt/src/literal.cc:30:
/home/tcr/wabt/src/literal.cc:66:37: error: 'reinterpret_cast' is not a constant expression
66 | static constexpr float kHugeVal = HUGE_VALF;
| ^~~~~~~~~
/home/tcr/wabt/src/literal.cc:79:37: error: 'reinterpret_cast' is not a constant expression
79 | static constexpr float kHugeVal = HUGE_VAL;
| ^~~~~~~~
make[2]: *** [CMakeFiles/wabt.dir/build.make:373: CMakeFiles/wabt.dir/src/literal.cc.o] Error 1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/literal.cc at the kHugeVal definitions around lines 66 and 79, then inspect how HUGE_VALF and HUGE_VAL are provided by the AIX C++ headers. Reproduce the reported AIX build and adjust the handling so these definitions compile as constant expressions; done means wabt builds past literal.cc on AIX.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 76/100