summaryrefslogtreecommitdiff
path: root/CodingStyle
diff options
context:
space:
mode:
authorJarno Rajahalme <jrajahalme@nicira.com>2014-05-28 16:56:29 -0700
committerJarno Rajahalme <jrajahalme@nicira.com>2014-05-28 16:56:29 -0700
commit7c96151e33dcb8e547d2bd19de4a1ec62b2b36a0 (patch)
treed37b871f5cbe146b15af8b958535d3dd7a2fed07 /CodingStyle
parent2e388fa1c0ef59513d2ee2f180804be66228c1e0 (diff)
downloadopenvswitch-7c96151e33dcb8e547d2bd19de4a1ec62b2b36a0.tar.gz
CodingStyle: Allow C99 mixing of declarations and code.
As even the MSVC 2013 now supports the C99 mixing of declarations and code, we can now allow them in OVS code. Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'CodingStyle')
-rw-r--r--CodingStyle15
1 files changed, 7 insertions, 8 deletions
diff --git a/CodingStyle b/CodingStyle
index bae8cd65c..0ba036697 100644
--- a/CodingStyle
+++ b/CodingStyle
@@ -515,7 +515,7 @@ global variables.
C DIALECT
- Some C99 features are OK because they are widely implemented:
+ Most C99 features are OK because they are widely implemented:
* Flexible array members (e.g. struct { int foo[]; }).
@@ -533,16 +533,15 @@ C DIALECT
* Designated initializers (e.g. "struct foo foo = {.a = 1};" and
"int a[] = {[2] = 5};").
- Don't use other C99 features that are not widely implemented in
-older compilers:
+ * Mixing of declarations and code within a block. Please use this
+ judiciously; keep declarations nicely grouped together in the
+ beginning of a block if possible.
- * Don't mix declarations and code within a block.
-
- * Don't use declarations in iteration statements (e.g. don't write
+ * Use of declarations in iteration statements (e.g.
"for (int i = 0; i < 10; i++)").
- * Don't put a trailing comma in an enum declaration (e.g. don't
- write "enum { x = 1, };").
+ * Use of a trailing comma in an enum declaration (e.g.
+ "enum { x = 1, };").
As a matter of style, avoid // comments.