From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MtIWX-0007oS-R0 for qemu-devel@nongnu.org; Thu, 01 Oct 2009 06:04:33 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MtIWT-0007lq-Mp for qemu-devel@nongnu.org; Thu, 01 Oct 2009 06:04:33 -0400 Received: from [199.232.76.173] (port=51626 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MtIWT-0007lj-FE for qemu-devel@nongnu.org; Thu, 01 Oct 2009 06:04:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46136) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MtIWS-00014r-RC for qemu-devel@nongnu.org; Thu, 01 Oct 2009 06:04:29 -0400 Date: Thu, 1 Oct 2009 12:02:21 +0200 From: "Michael S. Tsirkin" Subject: Re: [Qemu-devel] Re: CODING_STYLE Message-ID: <20091001100220.GJ5718@redhat.com> References: <20090924191121.GB29419@redhat.com> <20090929161115.GA13885@redhat.com> <20090930135142.GA20378@redhat.com> <20091001012548.GA26280@laped.iglesias.mooo.com> <4AC46EAF.2030809@redhat.com> <20091001090259.GD5718@redhat.com> <20091001094616.GR9832@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091001094616.GR9832@redhat.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gleb Natapov Cc: Kevin Wolf , Blue Swirl , Juan Quintela , qemu-devel@nongnu.org, "Edgar E. Iglesias" On Thu, Oct 01, 2009 at 11:46:16AM +0200, Gleb Natapov wrote: > On Thu, Oct 01, 2009 at 11:02:59AM +0200, Michael S. Tsirkin wrote: > > On Thu, Oct 01, 2009 at 10:56:15AM +0200, Kevin Wolf wrote: > > > Am 01.10.2009 03:25, schrieb Edgar E. Iglesias: > > > > On Wed, Sep 30, 2009 at 07:00:21PM +0200, Juan Quintela wrote: > > > >> "Michael S. Tsirkin" wrote: > > > >> > > > >> .... > > > >> > > > >>>> Actually, I tried to tweak 'indent' to match QEMU style without much success. > > > >>>> > > > >>>> We could also select a new style, like Linux kernel one. I'm also not > > > >>>> a great fan of that either. But at least 'indent' could be used very > > > >>>> easily and I think there would be other benefits, like reuse of Git > > > >>>> hooks, patch checking scripts and Emacs configs. With full 'indent' > > > >>>> support all sources could be massaged mechanically to make the switch > > > >>>> less painful. > > > >>>> > > > >>>> Then there are K&R and GNU styles, but I like them even less. > > > >>> > > > >>> So ... Linux kernel style wins? What do others think? > > > >> > > > >> Where do I have to sign? > > > > > > > > Yeah. > > > > > > > > I really don't care very much. I've changed my CRIS and MicroBlaze code from > > > > style to style a couple of times but the only style regardless of style I find > > > > offensive is the: > > > > > > > > if (x) { > > > > x=1; > > > > } else { > > > > x=0; > > > > } > > > > > > > > TBH, the extra curley braceys are just pure nonsense. > > > > > > Except that when adding another line after x=1; the patch doesn't > > > contain a change to the if line (with a possibly long condition and the > > > possibility of introducing typos that nobody will see because everybody > > > assumes it's just the new brace). > > > > I don't think I saw a bug introduced this way in ages. > > The absense of braces is easy enough to spot. > > > With modern editors that indent automatically it's impossible not to > spot. > > > > But then, you could say the ugliness of braces is more important and I > > > really don't care too much about the braces. However, I don't think we > > > should change the coding style radically like switching to the Linux > > > kernel style. > > > > > > Kevin > > > > I think this is the only way to get a consistent style, for 3 reasons: > > - a lot of people hack at both projects, they just keep mixing styles > > - linux has automatic checkers that are maintained and improved over time > > - linux style is just better ;) > > > Real men's editor (TM) is able to switch style depending on what you > edit. > -- > Gleb.