Browse code

Patch to silence "may be used uninitialized" warnings in boost lexical_cast

Change-Id: I1fee4527227bbacef0754d28f9a7f5089d8b6030
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/3086
Tested-by: gerrit-photon <photon-checkins@vmware.com>
Reviewed-by: Divya Thaluru <dthaluru@vmware.com>

suezzelur authored on 2017/06/27 04:23:05
Showing 2 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,24 @@
0
+From e6adec141147c6ca3acf289342bff9bb28b0d675 Mon Sep 17 00:00:00 2001
1
+From: "Patrick J. LoPresti" <lopresti@gmail.com>
2
+Date: Fri, 1 Apr 2016 10:16:42 -0700
3
+Subject: [PATCH] Silence "may be used uninitialized" warnings from GCC 4.9.2
4
+ and others.
5
+
6
+Avoid boost::value_initialized<> since it does not work on move-only types.
7
+---
8
+ boost/lexical_cast.hpp | 2 +-
9
+ 1 file changed, 1 insertion(+), 1 deletion(-)
10
+
11
+diff --git a/boost/lexical_cast.hpp b/boost/lexical_cast.hpp
12
+index dc3d7e3..3dc21f8 100644
13
+--- a/boost/lexical_cast.hpp
14
+@@ -36,7 +36,7 @@ namespace boost
15
+     template <typename Target, typename Source>
16
+     inline Target lexical_cast(const Source &arg)
17
+     {
18
+-        Target result;
19
++        Target result = Target();
20
+ 
21
+         if (!boost::conversion::detail::try_lexical_convert(arg, result)) {
22
+             boost::conversion::detail::throw_bad_cast<Source, Target>();
... ...
@@ -1,7 +1,7 @@
1 1
 Summary:	Boost 
2 2
 Name:		boost
3 3
 Version:	1.60.0
4
-Release:	2%{?dist}
4
+Release:	3%{?dist}
5 5
 License:	Boost Software License V1
6 6
 URL:		http://www.boost.org/
7 7
 Group:		System Environment/Security
... ...
@@ -9,6 +9,7 @@ Vendor:		VMware, Inc.
9 9
 Distribution:	Photon
10 10
 Source0:	http://downloads.sourceforge.net/boost/boost_1_60_0.tar.bz2
11 11
 %define sha1 boost=7f56ab507d3258610391b47fef6b11635861175a
12
+Patch0:         boost-1.60.0-uninitialized-warning.patch
12 13
 BuildRequires:	bzip2-devel
13 14
 
14 15
 %description
... ...
@@ -26,6 +27,7 @@ for developing applications that use boost.
26 26
 
27 27
 %prep
28 28
 %setup -qn boost_1_60_0
29
+%patch0 -p1
29 30
 %build
30 31
 ./bootstrap.sh --prefix=%{buildroot}%{_prefix}
31 32
 ./b2 %{?_smp_mflags} stage threading=multi link=shared
... ...
@@ -47,10 +49,12 @@ rm -rf %{buildroot}/*
47 47
 %{_includedir}/*
48 48
 
49 49
 %changelog
50
+*	Mon Jun 26 2017 Anish Swaminathan <anishs@vmware.com> 1.60.0-3
51
+-	Patch to silence may be used uninitialized warning in lexical_cast
50 52
 *	Tue May 24 2016 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.60.0-2
51 53
 -	GA - Bump release of all rpms
52 54
 *	Wed Apr 27 2016 Xiaolin Li <xiaolinl@vmware.com> 1.60.0-1
53
--   Update to version 1.60.0.
55
+-       Update to version 1.60.0.
54 56
 *	Thu Oct 01 2015 Xiaolin Li <xiaolinl@vmware.com> 1.56.0-2
55 57
 _	Move header files to devel package.
56 58
 *	Tue Feb 10 2015 Divya Thaluru <dthaluru@vmware.com> 1.56.0-1