From: XXguille AT XXiies DOT XXes (Guillermo Rodriguez Garcia) Newsgroups: comp.os.msdos.djgpp Subject: Re: Portability and size_t type related question Date: Thu, 13 May 1999 22:28:09 GMT Organization: Telefonica Transmision de Datos Lines: 43 Message-ID: <373d50d7.7978822@noticias.iies.es> References: NNTP-Posting-Host: iies249.iies.es Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Newsreader: Forte Agent 1.5/32.451 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com El día Thu, 13 May 1999 16:18:56 +0300 (IDT), Eli Zaretskii escribió: >> >> Like 'char' is always 1 byte. >> > >> >That's not true, either. There are compilers (mostly for embedded >> >systems) where `char' is 32-bit wide. >> >> Then a byte is defined as 32 bits on those systems. > >AFAIK, there's no such thing as a `byte' in the C language description. Yes, there is. Just read what I quoted here from the ANSI C standard rationale. >So defining a byte as 32 bits doesn't help for the issue at hand which >had to do with portability of C programs. According to the ANSI standard, a char is always 1 byte wide, whatever the size of one byte is. >Most people think that byte is a synonym for 8 bits. Then, they're wrong :-) >> The >> exact definition of byte, for every system, is the minimum addressable >> memory unit. > >I'm not against this definition, but I'm not sure it's true. A compiler >for embedded system could disallow 8-bit bytes because that would produce >inefficient code, not because individual bytes aren't addressable. Then that compiler is not conforming to the ANSI standard. You know, I'm not making this up myself :-) It is all covered in the standard and in the rationale... Regards, GUILLE ---- Guillermo Rodriguez Garcia XXguille AT XXiies DOT XXes (ya sabes :-)