From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by sourceware.org (Postfix) with ESMTP id 04D77385802D for ; Sat, 29 May 2021 19:33:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 04D77385802D Received: from vapier.lan (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 1A074335DA4 for ; Sat, 29 May 2021 19:33:12 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: [PATCH/committed] sim: v850: add pointer casts for execv on Windows Date: Sat, 29 May 2021 15:33:10 -0400 Message-Id: <20210529193310.8710-1-vapier@gentoo.org> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-10.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Sat, 29 May 2021 19:33:14 -0000 The execv prototypes on Windows via mingw64 include extra const markings on the argv/envp pointers than what POSIX specifies. Cast them to void* as a hack to get it working on all platforms. --- sim/v850/ChangeLog | 4 ++++ sim/v850/simops.c | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/sim/v850/ChangeLog b/sim/v850/ChangeLog index 02e6bbdc2158..29237d80c985 100644 --- a/sim/v850/ChangeLog +++ b/sim/v850/ChangeLog @@ -1,3 +1,7 @@ +2021-05-29 Mike Frysinger + + * simops.c (OP_10007E0): Add (void*) casts to argv & envp. + 2021-05-17 Mike Frysinger * sim-main.h (SIM_HAVE_COMMON_SIM_STATE): Delete. diff --git a/sim/v850/simops.c b/sim/v850/simops.c index 62a2bbcbb615..f0e2745dee93 100644 --- a/sim/v850/simops.c +++ b/sim/v850/simops.c @@ -1640,7 +1640,7 @@ OP_10007E0 (void) char *path = fetch_str (simulator, PARM1); char **argv = fetch_argv (simulator, PARM2); char **envp = fetch_argv (simulator, PARM3); - RETVAL = execve (path, argv, envp); + RETVAL = execve (path, (void *)argv, (void *)envp); free (path); freeargv (argv); freeargv (envp); @@ -1656,7 +1656,7 @@ OP_10007E0 (void) { char *path = fetch_str (simulator, PARM1); char **argv = fetch_argv (simulator, PARM2); - RETVAL = execv (path, argv); + RETVAL = execv (path, (void *)argv); free (path); freeargv (argv); RETERR = errno; -- 2.31.1