Closed
Bug 1577051
Opened 6 years ago
Closed 6 years ago
FastBernoulliTrial.h has an implicit integer-to-float conversion that changes value, triggering a warning with new-enough clang
Categories
(Core :: MFBT, task)
Core
MFBT
Tracking
()
RESOLVED
FIXED
mozilla70
Tracking | Status | |
---|---|---|
firefox70 | --- | fixed |
People
(Reporter: Waldo, Assigned: Waldo)
Details
Attachments
(1 file)
clang tip has a compiler warning for implicit integer-to-float conversions that change value, and FastBernoulliTrial.h
contains such a conversion (in code to truncate-and-clamp a double
to size_t
)
double skipCount =
std::floor(std::log(mGenerator.nextDouble()) * mInvLogNotProbability);
if (skipCount < SIZE_MAX)
mSkipCount = skipCount;
else
mSkipCount = SIZE_MAX;
in skipCount < SIZE_MAX
when size_t
on the right-hand side is converted to double
.
Either value permissibly produced by that conversion is acceptable, so just do an explicit conversion to silence the warning.
Assignee | ||
Comment 1•6 years ago
|
||
Pushed by jwalden@mit.edu:
https://hg.mozilla.org/integration/autoland/rev/d72f6bb552f3
Fix an implicit-conversion-changes-value warning with new-enough clang by explicitly converting. r=froydnj
Comment 4•6 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
status-firefox70:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla70
You need to log in
before you can comment on or make changes to this bug.
Description
•