From aff328352803b19294b4f8300bd0e20f0e1ba6b6 Mon Sep 17 00:00:00 2001 From: Pekka Enberg <penberg@cloudius-systems.com> Date: Wed, 12 Feb 2014 17:12:05 +0200 Subject: [PATCH] CodingStyle: Use of common sense is mandatory Make it explicit that the use of common sense is required when applying the rules of the style guide. Also point out explicitly that in multiple variable declarations, you're supposed to "violate" an earlier rule. Reviewed-by: Gleb Natapov <gleb@cloudius-systems.com> Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com> --- CODINGSTYLE.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/CODINGSTYLE.md b/CODINGSTYLE.md index 32866d4e8..6b44c414f 100644 --- a/CODINGSTYLE.md +++ b/CODINGSTYLE.md @@ -1,5 +1,8 @@ # OSv Coding Style -This document describe OSv coding style. + +This is a coding style guide for OSv. It is meant to be helpful, not a tool +for bikeshedding patches on the mailing list. The use of common sense when +applying these rules is required. ## 1. Indentation and layout 1.1 We use 4 spaces for indentation, no tabs. @@ -55,6 +58,13 @@ template and its paramters. int& b; ... +Please note that the rule obviously does not make sense when multiple variables +are declared on the same line. In such cases, it is preferable to do: + +... + int *a, *b; +... + ## 3. Braces 3.1 Always use curly braces for if statement, even if it is a one line if. -- GitLab