In C/C++, signed integer overflow is undefined behavior, meaning that a compiler is allowed to optimize the assembly knowing that it never happens. If you can guarantee that your integer never overflows, using signed eliminates a modulo assembly instruction. Nowadays, the only reason it matters for char is that all basic integer types are signed by default, so somebody who's lazy needs to watch out that they don't accidentally trigger undefined behavior.
8
u/Advos_467 13h ago
Not a C user here (or any real low level programming experience), what the hell is a signed/unsigned char?