|
From: Joe E. <jen...@fl...> - 2008-11-17 21:21:54
|
Donald G Porter wrote: > Jan Nijtmans wrote: > > ...Worse: the signature of Tcl_HashStats is wrong: it should never > > have returned a const char*! > > Please explain. Especially in light of the fact that TIP 27 was > the motivation for converting the return value of Tcl_HashStats() > from (char *) to (const char *). Tcl_HashStats is documented as: | Tcl_HashStats returns a dynamically-allocated string [...] | It is the callerâs responsibility to free the result | ^^^^^^^^^^^^^^ | string by passing it to ckfree. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ So the return value must be a non-const char *. (Freeing counts as a modification.) --Joe English |