64-bit bugs in new ovdb

Russ Allbery rra at stanford.edu
Thu Oct 5 23:35:51 UTC 2000


Forrest J Cavalier <mibsoft at epix.net> writes:

> INN 2.2 -> 2.3 broke ALL installations, not just 64 bit systems.

Point.  I was really hoping not to have to do another overview flag day
like that for a while, though.

> This has to be fixed eventually.

I'd be in favor of that, definitely.

> Russ, you are more up on C99 than many of us.

> Is there a way to guarantee an integer type with sizeof() == 4?

Yup.  uint32_t.  The MD5 code already uses it for this purpose, and
autoconf handles making sure it exists.

> In C99, what does int_least32_t really mean?

Essentially the same thing as "long" with a minor twist.

The idea behind the least* types is that they're the smallest available
integer type with at least that many bits.  int_least32_t seems completely
pointless to me; I don't know why anyone would use it over int32_t.
(Well, from a standards perspective, all implementations are required to
provide int_least32_t but are only required to provide int32_t if they
have a type that's exactly 4 bytes, so using int_least32_t is arguably
more portable if you don't need the guarantee of an exact size, but I
don't expect to ever see an implementation that doesn't provide a 4-byte
type for so long as we have so many protocols like IPv4 that requires
4-byte data types.)

> Does it mean that 2^32-1 + 1 == 0, or does sizeof(int_least32_t) == 4.

Nope, you want uint32_t for both of those.

-- 
Russ Allbery (rra at stanford.edu)             <http://www.eyrie.org/~eagle/>



More information about the inn-workers mailing list