From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45183) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WCRO5-0004XR-Mj for qemu-devel@nongnu.org; Sun, 09 Feb 2014 05:13:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WCRNz-0005Kf-Mp for qemu-devel@nongnu.org; Sun, 09 Feb 2014 05:13:21 -0500 Received: from cantor2.suse.de ([195.135.220.15]:51329 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WCRNz-0005K7-G8 for qemu-devel@nongnu.org; Sun, 09 Feb 2014 05:13:15 -0500 Message-ID: <52F754B5.3070000@suse.de> Date: Sun, 09 Feb 2014 11:13:09 +0100 From: =?ISO-8859-1?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1391445551-6561-1-git-send-email-pbonzini@redhat.com> <1391445551-6561-17-git-send-email-pbonzini@redhat.com> <52F6695A.7090801@suse.de> <52F6BEB1.2090606@redhat.com> <20140209080633.GK28427@otherpad.lan.raisama.net> In-Reply-To: <20140209080633.GK28427@otherpad.lan.raisama.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PULL 16/16] target-i386: Move KVM default-vendor hack to instance_init List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost Cc: Peter Maydell , QEMU Developers , Paolo Bonzini Am 09.02.2014 09:06, schrieb Eduardo Habkost: > On Sun, Feb 09, 2014 at 12:10:20AM +0000, Peter Maydell wrote: >> On 8 February 2014 23:33, Paolo Bonzini wrote: >>> Il 08/02/2014 18:28, Andreas F=E4rber ha scritto: >>>> Since when is it OK to declare variables in the middle of the block? >> >>> When the code looks better, it is OK since always: checkpatch.pl does= n't >>> complain and -Wdeclaration-after-statement is not added to the compil= er >>> flags. >> >> Huh? checkpatch is notoriously not a reliable guide, and we've had >> the "declarations at start of block" rule since forever. >=20 > Sorry for my confusion, but I was not aware of that rule, and I don't > know what I should use as a guide, if checkpatch.pl and CODING_STYLE ar= e > not enough. Is there additional coding style documentation or scripts I > should look at? HACKING exists as additional document, but it doesn't list it either. There's a lot of unwritten rules that reoccur in review, such as no QERR_*, no trailing \n in error_setg() and error_report(), ... I think the history here is that QEMU didn't allow C99 some time back and C89 (or ANSI C?) didn't allow declarations elsewhere. Blue was fiercely in favor of keeping that rule (just like the no-single-line-comments rule despite allowed from C99 on), saying that goto statements might do the wrong thing otherwise. And I have been advocating to make this rule more clear by uniformly separating declarations from statements with a white line. Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg