WaE: may be used uninitialized
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. Change-Id: Iebae5e130cd6ca6ef5c476c6b0366d57c0303c88
This commit is contained in:
parent
8b3a03a43f
commit
2cf07709dc
@ -46,6 +46,7 @@ boost_patches += boost.wunused.patch
|
||||
boost_patches += boost.wshadow.patch
|
||||
boost_patches += boost.wconstexpr-not-const.patch.0
|
||||
boost_patches += boost.wdeprecated-register.patch.0
|
||||
boost_patches += boost.wuninitialized.patch
|
||||
|
||||
$(eval $(call gb_UnpackedTarball_UnpackedTarball,boost))
|
||||
|
||||
|
10
boost/boost.wuninitialized.patch
Normal file
10
boost/boost.wuninitialized.patch
Normal file
@ -0,0 +1,10 @@
|
||||
--- foo/foo/foo/boost/random/binomial_distribution.hpp
|
||||
+++ foo/foo/foo/boost/random/binomial_distribution.hpp
|
||||
@@ -278,6 +278,7 @@
|
||||
m = static_cast<IntType>((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<RealType>(t_lcl));
|
||||
} else {
|
||||
btrd.r = p_lcl/(1-p_lcl);
|
Loading…
x
Reference in New Issue
Block a user