Subject: Re: "gnutls" under Darwin (was: CVS commit: pkgsrc/security/gnutls)
To: Matthias Scheler <tron@zhadum.org.uk>
From: Todd Vierling <tv@pobox.com>
List: tech-pkg
Date: 01/24/2007 16:30:19
On 1/24/07, Todd Vierling <tv@pobox.com> wrote:
> On 1/24/07, Matthias Scheler <tron@zhadum.org.uk> wrote:
> > http://porting.openoffice.org/mac/macosx_issues.html
>
> 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:

=====
x.cc: In static member function `static MyAbstractClass
MyWrapperClass::getClass()':
x.cc:35: error: invalid return type for function `static
MyAbstractClass MyWrapperClass::getClass()'
x.cc:35: error:   since type `MyAbstractClass' has abstract virtual functions
x.cc:37: error: cannot allocate an object of type `MyAbstractClass'
x.cc:37: 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 <tv@duh.org> <tv@pobox.com> <todd@vierling.name>