Tcl_SetResult compiler warnings
The extensions are compiled on Windows 10 with Visual Studio 2022, with the /W4 compiler option. The Microsoft docs says /W4 outputs:
all level 4 (informational) warnings that aren't off by default. We recommend that you use this option to provide lint-like warnings.
The extensions are using stubs. Compiler options include: /W4 -DUSE_TCL_STUBS -DUSE_TK_STUBS -DTCL_THREADS=1
With Tcl 8.6.14 any C statement such as:
Tcl_SetResult( interp, "this is an error message", TCL_STATIC );
now produces a warning:
warning C4152: nonstandard extension, function/data pointer conversion in expression
The cause appears to be additional macro trickery introduced into tclDecls.h in Tcl 8.6.14:
#if defined(USE_TCL_STUBS) ....... #ifndef __cplusplus .......... # undef Tcl_SetResult # define Tcl_SetResult \ ((void (*)(Tcl_Interp *, char *, void *))(void *)(tclStubsPtr->tcl_SetResult)) /* 232 */ #endif #endif
The warning is from the third argument of the Tcl_SetResult macro declaration, which is now void * instead of Tcl_FreeProc *freeProc.
92e8b69faeClosed ticket [d556d54723]: Inconsistency in Tcl declaration of Tcl_EventuallyFree and Tcl_SetResult causes warnings when compiling. plus 7 other changes ticket2024-07-03 20:19:111714783349Fix [df85199878]: Tcl_SetResult compiler warnings check-in2024-04-05 21:25:20
Hm, this piece what meant to prevent another compiler warning, see [8ab8a138c9]. But if it produces another one with MSVC, it's counter-productive. Thanks for the report, indeed it's better to remove this.