From owner-svn-src-all@FreeBSD.ORG Thu Nov 27 17:57:32 2008 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 614601065670; Thu, 27 Nov 2008 17:57:32 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 245598FC27; Thu, 27 Nov 2008 17:57:32 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id mARHtVsu008168; Thu, 27 Nov 2008 10:55:31 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Thu, 27 Nov 2008 10:55:34 -0700 (MST) Message-Id: <20081127.105534.188222755.imp@bsdimp.com> To: ivoras@gmail.com From: "M. Warner Losh" In-Reply-To: <9bbcef730811270238k61c3e59fqee7715f017d70ccf@mail.gmail.com> References: <9bbcef730811270220h1a7f812k2ba340737132ff82@mail.gmail.com> <8663m94g30.fsf@ds4.des.no> <9bbcef730811270238k61c3e59fqee7715f017d70ccf@mail.gmail.com> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@FreeBSD.org, des@des.no, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r185356 - head/sys/dev/ixgbe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Nov 2008 17:57:32 -0000 In message: <9bbcef730811270238k61c3e59fqee7715f017d70ccf@mail.gmail.co= m> "Ivan Voras" writes: : 2008/11/27 Dag-Erling Sm=F8rgrav : : > "Ivan Voras" writes: : >> And at least the newer GEOM code also uses c99 variable declaratio= ns : >> (not only for initializers - they were c99 from the start). : > : > I'm curious about what you mean with "c99 variable declarations". = If : > you are referring to loop variable declarations, I can only find tw= o : > cases, both in g_linux_lvm.c. Other than that and mixing declarati= ons : > with statements (which style(9) explicitly forbids), there is no : > difference between c89 to c99 as far as variable declarations are : > concerned. : = : Yes, but not only loops - I mean things like: : = : if () { : struct *something abc; : int y; : ... : } : = : You'll probably find my code is one the biggest users of this style : but I've only started using it when I saw it already used. This is a K&R level C construct. It is discouraged in style(9) because it makes it hard to find declarations. However, it is used in the kernel in a number of places. I personally really dislike the style (and yes, I know all the arguments for it). If you really want something that complex inside a block to need block scoped variables, then that really argues for a function oft times... Warner