{"thread":{"id":"56916","subject":"Re: [PATCH 1/1] git-compat-util: add a test balloon for C99 support","startedAt":"2021-11-16T10:30:35Z","lastAt":"2021-11-24T15:10:40Z","messageCount":14,"participants":["Johannes Schindelin","Junio C Hamano","Ævar Arnfjörð Bjarmason","Carlo Arenas","brian m. carlson"],"isPatch":true,"patchVersion":1,"patchTotal":1},"messages":[{"id":"441290","messageId":"nycvar.QRO.7.76.6.2111161129120.21127@tvgsbejvaqbjf.bet","threadId":"56916","inReplyTo":"20211114211622.1465981-2-sandals@crustytoothpaste.net","subject":"Re: [PATCH 1/1] git-compat-util: add a test balloon for C99 support","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2021-11-16T10:30:08Z","receivedAt":"2021-11-16T10:30:35Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi brian,\n\nOn Sun, 14 Nov 2021, brian m. carlson wrote:\n\n> The C99 standard was released in January 1999, now 22 years ago.  It\n> provides a variety of useful features, including variadic arguments for\n> macros, declarations after statements, variable length arrays, and a\n> wide variety of other useful features, many of which we already use.\n>\n> We'd like to take advantage of these features, but we want to be\n> cautious.  As far as we know, all major compilers now support C99 or a\n> later C standard, such as C11 or C17.  POSIX has required C99 support as\n> a requirement for the 2001 revision, so we can safely assume any POSIX\n> system which we are interested in supporting has C99.\n>\n> Even MSVC, long a holdout against modern C, now supports both C11 and\n> C17 with an appropriate update.  Moreover, even if people are using an\n> older version of MSVC on these systems, they will generally need some\n> implementation of the standard Unix utilities for the testsuite, and GNU\n> coreutils, the most common option, has required C99 since 2009.\n> Therefore, we can safely assume that a suitable version of GCC or clang\n> is available to users even if their version of MSVC is not sufficiently\n> capable.\n>\n> Let's add a test balloon to git-compat-util.h to see if anyone is using\n> an older compiler.  We'll add a comment telling people how to enable\n> this functionality on GCC and Clang, even though modern versions of both\n> will automatically do the right thing, and ask people still experiencing\n> a problem to report that to us on the list.\n>\n> Note that C89 compilers don't provide the __STDC_VERSION__ macro, so we\n> use a well-known hack of using \"- 0\".  On compilers with this macro, it\n> doesn't change the value, and on C89 compilers, the macro will be\n> replaced with nothing, and our value will be 0.\n>\n> Sparse is also updated with a reference to the gnu99 standard, without\n> which it defaults to C89.\n>\n> Update the cmake configuration to require C11 for MSVC.  We do this\n> because this will make MSVC to use C11, since it does not explicitly\n> support C99.  We do this with a compiler options because setting the\n> C_STANDARD option does not work in our CI on MSVC and at the moment, we\n> don't want to require C11 for Unix compilers.\n\nI am all in favor of this patch!\n\nThank you,\nDscho\n\n>\n> Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>\n> ---\n>  Makefile                            |  4 ++--\n>  contrib/buildsystems/CMakeLists.txt |  3 +--\n>  git-compat-util.h                   | 12 ++++++++++++\n>  3 files changed, 15 insertions(+), 4 deletions(-)\n>\n> diff --git a/Makefile b/Makefile\n> index 12be39ac49..22d9e67542 100644\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -1204,7 +1204,7 @@ endif\n>  # Set CFLAGS, LDFLAGS and other *FLAGS variables. These might be\n>  # tweaked by config.* below as well as the command-line, both of\n>  # which'll override these defaults.\n> -CFLAGS = -g -O2 -Wall\n> +CFLAGS = -g -O2 -Wall -std=gnu99\n>  LDFLAGS =\n>  CC_LD_DYNPATH = -Wl,-rpath,\n>  BASIC_CFLAGS = -I.\n> @@ -1215,7 +1215,7 @@ ARFLAGS = rcs\n>  PTHREAD_CFLAGS =\n>\n>  # For the 'sparse' target\n> -SPARSE_FLAGS ?=\n> +SPARSE_FLAGS ?= -std=gnu99\n>  SP_EXTRA_FLAGS = -Wno-universal-initializer\n>\n>  # For informing GIT-BUILD-OPTIONS of the SANITIZE=leak target\n> diff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt\n> index fd1399c440..91e8525fa9 100644\n> --- a/contrib/buildsystems/CMakeLists.txt\n> +++ b/contrib/buildsystems/CMakeLists.txt\n> @@ -208,7 +208,7 @@ endif()\n>  if(CMAKE_C_COMPILER_ID STREQUAL \"MSVC\")\n>  \tset(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR})\n>  \tset(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR})\n> -\tadd_compile_options(/MP)\n> +\tadd_compile_options(/MP /std:c11)\n>  endif()\n>\n>  #default behaviour\n> @@ -600,7 +600,6 @@ endif()\n>  list(REMOVE_DUPLICATES excluded_progs)\n>  list(REMOVE_DUPLICATES PROGRAMS_BUILT)\n>\n> -\n>  foreach(p ${excluded_progs})\n>  \tlist(APPEND EXCLUSION_PROGS --exclude-program ${p} )\n>  endforeach()\n> diff --git a/git-compat-util.h b/git-compat-util.h\n> index d70ce14286..6d995bdc0f 100644\n> --- a/git-compat-util.h\n> +++ b/git-compat-util.h\n> @@ -1,6 +1,18 @@\n>  #ifndef GIT_COMPAT_UTIL_H\n>  #define GIT_COMPAT_UTIL_H\n>\n> +#if __STDC_VERSION__ - 0 < 199901L\n> +/*\n> + * Git is in a testing period for mandatory C99 support in the compiler.  If\n> + * your compiler is reasonably recent, you can try to enable C99 support (or,\n> + * for MSVC, C11 support).  If you encounter a problem and can't enable C99\n> + * support with your compiler and don't have access to one with this support,\n> + * such as GCC or Clang, you can remove this #if directive, but please report\n> + * the details of your system to git@vger.kernel.org.\n> + */\n> +#error \"Required C99 support is in a test phase.  Please see git-compat-util.h for more details.\"\n> +#endif\n> +\n>  #ifdef USE_MSVC_CRTDBG\n>  /*\n>   * For these to work they must appear very early in each\n>\n"},{"id":"441413","messageId":"xmqqk0h7423v.fsf@gitster.g","threadId":"56916","inReplyTo":"nycvar.QRO.7.76.6.2111161129120.21127@tvgsbejvaqbjf.bet","subject":"Re: [PATCH 1/1] git-compat-util: add a test balloon for C99 support","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-11-17T08:29:08Z","receivedAt":"2021-11-17T08:29:15Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n>> Even MSVC, long a holdout against modern C, now supports both C11 and\n>> C17 with an appropriate update.  Moreover, even if people are using an\n>> older version of MSVC on these systems, they will generally need some\n>> implementation of the standard Unix utilities for the testsuite, and GNU\n>> coreutils, the most common option, has required C99 since 2009.\n>> Therefore, we can safely assume that a suitable version of GCC or clang\n>> is available to users even if their version of MSVC is not sufficiently\n>> capable.\n>\n> I am all in favor of this patch!\n\nI like the direction, but ...\n\n>> diff --git a/Makefile b/Makefile\n>> index 12be39ac49..22d9e67542 100644\n>> --- a/Makefile\n>> +++ b/Makefile\n>> @@ -1204,7 +1204,7 @@ endif\n>>  # Set CFLAGS, LDFLAGS and other *FLAGS variables. These might be\n>>  # tweaked by config.* below as well as the command-line, both of\n>>  # which'll override these defaults.\n>> -CFLAGS = -g -O2 -Wall\n>> +CFLAGS = -g -O2 -Wall -std=gnu99\n\n... as has been already pointed out, this part probably should not\nbe there.  It is not our intention to require gcc/clang, or to\nconstrain newer systems to gnu99.\n\n"},{"id":"441927","messageId":"nycvar.QRO.7.76.6.2111221242320.63@tvgsbejvaqbjf.bet","threadId":"56916","inReplyTo":"xmqqk0h7423v.fsf@gitster.g","subject":"Re: [PATCH 1/1] git-compat-util: add a test balloon for C99 support","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2021-11-22T11:44:37Z","receivedAt":"2021-11-22T11:45:01Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Junio & brian,\n\nOn Wed, 17 Nov 2021, Junio C Hamano wrote:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n>\n> >> Even MSVC, long a holdout against modern C, now supports both C11 and\n> >> C17 with an appropriate update.  Moreover, even if people are using an\n> >> older version of MSVC on these systems, they will generally need some\n> >> implementation of the standard Unix utilities for the testsuite, and GNU\n> >> coreutils, the most common option, has required C99 since 2009.\n> >> Therefore, we can safely assume that a suitable version of GCC or clang\n> >> is available to users even if their version of MSVC is not sufficiently\n> >> capable.\n> >\n> > I am all in favor of this patch!\n>\n> I like the direction, but ...\n>\n> >> diff --git a/Makefile b/Makefile\n> >> index 12be39ac49..22d9e67542 100644\n> >> --- a/Makefile\n> >> +++ b/Makefile\n> >> @@ -1204,7 +1204,7 @@ endif\n> >>  # Set CFLAGS, LDFLAGS and other *FLAGS variables. These might be\n> >>  # tweaked by config.* below as well as the command-line, both of\n> >>  # which'll override these defaults.\n> >> -CFLAGS = -g -O2 -Wall\n> >> +CFLAGS = -g -O2 -Wall -std=gnu99\n>\n> ... as has been already pointed out, this part probably should not\n> be there.  It is not our intention to require gcc/clang, or to\n> constrain newer systems to gnu99.\n\nAnother data point in favor of dropping this: our FreeBSD CI build reports\na compile error with this:\n\n\t[...]\n\tarchive.c:337:35: error: '_Generic' is a C11 extension\n\t[-Werror,-Wc11-extensions]\n\t\t\tstrbuf_addstr(&path_in_archive, basename(path));\n\t\t\t\t\t\t\t^\n\t/usr/include/libgen.h:61:21: note: expanded from macro 'basename'\n\t#define basename(x)     __generic(x, const char *, __old_basename, basename)(x)\n\t\t\t\t^\n\t/usr/include/sys/cdefs.h:329:2: note: expanded from macro '__generic'\n\t\t_Generic(expr, t: yes, default: no)\n\t\t^\n\t1 error generated.\n\nI verified in https://github.com/gitgitgadget/git/pull/1082 that this\npatch is indeed the cause of this compile error.\n\nCiao,\nDscho\n"},{"id":"441942","messageId":"211122.86pmqsz66b.gmgdl@evledraar.gmail.com","threadId":"56916","inReplyTo":"nycvar.QRO.7.76.6.2111221242320.63@tvgsbejvaqbjf.bet","subject":"Re: [PATCH 1/1] git-compat-util: add a test balloon for C99 support","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-11-22T13:05:42Z","receivedAt":"2021-11-22T13:11:30Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Mon, Nov 22 2021, Johannes Schindelin wrote:\n\n> Hi Junio & brian,\n>\n> On Wed, 17 Nov 2021, Junio C Hamano wrote:\n>\n>> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n>>\n>> >> Even MSVC, long a holdout against modern C, now supports both C11 and\n>> >> C17 with an appropriate update.  Moreover, even if people are using an\n>> >> older version of MSVC on these systems, they will generally need some\n>> >> implementation of the standard Unix utilities for the testsuite, and GNU\n>> >> coreutils, the most common option, has required C99 since 2009.\n>> >> Therefore, we can safely assume that a suitable version of GCC or clang\n>> >> is available to users even if their version of MSVC is not sufficiently\n>> >> capable.\n>> >\n>> > I am all in favor of this patch!\n>>\n>> I like the direction, but ...\n>>\n>> >> diff --git a/Makefile b/Makefile\n>> >> index 12be39ac49..22d9e67542 100644\n>> >> --- a/Makefile\n>> >> +++ b/Makefile\n>> >> @@ -1204,7 +1204,7 @@ endif\n>> >>  # Set CFLAGS, LDFLAGS and other *FLAGS variables. These might be\n>> >>  # tweaked by config.* below as well as the command-line, both of\n>> >>  # which'll override these defaults.\n>> >> -CFLAGS = -g -O2 -Wall\n>> >> +CFLAGS = -g -O2 -Wall -std=gnu99\n>>\n>> ... as has been already pointed out, this part probably should not\n>> be there.  It is not our intention to require gcc/clang, or to\n>> constrain newer systems to gnu99.\n>\n> Another data point in favor of dropping this: our FreeBSD CI build reports\n> a compile error with this:\n>\n> \t[...]\n> \tarchive.c:337:35: error: '_Generic' is a C11 extension\n> \t[-Werror,-Wc11-extensions]\n> \t\t\tstrbuf_addstr(&path_in_archive, basename(path));\n> \t\t\t\t\t\t\t^\n> \t/usr/include/libgen.h:61:21: note: expanded from macro 'basename'\n> \t#define basename(x)     __generic(x, const char *, __old_basename, basename)(x)\n> \t\t\t\t^\n> \t/usr/include/sys/cdefs.h:329:2: note: expanded from macro '__generic'\n> \t\t_Generic(expr, t: yes, default: no)\n> \t\t^\n> \t1 error generated.\n>\n> I verified in https://github.com/gitgitgadget/git/pull/1082 that this\n> patch is indeed the cause of this compile error.\n\nAs noted in another reply I don't think this -std=* thing is worth it,\nbut this isn't so much a case of breakage with this patch in particular,\nbut revealing an existing issue of us implicitly requiring C11 on\nFreeBSD.\n\nWhether that's worth pursuing is another matter, but it's not some\ninherent issue in this approach, but just a platform-specific nit we\ncould fix. Either by saying -std=c11 on that platform, or presumably\ndefining NO_LIBGEN_H if we wanted to proceed in lockstep with\nC99-but-not-C11 everyhere.\n\n"},{"id":"441976","messageId":"xmqq1r38hzi9.fsf@gitster.g","threadId":"56916","inReplyTo":"nycvar.QRO.7.76.6.2111221242320.63@tvgsbejvaqbjf.bet","subject":"Re: [PATCH 1/1] git-compat-util: add a test balloon for C99 support","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-11-22T17:27:26Z","receivedAt":"2021-11-22T17:27:30Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n>> I like the direction, but ...\n>>\n>> >> diff --git a/Makefile b/Makefile\n>> >> index 12be39ac49..22d9e67542 100644\n>> >> --- a/Makefile\n>> >> +++ b/Makefile\n>> >> @@ -1204,7 +1204,7 @@ endif\n>> >>  # Set CFLAGS, LDFLAGS and other *FLAGS variables. These might be\n>> >>  # tweaked by config.* below as well as the command-line, both of\n>> >>  # which'll override these defaults.\n>> >> -CFLAGS = -g -O2 -Wall\n>> >> +CFLAGS = -g -O2 -Wall -std=gnu99\n>>\n>> ... as has been already pointed out, this part probably should not\n>> be there.  It is not our intention to require gcc/clang, or to\n>> constrain newer systems to gnu99.\n>\n> Another data point in favor of dropping this: our FreeBSD CI build reports\n> a compile error with this:\n>\n> \t[...]\n> \tarchive.c:337:35: error: '_Generic' is a C11 extension\n> \t[-Werror,-Wc11-extensions]\n> \t\t\tstrbuf_addstr(&path_in_archive, basename(path));\n> \t\t\t\t\t\t\t^\n> \t/usr/include/libgen.h:61:21: note: expanded from macro 'basename'\n> \t#define basename(x)     __generic(x, const char *, __old_basename, basename)(x)\n> \t\t\t\t^\n> \t/usr/include/sys/cdefs.h:329:2: note: expanded from macro '__generic'\n> \t\t_Generic(expr, t: yes, default: no)\n> \t\t^\n> \t1 error generated.\n>\n> I verified in https://github.com/gitgitgadget/git/pull/1082 that this\n> patch is indeed the cause of this compile error.\n\nThanks.\n\nI took a look at #1082, which reverted this one (and nothing else)\nto see a test succeds, and then re-reverted it to see it fail (but\napparently only on FreeBSD/Cirrus).  \n\nI had an impression that it was claimed that without this, the other\nweatherbaloon for \"for (type var=...\" would not fly in some of the\njobs we have at CI?\n\n\n"},{"id":"441983","messageId":"CAPUEspibE6AMyoxwJGno9R=21JU5MpFVGBxCQYBCbCBwx-y25A@mail.gmail.com","threadId":"56916","inReplyTo":"xmqq1r38hzi9.fsf@gitster.g","subject":"Re: [PATCH 1/1] git-compat-util: add a test balloon for C99 support","fromName":"Carlo Arenas","fromEmail":"carenas@gmail.com","sentAt":"2021-11-22T17:52:16Z","receivedAt":"2021-11-22T17:52:33Z","isPatch":true,"sender":{"key":"carenas@gmail.com","avatar":"https://avatars.githubusercontent.com/u/76036?v=4"},"body":"On Mon, Nov 22, 2021 at 9:27 AM Junio C Hamano <gitster@pobox.com> wrote:\n\n> I had an impression that it was claimed that without this, the other\n> weatherbaloon for \"for (type var=...\" would not fly in some of the\n> jobs we have at CI?\n\nIt wouldn't if we have a CI job that tests with gcc < 5 but the last\nversion of that job died with travis-ci.org\n\nCarlo\n"},{"id":"442009","messageId":"xmqq8rxgf254.fsf@gitster.g","threadId":"56916","inReplyTo":"CAPUEspibE6AMyoxwJGno9R=21JU5MpFVGBxCQYBCbCBwx-y25A@mail.gmail.com","subject":"Re: [PATCH 1/1] git-compat-util: add a test balloon for C99 support","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-11-22T18:58:47Z","receivedAt":"2021-11-22T18:58:52Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Carlo Arenas <carenas@gmail.com> writes:\n\n> On Mon, Nov 22, 2021 at 9:27 AM Junio C Hamano <gitster@pobox.com> wrote:\n>\n>> I had an impression that it was claimed that without this, the other\n>> weatherbaloon for \"for (type var=...\" would not fly in some of the\n>> jobs we have at CI?\n>\n> It wouldn't if we have a CI job that tests with gcc < 5 but the last\n> version of that job died with travis-ci.org\n\nI was wondering how Dscho's test was not failing, and that is an\neasy answer to that question ;-)\n\nIf we wanted to resurrect that CI job, we can always add it in the\nCI definition anyway, so I am OK with that, too.  \n\nThanks.\n"},{"id":"442017","messageId":"xmqqv90jewwa.fsf@gitster.g","threadId":"56916","inReplyTo":"xmqq8rxgf254.fsf@gitster.g","subject":"Re: [PATCH 1/1] git-compat-util: add a test balloon for C99 support","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-11-22T20:52:05Z","receivedAt":"2021-11-22T20:52:10Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Carlo Arenas <carenas@gmail.com> writes:\n>\n>> On Mon, Nov 22, 2021 at 9:27 AM Junio C Hamano <gitster@pobox.com> wrote:\n>>\n>>> I had an impression that it was claimed that without this, the other\n>>> weatherbaloon for \"for (type var=...\" would not fly in some of the\n>>> jobs we have at CI?\n>>\n>> It wouldn't if we have a CI job that tests with gcc < 5 but the last\n>> version of that job died with travis-ci.org\n>\n> I was wondering how Dscho's test was not failing, and that is an\n> easy answer to that question ;-)\n>\n> If we wanted to resurrect that CI job, we can always add it in the\n> CI definition anyway, so I am OK with that, too.  \n\nBut if we were to do so, perhaps we'd want something like what I\ngave at https://lore.kernel.org/git/xmqqy25lwa86.fsf@gitster.g/ in\nits place to avoid confusing people.\n\nLet me update that topic before dropping the one under discussion.\n\n"},{"id":"442030","messageId":"nycvar.QRO.7.76.6.2111222300580.63@tvgsbejvaqbjf.bet","threadId":"56916","inReplyTo":"xmqqv90jewwa.fsf@gitster.g","subject":"Re: [PATCH 1/1] git-compat-util: add a test balloon for C99 supporty","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2021-11-22T22:03:14Z","receivedAt":"2021-11-22T22:03:48Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Junio,\n\nOn Mon, 22 Nov 2021, Junio C Hamano wrote:\n\n> Junio C Hamano <gitster@pobox.com> writes:\n>\n> > Carlo Arenas <carenas@gmail.com> writes:\n> >\n> >> On Mon, Nov 22, 2021 at 9:27 AM Junio C Hamano <gitster@pobox.com> wrote:\n> >>\n> >>> I had an impression that it was claimed that without this, the other\n> >>> weatherbaloon for \"for (type var=...\" would not fly in some of the\n> >>> jobs we have at CI?\n> >>\n> >> It wouldn't if we have a CI job that tests with gcc < 5 but the last\n> >> version of that job died with travis-ci.org\n> >\n> > I was wondering how Dscho's test was not failing, and that is an\n> > easy answer to that question ;-)\n> >\n> > If we wanted to resurrect that CI job, we can always add it in the\n> > CI definition anyway, so I am OK with that, too.\n>\n> But if we were to do so, perhaps we'd want something like what I\n> gave at https://lore.kernel.org/git/xmqqy25lwa86.fsf@gitster.g/ in\n> its place to avoid confusing people.\n\nThat sounds like a good course of action to me.\n\nPlease note that the MSVC-related adjustment of the `FLEX_ARRAY` block is\nstill needed, I think.\n\nCiao,\nDscho\n\nP.S.: In case it was not clear yet, I am in favor of going forward with\nthe C99 weather balloon. We should try to move in that direction, slowly\nand gently, as is our custom.\n"},{"id":"442032","messageId":"xmqqwnkzdepm.fsf@gitster.g","threadId":"56916","inReplyTo":"nycvar.QRO.7.76.6.2111222300580.63@tvgsbejvaqbjf.bet","subject":"Re: [PATCH 1/1] git-compat-util: add a test balloon for C99 supporty","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-11-22T22:10:13Z","receivedAt":"2021-11-22T22:10:19Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n>> But if we were to do so, perhaps we'd want something like what I\n>> gave at https://lore.kernel.org/git/xmqqy25lwa86.fsf@gitster.g/ in\n>> its place to avoid confusing people.\n>\n> That sounds like a good course of action to me.\n>\n> Please note that the MSVC-related adjustment of the `FLEX_ARRAY` block is\n> still needed, I think.\n\nThe \"something like what I gave ... to avoid confusing people\" patch\nis following up on the direction to drop the patch with -std=gnu99\nchange.  IIRC, your MSVC adjustment was to tweak that patch we were\ndiscussing of dropping, so even if it is still needed, it won't be\npart of what I was doing.\n\n"},{"id":"442035","messageId":"CAPUEspjj4bpnRsr=vpnzuvoHqw9A19fpPcX65oSHZryiyKXxEg@mail.gmail.com","threadId":"56916","inReplyTo":"xmqqwnkzdepm.fsf@gitster.g","subject":"Re: [PATCH 1/1] git-compat-util: add a test balloon for C99 supporty","fromName":"Carlo Arenas","fromEmail":"carenas@gmail.com","sentAt":"2021-11-22T22:22:55Z","receivedAt":"2021-11-22T22:23:36Z","isPatch":true,"sender":{"key":"carenas@gmail.com","avatar":"https://avatars.githubusercontent.com/u/76036?v=4"},"body":"On Mon, Nov 22, 2021 at 2:10 PM Junio C Hamano <gitster@pobox.com> wrote:\n>\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n>\n> >> But if we were to do so, perhaps we'd want something like what I\n> >> gave at https://lore.kernel.org/git/xmqqy25lwa86.fsf@gitster.g/ in\n> >> its place to avoid confusing people.\n> >\n> > That sounds like a good course of action to me.\n> >\n> > Please note that the MSVC-related adjustment of the `FLEX_ARRAY` block is\n> > still needed, I think.\n>\n> The \"something like what I gave ... to avoid confusing people\" patch\n> is following up on the direction to drop the patch with -std=gnu99\n> change.  IIRC, your MSVC adjustment was to tweak that patch we were\n> discussing of dropping, so even if it is still needed, it won't be\n> part of what I was doing.\n\nI think it will still be needed, I have somewhere indeed a bugfix\n(which I never got back to clean up enough for sending) to that\nsection because it was not C89 safe either, which is what dscho is\nlikely fixing from the point of view of MSVC that doesn't support the\nGNU syntax that we use as a fallback eagerly than we should.\n\nFWIW I got the chance to try to build in a long unmaintained debian 6\n(AKA squeeze) with gcc 4.4.5 and was greeted by the following edited\nmessage:\n\n  error: 'for' loop initial declarations are only allowed in C99 mode\n  note: use option -std=c99 or -std=gnu99 to compile your code\n\nSo I think whatever we do, likely it wouldn't be confusing to whoever\nis affected.\n\nCarlo\n"},{"id":"442143","messageId":"nycvar.QRO.7.76.6.2111231331530.63@tvgsbejvaqbjf.bet","threadId":"56916","inReplyTo":"xmqqwnkzdepm.fsf@gitster.g","subject":"Re: [PATCH 1/1] git-compat-util: add a test balloon for C99 supporty","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2021-11-23T12:32:44Z","receivedAt":"2021-11-23T12:33:06Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Junio,\n\nOn Mon, 22 Nov 2021, Junio C Hamano wrote:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n>\n> >> But if we were to do so, perhaps we'd want something like what I\n> >> gave at https://lore.kernel.org/git/xmqqy25lwa86.fsf@gitster.g/ in\n> >> its place to avoid confusing people.\n> >\n> > That sounds like a good course of action to me.\n> >\n> > Please note that the MSVC-related adjustment of the `FLEX_ARRAY` block is\n> > still needed, I think.\n>\n> The \"something like what I gave ... to avoid confusing people\" patch\n> is following up on the direction to drop the patch with -std=gnu99\n> change.  IIRC, your MSVC adjustment was to tweak that patch we were\n> discussing of dropping, so even if it is still needed, it won't be\n> part of what I was doing.\n\nI thought we were only dropping the `--std=gnu99` part, not the change to\nthe `git-compat-util.h` header file, nor the patch to the CMake\nconfiguration for MS Visual C.\n\nCiao,\nDscho\n"},{"id":"442197","messageId":"xmqq8rxe8w49.fsf@gitster.g","threadId":"56916","inReplyTo":"nycvar.QRO.7.76.6.2111231331530.63@tvgsbejvaqbjf.bet","subject":"Re: [PATCH 1/1] git-compat-util: add a test balloon for C99 supporty","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-11-23T20:17:42Z","receivedAt":"2021-11-23T20:17:48Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> Hi Junio,\n>\n> On Mon, 22 Nov 2021, Junio C Hamano wrote:\n>\n>> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n>>\n>> >> But if we were to do so, perhaps we'd want something like what I\n>> >> gave at https://lore.kernel.org/git/xmqqy25lwa86.fsf@gitster.g/ in\n>> >> its place to avoid confusing people.\n>> >\n>> > That sounds like a good course of action to me.\n>> >\n>> > Please note that the MSVC-related adjustment of the `FLEX_ARRAY` block is\n>> > still needed, I think.\n>>\n>> The \"something like what I gave ... to avoid confusing people\" patch\n>> is following up on the direction to drop the patch with -std=gnu99\n>> change.  IIRC, your MSVC adjustment was to tweak that patch we were\n>> discussing of dropping, so even if it is still needed, it won't be\n>> part of what I was doing.\n>\n> I thought we were only dropping the `--std=gnu99` part, not the change to\n> the `git-compat-util.h` header file, nor the patch to the CMake\n> configuration for MS Visual C.\n\nAh, yes, I think these parts need to be kept.  I am just dropping\nthe latest iteration with -std=gnu99 from consideration to merge\ndown to 'next' and below.\n\n"},{"id":"442248","messageId":"YZ5V1I7Mj5dx/pMt@camp.crustytoothpaste.net","threadId":"56916","inReplyTo":"xmqq8rxe8w49.fsf@gitster.g","subject":"Re: [PATCH 1/1] git-compat-util: add a test balloon for C99 supporty","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2021-11-24T15:10:12Z","receivedAt":"2021-11-24T15:10:40Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On 2021-11-23 at 20:17:42, Junio C Hamano wrote:\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> \n> > I thought we were only dropping the `--std=gnu99` part, not the change to\n> > the `git-compat-util.h` header file, nor the patch to the CMake\n> > configuration for MS Visual C.\n> \n> Ah, yes, I think these parts need to be kept.  I am just dropping\n> the latest iteration with -std=gnu99 from consideration to merge\n> down to 'next' and below.\n\nI'll try to get a v3 out relatively soon with those changes.  Due to\nvisiting family in the U.S., I've been a bit busy with things, but I\nshould have some time coming up to do a v3.\n-- \nbrian m. carlson (he/him or they/them)\nToronto, Ontario, CA\n"}]}