[TUHS] v7 K&R C

Warner Losh imp at bsdimp.com
Sat May 16 11:52:01 AEST 2020

On Fri, May 15, 2020 at 6:23 PM Nelson H. F. Beebe <beebe at 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.

arm has been the biggest outlier in terms of unsigned char. In FreeBSD,
this has been the second largest source of bugs with the platform... the
OABI weird alignment requirements being the first (thankfully behind us)...

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20200515/23d3ea56/attachment.htm>

More information about the TUHS mailing list