Skip to content

Commit a26fd03

Browse files
aspiersgitster
authored andcommitted
Documentation: move support for old compilers to CodingGuidelines
The "Try to be nice to older C compilers" text is clearly a guideline to be borne in mind whilst coding rather than when submitting patches. Signed-off-by: Adam Spiers <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 6a5b649 commit a26fd03

File tree

2 files changed

+8
-13
lines changed

2 files changed

+8
-13
lines changed

Documentation/CodingGuidelines

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,14 @@ For C programs:
112112

113113
- We try to keep to at most 80 characters per line.
114114

115+
- We try to support a wide range of C compilers to compile git with,
116+
including old ones. That means that you should not use C99
117+
initializers, even if a lot of compilers grok it.
118+
119+
- Variables have to be declared at the beginning of the block.
120+
121+
- NULL pointers shall be written as NULL, not as 0.
122+
115123
- When declaring pointers, the star sides with the variable
116124
name, i.e. "char *string", not "char* string" or
117125
"char * string". This makes it easier to understand code

Documentation/SubmittingPatches

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -127,19 +127,6 @@ in templates/hooks--pre-commit. To help ensure this does not happen,
127127
run git diff --check on your changes before you commit.
128128

129129

130-
(1a) Try to be nice to older C compilers
131-
132-
We try to support a wide range of C compilers to compile
133-
git with. That means that you should not use C99 initializers, even
134-
if a lot of compilers grok it.
135-
136-
Also, variables have to be declared at the beginning of the block
137-
(you can check this with gcc, using the -Wdeclaration-after-statement
138-
option).
139-
140-
Another thing: NULL pointers shall be written as NULL, not as 0.
141-
142-
143130
(2) Generate your patch using git tools out of your commits.
144131

145132
git based diff tools generate unidiff which is the preferred format.

0 commit comments

Comments
 (0)