* [PATCH] elfcmp: fix self-comparison error with GCC 6
@ 2016-04-11 14:00 david.abdurachmanov
0 siblings, 0 replies; 4+ messages in thread
From: david.abdurachmanov @ 2016-04-11 14:00 UTC (permalink / raw)
To: elfutils-devel
[-- Attachment #1: Type: text/plain, Size: 1328 bytes --]
From: David Abdurachmanov <davidlt@cern.ch>
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 | 4 ++++
src/elfcmp.c | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/ChangeLog b/src/ChangeLog
index f74b5dc..bdc9d13 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -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.
diff --git a/src/elfcmp.c b/src/elfcmp.c
index 852b92f..7b5d39c 100644
--- a/src/elfcmp.c
+++ b/src/elfcmp.c
@@ -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:
--
2.7.3
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] elfcmp: fix self-comparison error with GCC 6
@ 2016-04-11 17:25 David Abdurachmanov
0 siblings, 0 replies; 4+ messages in thread
From: David Abdurachmanov @ 2016-04-11 17:25 UTC (permalink / raw)
To: elfutils-devel
[-- Attachment #1: Type: text/plain, Size: 480 bytes --]
> On 11 Apr 2016, at 17:13, Mark Wielaard <mjw@redhat.com> wrote:
>
> Nice that GCC caught that. I am slightly surprised my own GCC6 testing
> didn't find this. I am using upstream gcc (GCC) 6.0.0 20160410
> (experimental). Did you have to do anything special on your Fedora setup
> to make GCC detect this?
Nothing, usual morning procedure: dnf upgrade && reboot
There was an update to GCC maybe 1 or 2 days ago. Maybe some improvements
with that came in.
david
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] elfcmp: fix self-comparison error with GCC 6
@ 2016-04-11 15:13 Mark Wielaard
0 siblings, 0 replies; 4+ messages in thread
From: Mark Wielaard @ 2016-04-11 15:13 UTC (permalink / raw)
To: elfutils-devel
[-- Attachment #1: Type: text/plain, Size: 1098 bytes --]
On Mon, 2016-04-11 at 16:00 +0200, david.abdurachmanov(a)cern.ch wrote:
> From: David Abdurachmanov <davidlt@cern.ch>
>
> 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
> @@ -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:
Thanks! And oops. Applied since that was obviously wrong.
Nice that GCC caught that. I am slightly surprised my own GCC6 testing
didn't find this. I am using upstream gcc (GCC) 6.0.0 20160410
(experimental). Did you have to do anything special on your Fedora setup
to make GCC detect this?
Thanks,
Mark
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] elfcmp: fix self-comparison error with GCC 6
@ 2016-04-11 13:50 david.abdurachmanov
0 siblings, 0 replies; 4+ messages in thread
From: david.abdurachmanov @ 2016-04-11 13:50 UTC (permalink / raw)
To: elfutils-devel
[-- Attachment #1: Type: text/plain, Size: 1328 bytes --]
From: David Abdurachmanov <davidlt@cern.ch>
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 | 4 ++++
src/elfcmp.c | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/ChangeLog b/src/ChangeLog
index f74b5dc..bdc9d13 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -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.
diff --git a/src/elfcmp.c b/src/elfcmp.c
index 852b92f..7b5d39c 100644
--- a/src/elfcmp.c
+++ b/src/elfcmp.c
@@ -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:
--
2.7.3
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-04-11 17:25 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-11 14:00 [PATCH] elfcmp: fix self-comparison error with GCC 6 david.abdurachmanov
-- strict thread matches above, loose matches on Subject: below --
2016-04-11 17:25 David Abdurachmanov
2016-04-11 15:13 Mark Wielaard
2016-04-11 13:50 david.abdurachmanov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).