From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 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 DCC4934117B; Sun, 23 Oct 2022 16:18:22 +0000 (UTC) Date: Sun, 23 Oct 2022 20:48:57 +0545 From: Mike Frysinger To: Tsukasa OI Cc: Andrew Burgess , Nick Clifton , gdb-patches@sourceware.org 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-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --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--