[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] Re: CODING_STYLE and if blocks
From: |
Måns Rullgård |
Subject: |
[Qemu-devel] Re: CODING_STYLE and if blocks |
Date: |
Thu, 22 Oct 2009 23:49:29 +0100 |
User-agent: |
Gnus/5.1008 (Gnus v5.10.8) XEmacs/21.4.22 (Instant Classic, linux) |
Aurelien Jarno <address@hidden> writes:
> Hi all,
>
> I am currently reviewing the S390 patches which extensively use of
> code like:
>
> 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");
>
> It is something currently allowed by the CODING_STYLE document (there is
> no "indented statement"), but I am not fully comfortable with it. Should
> we accept such code? Should we fix CODING_STYLE?
In my opinion a line break and indent after the if () should be used
except in the rare cases where keeping it all on a single line
improves readability.
--
Måns Rullgård
address@hidden