Subject: Re: C Language Standard(s)
To: Christoph Badura <bad@flatlin.ka.sub.org>
From: None <Chris_G_Demetriou@NIAGARA.NECTAR.CS.CMU.EDU>
List: current-users
Date: 12/29/1995 16:03:37
Christoph Badura wrote:
> Scott Reynolds wrote:
> >It's my understanding that one should only code intNN_t types when one 
> >needs _exactly_ NN bits, and a more generic type (e.g. quad_t) when 
> >needing one that is _at least_ some number of bits.  The only times that 
> >I see a need for the intNN_t types are in pieces of code that deal 
> >with standards (networking, most notably) and hardware drivers.  Of 
> >course, it's very important in those instances.
> 
> I second that.

You both are missing an important use of fixed-bit-width types:

On-disk data structures.


It's the same problem as with 'networking' actually: how do you get
potentially different processors, etc., to be able to share the same
data?  "You have to nail its size and format down in stone."

Unless i'm mistaken, that's why the DB code uses fixed-size data
types.  One should be able to move a DB database from an i386 to an
m68k, or from an m68k to an alpha; the datatypes used in the DB
encoding are fixed-sized, and the endianness is encoded in the DB
headers (if i recall properly)...  One only has to make sure that
one's applications are reasonable.



chris