Opened 4 years ago

Closed 4 years ago

#8850 closed Patches (fixed)

Patch for spurious warning at boost/accumulators/statistics/p_square_quantile.hpp(72)

Reported by: Gareth Sylvester-Bradley <gareth.sylvester-bradley@…> Owned by: Eric Niebler
Milestone: To Be Determined Component: accumulator
Version: Boost 1.54.0 Severity: Problem
Keywords: Cc: Gareth, Sylvester-Bradley, <gareth.sylvester-bradley@…>


When building with Visual Studio 2012 (msvc-11.0), 64-bit, I got a 27 kB warning message at the head of which was:

boost/accumulators/statistics/p_square_quantile.hpp(72): warning C4244: '=' : conversion from 'size_t' to 'double', possible loss of data

The offending line 72 and a possible one-character patch would seem to be:

-                this->actual_positions[i] = i + 1;
+                this->actual_positions[i] = i + 1.;

A code snippet that demonstrates the warning:

#include <boost/accumulators/accumulators.hpp>
#include <boost/accumulators/statistics/stats.hpp>
#include <boost/accumulators/statistics/median.hpp>

boost::accumulators::accumulator_set< double, boost::accumulators::stats< boost::accumulators::tag::median > > median_accumulator;

Attachments (0)

Change History (3)

comment:1 Changed 4 years ago by Eric Niebler

(In [85122]) fix msvc warning, refs #8850

comment:2 Changed 4 years ago by Eric Niebler

Status: newassigned

Fixed on trunk, will close when merged to release. Thanks.

comment:3 Changed 4 years ago by Eric Niebler

Resolution: fixed
Status: assignedclosed

(In [85424]) merge [85122],[85123],[85124] from trunk to release; fixes #7915, fixes #8850, fixes #8262

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Eric Niebler.
The resolution will be deleted.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.