Subject: Re: v2.35.0 DEVELOPER=1 regression

From: Junio C Hamano <[email-masked]>
Date: Fri, 14 Jan 2022 16:31:01 -0800

Ævar Arnfjörð Bjarmason <[email-masked]> writes:

> Wasn't the initial goal here to check whether we'd accidentally include
> C99? Just checking on GCC/Clang somewhere seems sufficient enough,

What do you mean by "accidentally include"?

The goal here is that developer build should give developer a set of
options that help the most---"not going beyond C99" is something we
want them to be checking, if able (and we have established that
users on FreeBSD are not capable).

Doesn't your "something like" limits the check to CI?  Developers
with compilers that _can_ help ensuring that we do not go beyond C99
should be able to do so by their local developer build.

> I.e. something like:
>     
>     diff --git a/ci/lib.sh b/ci/lib.sh
>     index 9d28ab50fb4..94d0d4127b9 100755
>     --- a/ci/lib.sh
>     +++ b/ci/lib.sh
>     @@ -209,6 +209,9 @@ linux-leaks)
>             export SANITIZE=leak
>             export GIT_TEST_PASSING_SANITIZE_LEAK=true
>             ;;
>     +linux-gcc|linux-clang)
>     +       MAKEFLAGS="$MAKEFLAGS CFLAGS=-std=gnu99"
>     +       ;;
>      esac
>      
>      MAKEFLAGS="$MAKEFLAGS CC=${CC:-cc}"
>     diff --git a/config.mak.dev b/config.mak.dev
>     index d4afac6b51f..216f92493fc 100644
>     --- a/config.mak.dev
>     +++ b/config.mak.dev
>     @@ -20,10 +20,6 @@ endif
>      endif
>      endif
>      
>     -ifneq ($(or $(filter gcc6,$(COMPILER_FEATURES)),$(filter clang7,$(COMPILER_FEATURES))),)
>     -DEVELOPER_CFLAGS += -std=gnu99
>     -endif
>     -
>      DEVELOPER_CFLAGS += -Wdeclaration-after-statement
>      DEVELOPER_CFLAGS += -Wformat-security
>      DEVELOPER_CFLAGS += -Wold-style-definition