* [PATCH] CodingGuidelines: let BSS do its job
@ 2025-06-11 21:16 Junio C Hamano
2025-06-12 7:40 ` Christian Couder
0 siblings, 1 reply; 2+ messages in thread
From: Junio C Hamano @ 2025-06-11 21:16 UTC (permalink / raw)
To: git
We have mentioned this in various reviews, but I didn't see it
mentioned in the CodingGuildelines document. Let's add it.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
Documentation/CodingGuidelines | 3 +++
1 file changed, 3 insertions(+)
diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines
index a0e7041c54..4d1d52aa37 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
--
2.50.0-rc2-207-gc448ca4963
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] CodingGuidelines: let BSS do its job
2025-06-11 21:16 [PATCH] CodingGuidelines: let BSS do its job Junio C Hamano
@ 2025-06-12 7:40 ` Christian Couder
0 siblings, 0 replies; 2+ messages in thread
From: Christian Couder @ 2025-06-12 7:40 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
On Wed, Jun 11, 2025 at 11:18 PM Junio C Hamano <gitster@pobox.com> wrote:
>
> We have mentioned this in various reviews, but I didn't see it
> mentioned in the CodingGuildelines document. Let's add it.
Yeah, thanks for maintaining this document!
> Signed-off-by: Junio C Hamano <gitster@pobox.com>
> ---
> Documentation/CodingGuidelines | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines
> index a0e7041c54..4d1d52aa37 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.
Looks good.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-06-12 7:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-11 21:16 [PATCH] CodingGuidelines: let BSS do its job Junio C Hamano
2025-06-12 7:40 ` Christian Couder
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.