From: Jan N. <jan...@gm...> - 2009-07-16 09:53:56
|
2009/7/16 Donald G Porter <don...@ni...>: > That said, these all appear to be calls to Tcl_GetObjType() which we > have increasing agreement is a dicey thing at best for extensions to > be calling. Especially bad that there appears to be no safety checks > for NULL returns. > > If Thread really needs access to the internals of the Tcl_ObjTypes > defined by Tcl itself, should Thread really get on a path to just > become part of Tcl? Well, I looked at the code, and the Thread extension is not one of the 'bad guys' which violate the API assumtions. Just putting a "const" here and there can eliminate all warnings, without introducing unsafe type casts or using the CONST86 macro. I think, calling Tcl_GetObjType() is not bad, it is bad when an extension writes to the memory where the returned pointer is pointed to. Thead doesn't do that, it uses Tcl_GetObjType() what it is meant for: a fast shortcut to check whether some object is of a specific type or not. That's fully legal. Regards, Jan Nijtmans |