🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #1973

Re: question about an array of enum

#1973
From: Chuck.Phillips
Date: Mon, 12 Nov 1990 09:35
28 lines
1998 bytes
>>>>> 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
Technical Details
Message-ID: <CHUCK.PHILLIPS.90Nov12093520@halley.FtCollins.NCR.COM>
Path: arc1-ca.pugleaf.net!utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!uunet!ncrlnk!ncr-mpd!Chuck.Phillips
References: <it1.657622430@ra> <9130019@hpavla.AVO.HP.COM> <MCDANIEL.90Nov6114504@dolphin.adi.com> <1990Nov06.200927.28712@dirtydog.ima.isc.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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: <CHUCK.PHILLIPS.90Nov12093520@halley.FtCollins.NCR.COM>
Date: 12 Nov 90 09:35:20 GMT
References: <it1.657622430@ra> <9130019@hpavla.AVO.HP.COM>
 <MCDANIEL.90Nov6114504@dolphin.adi.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