DragonFly commits List (threaded) for 2005-04
Re: cvs commit: src/lib/libc/string strcasecmp.c
:compatible with either.
:#define CHAR_MAX UCHAR_MAX /* max value for a char */
:#define CHAR_MIN 0 /* min value for a char */
:#define CHAR_MAX SCHAR_MAX /* max value for a char */
:#define CHAR_MIN SCHAR_MIN /* min value for a char */
:So in the default case, Matt is right. But it is a choice we as an
:implementation can make ourselves.
:Jeroen Ruigrok van der Werven <asmodai(at)wxs.nl> / asmodai / kita no mono
Yes and no. In theory you can make char's unsigned, and in fact
they are on some machines (like SGI's, I believe). But the
standard is a throwback for old architectures that can't handle
signed chars, and actually making a char unsigned by default on
a modern machine just creates massive confusion. (keep in mind
that even the venerable 6502 and 8085 had no problem with
It's so confusing that even systems with unsigned char defaults
have compiler options to make them signed by default... which
makes things even MORE confusing. But you see, they didn't
have a choice. People were screaming about their systems being
incompatible because chars were unsigned when everyone else's
chars were signed.
So ... for all intents and purposes, we can assume that char's
are signed, because there is no way they will be anything else
on any architecture we ever port to.