[PATCH v2] CodingGuidelines: Added note about position of 'else' in C programs.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



During code review of some patches, it was noted that 'else' should
appear on the same line as the closing '}' of its 'if' block.

Signed-off-by: Leila Muhtasib <muhtasib@xxxxxxxxx>
---
 Documentation/CodingGuidelines |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines
index 4557711..99588f0 100644
--- a/Documentation/CodingGuidelines
+++ b/Documentation/CodingGuidelines
@@ -123,6 +123,9 @@ For C programs:
 
  - We try to avoid assignments inside if().
 
+ - "else" should be positioned on the same line as the closing
+   "}" of its "if" block.
+
  - Try to make your code understandable.  You may put comments
    in, but comments invariably tend to stale out when the code
    they were describing changes.  Often splitting a function
-- 
1.7.7.5 (Apple Git-26)

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]