Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Mar 2016 08:43:36 +0100
From:      Hans Petter Selasky <hps@selasky.org>
To:        Gleb Smirnoff <glebius@FreeBSD.org>, Ryan Stone <rysto32@gmail.com>
Cc:        "src-committers@freebsd.org" <src-committers@freebsd.org>, "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>, "svn-src-head@freebsd.org" <svn-src-head@freebsd.org>
Subject:   Re: svn commit: r296868 - head/sys/sys
Message-ID:  <56E7BD28.2000606@selasky.org>
In-Reply-To: <20160314203318.GL1328@FreeBSD.org>
References:  <201603141807.u2EI7xqm075602@repo.freebsd.org> <CAFMmRNyDuFGa=PYSgkfHpVsLxdKrFetpxrOmeFEf=YGVB1MAjQ@mail.gmail.com> <20160314203318.GL1328@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 03/14/16 21:33, Gleb Smirnoff wrote:
> On Mon, Mar 14, 2016 at 02:31:37PM -0400, Ryan Stone wrote:
> R> On Mon, Mar 14, 2016 at 2:07 PM, Gleb Smirnoff <glebius@freebsd.org> wrote:
> R>
> R> >   Remove useless cast in SYSCTL_ADD_COUNTER_U64 macro.
> R> >
> R>
> R> Is it useless?  I believe that the point is to give a compiler error if an
> R> incompatible pointer type was passed as the ptr parameter.
>
> Thanks for explanation! I will back out.
>

Hi,

I added the casts to get more checks with regard to the type safety in 
the sysctls, because sysctl_add_oid() uses "void *". They are not useless.

Maybe this should be explained in a comment somewhere?

Similarly you'll find a set of sizeof() compile time assert checks for 
the static sysctls.

--HPS



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?56E7BD28.2000606>