From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=49217 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OfFDi-0001Z8-AZ for qemu-devel@nongnu.org; Sat, 31 Jul 2010 12:47:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OfFDg-00041y-Jd for qemu-devel@nongnu.org; Sat, 31 Jul 2010 12:47:34 -0400 Received: from hall.aurel32.net ([88.191.82.174]:59694) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OfFDg-00041m-ES for qemu-devel@nongnu.org; Sat, 31 Jul 2010 12:47:32 -0400 Date: Sat, 31 Jul 2010 18:47:29 +0200 From: Aurelien Jarno Subject: Re: [Qemu-devel] [PATCH] Drop braces around single statement rule Message-ID: <20100731164729.GM20459@volta.aurel32.net> References: <1280593414-2232-1-git-send-email-av1474@comtv.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <1280593414-2232-1-git-send-email-av1474@comtv.ru> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: malc Cc: qemu-devel@nongnu.org On Sat, Jul 31, 2010 at 08:23:34PM +0400, malc wrote: > History has shown that this particular rule is unenforcable. > > Signed-off-by: malc > --- > CODING_STYLE | 11 ++++++----- > 1 files changed, 6 insertions(+), 5 deletions(-) > > diff --git a/CODING_STYLE b/CODING_STYLE > index 92036f3..e0b5376 100644 > --- a/CODING_STYLE > +++ b/CODING_STYLE > @@ -54,16 +54,17 @@ readers that they are seeing a wrapped version; otherwise avoid this prefix. > > 4. Block structure > > -Every indented statement is braced; even if the block contains just one > -statement. The opening brace is on the line that contains the control > -flow statement that introduces the new block; the closing brace is on the > -same line as the else keyword, or on a line by itself if there is no else > -keyword. Example: > +The opening brace is on the line that contains the control flow > +statement that introduces the new block; the closing brace is on the > +same line as the else keyword, or on a line by itself if there is no > +else keyword. Example: > > if (a == 5) { > printf("a was 5.\n"); > + do5stuff(); > } else if (a == 6) { > printf("a was 6.\n"); > + do6stuff(); > } else { > printf("a was something else entirely.\n"); > } I am "neutral" on this particular rule. OTOH, my opinion is that we really should try to enforce the rules. The fact that we are humans and make mistakes (some patches not enforcing all the rules are committed), is not enough to just ignore the rules. If a rule is not enforceable, it should be removed from CODING_STYLE, not removed. -- Aurelien Jarno GPG: 1024D/F1BCDB73 aurelien@aurel32.net http://www.aurel32.net