Stream: general

Topic: libc: why does the signedness of c_char matter?


Lokathor (Dec 22 2019 at 19:36, on Zulip):

When checking bugs for libc I found this issue: https://github.com/rust-lang/libc/issues/1284
Where @gnzlbg states that you should have the correct signedness for c_char (i8 vs u8). Don't c_char values only have meaning in the 0 to 127 range anyway? So why does the sign matter?

(people besides gnzlbg can also answer, i'm just pinging them since they made the statement; Also I didn't want to clog up the issue tracker with what is probably just a beginner's question)

Charles Lew (Dec 23 2019 at 05:13, on Zulip):

value outside 0..=127 are meaningful too, it's only that they're subject to locale and mbcs mechanisms, and their meaning changes according to the current runtime setting.

gnzlbg (Dec 23 2019 at 09:22, on Zulip):

I'm pretty much offline after the holidays, but I've tried to write a more expanded answer on the github issue

gnzlbg (Dec 23 2019 at 09:22, on Zulip):

@Lokathor it would be simpler to just discuss that there

gnzlbg (Dec 23 2019 at 09:22, on Zulip):

but it might take me a couple of days to answer

Lokathor (Dec 23 2019 at 14:48, on Zulip):

Well you could ping me in an answer there if you like. Or here. Either way, but people often seem to get grumpy about github issues filling up with "offtopic" questions.

But yeah, take your time, very busy part of the year for most people.

Last update: Jan 21 2020 at 08:20UTC