Subject: Re: "gnutls" under Darwin (was: CVS commit: pkgsrc/security/gnutls)
To: Matthias Scheler <>
From: Todd Vierling <>
List: tech-pkg
Date: 01/24/2007 16:30:19
On 1/24/07, Todd Vierling <> wrote:
> On 1/24/07, Matthias Scheler <> wrote:
> >
> The code example there is, at best, buggy (if not completely wrong).
> The method getClass() as shown is returning an instance of, not a
> pointer or reference to, "MyAbstractClass":

> MyAbstractClass MyWrapperClass::getClass()

I just verified, the sample code at that link doesn't even compile on
modern gcc for the same reason I described:

===== In static member function `static MyAbstractClass
MyWrapperClass::getClass()': error: invalid return type for function `static
MyAbstractClass MyWrapperClass::getClass()' error:   since type `MyAbstractClass' has abstract virtual functions error: cannot allocate an object of type `MyAbstractClass' error:   since type `MyAbstractClass' has abstract virtual functions

The method above must be changed to do

MyAbstractClass& MyWrapperClass::getClass()

in order for it even to build at all.  There's some kind of crack
smoking going on there.

-- Todd Vierling <> <> <>