Typedefs

COTTRELL, JAMES cottrell at NBS-VMS.ARPA
Wed Oct 16 10:13:22 AEST 1985


/*
> > typedef	long	int60 ;	/* or whatever the type is for 60 bit ints */
> 
> My point is, if more than 32 bits are needed then this code is
> not going to port anyway, no matter what typedefs you use.

You mean not going to port *everywhere*. At least it will say under
*what* conditions it *will* port.
 
> > Likewise, if *your* code uses int8/int16/whatever correctly, specifying the
> > number of bits needed, then there file of typedefs will get them a
> > reasonable type for those variables.
> 
> If you use the proper C data types, there will be no need to worry
> about this at all; the code will work on all standard-conforming
> implementations without any change whatsoever.

Yes it will work. But how well? Some systems (notably BSD) ignore
register short definitions for example. This style allows (& requires
in certain cases) the porter to choose his tradeoffs globally.

> There is no need
> to invent system-specific typedefs for any integer type through 32
> bits, and for longer integer types typedefs are not sufficient.

Man does not do everything out of need. There is no need for floats
either since we have doubles, but the subject occupies space in this 
group often enuf.

You still haven';t addressed my other point. At least the guy gave
some thought to what he did. Would you rather port his code or
someone who doesn't even know the difference?

	jim		cottrell at nbs
*/
------



More information about the Comp.lang.c mailing list