Date: Thu, 25 Jan 2018 23:02:01 -0700 From: Warner Losh <imp@bsdimp.com> To: Eitan Adler <eadler@freebsd.org> Cc: Matt Joras <matt.joras@gmail.com>, src-committers <src-committers@freebsd.org>, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r328430 - head/sbin/devd Message-ID: <CANCZdfoyWoYT7Di1QPPdr9StdKL2pepfrB0ocR05sArmcqZ-_w@mail.gmail.com> In-Reply-To: <CAF6rxgks5NkExz=VB1YyPktKKft%2BYG47uttrLazw3tCvZyArtg@mail.gmail.com> References: <201801260440.w0Q4efhg008105@repo.freebsd.org> <CANCZdfosuC0CTig=6_p3D5g0fDPhCVW3%2B4HAEbD4EQ4%2B3TetpA@mail.gmail.com> <CADdTf%2BiVmzMSr%2BdVuXzx-A%2BBPNPLWuT=Rd3CbvEsW5SZOTMFWQ@mail.gmail.com> <CAF6rxgks5NkExz=VB1YyPktKKft%2BYG47uttrLazw3tCvZyArtg@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Jan 25, 2018 at 10:04 PM, Eitan Adler <eadler@freebsd.org> wrote: > On 25 January 2018 at 21:02, 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. > > Yeah, I don't think this needs it. That said, readded in 328431. I > removed it originally since it was the only virtual function in config > and it seemed out of place. At the least, I went looking for what > inherited from it. > It's a flaw in C++ that you have a choice here. All dtors should be virtual because you never know when you'll have new derived classes and have to hunt down a hard-to-find bug because you didn't go back and make it virtual. Of course, this flaw is there because of other flaws in the language. This isn't one of the cases where having it is harmful, so stylistically I always have them unless there's a good reason not to because were I to create derived classes, I might forget to make it virtual. It's an old habit, I'll admit. Warner
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfoyWoYT7Di1QPPdr9StdKL2pepfrB0ocR05sArmcqZ-_w>