From a20bf1df8b01f91577b00eedd45e3b1109055ca2 Mon Sep 17 00:00:00 2001 From: "Andrew D. Zonenberg" Date: Wed, 3 Jun 2020 04:16:52 -0700 Subject: [PATCH] Curly braces for single line statements --- cpp-coding-policy.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cpp-coding-policy.md b/cpp-coding-policy.md index 4881aaa..0b7de6b 100644 --- a/cpp-coding-policy.md +++ b/cpp-coding-policy.md @@ -35,6 +35,8 @@ limited to `gets()`, `strcpy()`, `sprintf()`, etc. * One level of indentation = one \t character = four columns. Do not use spaces for indentation. * Curly braces go on their own line. +* Curly braces are not required for a control statement with a single-line body, however if an explicitly empty body is +used then use braces rather than simply a semicolon. The opening and closing braces may be on the same line. * The * in a pointer declaration is part of the type, not the variable. For example `int* foo`, not `int *foo`. * Do not put a space between a keyword or identifier name and an opening parentheses. For example `if(foo)`, not `if (foo)`.