Hi Jonathan,

On Tue, May 25, 2010 at 05:02:36PM -0500, Jonathan Nieder wrote:
> Sebastian Harl wrote:
> > When initializing the RRDtool Tcl bindings, the following is done (see
> > bindings/tcl/tclrrd.c:init() in the RRDtool sources):
> > 
> >   Tcl_InitStubs(interp, TCL_VERSION, 0)
> > 
> > and then
> > 
> >   Tcl_PkgRequire(interp, "Tcl", TCL_VERSION, 1)
> 
> I am not so familiar with tcl ABI, unfortunately; sorry.  But this is
> almost certainly wrong.  If we are going to require a specific tcl
> version, why use stubs at all?

This is supposed to be s/stubs/pkgrequire/, right? ;-) I have no clue
about Tcl, but judging from the Tcl_InitStubs manpage, stubs is required
to be able to use some sort of extensions.

> If you use
> 
>   Tcl_InitStubs(interp, TCL_VERSION, 0)
>   Tcl_PkgRequire(interp, "Tcl", TCL_VERSION, 0)
> 
> or just
> 
>   Tcl_InitStubs(interp, TCL_VERSION, 0)
> 
> (the PkgRequire is implicit) then it will check a dependency of the form
> tcl (>= 8.5.whatever).  tcl 8.5.8 and tcl 8.6 will be allowed as they
> should be.

Sounds right to me.

Anyway, the problems seems to be the fourth parameter to Tcl_PkgRequire
-- I suppose this should almost certainly be 0. I wonder why this was
working before. I don't know if the explicit "package require" might
have any side-effects, so I'd rather leave it in there for now and
simply change that parameter. Do you expect any problems from that?

> Since your package is known to work with tcl 8.4 already, I’d use
> 
>   Tcl_InitStubs(interp, "8.4", 0)

Makes sense to me. However, since this is probably not going to be
required to fix the issue at hand, I'll forward that upstream and let
them decide about that ;-)

Cheers,
Sebastian

-- 
Sebastian "tokkee" Harl +++ GnuPG-ID: 0x8501C7FC +++ http://tokkee.org/

Those who would give up Essential Liberty to purchase a little Temporary
Safety, deserve neither Liberty nor Safety.         -- Benjamin Franklin

Attachment: signature.asc
Description: Digital signature

Reply via email to