Skip to content
Snippets Groups Projects
Commit 1dbba2cf authored by Gary R Hook's avatar Gary R Hook Committed by Jonathan Corbet
Browse files

Documentation/CodingStyle: Add an example for braces


Add another example of required braces when using a compound statement in
a loop.

Signed-off-by: default avatarGary R Hook <gary.hook@amd.com>
Signed-off-by: default avatarJonathan Corbet <corbet@lwn.net>
parent 5a5d1a77
No related branches found
No related tags found
No related merge requests found
......@@ -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
***********
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment