From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id WHQFFWhpVWMAxg8AWB0awg (envelope-from ) for ; Sun, 23 Oct 2022 12:18:48 -0400 Received: by simark.ca (Postfix, from userid 112) id 52A291E112; Sun, 23 Oct 2022 12:18:48 -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=FJ4V0ri7; 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 F3EC41E0D5 for ; Sun, 23 Oct 2022 12:18:47 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 680FB3850235 for ; Sun, 23 Oct 2022 16:18:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 680FB3850235 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666541927; bh=9CKoiJfszN2fBToKthDcLTmb1obKPW4syHcU1i+grw4=; 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=FJ4V0ri71NhK+fcEceMAY+yyofdQGMA3/Oj+fdVDPiMnkn98kIyHSr4/7x+pe0jIE hfgi3sbkT7/nglRKfHSZJW5D9+4KiYwc333RHv5dtaJKs3hDyNNS0rULv67ROlEc2A gM01TnXxzui2g0+qmHGbesmKK4UpxANI29zRNBh8= Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) by sourceware.org (Postfix) with ESMTP id 39E9D3851C21 for ; Sun, 23 Oct 2022 16:18:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 39E9D3851C21 Received: by smtp.gentoo.org (Postfix, from userid 559) id DCC4934117B; Sun, 23 Oct 2022 16:18:22 +0000 (UTC) Date: Sun, 23 Oct 2022 20:48:57 +0545 To: Tsukasa OI Subject: Re: [PATCH 25/40] sim/mn10300: Add an explicit cast Message-ID: Mail-Followup-To: Tsukasa OI , Andrew Burgess , Nick Clifton , gdb-patches@sourceware.org References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="9mh2gBpnP70EYzd3" Content-Disposition: inline In-Reply-To: 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" --9mh2gBpnP70EYzd3 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. > --- > sim/mn10300/op_utils.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) >=20 > --- a/sim/mn10300/op_utils.c > +++ b/sim/mn10300/op_utils.c > @@ -152,8 +152,9 @@ do_syscall (SIM_DESC sd) > if (cb_target_to_host_syscall (STATE_CALLBACK (sd), func) =3D=3D CB_SY= S_exit) > { > /* EXIT - caller can look in parm1 to work out the reason */ > - sim_engine_halt (simulator, STATE_CPU (simulator, 0), NULL, PC, > - (parm1 =3D=3D 0xdead ? SIM_SIGABRT : sim_exited), parm1); > + sim_engine_halt ( > + simulator, STATE_CPU (simulator, 0), NULL, PC, > + (parm1 =3D=3D 0xdead ? (enum sim_stop) SIM_SIGABRT : sim_exited), par= m1); i'm fairly certain the existing code is wrong, and adding the cast masks th= at error. so we don't want to do this. signals should be passed as the sigrc argument. -mike --9mh2gBpnP70EYzd3 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEuQK1JxMl+JKsJRrUQWM7n+g39YEFAmNVV9wACgkQQWM7n+g3 9YH6ug//SMZtgG8elDOZ+b5Ga+jb/otRRqwh2656Q1vCV12LE4tkCsQmXTspQJV+ oe7aJQ/0MFQt6T1DYWsQqjTeCTB09AC1oCqY4bYzgI7GDQ8QnaW2BJNQys/VVEcr jKDTlnt2PNoH15+7W/bM4NNfSnWAfIq0lWVrHUUUCxZ+8cUAbc8Qg+SJzvko7Bjl ekwuROB+Wwsz4QpWjcMMM/JKvDeE+LjCDU32E8D3UjD+RGpsx3eOs4CwjQ0YpPxp ZU/oZNRzM5yhfL7znagKYbi0yG88aEW48AzKS2lRaQelo6HmBwKMzkxTsQfkGJ3S ud+odefnhnFw10djxrTo4bz4gH+DsV1SR5yuy59o+DH8sdiLn0XlVXbAnnzbkv6U qWKZgZ9gpPdAUFCTjPiIIEp/S3gYnz0d3vwabXgTq3FtvhCDCBm54UV2Td5IW8fA xf8J1RRhrB4gbdPKz50lRNXoKJSzUH/3TM4O8oQWOiCqOA0WM5efe8JHN22j/TGQ lsUgGAN9LBPZ7+b2dSfT62x8AzDAHs2zyuoKdyRqgbHejI+I2NB3+2pHhcrVc+Kt pnlVr7oNxZdtSBq9UtOcBAIC+YW28FIeh6ng7/PfvRSbFyPXQsr0/6g6sE2J6tWG qFiDnDhPUld6M98gsfsuwU8gQl/heCYQa0oit/nKsNwicUGUBoY= =dQ2K -----END PGP SIGNATURE----- --9mh2gBpnP70EYzd3--