From: SourceForge.net <no...@so...> - 2006-07-30 16:51:39
|
Bugs item #1527169, was opened at 2006-07-23 00:38 Message generated for change (Settings changed) made by kennykb You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=1527169&group_id=10894 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: 23. [scan] Group: development: 8.5a5 >Status: Pending >Resolution: Wont Fix Priority: 5 Submitted By: Don Porter (dgp) Assigned to: Kevin B KENNY (kennykb) Summary: [scan] incompatibility Initial Comment: On 64-bit system: % info patch 8.4.14 % scan 0xfffff550 %x -2736 % info patch 8.5a5 % scan 0xfffff550 %x 4294964560 TIP 237 doesn't appear to call for this change. A bug? ---------------------------------------------------------------------- >Comment By: Kevin B KENNY (kennykb) Date: 2006-07-30 12:51 Message: Logged In: YES user_id=99768 Alas, Tcl has had a great many inconsistencies over time with the way that integers larger than the precision of the machine are handled, and the way that differences among machines are handled. Moving forward, we've taken the approach in 8.5 that Tcl's integers are of arbitrary precision, and provided %llx, %llo, %llu and %lld format groups that work the same on all platforms. We've also adopted the idea that %x, %o, %u and %d are the width of a native 'long int' or 'long unsigned int' - whatever that is on the platform - and that %lx, %lo, %lu, and %ld are the width of a 'long long' (or __int64 in the Microsoft compilers) or 'unsigned long long' (unsigned __int64). This does indeed introduce a handful of incompatibilities, but it also fixes a number of insidious bugs, of which the ones mentioned in TIP #237 are representative. To constrain an integer to 'signed 32-bit', irrespective of the platform's integer width or the input format, the easiest thing at present is to combine the bit weights yourself: expr {($x & 0x7fffffff) - ($x & 0x80000000)} This expression will give the value of the least significant 32 bits of any integer, interpreted as a signed (twos-complement) 32-bit quantity. ---------------------------------------------------------------------- Comment By: Don Porter (dgp) Date: 2006-07-23 01:00 Message: Logged In: YES user_id=80530 I know the revised docs declare the new behavior is correct, but don't trust them; they were written by the same fellow who wrote the new code. :) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=1527169&group_id=10894 |