From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57460) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5rN9-00036v-Ih for qemu-devel@nongnu.org; Fri, 19 Jun 2015 04:10:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z5rN6-0008Hi-63 for qemu-devel@nongnu.org; Fri, 19 Jun 2015 04:09:59 -0400 Received: from cantor2.suse.de ([195.135.220.15]:50692 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5rN5-0008HA-Vh for qemu-devel@nongnu.org; Fri, 19 Jun 2015 04:09:56 -0400 Message-ID: <5583CE51.3020206@suse.de> Date: Fri, 19 Jun 2015 10:09:53 +0200 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1434698944-3331-1-git-send-email-pbonzini@redhat.com> In-Reply-To: <1434698944-3331-1-git-send-email-pbonzini@redhat.com> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] CODING_STYLE: update line length and mixed declaration rules List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , qemu-devel@nongnu.org Cc: Markus Armbruster , Eduardo Habkost Am 19.06.2015 um 09:29 schrieb Paolo Bonzini: > 1) Line lengths above 80 characters do exist. They are rare, but > they happen from time to time. An ignored rule is worse than an > exception to the rule, so do the latter. >=20 > 2) Mixed declarations also do exist at the top of #ifdef blocks. > Remark on this particular usage and suggest an alternative. >=20 > Cc: Andreas Faerber > Cc: Markus Armbruster > Cc: Eduardo Habkost > Signed-off-by: Paolo Bonzini > --- > CODING_STYLE | 21 ++++++++++++++++----- > scripts/checkpatch.pl | 9 ++++++--- > 2 files changed, 22 insertions(+), 8 deletions(-) >=20 > diff --git a/CODING_STYLE b/CODING_STYLE > index d46cfa5..d013cb8 100644 > --- a/CODING_STYLE > +++ b/CODING_STYLE > @@ -31,7 +31,11 @@ Do not leave whitespace dangling off the ends of lin= es. > =20 > 2. Line width > =20 > -Lines are 80 characters; not longer. > +Lines should be 80 characters; try not to make them longer. > + > +Sometimes it is hard to do, especially when dealing with QEMU subsyste= ms > +that use long function or symbol names. Even in that case, do not mak= e > +lines _much_ longer than 80 characters. Anthony had always allowed sensible exceptions to that rule, so +1 for reformulating it here. However, I would suggest that in that case we should lower the recommendation/warning to 78 chars, with the rationale of not only the actual code but also two-way diffs (79 chars plus +/-/space) and three-way diffs (78 chars plus 2x +/-/space) fitting into standard 80x24 windows. Either way, can you please decouple the two changes? Regards, Andreas > =20 > Rationale: > - Some people like to tile their 24" screens with a 6x4 matrix of 80x= 24 > @@ -39,6 +43,8 @@ Rationale: > let them keep doing it. > - Code and especially patches is much more readable if limited to a s= ane > line length. Eighty is traditional. > + - The four-space indentation makes the most common excuse ("But look > + at all that white space on the left!") moot. > - It is the QEMU coding style. > =20 > 3. Naming [snip] --=20 SUSE Linux GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Felix Imend=F6rffer, Jane Smithard, Dilip Upmanyu, Graham Norton; HRB 21284 (AG N=FCrnberg)