Style guides and portability
Stephen J Bevan
bevan at cs.man.ac.uk
Sat Jan 12 23:09:20 AEST 1991
> No, any C compiler worth using (and certainly any that conforms to the
> standard) will provide at least 16 bits for an int, at least 32 bits
> for a long, and at least 8 bits for a char. While there are uses for
> user-defined primitive data types (for example, I use "bool" and
> (generic object) "pointer" types), I don't think that int16, int32, etc.
> are justifiable.
What about the cases where it is a requirement that a particular int
MUST be able to hold 32 bit numbers. If you transfer this to a 16 bit
int system, your software is going to die horribly.
The only way I know around this is to define types like int32 and a
lot of macros/functions that go along with them. For example,
int32plus, int32divide, ... etc.
Does anybody have a better solution ?
Stephen J. Bevan bevan at cs.man.ac.uk
More information about the Comp.lang.c
mailing list