Blame SOURCES/elfutils-0.166-elfcmp-comp-gcc6.patch

18809c
From 836a16fe5b5bab4a3afe2c991c104652775ce3a3 Mon Sep 17 00:00:00 2001
18809c
From: David Abdurachmanov <davidlt@cern.ch>
18809c
Date: Mon, 11 Apr 2016 16:00:57 +0200
18809c
Subject: [PATCH] elfcmp: fix self-comparison error with GCC 6
18809c
MIME-Version: 1.0
18809c
Content-Type: text/plain; charset=UTF-8
18809c
Content-Transfer-Encoding: 8bit
18809c
18809c
Noticed with Fedora 24 Alpha, gcc (GCC) 6.0.0 20160406
18809c
(Red Hat 6.0.0-0.20).
18809c
18809c
elfcmp.c: In function ‘main’:
18809c
elfcmp.c:364:199: error: self-comparison always evaluates
18809c
to false [-Werror=tautological-compare]
18809c
        if (unlikely (name1 == NULL || name2 == NULL
18809c
18809c
Signed-off-by: David Abdurachmanov <davidlt@cern.ch>
18809c
---
18809c
 src/ChangeLog | 4 ++++
18809c
 src/elfcmp.c  | 2 +-
18809c
 2 files changed, 5 insertions(+), 1 deletion(-)
18809c
18809c
diff --git a/src/ChangeLog b/src/ChangeLog
18809c
index f74b5dc..bdc9d13 100644
18809c
--- a/src/ChangeLog
18809c
+++ b/src/ChangeLog
18809c
@@ -1,3 +1,7 @@
18809c
+2016-04-11  David Abdurachmanov  <davidlt@cern.ch>
18809c
+
18809c
+	* elfcmp.c (main): Fix self-comparison error with GCC 6.
18809c
+
18809c
 2016-03-21  Mark Wielaard  <mjw@redhat.com>
18809c
 
18809c
 	* nm.c (show_symbols): Check for malloc size argument overflow.
18809c
diff --git a/src/elfcmp.c b/src/elfcmp.c
18809c
index 852b92f..7b5d39c 100644
18809c
--- a/src/elfcmp.c
18809c
+++ b/src/elfcmp.c
18809c
@@ -368,7 +368,7 @@ main (int argc, char *argv[])
18809c
 				&& sym1->st_shndx != SHN_UNDEF)
18809c
 			    || sym1->st_info != sym2->st_info
18809c
 			    || sym1->st_other != sym2->st_other
18809c
-			    || sym1->st_shndx != sym1->st_shndx))
18809c
+			    || sym1->st_shndx != sym2->st_shndx))
18809c
 		{
18809c
 		  // XXX Do we want to allow reordered symbol tables?
18809c
 		symtab_mismatch:
18809c
-- 
18809c
1.8.3.1
18809c