From fbd2bf08de13d7a8d27b9b074b6d16ea01357206 Mon Sep 17 00:00:00 2001
From: Tor Lillqvist <tml@iki.fi>
Date: Mon, 14 Apr 2014 12:33:14 +0200
Subject: [PATCH 2/2] random: fix GCC 4.7 -Wuninitialized
For some reason, GCC 4.7 targeting X86 in the Android NDK 8e complained about
the fields in the "btrd" struct in the union in binomial_distribution
(boost/random/binomial_distribution.hpp) maybe being uninitialized in a call
to its copy constructor. So make sure these fields are initialized in all
cases.
Signed-off-by: Michael Stahl <mstahl@redhat.com>
---
include/boost/random/binomial_distribution.hpp | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/boost/random/binomial_distribution.hpp b/include/boost/random/binomial_distribution.hpp
index 8612eca..afebe41 100644
a
|
b
|
private:
|
278 | 278 | m = static_cast<IntType>((t_lcl+1)*p_lcl); |
279 | 279 | |
280 | 280 | if(use_inversion()) { |
| 281 | btrd.r = btrd.nr = btrd.npq = btrd.b = btrd.a = btrd.c = btrd.alpha = btrd.v_r = btrd.u_rv_r = 0; |
281 | 282 | q_n = pow((1 - p_lcl), static_cast<RealType>(t_lcl)); |
282 | 283 | } else { |
283 | 284 | btrd.r = p_lcl/(1-p_lcl); |