From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id yqNhD5KjrWWwXgMAWB0awg (envelope-from ) for ; Sun, 21 Jan 2024 18:06:58 -0500 Received: by simark.ca (Postfix, from userid 112) id 2B0C21E0C3; Sun, 21 Jan 2024 18:06:58 -0500 (EST) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 162ED1E098 for ; Sun, 21 Jan 2024 18:06:56 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 743C9385E02B for ; Sun, 21 Jan 2024 23:06:55 +0000 (GMT) Received: from gnu.wildebeest.org (gnu.wildebeest.org [45.83.234.184]) by sourceware.org (Postfix) with ESMTPS id 94C503858D3C for ; Sun, 21 Jan 2024 23:06:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 94C503858D3C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=klomp.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=klomp.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 94C503858D3C Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=45.83.234.184 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705878398; cv=none; b=lZUhaLnvBICVkdIjgoaMxAnk+CFcedOwt/JH8/FbBNkoQu7Fz2qkiHrBephWddLb9BHj4d/mGDOT2Hsa7lZBCsHl8cWKSrMHaehv+z0JB9sI9cjrceNbmw9UuIjh8b+Lwb0VBczNoQ+P2Td7Ur1CQ+l7aDa//fbOM8Po34xGQ7k= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705878398; c=relaxed/simple; bh=CNrRIZUdn/hlubXJZYbYT4Au8fow8Yg12Qb5RQXpRTs=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=YApqP8KESzauP7nODA04SkzmPrY7a3Ylxn0CbCkXVd1fHsGRQPsnge2+3Fc0lbdsxejaT8LxMwRPDIkeQ7awUkA6Cwx+VQWYMS1l1+3kJTvU/cHBWO6MoEZ86ps7WG5XoMOawdrRDFLHqwkEplJJJXrogopYs3bsE+ONyfnpdhM= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from csb.redhat.com (deer0x03.wildebeest.org [172.31.17.133]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id A99FA302BBEA; Mon, 22 Jan 2024 00:06:33 +0100 (CET) Received: by csb.redhat.com (Postfix, from userid 10916) id 8A6D1CEF2C; Mon, 22 Jan 2024 00:06:33 +0100 (CET) From: Mark Wielaard To: gdb-patches@sourceware.org Cc: Mark Wielaard Subject: [PATCH] sim: Fix -Wincompatible-pointer-types in frv/sem.c Date: Mon, 22 Jan 2024 00:06:20 +0100 Message-Id: <20240121230620.575972-1-mark@klomp.org> X-Mailer: git-send-email 2.39.3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-9.3 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org GCC errors on -Wincompatible-pointer-types sim/frv/sem.c: In function ‘frvbf_sem_mmachu’: sim/frv/sem.c:24345:41: error: passing argument 2 of ‘sim_queue_fn_di_write’ from incompatible pointer type [-Wincompatible-pointer-types] 24345 | sim_queue_fn_di_write (current_cpu, frvbf_h_acc40U_set, FLD (f_ACC40Uk), opval); | ^~~~~~~~~~~~~~~~~~ | | | void (*)(SIM_CPU *, UINT, UDI) {aka void (*)(struct _sim_cpu *, unsigned int, long unsigned int)} In file included from ../../binutils-gdb/sim/common/cgen-cpu.h:25, from ../../binutils-gdb/sim/common/sim-cpu.h:32, from ../../binutils-gdb/sim/common/sim-base.h:90, from ../../binutils-gdb/sim/frv/sim-main.h:41, from ../../binutils-gdb/sim/frv/sem.c:28: ../../binutils-gdb/sim/common/cgen-par.h:195:47: note: expected ‘void (*)(SIM_CPU *, UINT, DI)’ {aka ‘void (*)(struct _sim_cpu *, unsigned int, long int)’} but argument is of type ‘void (*)(SIM_CPU *, UINT, UDI)’ {aka ‘void (*)(struct _sim_cpu *, unsigned int, long unsigned int)’} 195 | extern void sim_queue_fn_di_write (SIM_CPU *, void (*)(SIM_CPU *, UINT, DI), UINT, DI); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The issue is that sim_queue_fn_di_write takes a function with a DI argument but frvbf_h_acc40U_set takes a UDI. Since there is no sim_queue_fn that takes a UDI just define frvbf_h_acc40U_set as if it takes a DI. --- sim/frv/cpu.c | 2 +- sim/frv/cpu.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sim/frv/cpu.c b/sim/frv/cpu.c index b28bcd72d66..2aaa3f22953 100644 --- a/sim/frv/cpu.c +++ b/sim/frv/cpu.c @@ -631,7 +631,7 @@ frvbf_h_acc40U_get (SIM_CPU *current_cpu, UINT regno) /* Set a value for h-acc40U. */ void -frvbf_h_acc40U_set (SIM_CPU *current_cpu, UINT regno, UDI newval) +frvbf_h_acc40U_set (SIM_CPU *current_cpu, UINT regno, DI newval) { SET_H_ACC40U (regno, newval); } diff --git a/sim/frv/cpu.h b/sim/frv/cpu.h index ab5f2d1b539..a099e975d8e 100644 --- a/sim/frv/cpu.h +++ b/sim/frv/cpu.h @@ -352,7 +352,7 @@ void frvbf_h_accg_set (SIM_CPU *, UINT, USI); DI frvbf_h_acc40S_get (SIM_CPU *, UINT); void frvbf_h_acc40S_set (SIM_CPU *, UINT, DI); UDI frvbf_h_acc40U_get (SIM_CPU *, UINT); -void frvbf_h_acc40U_set (SIM_CPU *, UINT, UDI); +void frvbf_h_acc40U_set (SIM_CPU *, UINT, DI); DI frvbf_h_iacc0_get (SIM_CPU *, UINT); void frvbf_h_iacc0_set (SIM_CPU *, UINT, DI); UQI frvbf_h_iccr_get (SIM_CPU *, UINT); -- 2.39.3