Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2001-04-05
08:11 • Ticket [402663ffff] Fix for bug 124600 status still Closed with 3 other chan... artifact: 70b517d3b6 user: dgp
2000-12-12
00:22 • Ticket [402663ffff]: 4 changes artifact: aae16356e8 user: kennykb
2000-12-11
10:45 • Ticket [402663ffff]: 6 changes artifact: d8c3d859cb user: dgp
2000-12-10
10:03 • Closed ticket [402663ffff]. artifact: 3417bc00f8 user: hobbs
2000-12-07
02:01 • Ticket [402663ffff]: 4 changes artifact: e2c946d7ea user: kennykb
2000-12-06
22:48 • Ticket [402663ffff]: 4 changes artifact: 6b11509df9 user: dgp
22:45 • Ticket [402663ffff]: 4 changes artifact: ed808a44e8 user: kennykb
17:24 • Ticket [402663ffff]: 4 changes artifact: 5395295a3a user: dkf
03:00 • Ticket [402663ffff]: 4 changes artifact: 688709e164 user: kennykb
02:59 • Add attachment None to ticket [402663ffff] artifact: 9297539c4d user: kennykb
2000-12-05
19:59 • New ticket [402663ffff] Fix for bug 124600. artifact: 4ad43fc565 user: kennykb

Fix for bug 124600

Closed402663ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
kennykbplain2000-12-06 03:00:17
Patch adds two test cases for the correct recovery of large integers.

All tests continue to pass with patch applied.
dkfplain2000-12-06 17:24:55
I'd rather build MIN_INT and MAX_INT with the bit shift and bit negation operators, but I suppose that's just a matter of style.  Also stylistically speaking, if the values of MIN_INT and MAX_INT are shared between the tests, surely they should be computed outside the tests, but just in the main body of the file?
kennykbplain2000-12-06 22:45:02
I'd rather build MIN_INT and MAX_INT with bit shift and negation myself, but couldn't find a convenient way to do it.

( 1 << 31 ) for MIN_INT might work, except that it messes up the 64-bit port.

( -1 >> 1 ) might define MAX_INT, except that >> is an arithmetic right-shift and sign extends the damned thing: 
    ( -1 >> 1 ) == -1 !

(I probably ought to work up a TIP for an unsigned shift-right operator, perhaps '>>>'.)

The rules for setting up tests have never been clear to me.  Most of the other Tcl tests are entirely self-contained; in very, very few places is there code in the body of the file, except for cleaning up after failed tests.  If you'd rather hoist the code out, and you understand the implications, by all means go ahead.
dgpplain2000-12-06 22:48:49
I agree with Donal's comments.  See the proc
[largest_int] in tests/string.test for an
example.
kennykbplain2000-12-07 02:01:57
Patch Code - Modified - New Version

OK, the revised patch has an [int_range] procedure analogous to the [largest_int] proc in tests/string.tests, and deletes it after the two tests run.  It also replaces the addition with bit shift and uses bitwise negation to make MAX_INT out of MIN_INT.
hobbsplain2000-12-10 10:03:00
Looks clean, commited 9 Dec 2000 (tested Windows and Solaris).
dgpplain2000-12-11 10:45:15
The tests scan-4.62 and scan-4.63 fail on
RedHat Linux 6.2 on an Alpha XL-300 (64-bit):

% int_range
-9223372036854775808 9223372036854775807
% foreach { MIN_INT MAX_INT } [int_range] {}
% format %o $MAX_INT
integer value too large to represent as non-long integer

A new bug in [format]?  Or just tests that weren't
written carefully enough?
kennykbplain2000-12-12 00:22:08
Don's trouble on a 64-bit Linux is already documented as bug 119223.
It isn't a new regression, just an incomplete 64-bit port.
dgp Ticket [402663ffff]: 3 changes [History diff]2001-04-05 08:11:56
Log in (anonymous is fine) to add a comment.

Attachments: