D-Programming-Language/dmd — pull request #2215 by yebblies (2013-06-19 03:11:09+00:00)
Title: [DDMD] Make char unsigned

C++ has the annoying situation of three char variants - `signed char`, `unsigned char`, and `char`. Obviously `char` is either signed or unsigned, but it gets its own unique mangling anyway.

For the translation, I'm converting `signed char` to `byte`, `unsigned char` to `ubyte`, and `char` to `char`.

For this mapping to be accurate, the C++ `char` needs to be unsigned, which is enabled for gcc and dmc with the switches below.

The compiler currently uses `char` when the sign doesn't matter, and `unsigned char` when it does (eg for unicode stuff). This is problematic in D as string literals do not convert to `const(ubyte)*`, only `const(char)*`.

The plan is to change all strings to `const(char)*` or `char*` inside the compiler, and this is the first step.