From: Jan N. <jan...@gm...> - 2025-01-07 12:07:28
|
Op di 7 jan 2025 om 12:40 schreef Ashok: > In response to a question on the chat, I’m a bit confused by the > TCL_STUB_MAGIC values in tcl.h. The comment there states the value > distinguishes older (pre-9) version of Tcl. However, it seems to me for > 32-bit versions the values are the same for both Tcl 8 and 9 > (0x..CB+sizeof(void*) ==0x..CF. > > > > So, which of the following is true? > > > > - My math is horribly wrong; always a possibility > > Not true. > > - The comment is wrong > > True, but .... better not change it (see below). > > - There is a bug in the defined values > > Not true On platforms where sizeof(int) == sizeof(long) == sizeof(ptrdiff_t), changing int -> Tcl_Size doesn't actually change anything. On such platforms, extensions built for Tcl 8.6 (Using Tcl_InitStubs(interp, "8.6-") ...) will run fine on Tcl 9.0, even without re-compilation, unless .... a deprecated function is used. For most common extensions (like tdbc::*, Itcl, sqlite3) it just works fine. I think this is a useful 'undocumented feature'. Because of the (unlikely) 'unless' above, and because such platforms are dying anyway, not something we should promote. But for people who know what they are doing, why not! Hope this helps, Jan Nijtmans |