Menu

#3414 format bugs on P4's and AMD64's

closed-invalid
None
5
2006-04-26
2006-04-11
Brian
No

Trying to do some basic calculations with expr and
format is barfing on the first run and working on
subsequent on a P4:
tcl>set prefix 0x03000000
tcl>set mask 0xff000000
tcl>set j [expr $prefix | ~$mask+1]
tcl>set last [format 0x%08x $j]
Error:
tcl>set last [format 0x%08x $j]
tcl>set last [format 0x%08x $j]
tcl>set last [format 0x%08x $j]

This is on an AMD64:
tcl>set prefix 0x03000000
tcl>set mask 0xff000000
tcl>set j [expr $prefix | ~$mask+1]
tcl>set last [format 0x%08x $j]
tcl>puts $last
0xffffffff03000000

This is on a P3
tcl>set prefix 0x03000000
tcl>set mask 0xff000000
tcl>set j [expr $prefix | ~$mask+1]
tcl>set last [format 0x%08x $j]
Error:
tcl>set last [format 0x%08x $j]
tcl>puts $last
0x03000000

This is with default redhat packages.

Discussion

  • Jeffrey Hobbs

    Jeffrey Hobbs - 2006-04-11
    • assigned_to: nobody --> dgp
    • status: open --> pending-invalid
     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2006-04-11

    Logged In: YES
    user_id=72656

    What version of Tcl was this with? I cannot repro the
    problem on AMD64 and P4 using SuSE 9.2 on both, either in
    8.4 or 8.5.

     
  • Brian

    Brian - 2006-04-11

    Logged In: YES
    user_id=1500042

    This is on FC3 with tcl-8.4.7-2

     
  • Brian

    Brian - 2006-04-11
    • status: pending-invalid --> open-invalid
     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2006-04-11

    Logged In: YES
    user_id=72656

    Please retest with the head (8.4.13) or you can grab
    ActiveTcl 8.4.12 at http://www.activestate.com/ for a quick
    test.

     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2006-04-11
    • status: open-invalid --> pending-invalid
     
  • Don Porter

    Don Porter - 2006-04-12

    Logged In: YES
    user_id=80530

    It's a bit difficult to
    follow the original report
    (some pasting errors?), but it
    looks like the issue is whether

    0x03000000

    or

    0xffffffff03000000

    is the correct result of

    [format 0x%08x -4244635648]

    ?

    The answer is that the correct
    result is platform-dependent
    and varies depending on the value
    of ::tcl_platform(wordSize), I think.

    Which result do you want your script
    to produce portably?

     
  • SourceForge Robot

    Logged In: YES
    user_id=1312539

    This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 14 days (the time period specified by
    the administrator of this Tracker).

     
  • SourceForge Robot

    • status: pending-invalid --> closed-invalid
     
MongoDB Logo MongoDB