From 87402c849eda1a75df7882b3c04ba08f33848da4 Mon Sep 17 00:00:00 2001 From: Michael Gran Date: Sat, 22 Mar 2025 17:42:41 -0700 Subject: [PATCH] MinGW32: cast arguments to execvp MinGW32's MSVCRT library requires strict casting for exec family functions * libguile/posix.c (scm_execl, scm_execlp, scm_execle) [__MINGW32__]: cast arguments --- libguile/posix.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/libguile/posix.c b/libguile/posix.c index 7cd80ed76..3d38bc310 100644 --- a/libguile/posix.c +++ b/libguile/posix.c @@ -1,4 +1,4 @@ -/* Copyright 1995-2014, 2016-2019, 2021-2024 +/* Copyright 1995-2014, 2016-2019, 2021-2025 Free Software Foundation, Inc. Copyright 2021 Maxime Devos @@ -1174,7 +1174,11 @@ SCM_DEFINE (scm_execl, "execl", 1, 0, 1, exec_argv = scm_i_allocate_string_pointers (args); +#ifdef __MINGW32__ + execv (exec_file, (const char * const *)exec_argv); +#else execv (exec_file, exec_argv); +#endif SCM_SYSERROR; /* not reached. */ @@ -1203,7 +1207,11 @@ SCM_DEFINE (scm_execlp, "execlp", 1, 0, 1, exec_argv = scm_i_allocate_string_pointers (args); +#ifdef __MINGW32__ + execvp (exec_file, (const char * const *)exec_argv); +#else execvp (exec_file, exec_argv); +#endif SCM_SYSERROR; /* not reached. */ @@ -1237,7 +1245,11 @@ SCM_DEFINE (scm_execle, "execle", 2, 0, 1, exec_argv = scm_i_allocate_string_pointers (args); exec_env = scm_i_allocate_string_pointers (env); +#ifdef __MINGW32__ + execve (exec_file, (const char * const *) exec_argv, (const char * const *) exec_env); +#else execve (exec_file, exec_argv, exec_env); +#endif SCM_SYSERROR; /* not reached. */