Solved.
diff --git a/src/lib/gmp_wrap.c b/src/lib/gmp_wrap.c
index a1065104..45e3fa7b 100644
--- a/src/lib/gmp_wrap.c
+++ b/src/lib/gmp_wrap.c
@@ -165,7 +165,7 @@ gmp_wrap_gcd(mp_limb_t * rp, mp_limb_t *s1p,
rp[res] = rc;
res++;
}
- if (rp[res - 1] & (1ul << (BIT_CNT - 1))) {
+ if (rp[res - 1] & (1ull << (BIT_CNT - 1))) {
rp[res] = 0;
res++;
}
On Windows, 1ul (unsigned long) is 4 bytes instead of 8.
So changing to 1ull fixes this.
Actually there is compiler warning on this line on Windows:
../../../fricas/src/lib/gmp_wrap.c: In function 'gmp_wrap_gcd':
../../../fricas/src/lib/gmp_wrap.c:168:28: warning: left shift count >=
width of type [-Wshift-count-overflow]
168 | if (rp[res - 1] & (1ul << (BIT_CNT - 1))) {
| ^~
- Qian