Subject: Re: tcl 7.4 and tk 4.0 test suite errors
To: None <current-users@NetBSD.ORG>
From: der Mouse <mouse@Collatz.McRCIM.McGill.EDU>
List: current-users
Date: 08/09/1995 15:06:35
>> Thats an easy fix:
>> ! sprintf(interp->result, "%ld", (int)statBuf.st_size);
> Please, try
> ! sprintf(interp->result, "%ld", (long)statBuf.st_size);
> instead. "int" is not "long".
True. Of course, you may be even better off - for NetBSD - to use
sprintf(interp->result, "%qd", statBuf.stsize);
Or, if you want portability, in the NetBSD system-specific section put
something like
#define SIGNED_LONGEST_FMT "%qd"
#define SIGNED_LONGEST_CAST (quad_t)
and then write
sprintf(interp->result, SIGNED_LONGEST_FMT, SIGNED_LONGEST_CAST statBuf.stsize);
It's unfortunate, really, that you have to do this sort of stuff; used
to be you could count on "long" being the biggest size available. But
I don't see any good way around it....
der Mouse
mouse@collatz.mcrcim.mcgill.edu