[Qemu-devel] [PATCH] CODING_STYLE: don't allow non-indented statements after if/else blocks

2009-10-26 Thread Aurelien Jarno
Rationale: The following code is difficult to read, but allowed by the current coding style. 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); Signed-off-by: Aurelien Jarno aurel...@aurel32.net --- CODING_STYLE | 10

Re: [Qemu-devel] [PATCH] CODING_STYLE: don't allow non-indented statements after if/else blocks

2009-10-26 Thread Blue Swirl
On Mon, Oct 26, 2009 at 8:26 AM, Aurelien Jarno aurel...@aurel32.net wrote: Rationale: The following code is difficult to read, but allowed by the current coding style. Fully agree. +Every control flow statement is followed by a new indented and braced +block; even if the block contains just

Re: [Qemu-devel] [PATCH] CODING_STYLE: don't allow non-indented statements after if/else blocks

2009-10-26 Thread Aurelien Jarno
On Mon, Oct 26, 2009 at 06:02:52PM +0200, Blue Swirl wrote: On Mon, Oct 26, 2009 at 8:26 AM, Aurelien Jarno aurel...@aurel32.net wrote: Rationale: The following code is difficult to read, but allowed by the current coding style. Fully agree. +Every control flow statement is followed by

Re: [Qemu-devel] [PATCH] CODING_STYLE: don't allow non-indented statements after if/else blocks

2009-10-26 Thread Blue Swirl
On Mon, Oct 26, 2009 at 10:03 PM, Aurelien Jarno aurel...@aurel32.net wrote: On Mon, Oct 26, 2009 at 06:02:52PM +0200, Blue Swirl wrote: On Mon, Oct 26, 2009 at 8:26 AM, Aurelien Jarno aurel...@aurel32.net wrote: Rationale: The following code is difficult to read, but allowed by the current

Re: [Qemu-devel] [PATCH] CODING_STYLE: don't allow non-indented statements after if/else blocks

2009-10-26 Thread Aurelien Jarno
On Mon, Oct 26, 2009 at 10:20:34PM +0200, Blue Swirl wrote: On Mon, Oct 26, 2009 at 10:03 PM, Aurelien Jarno aurel...@aurel32.net wrote: On Mon, Oct 26, 2009 at 06:02:52PM +0200, Blue Swirl wrote: On Mon, Oct 26, 2009 at 8:26 AM, Aurelien Jarno aurel...@aurel32.net wrote: Rationale: The

Re: [Qemu-devel] [PATCH] CODING_STYLE: don't allow non-indented statements after if/else blocks

2009-10-26 Thread Anthony Liguori
Aurelien Jarno wrote: That's the problem. We have seen that people already take advantage of the ambiguities, as I would have never have imagined someone writing the code in the rationale of this patch to avoid putting braces. I appreciate the desire to be precise, but we aren't writing a