OpenSTA/util
Henner Zeller e8218f2db1
Tcl 9 compatibility changes (#414)
* Provide close2proc function to prevent tcl9 from crashing.

Tcl 9 does not test if the close2Proc function pointer is non-null,
but calls it unconditionally:
https://github.com/tcltk/tcl/blob/core-9-0-3/generic/tclIO.c#L384

So we need to provide a non-null function pointer for our code
to not crash with Tcl9.

Use the same implementation as the previous close channel
had.

Signed-off-by: Henner Zeller <h.zeller@acm.org>

* Use non-deprecated trace add variable syntax.

In modern tcl, `trace variable` is now i`trace add variable`,
and `"rw"` should be spelled out as `{read write}`
There were backwards compatible forms in Tcl 8.x but now loudly
complains in Tcl 9

Signed-off-by: Henner Zeller <h.zeller@acm.org>

* Use `Tcl_Size` for all tcl functions returning sizes.

This is the type the Tcl-API provides in its prototypes and
starting from Tcl9 this typedef actually changes from `int` to `long`,
so will no longer compile when passing an `int*`.

So whenever we get a return value of this type, use the
correct typedef to declare the variable. This makes it forward and
backward compatible.

Signed-off-by: Henner Zeller <h.zeller@acm.org>

* Address review comments: compare with `read`/`write` not `r`, `w`

Signed-off-by: Henner Zeller <h.zeller@acm.org>

---------

Signed-off-by: Henner Zeller <h.zeller@acm.org>
2026-04-03 11:02:25 -07:00
..
Debug.cc string squash 2026-03-28 19:13:35 -07:00
DispatchQueue.cc util: Add method to get thread count from dispatch queue (#324) 2025-12-12 15:49:22 -08:00
Error.cc string squash 2026-03-28 19:13:35 -07:00
FlexDisableRegister.hh verilog c++ parser 2025-01-21 18:35:21 -07:00
Fuzzy.cc update copyright 2026-03-10 14:57:45 -07:00
Hash.cc string squash 2026-03-28 19:13:35 -07:00
Machine.cc update copyright 2026-03-10 14:57:45 -07:00
MachineApple.cc update copyright 2025-01-21 18:54:33 -07:00
MachineLinux.cc use std::format squash 2026-03-16 15:01:38 -07:00
MachineUnknown.cc update copyright 2025-01-21 18:54:33 -07:00
MachineWin32.cc update copyright 2025-01-21 18:54:33 -07:00
MinMax.cc string squash 2026-03-28 19:13:35 -07:00
PatternMatch.cc string squash 2026-03-28 19:13:35 -07:00
Report.cc string squash 2026-03-28 19:13:35 -07:00
ReportStd.cc update copyright 2026-03-10 14:57:45 -07:00
ReportTcl.cc Tcl 9 compatibility changes (#414) 2026-04-03 11:02:25 -07:00
RiseFallMinMax.cc update copyright 2026-03-10 14:57:45 -07:00
RiseFallMinMaxDelay.cc update copyright 2026-03-10 14:57:45 -07:00
RiseFallValues.cc update copyright 2026-03-10 14:57:45 -07:00
StaConfig.hh.cmake StaConfig.hh pass HAVE_CXX_STD_FORMAT 2026-03-24 12:22:20 -07:00
Stats.cc use std::format squash 2026-03-16 15:01:38 -07:00
StringUtil.cc string squash 2026-03-28 19:13:35 -07:00
Transition.cc string squash 2026-03-28 19:13:35 -07:00
Util.i string squash 2026-03-28 19:13:35 -07:00
gzstream.hh Fix an undefined behaviour and a memory leak (#289) 2025-09-03 15:12:26 -07:00