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
std.libc spells C strings *const i8; on an unsigned-char target c_char is u8 (§16.1, #2176) #2585
§16.1 / #2176: c_char is the target's alias, u8 on AArch64 Linux and wasm. lib/std/libc.w and lib/std/string.w declare C strings as *const i8 / *mut i8 (strlen(s: *const i8), ...), and lib/std/zip.w, collections.w, build.w carry the spelling. On a signed-char host the two are one type; on AArch64 Linux a *const c_char (what c_import and the migrator now spell, after the fix for the linux-aarch64 seed leg in #2582) does not pass to a *const i8 parameter without a cast, and a c_char value does not store through a *mut i8.
Expected: the standard library spells C's char as c_char in every position, as the spec writes it (*const c_char, 016_ffi.md), so a program compiles the same on both char signednesses.
Found while cutting the linux-aarch64 seed (#2582); the compiler side (src/compiler/ClangBridge.w) is fixed on branch charptr.
This now blocks the linux-aarch64 seed leg (#2582): c-migrator-core-tests check-posix-path-calls migrates realpath(".", resolved) to var result: *mut c_char = realpath(c".".ptr, &resolved[0] as *mut c_char); on AArch64 Linux the unit's c_char is u8 while std.libc's realpath returns *mut i8, and the mismatch surfaces as an ICE in MIR ("use rvalue type is incompatible with assign destination") rather than a Sema diagnostic — a second defect (D65: Sema accepted a *mut i8 value for a *mut u8 binding). The x86_64 and Windows legs are unaffected (signed char). Needs: a target-aware c_char the standard library itself declares and spells its C strings with, and Sema refusing the pointer mismatch.
Ruled (Eric, 2026-10-23), recorded as D155: a migrated corpus never contains a concrete value for a c_* alias (corpora import std's target-resolved aliases; c_long falls out with c_char); c_char is the target's everywhere; c"…" is *const c_char; a pointer to one integer type is not a pointer to another, with the fix-it p as *const c_char, landed last with a fixture per target. Facades written against c_char stay portable without edits. Order: std.libc aliases and C strings → the literal and the runtime's parameters → the migrator emits no type c_*, every corpus re-promoted under ruling:D155 and tested on AArch64 Linux and Windows → the Sema diagnostic → the aarch64 seed leg.
Implemented and merged as f36cf4f (#2596) under rulings D155 and D156: the C aliases are the target's builtins, the migrator spells fixed widths with c_char symbolic and records the data model, the D65 pointer rule is in with its p as *const c_char fix-it, all six corpora re-promoted. Remaining, tracked in handoff.md: the corpus tests on eric-5090/win10, a D155 Darwin seed cut (after which the interim i8 casts in src/ and the fixtures' c"…".ptr as *const i8 casts become c_char), then the linux-aarch64 seed leg (#2582).
Activity
ehartford commentedon Oct 23, 2026
This now blocks the linux-aarch64 seed leg (#2582):
c-migrator-core-testscheck-posix-path-calls migratesrealpath(".", resolved)tovar result: *mut c_char = realpath(c".".ptr, &resolved[0] as *mut c_char); on AArch64 Linux the unit'sc_charis u8 while std.libc'srealpathreturns*mut i8, and the mismatch surfaces as an ICE in MIR ("use rvalue type is incompatible with assign destination") rather than a Sema diagnostic — a second defect (D65: Sema accepted a*mut i8value for a*mut u8binding). The x86_64 and Windows legs are unaffected (signed char). Needs: a target-awarec_charthe standard library itself declares and spells its C strings with, and Sema refusing the pointer mismatch.ehartford commentedon Oct 23, 2026
Ruled (Eric, 2026-10-23), recorded as D155: a migrated corpus never contains a concrete value for a
c_*alias (corpora import std's target-resolved aliases;c_longfalls out withc_char);c_charis the target's everywhere;c"…"is*const c_char; a pointer to one integer type is not a pointer to another, with the fix-itp as *const c_char, landed last with a fixture per target. Facades written againstc_charstay portable without edits. Order: std.libc aliases and C strings → the literal and the runtime's parameters → the migrator emits notype c_*, every corpus re-promoted underruling:D155and tested on AArch64 Linux and Windows → the Sema diagnostic → the aarch64 seed leg.The C aliases are the compiler's builtins, the target's; no import or…
The standard library spells every C string with c_char (D155)
D155/D156: the C aliases are the target's builtins; a corpus is compi…
ehartford commentedon Oct 24, 2026
Implemented and merged as f36cf4f (#2596) under rulings D155 and D156: the C aliases are the target's builtins, the migrator spells fixed widths with
c_charsymbolic and records the data model, the D65 pointer rule is in with itsp as *const c_charfix-it, all six corpora re-promoted. Remaining, tracked in handoff.md: the corpus tests on eric-5090/win10, a D155 Darwin seed cut (after which the interimi8casts in src/ and the fixtures'c"…".ptr as *const i8casts becomec_char), then the linux-aarch64 seed leg (#2582).