tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: qsort_r



>>> [...] I don't think it's a good idea to make any assumptions at all
>>> about things the C standard doesn't guarantee.
>> Then there are a lot of things that need fixing; the one I'm most
>> aware of is the assumption that all-bits-0 is a nil pointer.
> Yes.  I think the official stance on that is to worry about it when a
> real platform appears where it matters.

So, rather than start fixing it now, at leisure, a big scramble when it
actually becomes important is preferable?  Well, I suppose it's their
collective neck - or, rather, their project's.

> The one family of cases where this isn't so clear is kernel things
> where in some cases you get zeroed pages that you know are zeroed and
> it's stupid and slow to write more zeros over them unnecessarily.

Also possible in userland, though less commonly.

>> (I've often thought it would be nice to have a checkout compiler
>> that went out of its way to break as many as possible of the usual
>> assumptions that are "true everywhere" but that C does not actually
>> promise....)
> Many people think that, but nobody's really done it, as it's a bit of
> a large project.  Go for it :-)

Heh.  Yeah, perhaps some one of these years I'll find the spare time to
start seriously hacking compilers.

>> I would even hazard a guess that there's code in the tree that
>> assumes int is exactly 32 bits,
> Yeah probably.  It's a big tree and there aren't really adequate
> checking tools for this.

Checkout compiler!  NetBSD/pdp10!  :-)

/~\ The ASCII                             Mouse
\ / Ribbon Campaign
 X  Against HTML                mouse%rodents-montreal.org@localhost
/ \ Email!           7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B


Home | Main Index | Thread Index | Old Index