Repository navigation
c_char is a type of its own on every target (D207, #3375) - #3430
Merged
Merged
Conversation
…ith the target's char signedness, never an alias of i8 or u8. A pointer, slice or collection of c_char is never one of i8 or u8. Without as, a c_char widens into a wider signed type and nothing else; a value conversion to or from u8 or i8, a narrowing into c_char, and arithmetic, ordering or equality beside a u8, an i8 or a wider unsigned integer are refused with the spelling; an integer literal is a c_char from 0 to 127. The same program is accepted or refused on every target. rt/wasm.w converts its 44 byte pointers at the c_char seams. ABI v14: stored bundles are rebuilt once, their interfaces spelling c_char (#3375)
This was referenced Nov 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #3375. Implements §16.1 as blessed 2026-11-18 (spec v7.59, D207).
The type.
c_charis one byte with the target'scharsignedness and is neveri8oru8; a pointer, slice or collection of it is never one of theirs. The #3375 defect (a resource over*mut c_charreceiving everyunsigned char *parameter on linux-aarch64 and none elsewhere) cannot occur: the types differ everywhere.Without
as: ac_charwidens intoi16,i32,i64,isize; a literal 0 to 127 and an ASCII character literal arec_chars; twoc_chars compute and compare.Refused, with the spelling, the same on every target: a value conversion to or from
u8/i8; a narrowing intoc_char; widening into an unsigned type; a literal outside 0 to 127; arithmetic, ordering or equality beside au8, ani8or a wider unsigned integer; a pointer or collection used as one ofi8/u8.Tree changes the rules required: 44 pointer conversions in
rt/wasm.w(the one runtime file only an unsigned-chartarget compiles) and one comparison in a test's embedded driver (behav_migrate_va_list). No example, UAT scenario or corpus changed.Clone,Debug,Displayforc_char.ABI v14. No layout or passing rule changes; the version moves so every stored bundle is rebuilt once and its interface spells
c_char.Tests:
behav_3375_c_char_own_typeand 14err_3375_c_char_*; all 13 refusals probed are identical on darwin and--target aarch64-linux-gnu.Battery green on the branch tip;
:release-checksgreen.