From owner-svn-src-head@FreeBSD.ORG Sat Jan 15 03:23:01 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 320A4106566B; Sat, 15 Jan 2011 03:23:01 +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 4405F8FC08; Sat, 15 Jan 2011 03:22:59 +0000 (UTC) Received: by wyf19 with SMTP id 19so3547127wyf.13 for ; Fri, 14 Jan 2011 19:22:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=tu7JVpvpe1+l7AF29g8WnXQlrlrtmIe7wZUVAXZwsWQ=; b=H7HGrd9co7PorIvHK5OAPfhG8UzQTDFykxcJX+PwtP5eQOxRVlXplbwNE5sVbqhD6G FoycJob7Ec2h7XKz0cJMyysAFBAI2wyNbKkK3CB/LTZjTDSVdRzMm3PnbXXyT6wEolo5 26j3YUL2hy+DGBhpsavgMDUyjj/xDDdhm3nVM= 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=nR0okwUSMrmSyZHqX8o8wa+pg2Z3KqnDU4F0HbAygZfMHgjv5Fb8M34QIbSf8z1kBL Guff+YAMUhgDFQOTQxrDvB3zradjMilPMnxY5GIiVz6e2fVZR6b3VcEXAJ69qQyRSafJ r4hHGWnPGpC69K1ua/rpI1RBnh/YnnwMRxzMY= MIME-Version: 1.0 Received: by 10.216.35.83 with SMTP id t61mr289047wea.1.1295061779118; Fri, 14 Jan 2011 19:22:59 -0800 (PST) Sender: yanegomi@gmail.com Received: by 10.216.254.226 with HTTP; Fri, 14 Jan 2011 19:22:58 -0800 (PST) In-Reply-To: <20110115133929.D16210@besplex.bde.org> References: <201101131820.p0DIKXip059402@svn.freebsd.org> <20110114174719.D28159@besplex.bde.org> <20110115133929.D16210@besplex.bde.org> Date: Fri, 14 Jan 2011 19:22:58 -0800 X-Google-Sender-Auth: 2XFJ2gNLjxXRsAkfctCDow4BOIE Message-ID: From: Garrett Cooper To: Bruce Evans Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, mdf@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r217369 - in head/sys: cam/scsi sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Jan 2011 03:23:01 -0000 On Fri, Jan 14, 2011 at 6:42 PM, Bruce Evans wrote: > On Fri, 14 Jan 2011 mdf@FreeBSD.org wrote: > >> On Thu, Jan 13, 2011 at 10:50 PM, Bruce Evans >> wrote: >>> >>> On Thu, 13 Jan 2011 mdf@freebsd.org wrote: >>> >>>> There appear to be 330 uses of SYSCTL and QUAD on the same line in >>>> CURRENT. =A0This seems reasonable to change them to S64, U64 and X64 s= o >>>> they correctly reflect the size they operate upon. >>>> >>>> What do y'all think? >>> >>> Now I suggest delaying this until they can be renamed to a type- generi= c >>> SYSCTL_INT() (would probably need to be spelled differently, SYSCTL_I() >>> say, even if SYSCTL_INT() was changed at the same time). >> >> I'm torn on this one. =A0The compiler knows the type (unless, for >> SYSCTL_INT, NULL/0 is used, but that is also a compile-time check), >> but to interpret it requires the use of __builtin_foo which is a gcc >> extension and not part of standard C. >> >> Philosophically, while I like this kind of letting the compiler do the >> work, if you want C++ you know where to find it. > > Oops. =A0I think sizeof() and issigned() can be used to determine the typ= e > well enough in functions and initialized data (do a fuller type check if > the compiler supports it), but I don't know how to do this in static > sysctl declarations (since sizeof() can't be used in cpp expressions). Why not just create some dumb testcases that can be run at build time to determine that for you? -Garrett