#2849·wabt

`HUGE_VAL` and `HUGE_VALF` are not constant expressions on AIX

Author: TaylorRichbergerCreated Sep 8, 2026Updated Sep 8, 2026

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