git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] CodingGuidelines: allow compound literals

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 26, 2026, 21:11 UTC
Message-ID
<xmqqbj8gp3pv.fsf@gitster.g>
In-Reply-To
<a4b382c0373e1b410c4c1ef74b313f86076d48aa.1793024062.git.phillip.wood@dunelm.org.uk>
Phillip Wood <phillip.wood123@gmail.com> writes:
Show 10 quoted lines
> From: Phillip Wood <phillip.wood@dunelm.org.uk>
>
> Our coding guidelines say that we'll allow compound literals from
> mid 2026 if no problems are reported in relation to the test balloon
> added in 01e49941d6 (reftable/system: provide thin wrapper for tempfile
> subsystem, 2024-11-18). As no such reports have been received, update
> the guidelines to allow this construct.
>
> Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
> ---

Yeah, I agree that it is about time to promote this to the accepted set.

So we do not have test balloon but we know we still cannot use two constructs from C99 due to MinGW and older IBM xlc? Perhaps we can raise test balloons for them by now?

Will merge and mark the topic as ready for 'next'.  Thanks.
Show 19 quoted lines
> diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines
> index c06f5d3071..23a4d2186a 100644
> --- a/Documentation/CodingGuidelines
> +++ b/Documentation/CodingGuidelines
> @@ -311,13 +311,8 @@ For C programs:
>     . since late 2023 with 8277dbe987 we have been using the bool type
>       from <stdbool.h>.
>  
> -   C99 features we have test balloons for:
> -
> -   . since late 2024 with v2.48.0-rc0~20, we have test balloons for
> -     compound literal syntax, e.g., (struct foo){ .member = value };
> -     our hope is that no platforms we care about have trouble using
> -     them, and officially adopt its wider use in mid 2026.  Do not add
> -     more use of the syntax until that happens.
> +   . since late 2024 with v2.48.0-rc0~20, we have been using compound
> +     literals, e.g., (struct foo){ .member = value };
>  
>     New C99 features that we cannot use yet:
Previous: Phillip WoodNext: Patrick Steinhardt
Message 2 of 4 in “CodingGuidelines: allow compound literals”
  1. CodingGuidelines: allow compound literalsPhillip Wood, Oct 26, 2026
  2. Junio C HamanoOct 26, 2026
  3. Patrick SteinhardtOct 27, 2026
  4. Phillip WoodOct 27, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.