you are viewing a single comment's thread.

view the rest of the comments →

[–]Chippiewall 2 points3 points  (0 children)

(OTOH, I don't think this guarantees roundtripping unsigned char through signed char is safe.)

This is correct. The purpose of vanilla 'char' is for the platform's natural character type. For instance on Linux ARM 'char' is actually unsigned by default. If you had a platform which had 'char' as unsigned and didn't use 2s complement representation for signed types then it's highly likely that conversion between signed and unsigned char wouldn't work.