From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by sourceware.org (Postfix) with ESMTP id 84F073857407 for ; Sun, 23 Oct 2022 16:25:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 84F073857407 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gentoo.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gentoo.org Received: by smtp.gentoo.org (Postfix, from userid 559) id 33F40340A3B; Sun, 23 Oct 2022 16:25:23 +0000 (UTC) Date: Sun, 23 Oct 2022 20:55:57 +0545 From: Mike Frysinger To: Tsukasa OI Cc: Andrew Burgess , Nick Clifton , gdb-patches@sourceware.org Subject: Re: [PATCH 32/40] sim/ppc: Add an explicit cast Message-ID: Mail-Followup-To: Tsukasa OI , Andrew Burgess , Nick Clifton , gdb-patches@sourceware.org References: <8d3ab3bfabd02995d344ace8016e5b09c14462eb.1666258361.git.research_trasio@irq.a4lg.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="U7BN4J6VWDqzbQEY" Content-Disposition: inline In-Reply-To: <8d3ab3bfabd02995d344ace8016e5b09c14462eb.1666258361.git.research_trasio@irq.a4lg.com> X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00,GIT_PATCH_0,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --U7BN4J6VWDqzbQEY Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 20 Oct 2022 09:32, Tsukasa OI wrote: > Clang generates a warning if there is an enum value with a mismatching ty= pe > without an explicit cast ("-Wenum-conversion"). > On the default configuration, it causes a build failure > (unless "--disable-werror" is specified). >=20 > This commit adds an explicit cast to hw_phb_decode type. > --- > sim/ppc/hw_phb.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/sim/ppc/hw_phb.c b/sim/ppc/hw_phb.c > index a3c19264235..a99a51d9cf9 100644 > --- a/sim/ppc/hw_phb.c > +++ b/sim/ppc/hw_phb.c > @@ -319,7 +319,7 @@ hw_phb_attach_address(device *me, > /* attach it to the relevent bus */ > DTRACE(phb, ("attach %s - %s %s:0x%lx (0x%lx bytes)\n", > device_path(client), > - hw_phb_decode_name(type), > + hw_phb_decode_name((hw_phb_decode)type), this assumes the enums attach_type & hw_phb_decode are the same. they aren= 't. so this looks like a real bug, and adding a cast covers it up. we should f= ix the bug. -mike --U7BN4J6VWDqzbQEY Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEuQK1JxMl+JKsJRrUQWM7n+g39YEFAmNVWYEACgkQQWM7n+g3 9YHSgRAAqh5ellDBRkJ07bxD5jgPDM7Ptza6n6O/6L1YgvRC1eQ+PayZtdvXC8HY XOcnTfw5DX5x81Yq1lrjDAKhOiYGk155iUoKTkrMYJU8Y0wyvJg3JzaVVfTVv4Nr QeYv7G4beOr3KsyG/EsCphN5QfgMGeRVkK5kgbBbUIHgXQomcUS1JPUvMPi6moGA M7O/zhGmIy/WmXTnyzMklP/VvgetaNeU+U91r+oFiq5SXGpfhqIuKlX22/TSpUmV GwDA2XqcA3T8/b6/wrUxuN9lh3gvD8GttgzyLJYF7/Vz3/LaRPMfA+UlyEQqpaEP 0wLkVF3Ae2/7daAQyChoO5V3GHo2sdc+RbUDzTEOT2fO9m86CD6MbSpRtdSdKRif bvP3VIU3ggbFJY4FB32wNGk0tid/sRVwWh+pT+hfOvPQjiZlonVrowM6uPNa3prU nhqnjOdcaeja3f5xNFMGI+gjYc4rZDZsxA8KOlxPItwkrHqHr51yI6PfrQeLAcxX geY0cuOs8jUDFgw7QYEfzxvCmuK61IaDku762ROByE+kljoCeExWVcMd1Gh65+/M dhxDJXTdwuKDa9ZNIxXXBzxOb1LehJOq716p9tZrHtvzv7uf4/g9bCWN7yb4eDXj GLAL95xOM/yC4yfIm9oPdMCtVSaHN1DozoHL7cL/N7rDKpVJwKw= =TU76 -----END PGP SIGNATURE----- --U7BN4J6VWDqzbQEY--