aboutsummaryrefslogtreecommitdiffstats
diff options
authorAlejandro Colomar <alx@kernel.org>2026-02-25 12:46:24 +0100
committerAlejandro Colomar <alx@kernel.org>2026-02-25 12:46:40 +0100
commitcf15e8e165e09f04ed756bb290b2636fd41fae9b (patch)
tree7b461d1041411fccd3c1ce39e6d8e8d0b80504c3
parent532e2240c87338975401acc663a32d498f349070 (diff)
downloadman-pages-cf15e8e165e09f04ed756bb290b2636fd41fae9b.tar.gz
CONTRIBUTING.d/style/c: Add 'Alignment' subsection
Signed-off-by: Alejandro Colomar <alx@kernel.org>
-rw-r--r--CONTRIBUTING.d/style/c17
1 files changed, 13 insertions, 4 deletions
diff --git a/CONTRIBUTING.d/style/c b/CONTRIBUTING.d/style/c
index 2d91666f93..ebc80b8792 100644
--- a/CONTRIBUTING.d/style/c
+++ b/CONTRIBUTING.d/style/c
@@ -24,16 +24,25 @@ Description
break;
}
- Line length
- Lines should not be longer than 80 columns. Except that if they
- contain string literals, they can be longer; don't break
- user-visible string literals.
+ Alignment
+ However, alignment is done with spaces.
When breaking a function prototype, start the continuation line
with 4 spaces.
+ void foo(const char *restrict x,
+ const char *restrict y);
+
When breaking a function call, align at the opening parenthesis.
+ foobar(qwertyuiopasdfghjklzxcvbnm, qwertyuiop,
+ asdfghjkl);
+
+ Line length
+ Lines should not be longer than 80 columns. Except that if they
+ contain string literals, they can be longer; don't break
+ user-visible string literals.
+
Braces and spaces
Use K&R style for braces. But if the controlling expression of
an if/for/while is broken, the opening brace goes on a line of