Summary

Chicken 5.4.0 doesn't build on Windows

Metadata

Description

I've been following this guide to get up and running with Chicken on Windows:

https://wiki.call-cc.org/msys2#installing-chicken-50-on-msys2

When trying to compile Chicken I get compiler errors:

 gcc -fno-strict-aliasing -fwrapv -DHAVE_CHICKEN_CONFIG_H -DC_ENABLE_PTABLES -c -Os  -DC_BUILDING_LIBCHICKEN posixwin.c -o posixwin-static.o -I. -I./
 In file included from posixwin.c:9:
 posixwin.c: In function 'f_4799':
 posixwin.c:185:57: error: passing argument 2 of 'execve' from incompatible pointer type [-Wincompatible-pointer-types]
   185 | #define C_u_i_execve(f,a,e) C_fix(execve(C_c_string(f), (const char *const *)C_c_pointer_ve, (const char *const *)C_c_pointer_vector_or_null(e)))
       |                                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       |                                                         |
       |                                                         const char * const*
 chicken.h:1046:56: note: in definition of macro 'C_fix'
  1046 | #define C_fix(n)                   ((C_word)((C_uword)(n) << C_FIXNUM_SHIFT) | C_FIXNUM_BIT)
       |                                                        ^
 posixwin.c:9646:17: note: in expansion of macro 'C_u_i_execve'
  9646 | t6=(C_truep(t4)?C_u_i_execve(t2,t3,t4):C_u_i_execvp(t2,t3));
       |                 ^~~~~~~~~~~~
 In file included from C:/msys64/ucrt64/include/unistd.h:11,
                  from chicken.h:134:
 C:/msys64/ucrt64/include/process.h:187:64: note: expected 'char * const*' but argument is of type 'const char * const*'
   187 |   _CRTIMP int __cdecl execve(const char *_Filename,char *const _ArgList[],char *const _Env[]) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
       |                                                    ~~~~~~~~~~~~^~~~~~~~~~
 posixwin.c:185:109: error: passing argument 3 of 'execve' from incompatible pointer type [-Wincompatible-pointer-types]
   185 | #define C_u_i_execve(f,a,e) C_fix(execve(C_c_string(f), (const char *const *)C_c_pointer_vector_or_null(a), (const char *const *)C_c_pointer_vector_or_null(e)))
       |
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       |
                 |
       |
                 const char * const*
 chicken.h:1046:56: note: in definition of macro 'C_fix'
  1046 | #define C_fix(n)                   ((C_word)((C_uword)(n) << C_FIXNUM_SHIFT) | C_FIXNUM_BIT)
       |                                                        ^
 posixwin.c:9646:17: note: in expansion of macro 'C_u_i_execve'
  9646 | t6=(C_truep(t4)?C_u_i_execve(t2,t3,t4):C_u_i_execvp(t2,t3));
       |                 ^~~~~~~~~~~~
 C:/msys64/ucrt64/include/process.h:187:87: note: expected 'char * const*' but argument is of type 'const char * const*'
   187 |   _CRTIMP int __cdecl execve(const char *_Filename,char *const _ArgList[],char *const _Env[) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
       |                                                                           ~~~~~~~~~~~~^~~~~
 posixwin.c:184:57: error: passing argument 2 of 'execvp' from incompatible pointer type [-Wincompatible-pointer-types]
   184 | #define C_u_i_execvp(f,a)   C_fix(execvp(C_c_string(f), (const char *const *)C_c_pointer_ve))
       |                                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       |                                                         |
       |                                                         const char * const*
 chicken.h:1046:56: note: in definition of macro 'C_fix'
  1046 | #define C_fix(n)                   ((C_word)((C_uword)(n) << C_FIXNUM_SHIFT) | C_FIXNUM_BIT)
       |                                                        ^
 posixwin.c:9646:40: note: in expansion of macro 'C_u_i_execvp'
  9646 | t6=(C_truep(t4)?C_u_i_execve(t2,t3,t4):C_u_i_execvp(t2,t3));
       |                                        ^~~~~~~~~~~~
 C:/msys64/ucrt64/include/process.h:188:64: note: expected 'char * const*' but argument is of type 'const char * const*'
   188 |   _CRTIMP int __cdecl execvp(const char *_Filename,char *const _ArgList[]) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
       |                                                    ~~~~~~~~~~~~^~~~~~~~~~
 posixwin.c: In function 'f_4882':
 posixwin.c:189:75: error: passing argument 3 of 'spawnvpe' from incompatible pointer type [-Wincompatible-pointer-types]
   189 | #define C_u_i_spawnvpe(m,f,a,e) C_fix(spawnvpe(C_unfix(m), C_c_string(f), (const char *cons, (const char *const *)C_c_pointer_vector_or_null(e)))
       |                                                                           ^~~~~~~~~~~~~~~~~
       |                                                                           |
       |                                                                           const char * const*
 chicken.h:1046:56: note: in definition of macro 'C_fix'
  1046 | #define C_fix(n)                   ((C_word)((C_uword)(n) << C_FIXNUM_SHIFT) | C_FIXNUM_BIT)
       |                                                        ^
 posixwin.c:9768:17: note: in expansion of macro 'C_u_i_spawnvpe'
  9768 | t6=(C_truep(t4)?C_u_i_spawnvpe(((C_word*)t0)[2],t2,t3,t4):C_u_i_spawnvp(((C_word*)t0)[2],t2,t3));
       |                 ^~~~~~~~~~~~~~
 C:/msys64/ucrt64/include/process.h:199:75: note: expected 'char * const*' but argument is of type 'const char * const*'
   199 |   _CRTIMP intptr_t __cdecl spawnvpe(int,const char *_Filename,char *const _ArgList[],char *const _Env[]) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
       |                                                               ~~~~~~~~~~~~^~~~~~~~~~
 posixwin.c:189:127: error: passing argument 4 of 'spawnvpe' from incompatible pointer type [-Wincompatible-pointer-types]
   189 | #define C_u_i_spawnvpe(m,f,a,e) C_fix(spawnvpe(C_unfix(m), C_c_string(f), (const char *const *)C_c_pointer_vector_or_null(a), (const char *const *)C_c_pointer_vector_or_null(e)))
       |
                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       |
                                   |
       |
                                   const char * const*
 chicken.h:1046:56: note: in definition of macro 'C_fix'
  1046 | #define C_fix(n)                   ((C_word)((C_uword)(n) << C_FIXNUM_SHIFT) | C_FIXNUM_BIT)
       |                                                        ^
 posixwin.c:9768:17: note: in expansion of macro 'C_u_i_spawnvpe'
  9768 | t6=(C_truep(t4)?C_u_i_spawnvpe(((C_word*)t0)[2],t2,t3,t4):C_u_i_spawnvp(((C_word*)t0)[2],t2,t3));
       |                 ^~~~~~~~~~~~~~
 C:/msys64/ucrt64/include/process.h:199:98: note: expected 'char * const*' but argument is of type 'const char * const*'
   199 |   _CRTIMP intptr_t __cdecl spawnvpe(int,const char *_Filename,char *const _ArgList[],char *) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
       |                                                                                      ~~~~~~
 posixwin.c:188:74: error: passing argument 3 of 'spawnvp' from incompatible pointer type [-Wincompatible-pointer-types]
   188 | #define C_u_i_spawnvp(m,f,a)    C_fix(spawnvp(C_unfix(m), C_c_string(f), (const char *const))
       |                                                                          ^~~~~~~~~~~~~~~~~~
       |                                                                          |
       |                                                                          const char * const
 chicken.h:1046:56: note: in definition of macro 'C_fix'
  1046 | #define C_fix(n)                   ((C_word)((C_uword)(n) << C_FIXNUM_SHIFT) | C_FIXNUM_BIT)
       |                                                        ^
 posixwin.c:9768:59: note: in expansion of macro 'C_u_i_spawnvp'
  9768 | t6=(C_truep(t4)?C_u_i_spawnvpe(((C_word*)t0)[2],t2,t3,t4):C_u_i_spawnvp(((C_word*)t0)[2],t2,t3));
       |                                                           ^~~~~~~~~~~~~
 C:/msys64/ucrt64/include/process.h:198:74: note: expected 'char * const*' but argument is of type 'const char * const*'
   198 |   _CRTIMP intptr_t __cdecl spawnvp(int,const char *_Filename,char *const _ArgList[]) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
       |                                                              ~~~~~~~~~~~~^~~~~~~~~~
 make: *** [rules.make:121: posixwin-static.o] Error 1

Changes and comments

[2025-12-22 20:33:39 UTC] MickeyKnox changed description

[2025-12-22 21:39:27 UTC] mario wrote:

I believe that is the same problem reported in https://lists.gnu.org/archive/html/chicken-users/2024-08/msg00009.html (there's a suggestion and a patch in the messages that follow in that thread).

[2025-12-23 03:53:26 UTC] MickeyKnox wrote:

Yes, that looks like it's the same problem. The easiest method to get the fixes would probably be to check it out from git, right? There are quite a few chicken-5-* branches. Is simply chicken-5 a good choice?

PS: Am I right to assume that the master branch tracks the developement of chicken-6?

PPS: I didn't receive an email for your comment, although I did check the CC box. Shouldn't that have generated an email for me?