提交 1dbba2cf 编写于 作者: G Gary R Hook 提交者: Jonathan Corbet

Documentation/CodingStyle: Add an example for braces

Add another example of required braces when using a compound statement in
a loop.
Signed-off-by: NGary R Hook <gary.hook@amd.com>
Signed-off-by: NJonathan Corbet <corbet@lwn.net>
上级 5a5d1a77
......@@ -200,6 +200,15 @@ statement; in the latter case use braces in both branches:
otherwise();
}
Also, use braces when a loop contains more than a single simple statement:
.. code-block:: c
while (condition) {
if (test)
do_something();
}
3.1) Spaces
***********
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册