64 bit architectures and C/C++

CADSI cadsi at ccad.uiowa.edu
Thu May 2 15:35:51 AEST 1991


>From article <1991May01.172042.5214 at buster.stafford.tx.us>, by rli at buster.stafford.tx.us (Buster Irby):
> turk at Apple.COM (Ken "Turk" Turkowski) writes:
> 
>>It is necessary to have 8, 16, and 32-bit data types, in order to be able
>>to read data from files.  I would suggest NOT specifying a size for the int
>>data type; this is supposed to be the most efficient integral data type
>>for a particular machine and compiler.
> 
> You assume a lot about the data in the file.  Is it stored in a specific
> processor format (ala Intel vs Motorolla)?  My experience has been that
> binary data is not portable anyway.

Binary isn't in general portable.  However, using proper typedefs in
a class one can move binary read/write classes from box to box.  I think
the solution the the whole issue of sizeof(whatever) is to simply assume
nothing.  Always typedef.  It isn't that difficult, and code I've done this
runs on things ranging from DOS machines to CRAY's COS (and UNICOS) without
code (barring the typedef header files) changes.

|----------------------------------------------------------------------------|
|Tom Hite					|  The views expressed by me |
|Manager, Product development			|  are mine, not necessarily |
|CADSI (Computer Aided Design Software Inc.	|  the views of CADSI.       |
|----------------------------------------------------------------------------|



More information about the Comp.lang.c mailing list