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/27/1996 11:11:26
>> This is, unfortunately, a limitation of The Way The World Works;
>> either we bite the bullet, make long the 64 bit type, and watch code
>> break or be slow on the 32 bit platforms, or we *cannot* offer a
>> conforming C implementation,
> in what way is our C implimentation not conforming ?

I ask this too.  (Aside from not diagnosing the syntax error in long
long declarations, of course - which can be fixed with appropriate
compiler flags.)  I don't think the standard says anything at all about
the existence (or nonexistence) of types longer than longs.

>> (Although I'd like to see Tcl work with our offsets, as long as no
>> standard format string can be used, it's Our Own Damn Fault (TM).)
> it is not _our_ fault.  it is inherent in the way that printf()
> is/was designed.

Yes and no.  Tcl should not be assuming off_t is long; it should be
casting it in the printf call, and (if there is any such) fixing the
scanf call to scan into an explicitly-long temporary and then assigning
it.  After all, off_t might be _shorter_ than a long, too.

But of course even if Tcl did that, it would break at 2GB or 4GB,
depending, and that _is_ our fault - if we insist on keeping the
longest standard type - long - at 32 bits, we have to expect things to
start breaking at the limits of that type.

> i think you'll find that more and more os's go to >32 bit off_t's and
> will lose with his bit of (broken) code.  tcl should be `fixed', not
> our system modified to be broken.

The "more and more [OSes]" will, I think, go to >32-bit off_t, but I
think you'll find they'll do it by making long longer, rather than
taking the way we have and making off_t longer than long.

One can hardly it "fixing" Tcl when one has to change it to use a
format string that doesn't exist in Standard C.  Tcl needs to be fixed,
as I explained above, but so does NetBSD.

Basically, as long as we require a non-standard format string to print
the full range of an off_t, we are going to have to accept that a lot
of code, a lot of code that really isn't broken, is not going to be
able to handle the full range of an off_t.

					der Mouse

			    mouse@collatz.mcrcim.mcgill.edu