From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1726) id 44A4A3858D39; Wed, 19 Oct 2022 13:33:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 44A4A3858D39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666186388; bh=mqjWXCXL2abwksThyTsc1odGjjdG/qQtdIbfUqG8xfM=; h=From:To:Subject:Date:From; b=hIsP5HsdrhgpcOjooE4/aWsxvSlcX1HrqxaxErQk1CPdqE+YLNk0UWT4qe7rdbABk d0yYvWIJkPc43ZYJISIPsWisJ/ahuayIhYeyu84zeJli6aav1QGULKM+wHKuDgkzjA Tyz05XfDM10XXEti5PN7/fnvZUx/BoQfNCzChjWY= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Andrew Burgess To: gdb-cvs@sourceware.org Subject: [binutils-gdb] sim/iq2000: silence pointer-sign warnings X-Act-Checkin: binutils-gdb X-Git-Author: Andrew Burgess X-Git-Refname: refs/heads/master X-Git-Oldrev: d0a7ca87ab208d72b2c6a9d44e30fe20c3c0542e X-Git-Newrev: feab6abfe23b5b1724cb3c00059254e8f1bc5225 Message-Id: <20221019133308.44A4A3858D39@sourceware.org> Date: Wed, 19 Oct 2022 13:33:08 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Dfeab6abfe23b= 5b1724cb3c00059254e8f1bc5225 commit feab6abfe23b5b1724cb3c00059254e8f1bc5225 Author: Andrew Burgess Date: Wed Oct 12 12:46:42 2022 +0100 sim/iq2000: silence pointer-sign warnings =20 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=98fe= tch_str=E2=80=99: /tmp/build/sim/../../src/sim/iq2000/iq2000.c:50:54: error: pointer ta= rgets in passing argument 3 of =E2=80=98sim_read=E2=80=99 differ in signedn= ess [-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. =20 Makefile.in was also disabling -Werror when compiling mloop.c, however, I'm not seeing any warnings when compiling that file, so I've removed the -Werror disable in that case too. Diff: --- sim/iq2000/Makefile.in | 3 --- sim/iq2000/iq2000.c | 9 ++++++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sim/iq2000/Makefile.in b/sim/iq2000/Makefile.in index 9f64adcecb4..757ed28ef6b 100644 --- a/sim/iq2000/Makefile.in +++ b/sim/iq2000/Makefile.in @@ -37,9 +37,6 @@ ALL_CPU_CFLAGS =3D -DHAVE_CPU_IQ2000BF -DHAVE_CPU_IQ10BF =20 SIM_EXTRA_CLEAN =3D iq2000-clean =20 -# Some modules don't build cleanly yet. -iq2000.o mloop.o: SIM_WERROR_CFLAGS =3D - ## COMMON_POST_CONFIG_FRAG =20 arch =3D iq2000 diff --git a/sim/iq2000/iq2000.c b/sim/iq2000/iq2000.c index b685a31b07a..2c01434c308 100644 --- a/sim/iq2000/iq2000.c +++ b/sim/iq2000/iq2000.c @@ -47,7 +47,8 @@ fetch_str (SIM_CPU *current_cpu, PCADDR pc, DI addr) pc, read_map, CPU2DATA(addr + nr)) !=3D 0) nr++; buf =3D NZALLOC (char, nr + 1); - sim_read (CPU_STATE (current_cpu), CPU2DATA(addr), buf, nr); + sim_read (CPU_STATE (current_cpu), CPU2DATA(addr), (unsigned char *) buf, + nr); return buf; } =20 @@ -82,7 +83,8 @@ do_syscall (SIM_CPU *current_cpu, PCADDR pc) =20 case TARGET_NEWLIB_SYS_write: buf =3D zalloc (PARM3); - sim_read (CPU_STATE (current_cpu), CPU2DATA(PARM2), buf, PARM3); + sim_read (CPU_STATE (current_cpu), CPU2DATA(PARM2), + (unsigned char *) buf, PARM3); SET_H_GR (ret_reg, sim_io_write (CPU_STATE (current_cpu), PARM1, buf, PARM3)); @@ -105,7 +107,8 @@ do_syscall (SIM_CPU *current_cpu, PCADDR pc) SET_H_GR (ret_reg, sim_io_read (CPU_STATE (current_cpu), PARM1, buf, PARM3)); - sim_write (CPU_STATE (current_cpu), CPU2DATA(PARM2), buf, PARM3); + sim_write (CPU_STATE (current_cpu), CPU2DATA(PARM2), + (unsigned char *) buf, PARM3); free (buf); break;