Hi,

Adrian Ebeling wrote:
> in commit 29d55bf8 (Mon Dec 14 2020), const qualifiers were added in 
> spawn_int.h:
> 
> extern int __spawni (pid_t *pid, const char *path,
>                       const posix_spawn_file_actions_t *file_actions,
>                       const posix_spawnattr_t *attrp, const char *const 
> argv[],
>                                                    /* ^^^^^ */
>                       const char *const envp[], int use_path);
>                    /* ^^^^^ */
> 
> However, the implementation for Windows in in spawni.c was not changed:
> 
> /* Native Windows API.  */
> int
> __spawni (pid_t *pid, const char *file,
>            const posix_spawn_file_actions_t *file_actions,
>            const posix_spawnattr_t *attrp, char *const argv[],
>                                        /* ^-- missing "const" */
>            char *const envp[], int use_path)
>        /* ^-- missing "const" */
> 
> So there's a compile error because the types don't match.

Oops. Thanks for the report. Fixed:


2020-12-23  Bruno Haible  <br...@clisp.org>

        posix_spawn[p]: Fix compilation error on Windows (regr. 2020-12-14).
        Reported by Adrian Ebeling <d...@adrian-ebeling.de> in
        <https://lists.gnu.org/archive/html/bug-gnulib/2020-12/msg00189.html>.
        * lib/spawni.c (__spawni): Update function parameters.

diff --git a/lib/spawni.c b/lib/spawni.c
index 1e20a97..06d98b4 100644
--- a/lib/spawni.c
+++ b/lib/spawni.c
@@ -95,8 +95,8 @@
 int
 __spawni (pid_t *pid, const char *file,
           const posix_spawn_file_actions_t *file_actions,
-          const posix_spawnattr_t *attrp, char *const argv[],
-          char *const envp[], int use_path)
+          const posix_spawnattr_t *attrp, const char *const argv[],
+          const char *const envp[], int use_path)
 {
   /* Not yet implemented.  */
   return ENOSYS;


Reply via email to