From: Donald G P. <don...@ni...> - 2025-04-16 19:58:52
|
This question may be fully addressed and answered in some TIP, and if so it's a sufficient answer to point me to it. In Tcl 9, is it true that C type Tcl_WideInt is always the same as C type (long long int) ? Likewise Tcl_WideUInt is always same as (unsigned long long int) ? If it is not true, what are the exceptions and why is it important to continue supporting them? If it is true, what do people think about work for Tcl 9.1 to tear down constructions that suggest otherwise, like conditional compilation on the value TCL_WIDE_INT_TYPE, etc. ? What do people think about including that simplification work also in Tcl 9.0 patch releases? -- | Don Porter Applied and Computational Mathematics Division | | don...@ni... Information Technology Laboratory | | http://math.nist.gov/~DPorter/ NIST | |______________________________________________________________________| |
From: Jan N. <jan...@gm...> - 2025-04-16 20:15:34
|
Op wo 16 apr 2025 om 21:59 schreef Donald G Porter via Tcl-Core: > > > This question may be fully addressed and answered in some TIP, and if > so it's a sufficient answer to point me to it. > In Tcl 9, is it true that C type Tcl_WideInt is always the same as > C type (long long int) ? Likewise Tcl_WideUInt is always same as > (unsigned long long int) ? <https://core.tcl-lang.org/tips/doc/trunk/tip/476.md>: "Whenever possible, typedef Tcl_WideInt to be equal to long long, even on platforms where long has the same size as long long." I would be OK with throwing away TCL_WIDE_INT_TYPE. Changing it would be a binary incompatible changes, and too many internal constructs would break if sizeof(Tcl_WideInt) > sizeof(long long) Hope this helps, Jan Nijtmans |
From: <apn...@ya...> - 2025-04-17 02:54:06
|
Thanks for bringing this up. It has always been a source of confusion for me so I'm all for eliminating it. See my question and Jan's response at https://sourceforge.net/p/tcl/mailman/tcl-core/thread/00c701db4146%24f0ec3650%24d2c4a2f0%24%40yahoo.com/#msg58846548 I am a little hesitant about defining Tcl_WideInt as int64_t (if I understood Donal correctly) rather than long long, in case some platform typedefs int64_t as long. Even though that is more elegant and cleaner in some respect, I suspect it would cause gcc warnings in extensions that are passing Tcl_WideInt to (external functions) that expect long long * (see above thread) or use it with %lld. /Ashok -----Original Message----- From: Donald G Porter via Tcl-Core <tcl...@li...> Sent: Thursday, April 17, 2025 12:55 AM To: Tcl List Core <tcl...@li...> Subject: [TCLCORE] Tcl_WideInt and long long This question may be fully addressed and answered in some TIP, and if so it's a sufficient answer to point me to it. In Tcl 9, is it true that C type Tcl_WideInt is always the same as C type (long long int) ? Likewise Tcl_WideUInt is always same as (unsigned long long int) ? If it is not true, what are the exceptions and why is it important to continue supporting them? If it is true, what do people think about work for Tcl 9.1 to tear down constructions that suggest otherwise, like conditional compilation on the value TCL_WIDE_INT_TYPE, etc. ? What do people think about including that simplification work also in Tcl 9.0 patch releases? -- | Don Porter Applied and Computational Mathematics Division | | don...@ni... Information Technology Laboratory | | http://math.nist.gov/~DPorter/ NIST | |______________________________________________________________________| _______________________________________________ Tcl-Core mailing list Tcl...@li... https://lists.sourceforge.net/lists/listinfo/tcl-core |
From: Jan N. <jan...@gm...> - 2025-04-18 09:40:48
|
Op wo 16 apr 2025 om 21:59 schreef Donald G Porter: > If it is true, what do people think about work for Tcl 9.1 to tear > down constructions that suggest otherwise, like conditional compilation > on the value TCL_WIDE_INT_TYPE, etc. ? What do people think about > including that simplification work also in Tcl 9.0 patch releases? You mean, something like this? <https://core.tcl-lang.org/tcl/info/tclwideint-is-longlong> In my opinion, overriding it using TCL_WIDE_INT_TYPE (where sizeof(TCL_WIDE_INT_TYPE) != sizeof(long long)) creates a binary incompatible version of Tcl. We should not allow it. It is not even documented anywhere (it shouldn't be!). That means, we can safely remove it. Hope this helps, Jan Nijtmans |