#3295 Error results from assignment of hex value to scale variable

obsolete: 8.4.11

In MS Windows NT 5.1 using Tcl/Tk 8.4.11 an error
results when a hexadecimal value is assigned to a scale
variable. The error message is: "can't assign
non-numeric value to scale variable".
To reproduce:

scale .s -variable foo
set foo 0xff

If the second line is replaced by:

set foo 255

no error results. I think that this is a bug in the MS
Windows code since it is not only correct on my
understanding of Tcl but works under Linux. Although I
have thus far encountered the bug only using Tk, it
appears to be a Tcl bug since whether a value is
treated as numeric or not is a Tcl issue.


  • Jeffrey Hobbs

    Jeffrey Hobbs - 2005-11-14
    • priority: 5 --> 6
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2005-11-14
    • assigned_to: hobbs --> kennykb
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2005-11-14

    Logged In: YES

    This is indeed actually a Tcl "bug", though only in 8.4, not
    in 8.5 (which changed various numeric handling).
    ScaleVarProc is calling Tcl_GetDoubleFromObj on that var,
    and it fails for 0xff. I would think that should work,
    being a valid strtod value, but it fails. Passing to Kevin.

  • Kevin B KENNY

    Kevin B KENNY - 2006-09-01
    • status: open --> pending-wont-fix
  • Kevin B KENNY

    Kevin B KENNY - 2006-09-01

    Logged In: YES

    What we're dealing with here is C89-C9x differences
    in 'strtod' - prior to C9x, there was no standard
    hexadecimal notation for floating point, and Microsoft's
    'strtod' does not accept hex.

    Tcl's Tcl_GetDoubleFromObj in 8.5 doesn't depend on
    the C library 'strtod' - we have our own scanner that
    also avoids a number of other issues in 'strtod' (for
    instance, the fact that Microsoft's does not do
    gradual underflow and is often off by several units
    in the least significant place). The changes for this
    are tied up in the changes for arbitrary-precision
    integers, and are not going to backport gracefully,
    so I'm going to close this as "Won't Fix" in 8.4 and
    fixed in 8.5.

  • SourceForge Robot

    • status: pending-wont-fix --> closed-wont-fix
  • SourceForge Robot

    Logged In: YES

    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).


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks