Subject: Re: [PATCH 1/3] CodingGuildlines: allow the use of bool

From: Junio C Hamano <[email-masked]>
Date: Mon, 14 Jul 2025 09:37:32 -0700

Phillip Wood <[email-masked]> writes:

> From: Phillip Wood <[email-masked]>
>
> We have had a test balloon for C99's bool type since 8277dbe987
> (git-compat-util: convert skip_{prefix,suffix}{,_mem} to bool,
> 2023-12-16). As we've had it over 18 months without any complaints
> let's declare it a success.
>
> Signed-off-by: Phillip Wood <[email-masked]>
> ---
>  Documentation/CodingGuidelines | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines
> index 6350949f2ef..528b42d1dd1 100644
> --- a/Documentation/CodingGuidelines
> +++ b/Documentation/CodingGuidelines
> @@ -298,6 +298,9 @@ For C programs:
>     . since late 2021 with 44ba10d6, we have had variables declared in
>       the for loop "for (int i = 0; i < 10; i++)".
>  
> +   . since late 2023 with 8277dbe987 we have been using the bool type
> +     from <stdbool.h>.

Let's see the other ones in the same list.

 * initializer elements that are not static (used since 2b6854c8
   (Cleanup variables in cat-file, 2007-04-21), declared official
   with 442c27dd (CodingGuidelines: mention dynamic C99 initializer
   elements, 2022-10-10).

 * trailing comma in enum definition (used since e1327023 (grep:
   refactor the concept of "grep source" into an object,
   2012-02-02), declared official with cc0c4297 (CodingGuidelines:
   spell out post-C89 rules, 2019-07-16).

 * designated initialiers for struct and arrays (used since cbc0f81d
   (strbuf: use designated initializers in STRBUF_INIT, 2017-07-10)
   and 512f41cf (clean.c: use designated initializer, 2017-07-14),
   declared official with cc0c4297 (CodingGuidelines: spell out
   post-C89 rules, 2019-07-16).

 * variadic macros (used since 765dc168 (git-compat-util: always
   enable variadic macros, 2021-01-28), declared official with
   56a29d2c (C99: remove hardcoded-out !HAVE_VARIADIC_MACROS code,
   2022-02-21).

 * declaring a control variable in for(;;) loop (used since 44ba10d6
   (revision: use C99 declaration of variable in for() loop,
   2021-11-14), declared official with 82dd01d8 (CodingGuidelines:
   allow declaring variables in for loops, 2022-10-10).

A year and a half sounds roughly the average timespan.

Will queue.  Thanks.