Skip to content
Tcl Source Code Artifact [30a8da4632]
Login

Artifact [30a8da4632]

Artifact 30a8da4632876792a564964231a4a8e4f47790f39ff3c8f3ce1d4266be4a4bc3:

Ticket change [30a8da4632] - Ticket [8ab8a138c9156e5a|8ab8a138c9] <i>Functions passed to Tcl_EventuallyFree() must be declared/defined as Tcl_FreeProc</i> status still Pending with 3 other changes by chrstphrchvz on 2023-10-13 13:58:28.
D 2023-10-13T13:58:28.466
J icomment <blockquote><tt>-Wcast-function-type</tt>\salso\sworks.</blockquote>\r\n…but\snot\swhen\sthere\sis\san\sintermediate\s<tt>(void\s*)</tt>\scast.\r\n\r\nThe\scasts\sin\stclDecls.h\scause\s<tt>Tcl_EventuallyFree()</tt>\sand\s<tt>Tcl_SetResult()</tt>\sto\sbe\scalled\sfrom\sfunction\spointers\sof\sincorrect\stype,\sand\sso\snow\sUBSan\scomplains\seven\smore.\sA\scouple\sof\sexamples:\r\n\r\n<pre>\r\n<span\sstyle="font-weight:bold">tk/generic/tkMenuDraw.c:796:2:\s<span\sstyle="color:firebrick">runtime\serror:</span>\scall\sto\sfunction\sTcl_EventuallyFree\sthrough\spointer\sto\sincorrect\sfunction\stype\s'void\s(*)(void\s*,\svoid\s*)'\r\ntclPreserve.c:265:\s<span\sstyle="color:gray">note:</span></span>\sTcl_EventuallyFree\sdefined\shere\r\nSUMMARY:\sUndefinedBehaviorSanitizer:\sundefined-behavior\stk/generic/tkMenuDraw.c:796:2\sin\s\r\n</pre>\r\n\r\n<pre>\r\n<span\sstyle="font-weight:bold">tcl/generic/tclTest.c:1117:2:\s<span\sstyle="color:firebrick">runtime\serror:</span>\scall\sto\sfunction\sTcl_SetResult\sthrough\spointer\sto\sincorrect\sfunction\stype\s'void\s(*)(struct\sTcl_Interp\s*,\schar\s*,\svoid\s*)'\r\ntclResult.c:419:\s<span\sstyle="color:gray">note:</span></span>\sTcl_SetResult\sdefined\shere\r\nSUMMARY:\sUndefinedBehaviorSanitizer:\sundefined-behavior\stcl/generic/tclTest.c:1117:2\sin\s\r\n</pre>
J login chrstphrchvz
J mimetype text/x-fossil-wiki
K 8ab8a138c9156e5a5a4a386310c6fd11608b8805
U chrstphrchvz
Z 1a7d2dc93ed345da76c8190241619148