From ecd951296b64913c07949feb86c056bf42a20f0e Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 26 Jun 2025 09:55:11 +0000 Subject: =?UTF-8?q?tclWinPipe.c:3427:12:=20warning:=20unused=20parameter?= =?UTF-8?q?=20=E2=80=98wakeEvent=E2=80=99=20[-Wunused-parameter]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- win/tclWinInt.h | 3 +-- win/tclWinPipe.c | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/win/tclWinInt.h b/win/tclWinInt.h index 3ba3c57..c37daf7 100644 --- a/win/tclWinInt.h +++ b/win/tclWinInt.h @@ -122,8 +122,7 @@ TclPipeThreadIsAlive( return (pipeTI && pipeTI->state != PTI_STATE_DOWN); }; -MODULE_SCOPE int TclPipeThreadStopSignal(TclPipeThreadInfo **pipeTIPtr, - HANDLE wakeEvent); +MODULE_SCOPE int TclPipeThreadStopSignal(TclPipeThreadInfo **pipeTIPtr); MODULE_SCOPE void TclPipeThreadStop(TclPipeThreadInfo **pipeTIPtr, HANDLE hThread); MODULE_SCOPE void TclPipeThreadExit(TclPipeThreadInfo **pipeTIPtr); diff --git a/win/tclWinPipe.c b/win/tclWinPipe.c index a2b630a..71d1e4b 100644 --- a/win/tclWinPipe.c +++ b/win/tclWinPipe.c @@ -2052,7 +2052,7 @@ PipeClose2Proc( if ((pipePtr->flags & PIPE_ASYNC) && inExit) { /* give it a chance to leave honorably */ - TclPipeThreadStopSignal(&pipePtr->writeTI, pipePtr->writable); + TclPipeThreadStopSignal(&pipePtr->writeTI); if (WaitForSingleObject(pipePtr->writable, 20) == WAIT_TIMEOUT) { return EWOULDBLOCK; @@ -3423,8 +3423,7 @@ TclPipeThreadWaitForSignal( int TclPipeThreadStopSignal( - TclPipeThreadInfo **pipeTIPtr, - HANDLE wakeEvent) + TclPipeThreadInfo **pipeTIPtr) { TclPipeThreadInfo *pipeTI = *pipeTIPtr; HANDLE evControl; -- cgit v0.12 From 55777cb64df700cc762d127daf47eaf9ec1065e9 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 26 Jun 2025 11:14:11 +0000 Subject: Make everthing compile (again) and run with a C++ compiler. --- generic/tclBinary.c | 6 ++---- generic/tclNamesp.c | 10 +++++----- generic/tclTest.c | 6 ++++++ generic/tclThreadTest.c | 6 ++++++ unix/tclAppInit.c | 6 ++++++ win/tclAppInit.c | 6 ++++++ 6 files changed, 31 insertions(+), 9 deletions(-) diff --git a/generic/tclBinary.c b/generic/tclBinary.c index 5094a88..1e68415 100644 --- a/generic/tclBinary.c +++ b/generic/tclBinary.c @@ -2740,13 +2740,13 @@ BinaryEncodeUu( { Tcl_Obj *resultObj; unsigned char *data, *start, *cursor; - int i, bits, index; + int i, bits; unsigned int n; int lineLength = 61; const unsigned char SingleNewline[] = { UCHAR('\n') }; const unsigned char *wrapchar = SingleNewline; Tcl_Size j, rawLength, offset, count = 0, wrapcharlen = sizeof(SingleNewline); - enum { OPT_MAXLEN, OPT_WRAPCHAR }; + enum { OPT_MAXLEN, OPT_WRAPCHAR } index; static const char *const optStrings[] = { "-maxlen", "-wrapchar", NULL }; if (objc < 2 || objc % 2 != 0) { @@ -2805,8 +2805,6 @@ BinaryEncodeUu( return TCL_ERROR; } break; - default: - TCL_UNREACHABLE(); } } diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c index 5acb014..3670d7f 100644 --- a/generic/tclNamesp.c +++ b/generic/tclNamesp.c @@ -4745,7 +4745,7 @@ NamespaceWhichCmd( static const char *const opts[] = { "-command", "-variable", NULL }; - int lookupType = 0; + enum { OPT_COMMAND, OPT_VARIABLE } lookupType; Tcl_Obj *resultPtr; if (objc < 2 || objc > 3) { @@ -4770,14 +4770,15 @@ NamespaceWhichCmd( TclNewObj(resultPtr); switch (lookupType) { - case 0:; /* -command */ + case OPT_COMMAND: { Tcl_Command cmd = Tcl_GetCommandFromObj(interp, objv[objc-1]); if (cmd != NULL) { Tcl_GetCommandFullName(interp, cmd, resultPtr); } break; - case 1:; /* -variable */ + } + case OPT_VARIABLE: { Tcl_Var var = Tcl_FindNamespaceVar(interp, TclGetString(objv[objc-1]), NULL, /*flags*/ 0); @@ -4785,8 +4786,7 @@ NamespaceWhichCmd( Tcl_GetVariableFullName(interp, var, resultPtr); } break; - default: - TCL_UNREACHABLE(); + } } Tcl_SetObjResult(interp, resultPtr); return TCL_OK; diff --git a/generic/tclTest.c b/generic/tclTest.c index c67ec25..e6c2a94 100644 --- a/generic/tclTest.c +++ b/generic/tclTest.c @@ -41,8 +41,14 @@ /* * Declare external functions used in Windows tests. */ +#ifdef __cplusplus +extern "C" { +#endif DLLEXPORT int Tcltest_Init(Tcl_Interp *interp); DLLEXPORT int Tcltest_SafeInit(Tcl_Interp *interp); +#ifdef __cplusplus +} +#endif /* * Dynamic string shared by TestdcallCmd and DelCallbackProc; used to collect diff --git a/generic/tclThreadTest.c b/generic/tclThreadTest.c index 52493c1..faaf92a 100644 --- a/generic/tclThreadTest.c +++ b/generic/tclThreadTest.c @@ -139,7 +139,13 @@ static void ThreadFreeProc(void *clientData); static int ThreadDeleteEvent(Tcl_Event *eventPtr, void *clientData); static void ThreadExitProc(void *clientData); +#ifdef __cplusplus +extern "C" { +#endif extern int Tcltest_Init(Tcl_Interp *interp); +#ifdef __cplusplus +} +#endif /* *---------------------------------------------------------------------- diff --git a/unix/tclAppInit.c b/unix/tclAppInit.c index 6158c99..8d967e8 100644 --- a/unix/tclAppInit.c +++ b/unix/tclAppInit.c @@ -24,8 +24,14 @@ #endif #ifdef TCL_TEST +#ifdef __cplusplus +extern "C" { +#endif extern Tcl_LibraryInitProc Tcltest_Init; extern Tcl_LibraryInitProc Tcltest_SafeInit; +#ifdef __cplusplus +} +#endif #endif /* TCL_TEST */ #ifdef TCL_XT_TEST diff --git a/win/tclAppInit.c b/win/tclAppInit.c index 339d61e..c293952 100644 --- a/win/tclAppInit.c +++ b/win/tclAppInit.c @@ -26,8 +26,14 @@ #endif #ifdef TCL_TEST +#ifdef __cplusplus +extern "C" { +#endif extern Tcl_LibraryInitProc Tcltest_Init; extern Tcl_LibraryInitProc Tcltest_SafeInit; +#ifdef __cplusplus +} +#endif #endif /* TCL_TEST */ #if defined(STATIC_BUILD) -- cgit v0.12 From b824cdafecff216fa052f26eb099a54eeffd6b13 Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 26 Jun 2025 13:19:43 +0000 Subject: [27fa01a7db] Restore default option to [namespace which] implementation. --- generic/tclNamesp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c index 3670d7f..fb4ec83 100644 --- a/generic/tclNamesp.c +++ b/generic/tclNamesp.c @@ -4745,7 +4745,7 @@ NamespaceWhichCmd( static const char *const opts[] = { "-command", "-variable", NULL }; - enum { OPT_COMMAND, OPT_VARIABLE } lookupType; + enum { OPT_COMMAND, OPT_VARIABLE } lookupType = OPT_COMMAND; Tcl_Obj *resultPtr; if (objc < 2 || objc > 3) { -- cgit v0.12 From bb3e4af18d9b71c3cf04ff2ae49768ce69d60e4b Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 27 Jun 2025 07:16:03 +0000 Subject: Make all references to -DFOO compiler flags bold in documentation --- doc/ByteArrObj.3 | 2 +- doc/CrtAlias.3 | 2 +- doc/DictObj.3 | 2 +- doc/FileSystem.3 | 2 +- doc/ListObj.3 | 4 ++-- doc/ParseArgs.3 | 2 +- doc/SplitList.3 | 2 +- doc/SplitPath.3 | 2 +- doc/StringObj.3 | 2 +- doc/Tcl_Main.3 | 2 +- 10 files changed, 11 insertions(+), 11 deletions(-) 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/ListObj.3 b/doc/ListObj.3 index 6e4d0d5..872b90f 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\fB-DTCL_8_API\fR\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 -- cgit v0.12 From 5721de48caace8b5dc120cfc1674ed8627390810 Mon Sep 17 00:00:00 2001 From: apnadkarni Date: Fri, 27 Jun 2025 07:45:18 +0000 Subject: Make exec-bug-4f0b5767ac test independent of locale --- tests/exec.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/exec.test b/tests/exec.test index fc5f1fa..ac9530f 100644 --- a/tests/exec.test +++ b/tests/exec.test @@ -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 -- cgit v0.12 From 662d103e7d14952947a018b639531b2d899d943c Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 27 Jun 2025 08:12:13 +0000 Subject: doc fix --- doc/ListObj.3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/ListObj.3 b/doc/ListObj.3 index 872b90f..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 \fB\fB-DTCL_8_API\fR\fR, 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 -- cgit v0.12