Modify

Ticket #8850 (closed Patches: fixed)

Opened 9 months ago

Last modified 8 months ago

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@…>

Description

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

Change History

comment:1 Changed 9 months ago by eric_niebler

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

comment:2 Changed 9 months ago by eric_niebler

  • Status changed from new to assigned

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

comment:3 Changed 8 months ago by eric_niebler

  • Status changed from assigned to closed
  • Resolution set to fixed

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

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


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

 
Note: See TracTickets for help on using tickets.