Path: utzoo!attcan!uunet!portal!cup.portal.com!thad
From: thad@cup.portal.com
Newsgroups: comp.lang.c
Subject: Re: Absolute size of 'short'
Message-ID: <8186@cup.portal.com>
Date: 16 Aug 88 10:42:22 GMT
References: <214@ISIDAPS5.UUCP> <9641@dartvax.Dartmouth.EDU> <62505@sun.uuc
Organization: The Portal System (TM)
Lines: 31
XPortal-User-Id: 1.1001.2826

Interesting this subject is coming up!  I implemented the following in one C
compiler to assure compatibility with existing assembler structures, and it
has been a lifesaver:

       bit[:n]  name;

which defaults to a one-bit-wide

Some examples:

      bit    DiskBitmap[_SECTORS];

      bit:2  foo;

Makes for extrememly readable AND maintainable code.

There are situations where storage compaction is of far greater importance
than the access time (e.g. in one of my DBMS products).

Constructs such as the following do NOT function "properly" with most compilers:

     struct OneBitElement {
          int  foo : 1;
     };

     struct MyDataBlock {
          int  bar;
          struct OneBitElement bletch[32];
     };

I cannot believe I'm the only one with this requirement.  Sheesh.