From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id WBhQEqvspGCENgAAWB0awg (envelope-from ) for ; Wed, 19 May 2021 06:47:07 -0400 Received: by simark.ca (Postfix, from userid 112) id 4938F1F11C; Wed, 19 May 2021 06:47:07 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=MAILING_LIST_MULTI, RDNS_DYNAMIC autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 466CC1E01F for ; Wed, 19 May 2021 06:47:06 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0F5A0386FC1D; Wed, 19 May 2021 10:47:06 +0000 (GMT) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by sourceware.org (Postfix) with ESMTPS id AA900386FC37 for ; Wed, 19 May 2021 10:47:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org AA900386FC37 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tdevries@suse.de X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id B1B76AE8D; Wed, 19 May 2021 10:47:02 +0000 (UTC) Date: Wed, 19 May 2021 12:47:01 +0200 From: Tom de Vries To: gdb-patches@sourceware.org, andrew.burgess@embecosm.com, vapier@gentoo.org Subject: [PATCH] sim: pcc: fix some Wenum-compare warnings Message-ID: <20210519104700.GA12577@delia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" 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 ' [-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 */