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 0196A385841F for ; Wed, 26 Oct 2022 10:06:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0196A385841F 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 C84A4340976; Wed, 26 Oct 2022 10:06:22 +0000 (UTC) Date: Wed, 26 Oct 2022 14:36:58 +0545 From: Mike Frysinger To: Andrew Burgess Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 5/5] sim/iq2000: silence pointer-sign warnings Message-ID: Mail-Followup-To: Andrew Burgess , gdb-patches@sourceware.org References: <89f7a81c43e4b9acf725de1668f7754692e6dd83.1665578246.git.aburgess@redhat.com> <87r0yx8bty.fsf@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="g+NQc1BdXY54k/qM" Content-Disposition: inline In-Reply-To: <87r0yx8bty.fsf@redhat.com> X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,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: --g+NQc1BdXY54k/qM Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 24 Oct 2022 16:45, Andrew Burgess wrote: > Mike Frysinger writes: >=20 > > On 12 Oct 2022 13:38, Andrew Burgess via Gdb-patches wrote: > >> When building the iq2000 simulator I see a few warnings like this: > >>=20 > >> /tmp/build/sim/../../src/sim/iq2000/iq2000.c: In function =E2=80=98f= etch_str=E2=80=99: > >> /tmp/build/sim/../../src/sim/iq2000/iq2000.c:50:54: error: pointer t= argets in passing argument 3 of =E2=80=98sim_read=E2=80=99 differ in signed= ness [-Werror=3Dpointer-sign] > >> 50 | sim_read (CPU_STATE (current_cpu), CPU2DATA(addr), buf, nr= ); > >> | ^~~ > >> | | > >> | char * > >>=20 > >> I've silenced these warnings by casting buf to 'unsigned char *'. > >> With this change I now see no warnings when compiling iq2000.c, so > >> I've removed the line from Makefile.in that disables -Werror. > > > > i left this warning in place so someone would fix it properly rather th= an > > just cast it away >=20 > Sorry for not understanding that. If you'd like to expand on "properly" > I'll take a pass at fixing it. whatever doesn't require a lot of casting :). sprinkling casts around means leaving landmines for ourselves in the future. in this particular case, i think the only reasonable answer is to change the sim_read & sim_write APIs to work on void* much like the C library funcs. i get that void pointers are basically implicit casts, but i think that's sti= ll the right way to go unless i'm forgetting something obvious. i also vaguely recall that we really shouldn't be using sim_read & sim_write in sim backends in the first place, but instead leaning on sim_core_* APIs. -mike --g+NQc1BdXY54k/qM Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEuQK1JxMl+JKsJRrUQWM7n+g39YEFAmNY9S4ACgkQQWM7n+g3 9YFf/A/9FaF7GPoHP4eAiv1KedSe+XzM80isxl1mWImpJVXAlwG3Ll4pGRuZc8xE HSSayv23chK/WAI11hzwUj4Ug2+Vo5YeuiDPhU0tVBaRYm0MyLYUvBa3XYoru56J EGKfYdinmXZx8vX/D9/ehii6x/ZACNd22t8cNRA9AWE9anyC9QHQ1ZcbbJUTcM/l tY5zmFBWdsGJsaFHoBzc8aARzc0trYK1I1PXZIfYzPkrZ3bY7KjqNTzODrqmFuMt 1lF73SmkMWAr6o7cJdsyj5Ejfs8ecCteBJW3BXIW8YLlddIe047kU1UWVkxaN3Jf Dbr+pOzTsFobQ+1y56wcQvYL4ePMNdau7btDKHpDglkmTjHXm0rREXAVfqqvy+Qs IQgVaZYTgsonrBVijEvT/PjAzUgy6D1szxCNbivxEVg7FQSUyeT40Fg7JmKMWwuQ ucy+G1/HPqs+lBIGyYcdbi+OXHdfzbq8VlU3lItBh9y5hjGwpb6l88OWZ+ozmPVX tUQhJ9+xdsBQsNk+kNbKn0KCc/8d1S+g1AE4hegztDHqTHICTeKpWH9GntmJ52jl EteRMtKhVdNiqSH4NmWNa0SAycFmU0EdAWye3gol+32oZB6WZmvgKETFs4n+vOi3 z7BlgtT2RmqwZ8ZfRhGN9eB/sehNGD6FxHezx91iOfNfttu5YZo= =FsLv -----END PGP SIGNATURE----- --g+NQc1BdXY54k/qM--