From: SourceForge.net <no...@so...> - 2003-09-11 08:10:02
|
Bugs item #803489, was opened at 2003-09-10 00:10 Message generated for change (Comment added) made by dkf You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=803489&group_id=10894 Category: 21. [namespace] Group: 8.5a0 Status: Open Resolution: Invalid Priority: 9 Submitted By: David Gravereaux (davygrvy) >Assigned to: Don Porter (dgp) Summary: Tcl_FindNamespace problem in the Stubs table Initial Comment: Tcl_FindNamespace now has a new entry in the public table for 8.5. The old one still exists in the private table, too, but isn't visible due to . The public tclDecls.h is included first. All fine so far, but any extension that links with the new Stubs table blows chucks when loaded into an older core. Why? tclStubsPtr->tcl_FindNamespace is NULL. I'd rather have it still be tclIntStubsPtr- >tcl_FindNamespace, still. Solution? Not sure.. tclDecls.h: #ifndef Tcl_FindNamespace #define Tcl_FindNamespace \ (tclStubsPtr->tcl_FindNamespace) /* 514 */ #endif tclIntDecls.h: #ifndef Tcl_FindNamespace #define Tcl_FindNamespace \ (tclIntStubsPtr->tcl_FindNamespace) /* 117 */ #endif ---------------------------------------------------------------------- >Comment By: Donal K. Fellows (dkf) Date: 2003-09-11 09:09 Message: Logged In: YES user_id=79902 I refuse to fix it because I believe you are trying to do something that is not supported. If you build against 8.x (x=[1..4]) then you can load into 8.5 and that will work. But building against one version and loading into a previous version? That's peverse. It won't work in general. This is just yet another reason why not. (And if you use any of the other namespace APIs that I didn't expose, if I get around to exposing those they may well be completely different anyway.) dgp: Why on *earth* would we want to support that form of compatability? Give me a good enough reason and I'll find a way around this, but right now I think it is a feature we do *not* want. (davygrvy: this is a policy decision so please do not change anything until we have had some more clarification, and even then I volunteer to do it since I've grokked the stubs generator fairly recently.) ---------------------------------------------------------------------- Comment By: David Gravereaux (davygrvy) Date: 2003-09-11 03:56 Message: Logged In: YES user_id=7549 Sorry, this is a big bug. So I now have to source tclIntDecls.h prior to to tcl.h to solve this? My app doesn't touch channel types. The signature of Tcl_FindNamespace hasn't changed, so please don't change the slot. Congrats, you have succesfully broken something that remains identical. True, the old is still there, but hidden from me now due to the order of the include files. Yet more stupid macros will be needed to support the backward compatibility.. Oh the joy.. If you refuse to fix it, I'll do it then. ---------------------------------------------------------------------- Comment By: Donal K. Fellows (dkf) Date: 2003-09-10 13:57 Message: Logged In: YES user_id=79902 The function is still in the old slot and there has never been a guarantee that internal stubs will be perfectly maintained. In 8.4 and before, Tcl_FindNamespace is an internal function; anyone #including tclInt.h does not have as strong a guarantee of compatability. Note that since there have been structure size alterations (e.g. in channel types), it is not really generally safe to load a stubbed library into an earlier version of Tcl, no matter how you call Tcl_InitStubs. IMHO, this is pilot error, *not* a bug. ---------------------------------------------------------------------- Comment By: David Gravereaux (davygrvy) Date: 2003-09-10 13:30 Message: Logged In: YES user_id=7549 Stubs are supposed to gain, never lose slots. You moved my slot. I know this code works in 8.1, therefore, I state it: #ifdef USE_TCL_STUBS if (Tcl_InitStubs(interp, "8.1", 0) == 0L) { return TCL_ERROR; } #endif This change breaks my stuff. Please don't make a needed private->public move break existing code. I'm all for the API shift to the public, but could you leave the old slot position the same? ---------------------------------------------------------------------- Comment By: Donal K. Fellows (dkf) Date: 2003-09-10 13:03 Message: Logged In: YES user_id=79902 Could someone explain why people might have an expectation that an extension compiled with 8.x might work with 8.y when x>y? I thought that was a compatability case which we were explicitly not supporting... ---------------------------------------------------------------------- Comment By: David Gravereaux (davygrvy) Date: 2003-09-10 05:40 Message: Logged In: YES user_id=7549 Just before I reverted, I found a quick fix: #include "tclInt.h" #ifdef Tcl_FindNamespace #undef Tcl_FindNamespace #define Tcl_FindNamespace \ (tclIntStubsPtr->tcl_FindNamespace) #endif . . . That'll work for me for now.. ---------------------------------------------------------------------- Comment By: David Gravereaux (davygrvy) Date: 2003-09-10 05:12 Message: Logged In: YES user_id=7549 until this gets fixed, I'm dropping back to 8.4 for extension builds. It's blowing up everything I've got in progress. ---------------------------------------------------------------------- Comment By: David Gravereaux (davygrvy) Date: 2003-09-10 00:20 Message: Logged In: YES user_id=7549 How about a new command added to genStubs.tcl: forward generic Int { Tcl_Namespace *Tcl_FindNamespace(Tcl_Interp *interp, CONST char *name, Tcl_Namespace *contextNsPtr, int flags) } and doesn't write write a new slot to the table, and defines the name to be: #ifndef Tcl_FindNamespace #define Tcl_FindNamespace \ (tclIntStubsPtr->tcl_FindNamespace) /* 514 */ #endif even in the public tclStubs.h. Would that be cart before the horse? ---------------------------------------------------------------------- Comment By: Don Porter (dgp) Date: 2003-09-10 00:18 Message: Logged In: YES user_id=80530 Donal, your genstubs trickery handled forward compatibility fine, but as davygrvy points out, it leaves out support for backward compatibility. (Compile an extension against 8.5 headers, but [load] it into an 8.4 interp). I know the wrapper solution is tedious, but it appears to be the way to go. ---------------------------------------------------------------------- Comment By: Don Porter (dgp) Date: 2003-09-10 00:15 Message: Logged In: YES user_id=80530 Ah. Never mind. I get the trouble now. ---------------------------------------------------------------------- Comment By: Don Porter (dgp) Date: 2003-09-10 00:12 Message: Logged In: YES user_id=80530 Have you re-run 'make genstubs' since your last update? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=803489&group_id=10894 |