Re: [gtk-list] Re: Gtk--: Why does this (specific code) compile at all?





> > so far so good ... my original code though said:
> >     win.add (&vbox);    // note the extra '&'
> >
> > while compiles fine (without warnings)
>
> Which version of Gtk-- are you compiling with ? There should be an
> error with the last one.

I use: Glib/Gtk+ 1.2.1 and Gtk-- 1.0.0, and egcs 2.91.57 (which is egcs 1.1b and
at least 6 months old) ... I actually received a message from someone running
terraform under Solaris 2.6 (using egcs) and there the linker complains about
differing object sizes ... on my RH5.2 x86 linux box though no warning or errors
are issued ...

> > but in my experience is wrong (and I suspect this line of causing a
> > core dump under certain OSs).
>
> Yes indeed, because you'll end up deleting the vbox twice.

Thank you for confirming this ...

> > As thus my question is: why does this compile at all?
>
> Because the ctor wasn't explicit, so your ptr was silently being
> converted to a Gtk_ObjectHandle. (quite a nasty one, uh ? :-)

Yes, very much so since on my system everything works but
this doesn't hold true for other types of systems/OSs ...

Thanks
--> Robert




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]