From owner-freebsd-arch@FreeBSD.ORG Sat Jan 8 03:58:29 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 8FD4E10656A6; Sat, 8 Jan 2011 03:58:29 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id EFF638FC13; Sat, 8 Jan 2011 03:58:28 +0000 (UTC) Received: by wyf19 with SMTP id 19so18215627wyf.13 for ; Fri, 07 Jan 2011 19:58:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=mw6LXB1rb813Qr1bE3mZRDassAonuCUS07eJrpWliHM=; b=ni7WaaJCsVl3CnNSWgq2qjQiKBNBpnoKz0azEDloQbGz1MDGm5mbxBFS7zD8/UqHaz 7mQzJZzhJew+HEhVpGiuRwfCDx6DWmcC0ApwSnZ2b82dH+Ws2FWg7e/wVxzdyUHeq3Wm GPQXdlACF82hEMTE2BSxGb9TwEGQ5kgxD7b2w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=SJ6y+wqt+DYdjCP20g80fiYvgWf2mzuxZQSLJUnhXAyiWWTFvssITz65m+0hbKPo+p OjSpGiXr7uDK7AApGD4O4SjEHqgAQHWYaUg7H9jq6+gCedVC2che5LtimaAXiuqlpkAe R8mPzlxzjvg4rOy5vDBBjwChj/48+/Qx8oTb8= MIME-Version: 1.0 Received: by 10.216.191.215 with SMTP id g65mr1825290wen.16.1294459107459; Fri, 07 Jan 2011 19:58:27 -0800 (PST) Sender: yanegomi@gmail.com Received: by 10.216.254.226 with HTTP; Fri, 7 Jan 2011 19:58:27 -0800 (PST) In-Reply-To: References: Date: Fri, 7 Jan 2011 19:58:27 -0800 X-Google-Sender-Auth: -fCzRAj4_rBtYr5Y2ahUWNdIgXM Message-ID: From: Garrett Cooper To: George Neville-Neil Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: mdf@freebsd.org, 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:58:29 -0000 On Fri, Jan 7, 2011 at 7:32 PM, George Neville-Neil 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