Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!uunet!ncrlnk!ncr-mpd!Chuck.Phillips From: Chuck.Phillips@FtCollins.NCR.COM (Chuck.Phillips) Newsgroups: comp.std.c Subject: Re: question about an array of enum Message-ID: Date: 12 Nov 90 09:35:20 GMT References: <9130019@hpavla.AVO.HP.COM> <1990Nov06.200927.28712@dirtydog.ima.isc.com> Sender: news@ncr-mpd.FtCollins.NCR.COM Organization: NCR Microelectronics, Ft. Collins, CO Lines: 28 In-reply-to: karl@ima.isc.com's message of 6 Nov 90 20:09:27 GMT >>>>> On 6 Nov 90 20:09:27 GMT, karl@ima.isc.com (Karl Heuer) said: >> 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. Karl> What this really implies is that, if bit arrays are ever supported, Karl> they won't fit cleanly into the existing language and hence will Karl> probably not support all the same features as "normal" arrays. How about if sizeof() returns the smallest number of bytes that are required to contain a bit array of a given size? This would require no changes to malloc(), etc., to incorporate bit arrays. Most current architectures require alignment to something larger than a char, anyway. Of course, other things would be required to robustly implement bit arrays, (bit pointers, bitsizeof(), etc.) but I don't see that ANSI C has done anything to prevent this. In fact, by avoiding the areas of the language that are now _explicitly_ undefined, one is much less likely to be bit by bit pointers. (Sorry, I couldn't resist. :-) Just my $0.02, -- Chuck Phillips MS440 NCR Microelectronics chuck.phillips%ftcollins.ncr.com 2001 Danfield Ct. Ft. Collins, CO. 80525 ...uunet!ncrlnk!ncr-mpd!bach!chuckp