There are a couple of issues that have come up only in Windows (that are not problems in Linux).
There are also compilation warnings that come up only in Windows. (Coincidence?)
The compilation warnings may be unrelated to the other problems, but probably should be cleaned up anyway.
$ make
OS="mingw64_nt-10.0-18363"
gcc -DWIN32=1 -g -O3 -D_FILE_OFFSET_BITS=64 -c -o src/0.o src/0.c
gcc -DWIN32=1 -g -O3 -D_FILE_OFFSET_BITS=64 -c -o src/bswap.o src/bswap.c
gcc -DWIN32=1 -g -O3 -D_FILE_OFFSET_BITS=64 -c -o src/c.o src/c.c
gcc -DWIN32=1 -g -O3 -D_FILE_OFFSET_BITS=64 -c -o src/getline.o src/getline.c
src/getline.c: In function 'getdelim':
src/getline.c:125:14: warning: overflow in conversion from 'size_t' {aka 'long long unsigned int'} to 'ssize_t' {aka 'long long int'} changes value from '*n = 18446744073709551615' to '-1' [-Woverflow]
125 | error: R *n=-1;
| ~~^~~
gcc -DWIN32=1 -g -O3 -D_FILE_OFFSET_BITS=64 -c -o src/mt.o src/mt.c
gcc -DWIN32=1 -g -O3 -D_FILE_OFFSET_BITS=64 -c -o src/p.o src/p.c
In file included from src/incs.h:42,
from src/p.c:1:
src/p.c: In function 'capture':
src/p.c:568:27: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
568 | { j=(V)atol(s+k); i=DT_SPECIAL_VERB_OFFSET;
| ^
src/ts.h:68:24: note: in definition of macro 'CS'
68 | #define CS(n,x) case n:x;break;
| ^
gcc -DWIN32=1 -g -O3 -D_FILE_OFFSET_BITS=64 -c -o src/r.o src/r.c
src/r.c:54:5: warning: '_putenv_s' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
54 | int _putenv_s(cS nm,cS v)
| ^~~~~~~~~
gcc -DWIN32=1 -g -O3 -D_FILE_OFFSET_BITS=64 -c -o src/k.o src/k.c
gcc -DWIN32=1 -g -O3 -D_FILE_OFFSET_BITS=64 -c -o src/kc.o src/kc.c
gcc -DWIN32=1 -g -O3 -D_FILE_OFFSET_BITS=64 -c -o src/kx.o src/kx.c
src/kx.c: In function 'ex':
cc1.exe: warning: function may return address of local variable [-Wreturn-local-addr]
src/kx.c:599:8: note: declared here
599 | K ex(K a) //Input is (usually, but not always) 7-0 type from wd()
| ~~^
src/kx.c:599:8: note: declared here
src/kx.c: In function 'ex1':
cc1.exe: warning: function may return address of local variable [-Wreturn-local-addr]
src/kx.c:778:7: note: declared here
778 | K a=Kv(); a->n=0; K kb=newK(-4,d); M(a,kb) V*b=(V*)kK(kb);
| ^
src/kx.c:778:7: note: declared here
gcc -DWIN32=1 -g -O3 -D_FILE_OFFSET_BITS=64 -c -o src/kg.o src/kg.c
gcc -DWIN32=1 -g -O3 -D_FILE_OFFSET_BITS=64 -c -o src/km.o src/km.c
gcc -DWIN32=1 -g -O3 -D_FILE_OFFSET_BITS=64 -c -o src/kn.o src/kn.c
gcc -DWIN32=1 -g -O3 -D_FILE_OFFSET_BITS=64 -c -o src/ko.o src/ko.c
gcc -DWIN32=1 -g -O3 -D_FILE_OFFSET_BITS=64 -c -o src/ks.o src/ks.c
gcc -DWIN32=1 -g -O3 -D_FILE_OFFSET_BITS=64 -c -o src/v.o src/v.c
gcc -DWIN32=1 -g -O3 -D_FILE_OFFSET_BITS=64 -c -o src/va.o src/va.c
gcc -DWIN32=1 -g -O3 -D_FILE_OFFSET_BITS=64 -c -o src/vc.o src/vc.c
gcc -DWIN32=1 -g -O3 -D_FILE_OFFSET_BITS=64 -c -o src/vd.o src/vd.c
gcc -DWIN32=1 -g -O3 -D_FILE_OFFSET_BITS=64 -c -o src/vf.o src/vf.c
gcc -DWIN32=1 -g -O3 -D_FILE_OFFSET_BITS=64 -c -o src/vg.o src/vg.c
gcc -DWIN32=1 -g -O3 -D_FILE_OFFSET_BITS=64 -c -o src/vq.o src/vq.c
gcc -DWIN32=1 -g -O3 -D_FILE_OFFSET_BITS=64 -c -o src/main.o src/main.c
gcc -DWIN32=1 -g -O3 -D_FILE_OFFSET_BITS=64 src/win/mman.o src/win/dlfcn.o src/win/safe-ctype.o src/win/fnmatch.o src/win/pread.o src/win/usleep.o src/0.o src/bswap.o src/c.o src/getline.o src/mt.o src/p.o src/r.o src/k.o src/kc.o src/kx.o src/kg.o src/km.o src/kn.o src/ko.o src/ks.o src/v.o src/va.o src/vc.o src/vd.o src/vf.o src/vg.o src/vq.o src/main.o -o k -lws2_32 -static -lpthread
There are a couple of issues that have come up only in Windows (that are not problems in Linux). There are also compilation warnings that come up only in Windows. (Coincidence?)
The compilation warnings may be unrelated to the other problems, but probably should be cleaned up anyway.