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
This commit is contained in:
Junio C Hamano
2025-06-24 09:48:50 -07:00

View File

@@ -315,6 +315,9 @@ For C programs:
encouraged to have a blank line between the end of the declarations encouraged to have a blank line between the end of the declarations
and the first statement in the block. 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. - NULL pointers shall be written as NULL, not as 0.
- When declaring pointers, the star sides with the variable - When declaring pointers, the star sides with the variable