Skip to content

[BUG] BENCHMARK_ENABLE_WERROR: implicit conversion loses integer precision #1982

@SunBlack

Description

@SunBlack

Describe the bug

Tried to push the latest release to vcpkg (see microsoft/vcpkg#45467), but the android builds are failing

System
Which OS, compiler, and compiler version are you using:

  • OS: Android
  • Compiler and version: arm64/x64 (Clang 18.0.3 on x64 as far as I can see)

To reproduce
See vcpkg portfile

Expected behavior
Compiles, but it failes due to:

/mnt/vcpkg-ci/b/benchmark/src/v1.9.3-f02919e468.clean/src/benchmark.cc:836:52: error: implicit conversion loses integer precision: 'unsigned long' to 'unsigned int' [-Werror,-Wshorten-64-to-32]
  835 |   const auto prev_personality = personality(
      |                                 ~~~~~~~~~~~
  836 |       static_cast<unsigned long>(curr_personality) | ADDR_NO_RANDOMIZE);
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~

The line was added last week within #1978. As BENCHMARK_ENABLE_WERROR is enabled by default, this should be fixed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions