From fbd2bf08de13d7a8d27b9b074b6d16ea01357206 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist 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 --- 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/include/boost/random/binomial_distribution.hpp +++ b/include/boost/random/binomial_distribution.hpp @@ -278,6 +278,7 @@ private: m = static_cast((t_lcl+1)*p_lcl); if(use_inversion()) { + btrd.r = btrd.nr = btrd.npq = btrd.b = btrd.a = btrd.c = btrd.alpha = btrd.v_r = btrd.u_rv_r = 0; q_n = pow((1 - p_lcl), static_cast(t_lcl)); } else { btrd.r = p_lcl/(1-p_lcl); -- 1.8.3.1