Skip to content

Tcl 9: can't see sta::float_inf inside report_check_types #422

@hzeller

Description

@hzeller

Calling report_check_types when compiled with Tcl 9 results in an issue reading the sta::float_inf variable.

Let's consider the following foo.tcl

cat ~/foo.tcl 
proc hello {} {
  # Accessing vars from within proc
  puts "Tcl patchlevel = $::tcl_patchLevel"
  puts "sta::float_inf = $sta::float_inf"
}

hello
report_check_types

Calling this with a Tcl8-linked sta, we can see that we can access $sta::float_inf as expected within a proc, and calling report_check_types emits some error as expected

cat ~/foo.tcl | build-8/sta -no_splash
Tcl patchlevel = 8.5.19
sta::float_inf = 1.0000000150474662e+30
Error: 1571 No network has been linked.

However, compiled with tcl 9 there is a strange error from within report_check_types as it can't access the variable, while our little hello test proc can see and access it.

$ cat ~/foo.tcl | build-9/sta -no_splash
Tcl patchlevel = 9.0.3
sta::float_inf = 1.0000000150474662e+30
can't read "sta::float_inf": no such variable

Unclear the reason to me right now.
Some different way Tcl 9 handles variables outside the current scope compared to Tcl 8.x ?
Some swig issue (using SWIG Version 4.3.1) ?
proc_redirect confusing Tcl 9 ?
Bug in Tcl 9 ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions