aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/CodingGuidelines
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-06-24 09:48:50 -0700
committerJunio C Hamano <gitster@pobox.com>2025-06-24 09:48:50 -0700
commit1f082506ba5b9815a6d7476aca40880c08950fef (patch)
tree562d933224081765020609f367e1319bfa75720e /Documentation/CodingGuidelines
parentMerge branch 'ac/preload-index-wo-the-repository' (diff)
parentCodingGuidelines: let BSS do its job (diff)
downloadgit-1f082506ba5b9815a6d7476aca40880c08950fef.tar.gz
git-1f082506ba5b9815a6d7476aca40880c08950fef.zip
Merge branch 'jc/cg-let-bss-do-its-job'
Clarify "do not explicitly initialize to zero" rule in the CodingGuidelines document. * jc/cg-let-bss-do-its-job: CodingGuidelines: let BSS do its job
Diffstat (limited to 'Documentation/CodingGuidelines')
-rw-r--r--Documentation/CodingGuidelines3
1 files changed, 3 insertions, 0 deletions
diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines
index 88971dea91..6350949f2e 100644
--- a/Documentation/CodingGuidelines
+++ b/Documentation/CodingGuidelines
@@ -315,6 +315,9 @@ For C programs:
encouraged to have a blank line between the end of the declarations
and the first statement in the block.
+ - Do not explicitly initialize global variables to 0 or NULL;
+ instead, let BSS take care of the zero initialization.
+
- NULL pointers shall be written as NULL, not as 0.
- When declaring pointers, the star sides with the variable