From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LoMpe-0006nS-FV for qemu-devel@nongnu.org; Mon, 30 Mar 2009 15:07:38 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LoMpZ-0006j6-P1 for qemu-devel@nongnu.org; Mon, 30 Mar 2009 15:07:37 -0400 Received: from [199.232.76.173] (port=39914 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LoMpZ-0006iq-5r for qemu-devel@nongnu.org; Mon, 30 Mar 2009 15:07:33 -0400 Received: from bsdimp.com ([199.45.160.85]:59935 helo=harmony.bsdimp.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LoMnD-0003gj-Hm for qemu-devel@nongnu.org; Mon, 30 Mar 2009 15:05:07 -0400 Date: Mon, 30 Mar 2009 13:02:12 -0600 (MDT) Message-Id: <20090330.130212.1723234361.imp@bsdimp.com> Subject: Re: [Qemu-devel] [PATCH] Document Qemu coding style From: "M. Warner Losh" In-Reply-To: References: <1238361823-24939-1-git-send-email-avi@redhat.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, blauwirbel@gmail.com In message: Blue Swirl writes: : > +An exception is the opening brace for a function; for reasons of tradition : > +and clarity it comes on a line by itself: : > + : > + void a_function(void) : > + { : > + do_something(); : > + } : > + : > +Rationale: a consistent (except for functions...) bracing style reduces : > +ambiguity and avoids needless churn when lines are added or removed. : > +Furthermore, it is the Qemu coding style. : : No, this is the K&R style. Quoting linux/Documentation/CodingStyle: : : Heretic people all over the world have claimed that this inconsistency : is ... well ... inconsistent, but all right-thinking people know that : (a) K&R are _right_ and (b) K&R are right. Besides, functions are : special anyway (you can't nest them in C). And besides, there's lots of almost-smart tools that operate on source code that know this is always true... Or at least historically that's been the case, don't know of any widely used ones today, but I doubt they were all fixed... Warner