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

Re: [PATCH] CodingGuidelines: give deadline for "for (int i = 0; ..."

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Mar 31, 2022, 21:19 UTC
Message-ID
<YkYa2NyA6IwIqZ4C@camp.crustytoothpaste.net>
In-Reply-To
<xmqqo81l286e.fsf@gitster.g>
On 2022-03-31 at 20:12:09, Junio C Hamano wrote:
Show 25 quoted lines
> Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
> 
> >> 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
> >
> > Unfortunately this really isn't the case at all, the norm is for
> > compilers to advertise that they support verison X of the standard via
> > these macros when they consider the support "good enough", but while
> > there's still a long list of unimplemented features before they're at
> > 100% support (and most never fully get to 100%).
> >
> > We also need to worry about the stdlib implementation, and not just the
> > compiler, see e.g. the %zu format and MinGW in the exchange at
> > https://lore.kernel.org/git/220318.86bky3cr8j.gmgdl@evledraar.gmail.com/
> > and
> > https://lore.kernel.org/git/a67e0fd8-4a14-16c9-9b57-3430440ef93c@gmail.com/;
> >
> > But I think we're thoroughly past needing to worry about basic language
> > features in C99 such as these inline variable declarations.
> 
> Well, that makes it sound like the C99 weather balloon was almost
> useless, doesn't it?

I think if we were talking about C17, maybe. But as I said in my commit message, C99 is over two decades old and required for the POSIX version which came out in 2001. I'm aware of only two platforms we care about that don't support that POSIX version, which are NonStop and Windows.

I think the likelihood of this being a problem is very low. And I think we can justifiably expect that major syntactic functionality is available when the define is set accordingly. I am also willing to simply tell people that a compiler that includes the define and doesn't include the requisite features is buggy and ask them to use a modern version of GCC or clang. But, ultimately, given we're talking about C99, this is extremely unlikely to ever be a problem in 2022.

-- 
brian m. carlson (he/him or they/them)
Toronto, Ontario, CA
Previous: Junio C HamanoNext: Ævar Arnfjörð Bjarmason
Message 6 of 7 in “CodingGuidelines: give deadline for "for (int i = 0; ..."”
  1. CodingGuidelines: give deadline for "for (int i = 0; ..."Junio C Hamano, Mar 31, 2022
  2. Ævar Arnfjörð BjarmasonMar 31, 2022
  3. Phillip WoodMar 31, 2022
  4. Ævar Arnfjörð BjarmasonMar 31, 2022
  5. Junio C HamanoMar 31, 2022
  6. brian m. carlsonMar 31, 2022
  7. Ævar Arnfjörð BjarmasonApr 1, 2022

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.