diff options
author | Junio C Hamano <gitster@pobox.com> | 2022-03-30 17:09:16 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-03-31 13:12:26 -0700 |
commit | 6563706568b952d85c050b208b5301303d32810c (patch) | |
tree | e4eef4559f935aa7b35fbae63ca008e70b5ee0bf /Documentation/CodingGuidelines | |
parent | 4c53a8c20f8984adb226293a3ffd7b88c3f4ac1a (diff) | |
download | git-6563706568b952d85c050b208b5301303d32810c.tar.gz |
CodingGuidelines: give deadline for "for (int i = 0; ..."
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.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/CodingGuidelines')
-rw-r--r-- | Documentation/CodingGuidelines | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines index 0e27b5395d..cfa6307dfe 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. |