You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While building CL11 1.8.0 on an x86_64 machine with gcc 9.1.1 (Fedora Rawhide), this test in HelpersTest fails:
[----------] 4 tests from CheckedMultiply
[ RUN ] CheckedMultiply.Int
/builddir/build/BUILD/CLI11-1.8.0/tests/HelpersTest.cpp:398: Failure
Value of: CLI::detail::checked_multiply(a, b)
Actual: true
Expected: false
[ FAILED ] CheckedMultiply.Int (0 ms)
The issue is that checked_multiply relies on integer overflow wrapping around, but that is undefined behavior according to the standard. When compiling with gcc, -fwrapv must be passed to the compiler so that it doesn't optimize away such code. I have verified that the test passes after adding that option to the build flags.
The text was updated successfully, but these errors were encountered:
While building CL11 1.8.0 on an x86_64 machine with gcc 9.1.1 (Fedora Rawhide), this test in HelpersTest fails:
[----------] 4 tests from CheckedMultiply
[ RUN ] CheckedMultiply.Int
/builddir/build/BUILD/CLI11-1.8.0/tests/HelpersTest.cpp:398: Failure
Value of: CLI::detail::checked_multiply(a, b)
Actual: true
Expected: false
[ FAILED ] CheckedMultiply.Int (0 ms)
The issue is that checked_multiply relies on integer overflow wrapping around, but that is undefined behavior according to the standard. When compiling with gcc, -fwrapv must be passed to the compiler so that it doesn't optimize away such code. I have verified that the test passes after adding that option to the build flags.
The text was updated successfully, but these errors were encountered: