From: <no...@so...> - 2001-04-09 23:17:43
|
Bugs item #219151, was updated on 2000-10-25 22:02 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=110894&aid=219151&group_id=10894 Category: None Group: 8.0.4 Status: Open Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Kevin B KENNY (kennykb) Summary: Annoying ANSI signatures of many Tcl library functions. Initial Comment: OriginalBugID: 1162 RFE Version: 8.0.4 SubmitDate: '1999-02-02' LastModified: '2000-05-17' Severity: MED Status: Assigned Submitter: pat ChangedBy: hobbs RelatedBugIDs: 2580 OS: Solaris OSVersion: 2.6 Machine: Other FixedDate: '2000-10-25' ClosedDate: '2000-10-25' Name: Krzysztof Kozminski Extensions: BLT, DP, Expect, Tree, Itcl, Itk and about a dozen others... DesiredBehavior: Many Tcl API procedures take a "char *" argument where they really could take a "const char *" if only some minor effort was dedicated to fixing the procedures that really have no business accessing their arguments as writable strings. This causes annoying warnings whenever compiling code that follows the discipline of calling constant a constant, e.g., when one uses RogueWave tools for string processing and then tries to pass the result to Tcl. It would be really nice if functions like: Tcl_CommandComplete, Tcl_Eval, Tcl_AppendElement, Tcl_StringMatch, Tcl_SetResult, Tcl_FindHashEntry, Tcl_CreateHashEntry, and many others were capable to take const char *. I tend to consider the current signatures more of a bug, than a missing feature... KK Should really use CONST, isn't a big deal, although it changes many core sigs. (updated stubs and all). -- 04/03/2000 hobbs ---------------------------------------------------------------------- >Comment By: Kevin B KENNY (kennykb) Date: 2001-04-09 16:17 Message: Logged In: YES user_id=99768 Of the calls that the user lists, Tcl_Eval and Tcl_SetResult actually need pointers to non-constant strings. Tcl_Eval overwrites the string as it is parsing it, and Tcl_SetResult with TCL_DYNAMIC or a user memory management procedure requires pointer to non-const so that the memory can be freed. The other calls that the user lists (and many more) can and should be fixed, per TIP#27. ---------------------------------------------------------------------- Comment By: Don Porter (dgp) Date: 2001-02-07 23:21 Message: Kevin Kenny is planning a TIP to tackle this. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=110894&aid=219151&group_id=10894 |