Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N16Tq-0004fu-HU for qemu-devel@nongnu.org; Thu, 22 Oct 2009 18:50:02 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N16Tm-0004fA-RY for qemu-devel@nongnu.org; Thu, 22 Oct 2009 18:50:02 -0400 Received: from [199.232.76.173] (port=35374 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N16Tm-0004f5-ME for qemu-devel@nongnu.org; Thu, 22 Oct 2009 18:49:58 -0400 Received: from lo.gmane.org ([80.91.229.12]:59986) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1N16Tm-0000D1-58 for qemu-devel@nongnu.org; Thu, 22 Oct 2009 18:49:58 -0400 Received: from list by lo.gmane.org with local (Exim 4.50) id 1N16Tj-0001MW-1s for qemu-devel@nongnu.org; Fri, 23 Oct 2009 00:49:55 +0200 Received: from unicorn.mansr.com ([78.86.181.103]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 23 Oct 2009 00:49:55 +0200 Received: from mans by unicorn.mansr.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 23 Oct 2009 00:49:55 +0200 From: =?iso-8859-1?Q?M=E5ns_Rullg=E5rd?= Date: Thu, 22 Oct 2009 23:49:29 +0100 Message-ID: References: <20091022220153.GB10700@volta.aurel32.net> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Sender: news Subject: [Qemu-devel] Re: CODING_STYLE and if blocks List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Aurelien Jarno writes: > Hi all, > > I am currently reviewing the S390 patches which extensively use of > code like: > > if (a == 5) printf("a was 5.\n"); > else if (a == 6) printf("a was 6.\n"); > else printf("a was something else entirely.\n"); > > It is something currently allowed by the CODING_STYLE document (there is > no "indented statement"), but I am not fully comfortable with it. Should > we accept such code? Should we fix CODING_STYLE? In my opinion a line break and indent after the if () should be used except in the rare cases where keeping it all on a single line improves readability. -- Måns Rullgård mans@mansr.com