|
2012-04-10
| ||
| 16:31 | • Closed ticket [2458976fff]: Use gcc attributes to mark Tcl_Interp fields depreca... artifact: 827a23ae4b user: dkf | |
| 16:31 | • Ticket [2458976fff]: 4 changes artifact: 5d0538abf0 user: dkf | |
|
2011-05-08
| ||
| 22:03 | • Ticket [2458976fff]: 5 changes artifact: 5bb3776042 user: msofer | |
|
2008-12-23
| ||
| 00:12 | • Ticket [2458976fff]: 4 changes artifact: aaa462be9d user: dkf | |
|
2008-12-22
| ||
| 17:02 | • New ticket [2458976fff]. artifact: d6527b6352 user: nobody | |
Use gcc attributes to mark Tcl_Interp fields deprecated
Closed / Fixed2458976fffffffffffffffffffffffffffffffffCreated 18 years agoUpdated 15 years ago
Descriptionplain2008-12-22 17:02:39
Although there has been an effort to deprecate the fields of the Tcl_Interp structure as not being suitable for public use, because there is a backward compatibility macro that people can set, there is a danger that lazy programmers will just set it and then ignore the fact that they are using something that will go away. Then they'll get caught out and gripe (unfairly) that we didn't warn them. Programmers are like that. If we set it so that (when we're using gcc) we use 'deprecated' attributes on the result, freeProc and errorLine fields of the Tcl_Interp (i.e. so that if people don't define USE_INTERP_RESULT and USE_INTERP_ERRORLINE they guarantee that they won't get warnings) then such code as has a problem will become noisy and inclined to be fixed. People needing higher levels of assurance who are using -Werror probably ought to move to the new APIs sooner so as to get a longer guaranteed support period. More info about the right sort of attributes is on: http://gcc.gnu.org/onlinedocs/gcc/Variable-Attributes.html Search for 'deprecated' for what I'm talking about using.
dkfplain2008-12-23 00:12:32
Damnit, I submitted this!
msoferplain2011-05-08 22:03:06
I do not see the possibility of deprecating fields of a struct, and we certainly do not want to deprecate Tcl_Interp. What di you have in mind?
dkfplain2012-04-10 16:31:06
Reading through the GCC docs again, I see that __attribute__((__deprecated__)) *can* be applied to fields, if your version of GCC is new enough. What it does is cause access to those fields (but not the overall structure) to generate a warning. (You can supply a custom warning message from gcc 4.5 onwards.) It doesn't generate an error (unless you specify that all warnings are errors, in which case you're very much at the mercy of problems in OS headers too). Tcl itself doesn't touch those fields (it does in the Interp structure, but that's not got any warnings applied to it).
dkfplain2012-04-10 16:31:07
allow_comments - 1
Log in (anonymous is fine) to add a comment.