Mail Archives: djgpp/1999/05/13/22:50:41
-----BEGIN PGP SIGNED MESSAGE-----
Verily, on 13 May 99,
A scroll of the prophet Guillermo Rodriguez Garcia arrived,
Saying:
> El día Thu, 13 May 1999 11:12:26 GMT, XXguille AT XXiies DOT XXes (Guillermo
> Rodriguez Garcia) escribió:
>
>
> >>> Like 'char' is always 1 byte.
> >>
>
> Quoting from "Rationale for American National Standard for
> Information Systems - Programming Language - C" (the ANSI C
> rationale is a document which explain and tries to clarify the
> standard itself):
>
> "All objects in C must be representable as a contiguous sequence of
> bytes, each of which is at least 8 bits wide.
>
> A char (or signed char or unsigned char) occupies exactly one byte.
>
> (Thus, for instance, on a machine with 36-bit 'words', a 'byte' can
> be defined to consist of 9, 12, 18 or 36 bits, these numbers being
> all the exact divisors of 36 which are not less than 8.) These
> strictures codify the widespread presumption that any object can be
> treated as an array of characters, the size of which is given by the
> sizeof operator with that object's type as it operand."
>
>
> What I said above is also true: a byte can be any width, depending
> on the system; but for a conforming C implementation, the host
> machine must have at least 8 bits per byte.
>
To back this up, (quoting from _The Dictionary of Standard C_ by Rex
Jaeschke):
char: An integer type keyword. A char is big enough to hold any
character in the target system's character set. Standard C requires
it to be at least eight bits. char expressions traditionally were
widened to int when used in expressions and as arguments to functions.
However, Standard C allows them to be used without widening.
And also,
char, plain: The type char used without either of the modifiers
signed or unsigned. It is implementation-defined as to whether a
plain char is signed or unsigned.
Regards,
Jonathan B. Wiebe
- --
Most people use statistics the way a drunkard uses a lamp post, more
for support than illumination.
Mark Twain
- --
Jonathan B. Wiebe <jbwiebe AT cnx DOT net> <><
Kelowna, BC Cogitor, judicor: ergo sum.
PGP Key [RSA] 1024/400956F5
Key fingerprint: CA 05 F4 5D 89 3F 1F ED C0 5E 7B 18 79 59 7C 90
- --
-----BEGIN PGP SIGNATURE-----
Version: 2.6.3ia
Charset: cp850
iQCVAgUBNzt+An9nZYVACVb1AQGUGAQAxu5a96g/h/WYMTPcdFl2exvKJeD0EOHM
/GeDmOC7rKYsnsjmlfhwTMoN1aGMsaj/nJiiqg9roxAG7Y7Kl9up2nVXLL36MPC7
BerVJwVyrLNs664Kjy5pAz84+R8TT9oreYrzOrdVgmwex0/f09vEVqWUu1biZh97
yVTzLbdwslA=
=fsaq
-----END PGP SIGNATURE-----
- Raw text -