From owner-freebsd-arch@FreeBSD.ORG Sat Jan 8 03:53:39 2011 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E297910656CF; Sat, 8 Jan 2011 03:53:39 +0000 (UTC) (envelope-from gnn@neville-neil.com) Received: from vps.hungerhost.com (vps.hungerhost.com [216.38.53.176]) by mx1.freebsd.org (Postfix) with ESMTP id B54DF8FC13; Sat, 8 Jan 2011 03:53:39 +0000 (UTC) Received: from cpe-74-66-24-70.nyc.res.rr.com ([74.66.24.70] helo=[192.168.1.119]) by vps.hungerhost.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69) (envelope-from ) id 1PbPXU-00046I-4F; Fri, 07 Jan 2011 22:32:24 -0500 Mime-Version: 1.0 (Apple Message framework v1082) Content-Type: text/plain; charset=us-ascii From: George Neville-Neil In-Reply-To: Date: Fri, 7 Jan 2011 22:32:23 -0500 Content-Transfer-Encoding: 7bit Message-Id: References: To: mdf@FreeBSD.org X-Mailer: Apple Mail (2.1082) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vps.hungerhost.com X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - neville-neil.com Cc: FreeBSD Arch Subject: Re: SYSCTL type safety X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Jan 2011 03:53:40 -0000 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. We have a patch that uses transparent > unions to cause a compile-time error with a type mismatch. For 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. The 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. I definitely like the idea. Best, George