From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id e1rbCwhrVWOFxg8AWB0awg (envelope-from ) for ; Sun, 23 Oct 2022 12:25:44 -0400 Received: by simark.ca (Postfix, from userid 112) id 1FD0A1E112; Sun, 23 Oct 2022 12:25:44 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=PLkI06Ts; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 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 BE0A01E0D5 for ; Sun, 23 Oct 2022 12:25:43 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1C8123857348 for ; Sun, 23 Oct 2022 16:25:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1C8123857348 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666542343; bh=BnvdUnWn3nr3ko4GS6C55CcSgk1da37DxerhZbllM+E=; h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=PLkI06Tsg07qNC0RDqjoe3xXjyYxGR5IoK0Y7p0LFUDsc8QK+ffiBr2fQKaiZDdvW q0PKdn9rbYPX3zMGcke1/WPx84XsiwPKwkq1spLkZHmU4znpxzsdhBJN0fgvCxqOyg SsRZqYsqe8sqUG/bEoiYwr9luoeUQydKcUUEVsec= 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 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 To: Tsukasa OI 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-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: , From: Mike Frysinger via Gdb-patches Reply-To: Mike Frysinger Cc: Nick Clifton , gdb-patches@sourceware.org Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" --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--