From 39d222ebcb67eea2ab213da621646d7a3ae3fc71 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 9 Jun 2017 11:34:01 -0600 Subject: [PATCH] Update Coding Standard Document. --- Documentation/NuttXCCodingStandard.html | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Documentation/NuttXCCodingStandard.html b/Documentation/NuttXCCodingStandard.html index a116f981e7..87caa57034 100644 --- a/Documentation/NuttXCCodingStandard.html +++ b/Documentation/NuttXCCodingStandard.html @@ -2169,8 +2169,8 @@ x++;
  • Statement(s) always enclosed in braces. - Statement(s) following the if <condition> and else lines must always be enclosed in braces. - Braces must follow the if <condition> and else lines even in the case where these is no contained statement! + Statement(s) following the if <condition> and else keywords must always be enclosed in braces. + Braces must follow the if <condition> and else lines even in the cases where (a) there is no contained statement or (b) there is only a single statement!
  • Braces and indentation. @@ -2178,12 +2178,16 @@ x++;
  • Final brace followed by a single blank line. - The final right brace must be followed by a blank line. - This may be the final brace of the if compound statement. + The final right brace of the if-else must be followed by a blank line in most cases (the exception given below). + This may be the final brace of the if compound statement if the else keyword is not present. Or it may be the the final brace of the else compound statement if present. - A blank line never follows the right brace closing the if compound statement if else is present. + A blank line never follows the right brace closing the if compound statement if the else keyword is present. Use of braces must follow all other standard rules for braces and spacing.
  • +
  • + Exception where there is no blank line. + That blank line must also be omitted for certain cases where the if <condition>-else statement is nested within another compound statement; there should be no blank lines between consecutive right braces as discussed in the standard rules for use of braces. +
  • Other Applicable Coding Standards.