bit-field pointers / arrays

Doug Gwyn gwyn at brl-smoke.ARPA
Tue Dec 16 03:09:02 AEST 1986


In article <194 at haddock.UUCP> karl at haddock.ISC.COM.UUCP (Karl Heuer) writes:
-I think that this would be the best initial step.  It would be nice to phase
-out the assumption that sizeof(char)==1, but I think that (for this version of
-the standard) ANSI had better insist on it, though they may want to mark it as
-deprecated.
-
-But before they can remove this assumption, they have to go through all the
-functions that mention (or suggest) "bytes" and decide whether they mean
-"char" or "quantum of sizeof".  For example, malloc() should probably expect
-a bit count (even though it rounds upward for alignment), but what about
-fread()?  If it expects a bit count (which is what one would expect, given
-that its arg type is "size_t"), what happens if you try to fread() one bit?

This work has already been done, in document X3J11/86-136R,
although that document does not consider the bit in a bit-field
as the fundamental storage unit but rather proposes (short char),
which may or may not be a single bit as the implementor chooses.

A presentation of the whole multi-storage-unit character issue
is scheduled for the March 1987 X3J11 meeting.  If you have
points you want considered in this regard, please send them to
me (Gwyn at BRL.MIL), since I'll be making the presentation.



More information about the Comp.lang.c mailing list