Skip to content

Commit 7df3f55

Browse files
pks-tgitster
authored andcommitted
Documentation: clarify indentation style for C preprocessor directives
In the preceding commit, we have settled on using a single space per nesting level to indent preprocessor directives. Clarify our coding guidelines accordingly. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 3957267 commit 7df3f55

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Documentation/CodingGuidelines

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,16 @@ For C programs:
214214
- We use tabs to indent, and interpret tabs as taking up to
215215
8 spaces.
216216

217+
- Nested C preprocessor directives are indented after the hash by one
218+
space per nesting level.
219+
220+
#if FOO
221+
# include <foo.h>
222+
# if BAR
223+
# include <bar.h>
224+
# endif
225+
#endif
226+
217227
- We try to keep to at most 80 characters per line.
218228

219229
- As a Git developer we assume you have a reasonably modern compiler

0 commit comments

Comments
 (0)