svn commit: r296868 - head/sys/sys

Hans Petter Selasky hps at selasky.org
Tue Mar 15 07:40:53 UTC 2016


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 at 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


More information about the svn-src-all mailing list