You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
c_import lays out C's long as 64 bits on Windows: the C type aliases are hardcoded to arm64 macOS #2176
§16.1 (c_import maps C types to the target's C types); found writing the C-model brief (2026-10-05).
src/CImport.w:710-722 emits the C type aliases once, for every target, under the comment "arm64 macOS: char=signed, int=32, long=64, short=16":
type c_char = i8
type c_long = i64
type c_ulong = u64
type c_longdouble = f64
On Windows long is 32 bits (LLP64), on wasm32 too, and on Linux aarch64 char is unsigned. Repro (installed compiler from main 0ade380, and the Windows build of the same tree):
use c_import("struct S { long a; long b; };\nstatic inline unsigned long s_size(void) { return sizeof(struct S); }\n")
print(f"with {sizeof[S]()} c {s_size()}")
macOS: with 16 c 16
Windows x86_64: with 16 c 8. With and C disagree on the struct's layout; every field after a long is at the wrong offset, silently.
The migrated corpora inherit it: every defs.w (zlib, pcre2, tommyds, c-algorithms) declares pub type c_long = i64 / pub type c_ulong = u64, so on Windows zlib's uLong is 64 bits where C zlib's is 32.
Expected: the aliases are the target's C types (TargetSpec / TypeLayout already know the data model), and no type c_* alias is emitted into a corpus at all: they are the target's, not the migrating host's.
A related symptom on every host: a program that writes c_ulong with no import fails with "'c_ulong' requires an explicit import (§18.1); add: use std.re.defs.c_ulong". The only declarations of the name are the bundles' Darwin-sized ones.
Activity
c_import: the C type aliases are the parsed target's (#2176)
c_import facade over an omitted function (#2244); unsafe calls in gen…
ehartford commentedon Oct 7, 2026
Merged in db013d9 (PR #2247), battery green on 4bd97c6.
Link on any Linux layout: host libraries from the loader, runtime bes…
Phase 4: BTreeMap and BTreeSet over the M*LIB B+tree (D151); D152; D1…
linux seed legs: char pointers are c_char, va_list never decays, the …
Windows battery fixes; the root module keeps its spelling (#2788, #809,