From: Junio C Hamano <gitster@pobox.com>
To: git@vger.kernel.org
Subject: [PATCH] CodingGuidelines: give deadline for "for (int i = 0; ..."
Date: Wed, 30 Mar 2022 17:09:16 -0700 [thread overview]
Message-ID: <xmqqy20r3rv7.fsf@gitster.g> (raw)
We raised the weather balloon to see if we can allow the construct
in 44ba10d6 (revision: use C99 declaration of variable in for()
loop, 2021-11-14), which was shipped as a part of Git v2.35.
Document that fact in the coding guidelines, and more importantly,
give ourselves a deadline to revisit and update.
Let's declare that we will officially adopt the variable declaration
in the initializaiton part of "for ()" statement this winter, unless
we find that a platform we care about does not grok it.
A separate weather balloon for C99 as a whole was raised separately
in 7bc341e2 (git-compat-util: add a test balloon for C99 support,
2021-12-01). Hopefully, as we find out that all C99 features are OK
on all platforms we care about, we can stop probing the features we
want one-by-one like this (it does not necessarily mean that we
would automatically start using any and all C99 language features,
though).
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
Documentation/CodingGuidelines | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines
index 0e27b5395d..f0475c1770 100644
--- a/Documentation/CodingGuidelines
+++ b/Documentation/CodingGuidelines
@@ -217,7 +217,10 @@ For C programs:
the first statement (i.e. -Wdeclaration-after-statement).
- Declaring a variable in the for loop "for (int i = 0; i < 10; i++)"
- is still not allowed in this codebase.
+ is still not allowed in this codebase. We are in the process of
+ allowing it by waiting to see that 44ba10d6 (revision: use C99
+ declaration of variable in for() loop, 2021-11-14) does not get
+ complaints. Let's revisit this around November 2022.
- NULL pointers shall be written as NULL, not as 0.
--
2.35.1-898-ge9d02b9944
next reply other threads:[~2022-03-31 0:09 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-31 0:09 Junio C Hamano [this message]
2022-03-31 10:10 ` [PATCH] CodingGuidelines: give deadline for "for (int i = 0; ..." Ævar Arnfjörð Bjarmason
2022-03-31 14:48 ` Phillip Wood
2022-03-31 14:58 ` Ævar Arnfjörð Bjarmason
2022-03-31 20:12 ` Junio C Hamano
2022-03-31 21:19 ` brian m. carlson
2022-04-01 9:29 ` Ævar Arnfjörð Bjarmason
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqy20r3rv7.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).