So you should use LangFreeCallback instead of ckfree or free if appropriate. These two are equivalent unless s is an empty string. The Lang functions separate uninitialized and initialized data comparing data with NULL . Another useful construction is. Var, Arg, LangCallback, LangFreeProc.
Current implementation contains enough to make it possible to compile.
Checking for trouble If you start with working TCL code, you can start convertion using the above hints. What is described here is not included into base portableTk distribution. The type for construction of dynamic lists is ListFactory . If you are not going to change the value of arg after appending, the call to ListFactoryAppend may be quicker. DStrings Production of strings are still supported in portableTk .