#avr | Logs for 2014-09-26

Back
[00:02:02] <Xark> Jartza: Portability. As I mentioned when C was designed it wasn't clear a "char" would be 8 bits etc. How they have int8_t, uint8_t int32_t, uint32_t so it is a solved problem.
[00:02:47] <Xark> Jartza: char is "whatever is best/fastest/normal" for your machine, and you specify signed or unsigned if you have a preference.
[00:03:56] <Xark> Jartza: In hindsight, might have been good to nail down some specifics...but then it would be C/C++ (with loads of wacky legacy stuff).
[00:04:03] <Xark> wouldn't*
[00:08:29] <Jartza> "A char object may be used anywhere an int may be. In all cases the char is converted to an int by propa- gating its sign through the upper 8 bits of the resultant integer. This is consistent with the two’s complement repre- sentation used for both characters and integers. (However, the sign-propagation feature disappears in other imple- mentations.)"
[00:08:36] <Jartza> I guess that's the reason ;)
[00:08:55] <Jartza> from the "C Reference manual" by Dennis Richie
[00:11:51] <Jartza> should've asked Dennis when he visited finland
[00:11:55] <Jartza> now it's a bit late to ask :(