]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
elfcmp: fix self-comparison error with GCC 6
authorDavid Abdurachmanov <davidlt@cern.ch>
Mon, 11 Apr 2016 14:00:57 +0000 (16:00 +0200)
committerMark Wielaard <mark@tarox.wildebeest.org>
Mon, 11 Apr 2016 15:07:22 +0000 (17:07 +0200)
Noticed with Fedora 24 Alpha, gcc (GCC) 6.0.0 20160406
(Red Hat 6.0.0-0.20).

elfcmp.c: In function ‘main’:
elfcmp.c:364:199: error: self-comparison always evaluates
to false [-Werror=tautological-compare]
        if (unlikely (name1 == NULL || name2 == NULL

Signed-off-by: David Abdurachmanov <davidlt@cern.ch>
src/ChangeLog
src/elfcmp.c

index f74b5dcb4444a31adfaea47bd904bc2a70890de3..bdc9d1337bb9f992d9ef02291c8188a26cdfee33 100644 (file)
@@ -1,3 +1,7 @@
+2016-04-11  David Abdurachmanov  <davidlt@cern.ch>
+
+       * elfcmp.c (main): Fix self-comparison error with GCC 6.
+
 2016-03-21  Mark Wielaard  <mjw@redhat.com>
 
        * nm.c (show_symbols): Check for malloc size argument overflow.
index 852b92f55ceca63d29a37a360158b0d7b725be1f..7b5d39ce951db457a4f5e114cf33d6079b5f6a5b 100644 (file)
@@ -368,7 +368,7 @@ main (int argc, char *argv[])
                                && sym1->st_shndx != SHN_UNDEF)
                            || sym1->st_info != sym2->st_info
                            || sym1->st_other != sym2->st_other
-                           || sym1->st_shndx != sym1->st_shndx))
+                           || sym1->st_shndx != sym2->st_shndx))
                {
                  // XXX Do we want to allow reordered symbol tables?
                symtab_mismatch: