On 10/16/2011 12:32 AM, Chuck Guzis wrote:
On 15 Oct 2011 at 22:51, Eric Smith wrote:
Yes. All C types, except bitfields within a
structure, must have
sizes that are a multiple of the size of the char type.
Wasn't it presumptuous of K&R to assume that the smallest native
datum was a char? At the time the spec was being written, there did
exist bit-addressable machines, so directly-addressed bit arrays were
certainly possible on some hardware.
Not just bit-aligned data: some processors from that same broad era (e.g. iAPX432)
didn't even require that instructions be byte or word aligned.
I think the point folks are missing is that it isn't the processor that defines the
standard data types, but the language.
I used to be more condescending towards the attitude that
the-whole-world-is-a-stream-of-bytes (having worked with many I/O devices and languages
and computers that had far more evolved record concepts) but here i am in 2011 and if I
can coerce anything into a stream of bytes - I've got a lot of tools for working with
that.
Tim.