What breaks? (was Re: 64 bit longs?)
Henry Spencer
henry at zoo.toronto.edu
Fri Jan 18 15:49:48 AEST 1991
In article <14890 at smoke.brl.mil> gwyn at smoke.brl.mil (Doug Gwyn) writes:
>There is no portable way to declare any integral type constrained to use
>precisely 32 bits in its representation. However, "long" portably declares
>one that has AT LEAST 32 bits in its representation (or, you could express
>this in terms of the guaranteed range of representable values). net32_t
>is hopeless for the first case and unnecessary for the second.
Uh, Doug, please don't confuse the two slightly different threads of
discussion here. You're thinking of int32 ("I want a way to ask for ints
of at least 32 bits"), not net32_t ("I'll adjust the definition of this
typedef so it gives me exactly 32 bits").
There is no portable way to declare a type with *exactly* 32 bits, and
a TCP/IP sequence number (for example) is exactly 32, no more. Life with
64-bit longs would be a whole lot easier if the authors of certain kernel
networking software -- for example -- had consistently used a net32_t
typedef rather than int and long.
--
If the Space Shuttle was the answer, | Henry Spencer at U of Toronto Zoology
what was the question? | henry at zoo.toronto.edu utzoo!henry
More information about the Comp.lang.c
mailing list