question about an array of enum

Karl Heuer karl at ima.isc.com
Wed Nov 7 07:09:27 AEST 1990


In article <MCDANIEL.90Nov6114504 at dolphin.adi.com> mcdaniel at adi.com (Tim McDaniel) writes:
>[So, the array-of-enum might use up an int per slot.  Who cares?]

In particular, in the case of emulating a bit array, the distinction between
8-bit chars and 32-bit ints is less than that between chars and bits in the
first place.  If a 32-bit int is too wasteful, then so is an 8-bit char.

>> Then, some day if the language supports [arrays of bits], you will
>> be able to upgrade painlessly.
>
>Can't happen.  "sizeof (char) == 1" is now fixed in the language, as
>is the fact that it yields an integral type.

What this really implies is that, if bit arrays are ever supported, they won't
fit cleanly into the existing language and hence will probably not support all
the same features as "normal" arrays.

Karl W. Z. Heuer (karl at ima.isc.com or uunet!ima!karl), The Walking Lint



More information about the Comp.std.c mailing list