Skip to content

FpToStringTest fails when building with LTO #1366

@mariemrmr

Description

@mariemrmr

After the following steps:

git clone https://github.com/jbeder/yaml-cpp.git
cd yaml-cpp
mkdir build
cd build
cmake .. -DCMAKE_CXX_FLAGS="-flto" -DYAML_CPP_BUILD_TESTS=ON -DCMAKE_EXE_LINKER_FLAGS="-flto"
make
cd test
./yaml-cpp-tests

Tests FpToStringTest.conversion_double and FpToStringTest.conversion_float fail.
Part of the output:

Expected equality of these values:
  convert_with_stringstream(12345.67f, 7)
    Which is: "12,345.67"
  FpToString(12345.67f, 7)
    Which is: "12345.67"

The system locale on my host is en_US.UTF-8. Running with LC_ALL=C makes all tests pass. Compiling without LTO makes all tests pass too. Static build with LTO passes too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions