From 09de8591d28ef596e1c62cf0b6a2d6e6a8988e1e Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Tue, 28 Nov 2017 16:42:54 -0800 Subject: coding-style: Remove caveats about mixing statements and declarations. OVS practice has evolved over time to mix code and data more freely. See also: https://mail.openvswitch.org/pipermail/ovs-dev/2017-November/341032.html Signed-off-by: Ben Pfaff Acked-by: Justin Pettit --- Documentation/internals/contributing/coding-style.rst | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'Documentation/internals') diff --git a/Documentation/internals/contributing/coding-style.rst b/Documentation/internals/contributing/coding-style.rst index 63a36812a..3ce104994 100644 --- a/Documentation/internals/contributing/coding-style.rst +++ b/Documentation/internals/contributing/coding-style.rst @@ -627,9 +627,8 @@ Most C99 features are OK because they are widely implemented: - Designated initializers (e.g. ``struct foo foo = {.a = 1};`` and ``int a[] = {[2] = 5};``). -- 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. +- Mixing of declarations and code within a block. Favor positioning that + allows variables to be initialized at their point of declaration. - Use of declarations in iteration statements (e.g. ``for (int i = 0; i < 10; i++)``). -- cgit v1.2.1