libxl: CODING_STYLE: Forbid if (...) { stmt; } else stmt;
authorIan Jackson <ian.jackson@eu.citrix.com>
Mon, 8 Aug 2016 10:21:31 +0000 (11:21 +0100)
committerWei Liu <wei.liu2@citrix.com>
Mon, 8 Aug 2016 10:52:02 +0000 (11:52 +0100)
And clarify that the rule about omitting braces for single statements
is optional (it is even contradicted by the example).

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
tools/libxl/CODING_STYLE

index 01ee25b392a187e71268cc3bda348c16344c4526..32170efb9e4197de608c176e060c35451f9e638b 100644 (file)
@@ -294,8 +294,10 @@ Libxenlight coding style is super simple.  Avoid tricky expressions.
 
 5. Block structure
 
-Every indented statement is braced, except blocks that contain just
-one statement.
+Every indented statement is braced, but blocks that contain just one
+statement may have the braces omitted.  To avoid confusion, either all
+the blocks in an if...else chain have braces, or none of them do.
+
 The opening brace is on the line that contains the control flow
 statement that introduces the new block; the closing brace is on the
 same line as the else keyword, or on a line by itself if there is no