Mail Archives: djgpp/1999/05/14/11:50:27
El día Thu, 13 May 1999 16:18:56 +0300 (IDT), Eli Zaretskii
<eliz AT is DOT elta DOT co DOT il> 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 :-)
- Raw text -