Message-ID: From: "Jonathan & Shandra Wiebe" To: XXguille AT XXiies DOT XXes (Guillermo Rodriguez Garcia), djgpp AT delorie DOT com Date: Thu, 13 May 1999 19:45:16 -0800 MIME-Version: 1.0 Content-type: text/plain; charset=ISO-8859-1 Subject: Re: Portability and size_t type related question In-reply-to: <373db8ea.1455063@noticias.iies.es> X-Editor: Vim 5.3 X-mailer: Pegasus Mail for Windows (v3.01b) Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from Quoted-printable to 8bit by delorie.com id WAA00936 Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk -----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 <>< 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-----