Project

General

Profile

Actions

Bug #16559

closed

Incorrect parameter in call of bloom_filter leads to bad implicit conversion

Added by Willem Jan Withagen almost 8 years ago. Updated almost 7 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
% Done:

0%

Source:
Development
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

[ 71%] Building CXX object src/test/common/CMakeFiles/unittest_bloom_filter.dir/test_bloom_filter.cc.o
/usr/srcs/Ceph/work.cmake/ceph/src/test/common/test_bloom_filter.cc:294:28: warning: implicit conversion from 'double' to 'std::size_t' (aka 'unsigned long') changes value
from 0.1 to 0 [-Wliteral-conversion]
bloom_filter bf1(10, .1, .1), bf2;
~~ ^

Actions #1

Updated by Greg Farnum almost 8 years ago

Weird. That's initialized to predicted_inserted_element_count, false_positive_probability, random_seed. Looks like the test is just using a bad init type for the seed.

Actions #2

Updated by Willem Jan Withagen almost 8 years ago

Greg Farnum wrote:

Weird. That's initialized to predicted_inserted_element_count, false_positive_probability, random_seed. Looks like the test is just using a bad init type for the seed.

I would expect so, and the actually value I would pick would be 1.
Like in one of the other calls.
But I have not looked into the code at all.

So that is why I reported it as a bug.
Clang nags about it

Actions #3

Updated by Greg Farnum almost 7 years ago

  • Status changed from New to Resolved

This was just wrong and got fixed.

Actions

Also available in: Atom PDF