Overview
| Artifact ID: | 826e68ecdab3bfdc82d33cdc3df7710b8c7e8723 |
|---|---|
| Ticket: | 217999ffffffffffffffffffffffffffffffffff
const char * warnings |
| User & Date: | nobody on 2000-10-26 00:51:50 |
Changes
- assignee changed to: "nobody"
- cmimetype changed to: "text/plain"
- comment changed to:
OriginalBugID: 679 Bug Version: 8.0p2 SubmitDate: '1998-09-23' LastModified: '1999-09-15' Severity: LOW Status: Closed Submitter: welch ChangedBy: hobbs OS: Linux OSVersion: NA Machine: NA FixedDate: '2000-10-25' FixedInVersion: NA ClosedDate: '1999-09-15' The function prototypes in /usr/include/tcl.h have a large number of "char*" definitions that should really be "char const*". Without this correct constness, compiling will generate a large number of errors. For example: db/dbobject.cpp:1476: warning: converting `const char *' to `char *' is a contravariance violation db/dbobject.cpp:1476: warning: passing `const char *' as argument 2 of `Tcl_GetVar(Tcl_Interp *, char *, int)' discards const db/dbobject.cpp:1508: warning: converting `const char *' to `char *' is a contravariance violation db/dbobject.cpp:1508: warning: passing `const char *' as argument 2 of `Tcl_SetVar(Tcl_Interp *, char *, char *, int)' discards const db/dbobject.cpp:1511: warning: converting `const char *' to `char *' is a contravariance violation db/dbobject.cpp:1511: warning: passing `const char *' as argument 2 of `Tcl_SetVar(Tcl_Interp *, char *, char *, int)' discards const db/dbobject.cpp:1514: warning: converting `const char *' to `char *' is a contravariance violation db/dbobject.cpp:1514: warning: passing `const char *' as argument 2 of `Tcl_SetVar(Tcl_Interp *, char *, char *, int)' discards const Since argument #2 is never changed by the procedure, it should be declared as a const parameter. There's a good chance "tk.h" has the same problems, but I haven't checked yet. Brian ( [email protected] ) This is conflicting with someone else's code, where the cast should be made. It may be true that Tcl_SetVar won't change the char, but it has always been defined to be char*, so changing it would just cause others headaches. -- 09/15/1999 hobbs - foundin changed to: "obsolete: 8.0p2"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "nobody"
- subsystem changed to: "69. Other"
- title changed to: "const char * warnings"
- type changed to: "Bug"