From: Junio C Hamano Date: Fri, 07 Oct 2022 21:33:34 GMT Subject: Re: [PATCH 0/2] Fix syntax errors under clang 11.0.0 on MacOS Message-ID: In-Reply-To: <58d3ef47-2196-4f59-692a-fc86dfbc1252@jeffhostetler.com> Jeff Hostetler 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...