Skip to content

bench: fix 32-bit narrowing warning in bench/peer_eviction.cpp - #22464

Merged
maflcko merged 1 commit into
bitcoin:masterfrom
jonatack:fix-32bit-narrowing-warning
Jul 16, 2021
Merged

maflcko merged 1 commit into
bitcoin:masterfrom
jonatack:fix-32bit-narrowing-warning

Conversation

@jonatack

Copy link
Copy Markdown
Member

Closes #22459.

@DrahtBot DrahtBot added the Tests label Jul 15, 2021

@hebasto hebasto left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK e49d50c, tested on Debian 10.10 (i386):

$ CONFIG_SITE=$PWD/depends/i686-pc-linux-gnu/share/config.site ./configure --enable-suppress-external-warnings
$ make -j 9 > /dev/null
ar: `u' modifier ignored since `D' is the default (see `U')
bench/peer_eviction.cpp: In function ‘void EvictionProtectionCommon(ankerl::nanobench::Bench&, int, std::function<void(NodeEvictionCandidate&)>)’:
bench/peer_eviction.cpp:30:51: warning: narrowing conversion of ‘(((uint64_t)(& bench)->ankerl::nanobench::Bench::epochs()) * (& bench)->ankerl::nanobench::Bench::epochIterations())’ from ‘uint64_t’ {aka ‘long long unsigned int’} to ‘std::vector<std::vector<NodeEvictionCandidate> >::size_type’ {aka ‘unsigned int’} inside { } [-Wnarrowing]
     std::vector<Candidates> copies{bench.epochs() * bench.epochIterations(), candidates};
                                    ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
ar: `u' modifier ignored since `D' is the default (see `U')
ar: `u' modifier ignored since `D' is the default (see `U')
  • with this PR
$ CONFIG_SITE=$PWD/depends/i686-pc-linux-gnu/share/config.site ./configure --enable-suppress-external-warnings
$ make -j 9 > /dev/null
ar: `u' modifier ignored since `D' is the default (see `U')
ar: `u' modifier ignored since `D' is the default (see `U')
ar: `u' modifier ignored since `D' is the default (see `U')

@maflcko
maflcko merged commit f8b20fd into bitcoin:master Jul 16, 2021
@jonatack
jonatack deleted the fix-32bit-narrowing-warning branch July 16, 2021 06:54
gwillen pushed a commit to ElementsProject/elements that referenced this pull request Jun 1, 2022
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Aug 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

-Wnarrowing warning on 32-bit system

4 participants