summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2018-02-27 10:33:53 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2018-02-27 10:33:53 -0800
commit2b0f6b1c187742ec6719478a01885ad902456f84 (patch)
tree027e967241308d54854408b9780e20a3c1afca91
parentMerge branch 'bp/name-hash-dirname-fix' (diff)
parentCodingGuidelines: mention "static" and "extern" (diff)
downloadtgif-2b0f6b1c187742ec6719478a01885ad902456f84.tar.xz
Merge branch 'jk/doc-do-not-write-extern'
Devdoc update. * jk/doc-do-not-write-extern: CodingGuidelines: mention "static" and "extern"
-rw-r--r--Documentation/CodingGuidelines5
1 files changed, 5 insertions, 0 deletions
diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines
index c4cb5ff0d4..48aa4edfbd 100644
--- a/Documentation/CodingGuidelines
+++ b/Documentation/CodingGuidelines
@@ -386,6 +386,11 @@ For C programs:
- Use Git's gettext wrappers to make the user interface
translatable. See "Marking strings for translation" in po/README.
+ - Variables and functions local to a given source file should be marked
+ with "static". Variables that are visible to other source files
+ must be declared with "extern" in header files. However, function
+ declarations should not use "extern", as that is already the default.
+
For Perl programs:
- Most of the C guidelines above apply.