Subject: Re: v2.35.0 DEVELOPER=1 regression

From: Junio C Hamano <[email-masked]>
Date: Fri, 14 Jan 2022 11:51:14 -0800

"brian m. carlson" <[email-masked]> writes:

>> DEVELOPER=1 will now die because its core libraries use C11-specific
>> code:
>>     
>>     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:325:2: note: expanded from macro '__generic'
>>             _Generic(expr, t: yes, default: no)
>>             ^

Wow, that sounds horribly broken.

> I think we had this discussion about FreeBSD before and that's why I
> specifically dropped that option from the main makefile.  We can either
> drop that patch, or we can set it to -std=gnu11 and tell folks setting
> DEVELOPER to use a system released in the last five years.  I think we
> can be a little stricter with what we require in the case of DEVELOPER
> than we might be otherwise.

But that is not being stricter, but looser, no?  I thought that the
point of -std=gnu99 was to allow us to use C99 features while catching
use of language features newer than that, and use of -std=gnu11 will
defeat half the point, wouldn't it?