Nelson H. F. Beebe wrote in
<CMM.0.95.0.1589588129.beebe(a)gamma.math.utah.edu>:
|Discussions today on the TUHS list about the signed/unsigned nature of
|the C char type led me to reexamine logs of my feature test package at
|
|
http://www.math.utah.edu/pub/features/
|
|I had 170 build logs for it from 2017.11.07, so I moved those aside
|and ran another set of builds in our current enlarged test farm. That
|generated another 361 fresh builds. Those tests are all with the C
|compiler named "cc". I did not explore what other C compilers did,
|but I strongly suspect that they all agree on any single platform.
|
|On all but THREE systems, the tests report that "char" is signed, with
|CHAR_MAX == +127.
|
|The three outliers have char unsigned with CHAR_MAX == +255, and are
|
| * ARM armv7l Linux 4.13.1 (2017) and 5.6.7 (2020)
| * SGI O2 R10000-SC (150 MHz) IRIX 6.5 (2017 and 2020)
| * IBM POWER8 CentOS Linux release 7.4.1708 (AltArch) (2017)
|
|So, while the ISO C Standards, and historical practice, leave it
|implementation dependent whether char is signed or unsigned, there is
|a strong majority for a signed type.
Just to note Linus Torvalds "famous" "It better had been unsigned,
Virginia".
--steffen
|
|Der Kragenbaer, The moon bear,
|der holt sich munter he cheerfully and one by one
|einen nach dem anderen runter wa.ks himself off
|(By Robert Gernhardt)