Subject: Re: [PATCH 2/9] xdiff: make xrecord_t.ptr a uint8_t instead of char

From: Junio C Hamano <[email-masked]>
Date: Tue, 21 Oct 2025 11:15:25 -0700

Phillip Wood <[email-masked]> writes:

> It C "char" never refers to a unicode code point so I don't follow the 
> reasoning here. Isn't the reason you want to change from "char" to 
> "uint8_t" to match rust? Given "char" and "uint8_t" are the same width 
> why can't we use "char" in the C struct and "u8" in the rust struct as 
> the two structs would still have the same layout?

And forcing u8 makes sure both sides of the ffi agrees on the
signedness (C "char"'s signedness is implementation defined),
which is a good thing.

I 100% agree that being honest about the motivation to sell this
change would be a good thing to do here.  I do not think "in this
series, I want to match the types used at the interface to be of
Rust's" is a position to be ashamed of ;-)

> I agree with Patrick's comments on this patch - it would be nice to know 
> how you decided where to add casts. Given that rust is going to be 
> optional for at least a year we should take care to leave the C code in 
> good shape with a minimum number of casts.

Thanks.