Overview
| Artifact ID: | 1845801f5c58f354a2c7ac8efe13b14bbefe21c4f0ea321634f7c60927259c8a |
|---|---|
| Ticket: | 0238027108506a3271543dcc297ac71d3cb41d3f
Tcl_ParseArgsObjv TCL_ARGV_CONSTANT documentation error |
| User & Date: | anonymous on 2019-01-29 22:56:19 |
Changes
- assignee changed to: "nobody"
- closer changed to: "nobody"
- cmimetype changed to: "text/plain"
- comment changed to:
I quote the doc: TCL_ARGV_CONSTANT The argument does not take any following value argument. If this argument is present, the int pointed to by the srcPtr field is copied to the dstPtr field. The clientData field is ignored. But today, while programming an extension, I noticed that it's not "the int pointed to by the srcPtr field" but the pointer itself being put in dstPtr. When compiling the attached "test.c" and testing it, I get: $ gcc -shared -o test.{so,c} -DUSE_TCL_STUBS -I/usr/include -L/usr/lib64 -ltclstub8.6 $ tclsh > load ./test.so > test1 -opt 515178680 > test2 -opt 10 After looking at the source code, the solution is either applying diff --git a/tclIndexObj.c b/tclIndexObj.c index 30c33f1..4a388a5 100644 --- a/tclIndexObj.c +++ b/tclIndexObj.c @@ -1207,7 +1207,7 @@ Tcl_ParseArgsObjv( infoPtr = matchPtr; switch (infoPtr->type) { case TCL_ARGV_CONSTANT: - *((int *) infoPtr->dstPtr) = PTR2INT(infoPtr->srcPtr); + *((int *) infoPtr->dstPtr) = *(infoPtr->srcPtr); break; case TCL_ARGV_INT: if (objc == 0) { or changing the documentation to mean that it's the value being copied. - foundin changed to: "8.6.8"
- is_private changed to: "0"
- login: "anonymous"
- priority changed to: "5 Medium"
- private_contact changed to: "f597160e566927b8647015fd255e6e6f01f7002c"
- resolution changed to: "None"
- severity changed to: "Important"
- status changed to: "Open"
- submitter changed to: "anonymous"
- subsystem changed to: "None"
- title changed to:
Tcl_ParseArgsObjv TCL_ARGV_CONSTANT documentation error
- type changed to: "Bug"