Date: Fri, 7 Jan 2011 19:58:27 -0800 From: Garrett Cooper <gcooper@FreeBSD.org> To: George Neville-Neil <gnn@neville-neil.com> Cc: mdf@freebsd.org, FreeBSD Arch <freebsd-arch@freebsd.org> Subject: Re: SYSCTL type safety Message-ID: <AANLkTimphvTU6f8CRK8j7-9AC1ukd-cZBCCi_T7OJS%2B8@mail.gmail.com> In-Reply-To: <F98F6C21-C477-4C55-BF10-DBBFA5871E0B@neville-neil.com> References: <AANLkTimv%2Br8o9_U7dxvO1o7mpNSM4VdYH7ex=uT_4WwO@mail.gmail.com> <F98F6C21-C477-4C55-BF10-DBBFA5871E0B@neville-neil.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Jan 7, 2011 at 7:32 PM, George Neville-Neil <gnn@neville-neil.com> wrote: > > On Jan 7, 2011, at 18:13 , mdf@FreeBSD.org wrote: > >> Long ago at Isilon we ran into a problem with some sysctls in the >> stock FreeBSD tree using the wrong type, like SYSCTL_ULONG on an int, >> or just mixing unsigned/signed. =A0We have a patch that uses transparent >> unions to cause a compile-time error with a type mismatch. =A0For a >> while I was hesitant to push this since I wasn't sure about the use of >> a gcc extension, but the SYSCTL fixes and the way to keep them sane >> came up again when we started building a new driver locally, and the >> build failed until we fixed some SYSCTL stuff. >> >> Anyways, the patch to sys/sysctl.h is at >> >> http://people.freebsd.org/~mdf/bsd-sysctl-type-safety.diff >> >> Please chime in if you think this is a bad thing to add to the tree. >> I will of course ensure a make universe passes locally before >> committing this part. =A0The plan is to change the SYSCTL use, not the >> base type of the variable, for any conflicts found. >> > > I have read, but not tried the patch. =A0I definitely like the idea. +1 (haven't tried, like the idea). Similar needs to be done for tunables as well. Thanks, -Garrett
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTimphvTU6f8CRK8j7-9AC1ukd-cZBCCi_T7OJS%2B8>