1 From 39d4d46a0bd504ac708ffe72df87bf74cd12ad30 Mon Sep 17 00:00:00 2001
2 From: William Cohen <wcohen@redhat.com>
3 Date: Fri, 5 Feb 2016 17:30:19 -0500
4 Subject: [PATCH] Fix FTBFS problem with GCC-6
6 GCC-6 is pickier about some of the type conversions causing the Fedora
7 24 mass rebuild the build of oprofile failed with:
9 make[3]: Entering directory '/builddir/build/BUILD/oprofile-1.1.0/libutil++'
10 g++ -DHAVE_CONFIG_H -I. -I.. -I ../libutil -I ../libop -I ../libpp -W -Wall -fno-common -ftemplate-depth-50 -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -c -o op_bfd.o op_bfd.cpp
11 op_bfd.cpp: In member function 'void op_bfd::get_symbol_range(symbol_index_t, long long unsigned int&, long long unsigned int&) const':
12 op_bfd.cpp:538:47: error: cannot convert 'std::ostream {aka std::basic_ostream<char>}' to 'const bool' in initialization
13 bool const verbose = cverb << (vbfd & vlevel1);
15 op_bfd.cpp:546:7: error: in argument to unary !
19 Avoid the intermediate bool type to make GCC-6 happy.
21 Signed-off-by: William Cohen <wcohen@redhat.com>
22 [Backported from upstream]
23 Signed-off-by: Romain Naour <romain.naour@gmail.com>
25 libutil++/op_bfd.cpp | 4 +---
26 1 file changed, 1 insertion(+), 3 deletions(-)
28 diff --git a/libutil++/op_bfd.cpp b/libutil++/op_bfd.cpp
29 index 389c920..f2eb42b 100644
30 --- a/libutil++/op_bfd.cpp
31 +++ b/libutil++/op_bfd.cpp
32 @@ -535,15 +535,13 @@ void op_bfd::get_symbol_range(symbol_index_t sym_idx,
34 op_bfd_symbol const & sym = syms[sym_idx];
36 - bool const verbose = cverb << (vbfd & vlevel1);
41 start = sym.filepos();
42 end = start + sym.size();
45 + if (!(cverb << (vbfd & vlevel1)))
48 io_state state(cverb << (vbfd & vlevel1));