From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id D9E43385085C for ; Wed, 12 Oct 2022 12:38:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D9E43385085C Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-361-SXpRxq1mMW--5yyhqYwgpw-1; Wed, 12 Oct 2022 08:38:49 -0400 X-MC-Unique: SXpRxq1mMW--5yyhqYwgpw-1 Received: by mail-wm1-f69.google.com with SMTP id q14-20020a7bce8e000000b003c6b7debf22so446224wmj.0 for ; Wed, 12 Oct 2022 05:38:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gXz0ua5D8bzRysUGlKG9LgIQERU+rmgev+erzl6EDBc=; b=5N+OTpD/XNH6V5PUMYmSN/4cbaWYGTohJfakAbY8n4916cWVCTKQBEOu8p1QN7x9kj NVyPyTRQgU66rZ5eNEy1vAZIJoAIbiSkQAzKON7qQLhwKQopuDg1mmMufNPtxHJ0NfHh U/clXOZKiEkliJaF6XwFYpKGkPJp4jZP12qvF61y9O8uKItp6OJecdjVT7JEhg1idLf8 Dqm7eD1GzjOF+CiFgcG/vapIGeESX6ClN38eEn01ZRfAUjglUD9XLjk/wvnQ8T+aYPEB LEaF0G3QhPAcrp9Z50+IKzqBvNAu/p4kUUS3800jdaGrReKHxGrubZHIJKf4b6GhuDq/ O36g== X-Gm-Message-State: ACrzQf3HIA9idfVzT5iGxRPgCl3Bm5bUgFj0fS7SEHER8GBSZYETcZ7V 9hdfTljn+978T3LHU9VgnzxuWaSohdYF7bkLLyqeqyDfqtaIOfUB6kI88AhJxk5qmoyzf7qLeVe 25gLSESIBqSuV9H7x+umGIKpOX/j2MixheCf/M1ykavnjL+Xn0gBzMugfULly73pYZzQEscG54w == X-Received: by 2002:adf:e491:0:b0:22e:4483:a8b5 with SMTP id i17-20020adfe491000000b0022e4483a8b5mr18631273wrm.497.1665578327834; Wed, 12 Oct 2022 05:38:47 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7K9lyBH+Uq7RKzBLiWR6SROMrs9YnsSYubiCIfGqcZsKnheCzkeFqhU2HN3EzzDomsqraApg== X-Received: by 2002:adf:e491:0:b0:22e:4483:a8b5 with SMTP id i17-20020adfe491000000b0022e4483a8b5mr18631255wrm.497.1665578327485; Wed, 12 Oct 2022 05:38:47 -0700 (PDT) Received: from localhost (52.72.115.87.dyn.plus.net. [87.115.72.52]) by smtp.gmail.com with ESMTPSA id a13-20020adff7cd000000b0022a403954c3sm13646422wrq.42.2022.10.12.05.38.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Oct 2022 05:38:47 -0700 (PDT) From: Andrew Burgess To: gdb-patches@sourceware.org Subject: [PATCH 5/5] sim/iq2000: silence pointer-sign warnings Date: Wed, 12 Oct 2022 13:38:35 +0100 Message-Id: <89f7a81c43e4b9acf725de1668f7754692e6dd83.1665578246.git.aburgess@redhat.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-10.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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: , X-List-Received-Date: Wed, 12 Oct 2022 12:38:54 -0000 When building the iq2000 simulator I see a few warnings like this: /tmp/build/sim/../../src/sim/iq2000/iq2000.c: In function ‘fetch_str’: /tmp/build/sim/../../src/sim/iq2000/iq2000.c:50:54: error: pointer targets in passing argument 3 of ‘sim_read’ differ in signedness [-Werror=pointer-sign] 50 | sim_read (CPU_STATE (current_cpu), CPU2DATA(addr), buf, nr); | ^~~ | | | char * 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. 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. --- 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 = -DHAVE_CPU_IQ2000BF -DHAVE_CPU_IQ10BF SIM_EXTRA_CLEAN = iq2000-clean -# Some modules don't build cleanly yet. -iq2000.o mloop.o: SIM_WERROR_CFLAGS = - ## COMMON_POST_CONFIG_FRAG arch = 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)) != 0) nr++; buf = 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; } @@ -82,7 +83,8 @@ do_syscall (SIM_CPU *current_cpu, PCADDR pc) case TARGET_NEWLIB_SYS_write: buf = 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; -- 2.25.4