From owner-svn-src-head@freebsd.org  Fri Jan 26 16:56:09 2018
Return-Path: <owner-svn-src-head@freebsd.org>
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9188FEB697C
 for <svn-src-head@mailman.ysv.freebsd.org>;
 Fri, 26 Jan 2018 16:56:09 +0000 (UTC) (envelope-from ian@freebsd.org)
Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org
 [54.200.247.200])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 1B2387ADA4
 for <svn-src-head@freebsd.org>; Fri, 26 Jan 2018 16:56:08 +0000 (UTC)
 (envelope-from ian@freebsd.org)
X-MHO-User: cb6ae677-02b9-11e8-bb8e-b35b57339d60
X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information
X-Originating-IP: 73.78.92.27
X-Mail-Handler: DuoCircle Outbound SMTP
Received: from ilsoft.org (unknown [73.78.92.27])
 by outbound1.ore.mailhop.org (Halon) with ESMTPSA
 id cb6ae677-02b9-11e8-bb8e-b35b57339d60;
 Fri, 26 Jan 2018 16:56:04 +0000 (UTC)
Received: from rev (rev [172.22.42.240])
 by ilsoft.org (8.15.2/8.15.2) with ESMTP id w0QGu5QY013985;
 Fri, 26 Jan 2018 09:56:05 -0700 (MST) (envelope-from ian@freebsd.org)
Message-ID: <1516985765.42536.251.camel@freebsd.org>
Subject: Re: svn commit: r328430 - head/sbin/devd
From: Ian Lepore <ian@freebsd.org>
To: Warner Losh <imp@bsdimp.com>, Matt Joras <matt.joras@gmail.com>
Cc: Eitan Adler <eadler@freebsd.org>, src-committers
 <src-committers@freebsd.org>, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Date: Fri, 26 Jan 2018 09:56:05 -0700
In-Reply-To: <CANCZdfpbfMVYMG0=YxVMA6otHgAqiBu9LT=51RHEf_Ey9x8rzg@mail.gmail.com>
References: <201801260440.w0Q4efhg008105@repo.freebsd.org>
 <CANCZdfosuC0CTig=6_p3D5g0fDPhCVW3+4HAEbD4EQ4+3TetpA@mail.gmail.com>
 <CADdTf+iVmzMSr+dVuXzx-A+BPNPLWuT=Rd3CbvEsW5SZOTMFWQ@mail.gmail.com>
 <CANCZdfpbfMVYMG0=YxVMA6otHgAqiBu9LT=51RHEf_Ey9x8rzg@mail.gmail.com>
Content-Type: text/plain; charset="ISO-8859-1"
X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port 
Mime-Version: 1.0
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 <svn-src-head.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-head>,
 <mailto:svn-src-head-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-head/>
List-Post: <mailto:svn-src-head@freebsd.org>
List-Help: <mailto:svn-src-head-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-head>,
 <mailto:svn-src-head-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 26 Jan 2018 16:56:09 -0000

On Thu, 2018-01-25 at 22:59 -0700, Warner Losh wrote:
> On Thu, Jan 25, 2018 at 10:02 PM, Matt Joras <matt.joras@gmail.com> wrote:
> 
> > 
> > On Thu, Jan 25, 2018 at 8:52 PM, Warner Losh <imp@bsdimp.com> wrote:
> > > 
> > > 
> > > 
> > > On Thu, Jan 25, 2018 at 9:40 PM, Eitan Adler <eadler@freebsd.org> wrote:
> > > > 
> > > > 
> > > > Author: eadler
> > > > Date: Fri Jan 26 04:40:41 2018
> > > > New Revision: 328430
> > > > URL: https://svnweb.freebsd.org/changeset/base/328430
> > > > 
> > > > Log:
> > > >   devd: minor nits
> > > > 
> > > >   - mark usage as noreturn
> > > >   - config does not need a virtual destructor
> > > 
> > > Everything needs a virtual destructor...  Please back that part of this
> > > out...
> > > 
> > > Warner
> > Needs? If there's not inheritance there's no _need_ to do it, and it's
> > arguably superfluous. That being said it's also an arguably
> > superfluous change to remove it.
> > 
> OK. Needs might not be the proper word. It's a stylistic thing in all the
> C++ code I write. It keeps me from having to go back later and add it back
> when it really does need it after subclasses are derived from it. It's an
> important detail that often gets overlooked. The cost is minimal. And this
> isn't one of the rare cases where it's harmful to have it.
> 
> Warner

Bah.  When a class is not designed for inheritence, it should NOT have
a virtual dtor.  Not just because of the extra overhead of vtable
dispatching where it isn't needed, but also because it lulls someone
who comes along and looks at the class into thinking it was designed to
be derived-from.  If it wasn't specifically designed to be derived-
from, then before doing so somebody needs to make sure the class is
ready for that.

Modern compilers will warn about a class with virtual functions and no
virtual dtor, so just blindly including it is more harmful than
prophylactic these days, IMO.

-- Ian