Re: [PATCH 1/1] git-compat-util: add a test balloon for C99 support

2 messages, 2 authors, 2021-11-22 · open the first message on its own page

Re: [PATCH 1/1] git-compat-util: add a test balloon for C99 support

From: Junio C Hamano <hidden>
Date: 2021-11-22 17:27:30

Johannes Schindelin [off-list ref] writes:
quoted
I like the direction, but ...
quoted
quoted
diff --git a/Makefile b/Makefile
index 12be39ac49..22d9e67542 100644
--- a/Makefile
+++ b/Makefile
@@ -1204,7 +1204,7 @@ endif
 # Set CFLAGS, LDFLAGS and other *FLAGS variables. These might be
 # tweaked by config.* below as well as the command-line, both of
 # which'll override these defaults.
-CFLAGS = -g -O2 -Wall
+CFLAGS = -g -O2 -Wall -std=gnu99
... as has been already pointed out, this part probably should not
be there.  It is not our intention to require gcc/clang, or to
constrain newer systems to gnu99.
Another data point in favor of dropping this: our FreeBSD CI build reports
a compile error with this:

	[...]
	archive.c:337:35: error: '_Generic' is a C11 extension
	[-Werror,-Wc11-extensions]
			strbuf_addstr(&path_in_archive, basename(path));
							^
	/usr/include/libgen.h:61:21: note: expanded from macro 'basename'
	#define basename(x)     __generic(x, const char *, __old_basename, basename)(x)
				^
	/usr/include/sys/cdefs.h:329:2: note: expanded from macro '__generic'
		_Generic(expr, t: yes, default: no)
		^
	1 error generated.

I verified in https://github.com/gitgitgadget/git/pull/1082 that this
patch is indeed the cause of this compile error.
Thanks.

I took a look at #1082, which reverted this one (and nothing else)
to see a test succeds, and then re-reverted it to see it fail (but
apparently only on FreeBSD/Cirrus).  

I had an impression that it was claimed that without this, the other
weatherbaloon for "for (type var=..." would not fly in some of the
jobs we have at CI?

Re: [PATCH 1/1] git-compat-util: add a test balloon for C99 support

From: Carlo Arenas <hidden>
Date: 2021-11-22 17:52:33

On Mon, Nov 22, 2021 at 9:27 AM Junio C Hamano [off-list ref] wrote:
I had an impression that it was claimed that without this, the other
weatherbaloon for "for (type var=..." would not fly in some of the
jobs we have at CI?
It wouldn't if we have a CI job that tests with gcc < 5 but the last
version of that job died with travis-ci.org

Carlo
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help