diff options
| author | dgp <dgp@users.sourceforge.net> | 2025-06-30 20:11:39 (GMT) |
|---|---|---|
| committer | dgp <dgp@users.sourceforge.net> | 2025-06-30 20:11:39 (GMT) |
| commit | cb357cc4bf7d7a878604d015d57f171d246deb1b (patch) | |
| tree | 5a53c93db66b35bf8f99a06b18f71cd14410c734 | |
| parent | e41cc9b99bbef5f32b5c1fbcb56aff29e7753e18 (diff) | |
| parent | 269d6061c3ac140fe9fbc376efc58da0df344b3c (diff) | |
| download | tcl-cb357cc4bf7d7a878604d015d57f171d246deb1b.zip tcl-cb357cc4bf7d7a878604d015d57f171d246deb1b.tar.gz tcl-cb357cc4bf7d7a878604d015d57f171d246deb1b.tar.bz2 | |
merge 9.0
| -rw-r--r-- | changes.md | 4 | ||||
| -rw-r--r-- | doc/ByteArrObj.3 | 2 | ||||
| -rw-r--r-- | doc/CrtAlias.3 | 2 | ||||
| -rw-r--r-- | doc/DictObj.3 | 2 | ||||
| -rw-r--r-- | doc/FileSystem.3 | 2 | ||||
| -rw-r--r-- | doc/Limit.3 | 2 | ||||
| -rw-r--r-- | doc/ListObj.3 | 4 | ||||
| -rw-r--r-- | doc/ParseArgs.3 | 2 | ||||
| -rw-r--r-- | doc/SplitList.3 | 2 | ||||
| -rw-r--r-- | doc/SplitPath.3 | 2 | ||||
| -rw-r--r-- | doc/StringObj.3 | 2 | ||||
| -rw-r--r-- | doc/Tcl_Main.3 | 2 | ||||
| -rw-r--r-- | doc/buildinfo.n | 173 | ||||
| -rw-r--r-- | generic/tcl.decls | 2 | ||||
| -rw-r--r-- | generic/tclDecls.h | 4 | ||||
| -rw-r--r-- | generic/tclInterp.c | 7 | ||||
| -rw-r--r-- | tests/exec.test | 4 |
17 files changed, 198 insertions, 20 deletions
@@ -38,6 +38,10 @@ to the userbase. - [lseq numeric overflow](https://core.tcl-lang.org/tcl/tktview/0ee626) - ["return": broken ordering of nested -options](https://core.tcl-lang.org/tcl/tktview/ecf35c) - [Euro/Tail-sign missing from cp864 encoding](https://core.tcl-lang.org/tcl/tktview/ecafd8) + - [use after free on TSD in Winsock](https://core.tcl-lang.org/tcl/tktview/40b181) + - [use after free on Windows pipe handles](https://core.tcl-lang.org/tcl/tktview/7c2716) + - [tcl::build-info not documented](https://core.tcl-lang.org/tcl/tktview/ef7042) + - [interp limit commands still seems to be 32 bits](https://core.tcl-lang.org/tcl/tktview/9dfae3) # Incompatibilities - [The ActiveCodePage element has been removed from the Windows executable manifest for tclsh](https://core.tcl-lang.org/tips/doc/trunk/tip/716.md) diff --git a/doc/ByteArrObj.3 b/doc/ByteArrObj.3 index 6306591..88c9580 100644 --- a/doc/ByteArrObj.3 +++ b/doc/ByteArrObj.3 @@ -47,7 +47,7 @@ Interpreter to use for error reporting. Points to space where the number of bytes in the array may be written. May be (Tcl_Size *)NULL when not used. If it points to a variable which type is not \fBTcl_Size\fR, a compiler warning will be generated. -If your extensions is compiled with -DTCL_8_API, this function will return +If your extensions is compiled with \fB-DTCL_8_API\fR, this function will return NULL for byte arrays larger than INT_MAX (which should trigger proper error-handling), otherwise expect it to crash. .BE diff --git a/doc/CrtAlias.3 b/doc/CrtAlias.3 index ba2e415..2ddf59e 100644 --- a/doc/CrtAlias.3 +++ b/doc/CrtAlias.3 @@ -87,7 +87,7 @@ for an alias. Pointer to location to store count of additional value arguments to be passed to the alias. The location is in storage owned by the caller. If it points to a variable which type is not \fBTcl_Size\fR, a compiler -warning will be generated. If your extensions is compiled with -DTCL_8_API, +warning will be generated. If your extensions is compiled with \fB-DTCL_8_API\fR, this function will return TCL_ERROR for aliases with more than INT_MAX value arguments, otherwise expect it to crash .AP Tcl_Obj ***objvPtr out diff --git a/doc/DictObj.3 b/doc/DictObj.3 index ec36d6a..0cc2e39 100644 --- a/doc/DictObj.3 +++ b/doc/DictObj.3 @@ -74,7 +74,7 @@ Points to a variable that will have the number of key/value pairs contained within the dictionary placed within it. May be (Tcl_Size *)NULL when not used. If it points to a variable which type is not \fBTcl_Size\fR, a compiler warning will be generated. -If your extensions is compiled with -DTCL_8_API, this function will return +If your extensions is compiled with \fB-DTCL_8_API\fR, this function will return NULL for dictionaries larger than INT_MAX (which should trigger proper error-handling), otherwise expect it to crash. .AP Tcl_DictSearch *searchPtr in/out diff --git a/doc/FileSystem.3 b/doc/FileSystem.3 index 86f96e6..5a50f53 100644 --- a/doc/FileSystem.3 +++ b/doc/FileSystem.3 @@ -278,7 +278,7 @@ permissions will be set on the created file. Filled with the number of elements in the split path. May be (Tcl_Size *)NULL when not used. If it points to a variable which type is not \fBTcl_Size\fR, a compiler warning will be generated. -If your extensions is compiled with -DTCL_8_API, this function will return +If your extensions is compiled with \fB-DTCL_8_API\fR, this function will return NULL for paths having more than INT_MAX elements (which should trigger proper error-handling), otherwise expect it to crash. .AP Tcl_Obj *basePtr in diff --git a/doc/Limit.3 b/doc/Limit.3 index 5eb3ac8..a4005f3 100644 --- a/doc/Limit.3 +++ b/doc/Limit.3 @@ -32,7 +32,7 @@ int .sp \fBTcl_LimitTypeReset\fR(\fIinterp, type\fR) .sp -int +Tcl_Size \fBTcl_LimitGetCommands\fR(\fIinterp\fR) .sp \fBTcl_LimitSetCommands\fR(\fIinterp, commandLimit\fR) diff --git a/doc/ListObj.3 b/doc/ListObj.3 index 6e4d0d5..9fd7091 100644 --- a/doc/ListObj.3 +++ b/doc/ListObj.3 @@ -65,7 +65,7 @@ Points to location where \fBTcl_ListObjGetElements\fR stores the number of element values in \fIlistPtr\fR. May be (Tcl_Size *)NULL when not used. If it points to a variable which type is not \fBTcl_Size\fR, a compiler warning will be generated. -If your extensions is compiled with -DTCL_8_API, this function will return +If your extensions is compiled with \fB\-DTCL_8_API\fR, this function will return NULL for lists with more than INT_MAX elements (which should trigger proper error-handling), otherwise expect it to crash. .AP Tcl_Obj ***objvPtr out @@ -87,7 +87,7 @@ Points to location where \fBTcl_ListObjLength\fR stores the length of the list. May be (Tcl_Size *)NULL when not used. If it points to a variable which type is not \fBTcl_Size\fR, a compiler warning will be generated. -If your extensions is compiled with -DTCL_8_API, this function will return +If your extensions is compiled with \fB-DTCL_8_API\fR, this function will return TCL_ERROR for lists with more than INT_MAX elements (which should trigger proper error-handling), otherwise expect it to crash. .AP Tcl_Size index in diff --git a/doc/ParseArgs.3 b/doc/ParseArgs.3 index 594f4f1..ce61808 100644 --- a/doc/ParseArgs.3 +++ b/doc/ParseArgs.3 @@ -28,7 +28,7 @@ modified to hold number of arguments left in the unprocessed argument list stored in \fIremObjv\fR. May be (Tcl_Size *)NULL when not used. If it points to a variable which type is not \fBTcl_Size\fR, a compiler warning will be generated. -If your extensions is compiled with -DTCL_8_API, this function will return +If your extensions is compiled with \fB-DTCL_8_API\fR, this function will return NULL for argument lists with more than INT_MAX elements (which should trigger proper error-handling), otherwise expect it to crash. .AP "Tcl_Obj *const" *objv in diff --git a/doc/SplitList.3 b/doc/SplitList.3 index d036ace..cc47f03 100644 --- a/doc/SplitList.3 +++ b/doc/SplitList.3 @@ -43,7 +43,7 @@ Pointer to a string with proper list structure. Filled in with number of elements in \fIlist\fR. May be (Tcl_Size *)NULL when not used. If it points to a variable which type is not \fBTcl_Size\fR, a compiler warning will be generated. -If your extensions is compiled with -DTCL_8_API, this function will return +If your extensions is compiled with \fB-DTCL_8_API\fR, this function will return TCL_ERROR for lists with more than INT_MAX elements (which should trigger proper error-handling), otherwise expect it to crash. .AP "const char" ***argvPtr out diff --git a/doc/SplitPath.3 b/doc/SplitPath.3 index 452baff..25e672d 100644 --- a/doc/SplitPath.3 +++ b/doc/SplitPath.3 @@ -30,7 +30,7 @@ File path in a form appropriate for the current platform (see the Filled in with number of path elements in \fIpath\fR. May be (Tcl_Size *)NULL when not used. If it points to a variable which type is not \fBTcl_Size\fR, a compiler warning will be generated. -If your extensions is compiled with -DTCL_8_API, argcPtr will be filled +If your extensions is compiled with \fB-DTCL_8_API\fR, argcPtr will be filled with -1 for paths with more than INT_MAX elements (which should trigger proper error-handling), otherwise expect it to crash. .AP "const char" ***argvPtr out diff --git a/doc/StringObj.3 b/doc/StringObj.3 index f72c6a0..f13924a 100644 --- a/doc/StringObj.3 +++ b/doc/StringObj.3 @@ -124,7 +124,7 @@ The location where \fBTcl_GetStringFromObj\fR will store the length of a value's string representation. May be (Tcl_Size *)NULL when not used. If it points to a variable which type is not \fBTcl_Size\fR, a compiler warning will be generated. -If your extensions is compiled with -DTCL_8_API, this function will +If your extensions is compiled with \fB-DTCL_8_API\fR, this function will panic for strings with more than INT_MAX bytes/characters, otherwise expect it to crash. .AP "const char" *string in diff --git a/doc/Tcl_Main.3 b/doc/Tcl_Main.3 index 6410450..0258294 100644 --- a/doc/Tcl_Main.3 +++ b/doc/Tcl_Main.3 @@ -34,7 +34,7 @@ Tcl_Obj * Number of elements in \fIargv\fR. .AP char *argv[] in Array of strings containing command-line arguments. On Windows, when -using -DUNICODE, the parameter type changes to wchar_t *. +using \fB\-DUNICODE\fR, the parameter type changes to wchar_t *. .AP char *charargv[] in As argv, but does not change type to wchar_t. .AP char *wideargv[] in diff --git a/doc/buildinfo.n b/doc/buildinfo.n new file mode 100644 index 0000000..8822088 --- /dev/null +++ b/doc/buildinfo.n @@ -0,0 +1,173 @@ +'\" +'\" Copyright (c) 2025 Jan Nijtmans. +'\" +'\" See the file "license.terms" for information on usage and redistribution +'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. +'\" +.TH build-info n 9.0 Tcl "Tcl Built-In Commands" +.so man.macros +.BS +'\" Note: do not modify the .SH NAME line immediately below! +.SH NAME +buildinfo \- Build info +.SH SYNOPSIS +\fB::tcl::build-info\fR ?\fIfield\fR? +.BE +.SH DESCRIPTION +.PP +This command provides a way to retrieve information about how Tcl was built. +Without any options, the command returns the Tcl patchlevel, followed +by the '+'-sign, followed by the fossil commit-id followed by a list of +dot-separated tags. If a \fIfield\fR is given, this command extracts that +field as described below. Any other \fIfield\fR value not mentioned +below will always return "0". For official Tcl releases, the \fIfield\fRs are: +.\" METHOD: clang +.TP +\fB::tcl::build-info clang\fR +. +Returns the clang version number (as 4 digits) if Tcl is compiled with clang, 0 otherwise. +.\" METHOD: commit +.TP +\fB::tcl::build-info commit\fR +. +Returns the fossil commit-id where Tcl was built from. +.\" METHOD: compiledebug +.TP +\fB::tcl::build-info compiledebug\fR +. +Returns 1 if Tcl is compiled with \fB\-DTCL_COMPILE_DEBUG\fR, 0 otherwise. +.\" METHOD: compiler +.TP +\fB::tcl::build-info compiler\fR +. +Returns the compiler name (either clang, gcc, icc or msvc), followed by a dash and a (4-digit) version number. +.\" METHOD: compilestats +.TP +\fB::tcl::build-info compilestats\fR +. +Returns 1 if Tcl is compiled with \fB\-DTCL_COMPILE_STATS\fR, 0 otherwise. +.\" METHOD: cplusplus +.TP +\fB::tcl::build-info cplusplus\fR +. +Returns 1 if Tcl is compiled with a C++ compiler, 0 otherwise. +.\" METHOD: debug +.TP +\fB::tcl::build-info debug\fR +. +Returns 1 if Tcl is not compiled with \fB\-DNDEBUG\fR, 0 otherwise. +.\" METHOD: gcc +.TP +\fB::tcl::build-info gcc\fR +. +Returns the gcc version number (as 4 digits) if Tcl is compiled with gcc, 0 otherwise. +.\" METHOD: icc +.TP +\fB::tcl::build-info icc\fR +. +Returns the icc version number (as 4 digits) if Tcl is compiled with icc, 0 otherwise. +.\" METHOD: ilp32 +.TP +\fB::tcl::build-info ilp32\fR +. +Returns 1 if Tcl is compiled such that integers, longs and pointers are all 32-bit, 0 otherwise. +.\" METHOD: memdebug +.TP +\fB::tcl::build-info memdebug\fR +. +Returns 1 if Tcl is compiled with \fB\-DTCL_MEM_DEBUG\fR, 0 otherwise. +.\" METHOD: msvc +.TP +\fB::tcl::build-info msvc\fR +. +Returns the msvc version number (as 4 digits) if Tcl is compiled with msvc, 0 otherwise. +.\" METHOD: nmake +.TP +\fB::tcl::build-info nmake\fR +. +Returns 1 if Tcl is built using nmake, 0 otherwise. +.\" METHOD: no-deprecate +.TP +\fB::tcl::build-info no-deprecate\fR +. +Returns 1 if Tcl is compiled with \fB\-DTCL_NO_DEPRECATED\fR, 0 otherwise. +.\" METHOD: no-thread +.TP +\fB::tcl::build-info no-thread\fR +. +Returns 1 if Tcl is compiled with \fB\-DTCL_THREADS=0\fR, 0 otherwise. +.\" METHOD: no-optimize +.TP +\fB::tcl::build-info no-optimize\fR +. +Returns 1 if Tcl is not compiled with \fB\-DTCL_CFG_OPTIMIZED\fR, 0 otherwise. +.\" METHOD: objective-c +.TP +\fB::tcl::build-info objective-c\fR +. +Returns 1 if Tcl is compiled with an objective-c compiler, 0 otherwise. +.\" METHOD: objective-cplusplus +.TP +\fB::tcl::build-info objective-cplusplus\fR +. +Returns 1 if Tcl is compiled with an objective-c++ compiler, 0 otherwise. +.\" METHOD: patchlevel +.TP +\fB::tcl::build-info patchlevel\fR +. +Returns the Tcl patchlevel, same as \fBinfo patchlevel\fR. +.\" METHOD: profile +.TP +\fB::tcl::build-info profile\fR +. +Returns 1 if Tcl is compiled with \fB\-DTCL_CFG_PROFILED\fR, 0 otherwise. +.\" METHOD: purify +.TP +\fB::tcl::build-info purify\fR +. +Returns 1 if Tcl is compiled with \fB\-DPURIFY\fR, 0 otherwise. +.\" METHOD: static +.TP +\fB::tcl::build-info static\fR +. +Returns 1 if Tcl is compiled as a static library, 0 otherwise. +.\" METHOD: tommath +.TP +\fB::tcl::build-info tommath\fR +. +Returns the libtommath version number (as 4 digits) if libtommath is built into Tcl, 0 otherwise. +.\" METHOD: version +.TP +\fB::tcl::build-info version\fR +. +Returns the Tcl version, same as \fBinfo tclversion\fR. +.\" METHOD: zlib +.TP +\fB::tcl::build-info zlib\fR +. +Returns the zlib version number (as 4 digits) if zlib is built into Tcl, 0 otherwise. +.SH "EXAMPLES" +.PP +These show the use of \fB::tcl::build-info\fR. +.PP +.CS +\fB::tcl::build-info\fR + \fI\(-> 9.0.2+af16c07b81655fabde8028374161ad54b84ef9956843c63f49976b4ef601b611.gcc-1204\fR +\fB::tcl::build-info commit\fR + \fI\(-> af16c07b81655fabde8028374161ad54b84ef9956843c63f49976b4ef601b611\fR +\fB::tcl::build-info compiler\fR + \fI\(-> gcc-1204\fR +\fB::tcl::build-info gcc\fR + \fI\(-> 1204\fR +\fB::tcl::build-info version\fR + \fI\(-> 9.0\fR +\fB::tcl::build-info patchlevel\fR + \fI\(-> 9.0.2\fR +.CE +.SH "SEE ALSO" +info(n) +.SH "KEYWORDS" +build-info +'\" Local Variables: +'\" mode: nroff +'\" End: diff --git a/generic/tcl.decls b/generic/tcl.decls index ae5e04c..d72786b 100644 --- a/generic/tcl.decls +++ b/generic/tcl.decls @@ -1708,7 +1708,7 @@ declare 531 { void Tcl_LimitTypeReset(Tcl_Interp *interp, int type) } declare 532 { - int Tcl_LimitGetCommands(Tcl_Interp *interp) + Tcl_Size Tcl_LimitGetCommands(Tcl_Interp *interp) } declare 533 { void Tcl_LimitGetTime(Tcl_Interp *interp, Tcl_Time *timeLimitPtr) diff --git a/generic/tclDecls.h b/generic/tclDecls.h index e78638f..483a735 100644 --- a/generic/tclDecls.h +++ b/generic/tclDecls.h @@ -1410,7 +1410,7 @@ EXTERN void Tcl_LimitTypeSet(Tcl_Interp *interp, int type); /* 531 */ EXTERN void Tcl_LimitTypeReset(Tcl_Interp *interp, int type); /* 532 */ -EXTERN int Tcl_LimitGetCommands(Tcl_Interp *interp); +EXTERN Tcl_Size Tcl_LimitGetCommands(Tcl_Interp *interp); /* 533 */ EXTERN void Tcl_LimitGetTime(Tcl_Interp *interp, Tcl_Time *timeLimitPtr); @@ -2420,7 +2420,7 @@ typedef struct TclStubs { int (*tcl_LimitTypeExceeded) (Tcl_Interp *interp, int type); /* 529 */ void (*tcl_LimitTypeSet) (Tcl_Interp *interp, int type); /* 530 */ void (*tcl_LimitTypeReset) (Tcl_Interp *interp, int type); /* 531 */ - int (*tcl_LimitGetCommands) (Tcl_Interp *interp); /* 532 */ + Tcl_Size (*tcl_LimitGetCommands) (Tcl_Interp *interp); /* 532 */ void (*tcl_LimitGetTime) (Tcl_Interp *interp, Tcl_Time *timeLimitPtr); /* 533 */ int (*tcl_LimitGetGranularity) (Tcl_Interp *interp, int type); /* 534 */ Tcl_InterpState (*tcl_SaveInterpState) (Tcl_Interp *interp, int status); /* 535 */ diff --git a/generic/tclInterp.c b/generic/tclInterp.c index d58119e..90af06e 100644 --- a/generic/tclInterp.c +++ b/generic/tclInterp.c @@ -3965,7 +3965,7 @@ Tcl_LimitSetCommands( *---------------------------------------------------------------------- */ -int +Tcl_Size Tcl_LimitGetCommands( Tcl_Interp *interp) { @@ -4542,7 +4542,8 @@ ChildCommandLimitCmd( } else { Tcl_Size i, scriptLen = 0, limitLen = 0; Tcl_Obj *scriptObj = NULL, *granObj = NULL, *limitObj = NULL; - int gran = 0, limit = 0; + int gran = 0; + Tcl_Size limit = 0; for (i=consumedObjc ; i<objc ; i+=2) { if (Tcl_GetIndexFromObj(interp, objv[i], options, "option", 0, @@ -4573,7 +4574,7 @@ ChildCommandLimitCmd( if (limitLen == 0) { break; } - if (TclGetIntFromObj(interp, objv[i+1], &limit) != TCL_OK) { + if (Tcl_GetSizeIntFromObj(interp, objv[i+1], &limit) != TCL_OK) { return TCL_ERROR; } if (limit < 0) { diff --git a/tests/exec.test b/tests/exec.test index baaf04f..576f97d 100644 --- a/tests/exec.test +++ b/tests/exec.test @@ -28,7 +28,7 @@ testConstraint noosxCI [expr {![info exists ::env(MAC_CI)]}] # no idea how to check it in GHA programmatically, so simply disable it (todo: rewrite with better check later) if {[testConstraint win] && ![info exists ::env(CI)] && [info exists ::env(LOCALAPPDATA)] && - [file exists [file join $::env(LOCALAPPDATA) "Microsoft" "WindowsApps" "winget.exe"]]} { + [auto_execok winget] ne {}} { testConstraint haveWinget 1 } @@ -805,7 +805,7 @@ test exec-22.1 {exec -encoding invalid encoding} -body { test exec-bug-4f0b5767ac {exec App Execution Alias} -constraints haveWinget -body { exec winget --info -} -result "Windows Package Manager*" -match glob +} -result "Windows*" -match glob foreach cmdBuiltin { assoc call cd cls color copy date del dir echo |
