Subject: Re: [PATCH 0/2] Fix syntax errors under clang 11.0.0 on MacOS

From: Junio C Hamano <[email-masked]>
Date: Fri, 07 Oct 2022 14:33:34 -0700

Jeff Hostetler <[email-masked]> writes:

> So if I understand you correctly, Apple clang 11 is broken
> and Apple clang 12 is good.
>
> I was getting ready to send (as soon as the CI finished)
> the following a simple to add the -Wno... for clang 11 and
> below on Darwin.
>
> +ifeq ($(uname_S),Darwin)
> +# Older versions of Apple clang complain about initializing a
> +# struct-within-a-struct using just "{0}" rather than "{{0}}".
> +# More recent versions do not.  This error is considered a
> +# false-positive and not worth fixing, so just disable it.
> +ifeq ($(filter clang12,$(COMPILER_FEATURES)),)
> +DEVELOPER_CFLAGS += -Wno-missing-braces
> +endif
> +endif
>
> I'm not sure I understand all of what your suggestion does.

I do agree that one is dense, but aims for the same thing, and a bit
more.  It might be easier to read if written in longhand, but ...

ifeq ($(uname_s),Darwin)
ifeq ($(filter clang12,$(COMPILER_FEATURES)),)
DEVELOPER_CFLAGS += -Wno-missing-braces
endif
else
ifeq ($(filter clang9,$(COMPILER_FEATURES)),)
DEVELOPER_CFLAGS += -Wno-missing-braces
endif
endif

... we'd need to repeat ourselves, so...