int32 et al. (was: Style guides and portability)

Benson I. Margulies benson at odi.com
Sun Jan 20 05:51:01 AEST 1991


I can't remember the last time I was inclined, even briefly, to
disagree with Doug Gwyn. But here I go.

Some of us use structs to lay our persistent (that is, disk-resident)
storage. The size of the items never changes, as we move from platform
to platform. If we used int for a 32 byte int, we are nailed on the
PCs. If we use long, C++ compilers tend to moan piteously about
passing longs to int parameters, even when they are the same size. The
AIX ANSI C compiler does the same. So we have a typedef which we set
to int on some places, and long on others. If someone ever does turn
up with 64 bit longs, we will pat each other on the back and save
a lot of work.


-- 
Benson I. Margulies



More information about the Comp.lang.c mailing list