Subject: Re: How to get arbitrary time in shell script?
To: NetBSD User's Discussion List <netbsd-users@NetBSD.ORG>
From: Greg A. Woods <woods@weird.com>
List: netbsd-users
Date: 11/29/2001 16:07:59
[ On Thursday, November 29, 2001 at 12:46:03 (-0500), Greg A. Woods wrote: ]
> Subject: Re: How to get arbitrary time in shell script?
>
> That '10' should be something a bit bigger, such as maybe even 22 or 23,
> which should then accomodate signed 64-bit integers too (the value
> should probably be less than 23 unless TEMPSIZE is changed from its
> current value of 24).  Changing that '10' to '23' does indeed seem to
> fix the problem, at least on a 32-bit machine:
> 
> 	$ obj/sh -c 'echo $((1 << 31))'
> 	-2147483648
> 	$ ksh -c 'echo $((1 << 31))'    
> 	-2147483648
> 
> I guess I should send-pr that fix!  ;-)

Drat -- I should have looked at my mirror of the -current sources
instead of the release (I normally do the latter when reading
netbsd-users).  It's already been fixed (2001/09/19 in -current), and a
pullup to the releases was submitted but apparently hasn't happened yet.
See PR#13943.

(The fix applied will cause the compile to break if sizeof(int)==8
though, whereas using 23 instead would have given more life to the code :-)

-- 
							Greg A. Woods

+1 416 218-0098      VE3TCP      <gwoods@acm.org>     <woods@robohack.ca>
Planix, Inc. <woods@planix.com>;   Secrets of the Weird <woods@weird.com>