Subject: Re: Tcl7.5 and NetBSD-current
To: None <current-users@NetBSD.ORG>
From: der Mouse <mouse@Collatz.McRCIM.McGill.EDU>
List: current-users
Date: 02/29/1996 10:35:27
> Actually, I can see software breaking if long is smaller than
> (void *), but I can't see how or why it would break if long was
> larger than (void *).
I can. I've seen interfaces abused where a function takes a void *
cookie and some caller shoehorns an integer into that cookie. I think
Xt, the X toolkit, is an example; I'm quite sure it's got grossly
nonportable interfaces littered throughout it; indeed, a few of them
are even visible to its clients. (One reason I don't use Xt.)
Granted, such code is pretty broken, but it "works", in that current
32-bit platforms generally don't show it up. And indeed, we wouldn't
either, provided the integer it's shoehorning into the void * is small
enough to fit in 32 bits.
> And, of course, any such software that isn't the kernel is broken.
Agreed. (I've been trying to think of a user-land example and the
closest I've come up with are a compiler and a debugger, and neither
one quite makes the grade. Of course, anything like SunOS trace(1)
that works with "machine registers" has to be careful to use some
appropriate type for them, but that's not the same as justifying its
breaking if long and void* aren't the same size.)
der Mouse
mouse@collatz.mcrcim.mcgill.edu