4 ms·
char on linux arm is unsigned, makes for fun surprises when you only ever dealt with x86 and assumed char to be signed everywhere.
by Asmod4n 9mo ago
char on linux arm is unsigned, makes for fun surprises when you only ever dealt with x86 and assumed char to be signed everywhere.
- pkasting 9mo agoThis bit us in Chromium. We at least discussed forcing the compiler to use unsigned char on all platforms; I don't recall if that actually happened.
- MaskRay 9mo agoI recall that google3 switched to -funsigned-char for x86-64 a long time ago.
- pkasting 9mo agoA cursory Chromium code search does not find anything outside third_party/ forcing either signed or unsigned char. I suspect if I dug into the archives, I'd find a discussion on cxx@ with some comments about how doing this would result in some esoteric risk. If I was still on the Chrome team I'd go looking and see if it made sense to reraise the issue now; I know we had at least one stable branch security bug this caused.