public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] sim: pcc: fix some Wenum-compare warnings
@ 2021-05-19 10:47 Tom de Vries
  2021-05-19 17:06 ` Mike Frysinger
  0 siblings, 1 reply; 2+ messages in thread
From: Tom de Vries @ 2021-05-19 10:47 UTC (permalink / raw)
  To: gdb-patches, andrew.burgess, vapier

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 */

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] sim: pcc: fix some Wenum-compare warnings
  2021-05-19 10:47 [PATCH] sim: pcc: fix some Wenum-compare warnings Tom de Vries
@ 2021-05-19 17:06 ` Mike Frysinger
  0 siblings, 0 replies; 2+ messages in thread
From: Mike Frysinger @ 2021-05-19 17:06 UTC (permalink / raw)
  To: Tom de Vries; +Cc: gdb-patches, andrew.burgess

seems fine all things considered
-mike

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-05-19 17:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-19 10:47 [PATCH] sim: pcc: fix some Wenum-compare warnings Tom de Vries
2021-05-19 17:06 ` Mike Frysinger

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).