Newsgroups: comp.lang.c
Path: utzoo!henry
From: henry@zoo.toronto.edu (Henry Spencer)
Subject: Re: What breaks? (was Re: 64 bit longs?)
Message-ID: <1991Jan18.044948.27943@zoo.toronto.edu>
Organization: U of Toronto Zoology
References: <54379@eerie.acsu.Buffalo.EDU> <1991Jan15.053356.2631@zoo.toronto.edu> <1991Jan15.202123.14223@gjetor.geac.COM> <14890@smoke.brl.mil>
Date: Fri, 18 Jan 1991 04:49:48 GMT

In article <14890@smoke.brl.mil> gwyn@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@zoo.toronto.edu   utzoo!henry
