Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org, andrew.burgess@embecosm.com,
	vapier@gentoo.org
Subject: [PATCH] sim: pcc: fix some Wenum-compare warnings
Date: Wed, 19 May 2021 12:47:01 +0200	[thread overview]
Message-ID: <20210519104700.GA12577@delia> (raw)

Hi,

When compiling with --enable-werror and CFLAGS="-O0 -g -Wall", we run into:
...
src/sim/ppc/hw_phb.c: In function 'hw_phb_attach_address':
src/sim/ppc/hw_phb.c:315:12: error: comparison between \
  'attach_type {aka enum _attach_type}' and \
  'enum <anonymous>' [-Werror=enum-compare]
   if (type != hw_phb_normal_decode
            ^~
...

Fix this by casting type to hw_phb_decode.

Any comments?

Thanks,
- Tom

sim: pcc: fix some Wenum-compare warnings

---
 sim/ppc/hw_phb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sim/ppc/hw_phb.c b/sim/ppc/hw_phb.c
index 70d59d30844..a3c19264235 100644
--- a/sim/ppc/hw_phb.c
+++ b/sim/ppc/hw_phb.c
@@ -312,8 +312,8 @@ hw_phb_attach_address(device *me,
       || addr < pci_space->my_base)
     device_error(me, "attach addr (0x%lx) specified by %s outside of bus address range",
 		 (unsigned long)addr, device_path(client));
-  if (type != hw_phb_normal_decode
-      && type != hw_phb_subtractive_decode)
+  if ((hw_phb_decode)type != hw_phb_normal_decode
+      && (hw_phb_decode)type != hw_phb_subtractive_decode)
     device_error(me, "attach type (%d) specified by %s invalid",
 		 type, device_path(client));
   /* attach it to the relevent bus */

             reply	other threads:[~2021-05-19 10:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-19 10:47 Tom de Vries [this message]
2021-05-19 17:06 ` Mike Frysinger via Gdb-patches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210519104700.GA12577@delia \
    --to=tdevries@suse.de \
    --cc=andrew.burgess@embecosm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=vapier@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox