git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: Jeff Hostetler via GitGitGadget <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, "Jeff Hostetler" <jeffhost@microsoft.com>,
	"René Scharfe" <l.s.r@web.de>
Subject: Re: [PATCH 0/2] Fix syntax errors under clang 11.0.0 on MacOS
Date: Fri, 07 Oct 2022 13:02:39 +0200	[thread overview]
Message-ID: <221007.861qrjriul.gmgdl@evledraar.gmail.com> (raw)
In-Reply-To: <pull.1375.git.1665085395.gitgitgadget@gmail.com>


On Thu, Oct 06 2022, Jeff Hostetler via GitGitGadget wrote:

> This patch series fixes three syntax errors that caused compiler errors with
> clang 11.0.0 on MacOS. I've included the error/warning messages in the
> commit messages. The offending statements did compile successfully under
> clang 14.0.0 on MacOS, so I have to assume that this usage is newer than
> what clang 11 supports.
>
> I originally sent these changes in my "Trace2 timers and cleanup and some
> cleanup" series on Tuesday, but pulled them into a separate series based on
> feedback. I'll omit them from the trace2 series in the next version.

The expanded commit messages really help, thanks :)

So, to summarize, these don't fix compiler errors, but warnings, but of
course they're errors with DEVELOPER=1.

We already squash these for an older GCC, per the discussion at [1]. I
think we should just replace this series with something like (untested
on OSX, but it's just copy/pasting a template above it).
	
	diff --git a/config.mak.dev b/config.mak.dev
	index 4fa19d361b7..9b7bccd154c 100644
	--- a/config.mak.dev
	+++ b/config.mak.dev
	@@ -69,6 +69,14 @@ DEVELOPER_CFLAGS += -Wno-missing-braces
	 endif
	 endif
	 
	+ifeq ($(uname_S),Darwin)
	+ifneq ($(filter clang10,$(COMPILER_FEATURES)),)
	+ifeq ($(filter clang11,$(COMPILER_FEATURES)),)
	+DEVELOPER_CFLAGS += -Wno-missing-braces
	+endif
	+endif
	+endif
	+
	 # https://bugzilla.redhat.com/show_bug.cgi?id=2075786
	 ifneq ($(filter gcc12,$(COMPILER_FEATURES)),)
	 DEVELOPER_CFLAGS += -Wno-error=stringop-overread
	
Or, we can just say that for a <= clang v13 we'll use
-Wno-missing-braces, per:

 * The comment from René at
   http://lore.kernel.org/git/36cd156b-edb2-062c-9422-bf39aad39a6d@web.de
   that older vanilla clang is affected.

 * You having tested Apple clang v14, but not clang v12..v13.

I.e. to emit the whole uname_S bit.

I think it's not important that we try really hard to opt a given
compiler into some maximum set of warnings, we generally want to catch
most things here. As long as some compiler (particularly if it's in CI)
still covers these we should be good.

1. https://lore.kernel.org/git/220712.864jzm65mk.gmgdl@evledraar.gmail.com/

  parent reply	other threads:[~2022-10-07 11:09 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-06 19:43 [PATCH 0/2] Fix syntax errors under clang 11.0.0 on MacOS Jeff Hostetler via GitGitGadget
2022-10-06 19:43 ` [PATCH 1/2] builtin/merge-file: fix compiler error on MacOS with clang 11.0.0 Jeff Hostetler via GitGitGadget
2022-10-06 21:09   ` René Scharfe
2022-10-06 22:30     ` Eric Sunshine
2022-10-06 22:51       ` Junio C Hamano
2022-10-06 19:43 ` [PATCH 2/2] builtin/unpack-objects.c: " Jeff Hostetler via GitGitGadget
2022-10-06 20:38 ` [PATCH 0/2] Fix syntax errors under clang 11.0.0 on MacOS Junio C Hamano
2022-10-06 20:58   ` Eric Sunshine
2022-10-07 11:02 ` Ævar Arnfjörð Bjarmason [this message]
2022-10-07 15:19 ` Jeff Hostetler
2022-10-07 17:49   ` Junio C Hamano
2022-10-07 20:28     ` René Scharfe
2022-10-07 20:56       ` Jeff Hostetler
2022-10-07 21:33         ` Junio C Hamano
2022-10-08  3:46           ` Eric Sunshine
2022-10-08  6:52             ` René Scharfe
2022-10-09  5:19               ` Junio C Hamano
2022-10-07 21:30       ` Junio C Hamano
2022-10-10 15:39 ` [PATCH v2] config.mak.dev: disable suggest braces error on old clang versions Jeff Hostetler via GitGitGadget
2022-10-10 18:13   ` Junio C Hamano
2022-10-11  0:15     ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=221007.861qrjriul.gmgdl@evledraar.gmail.com \
    --to=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=jeffhost@microsoft.com \
    --cc=l.s.r@web.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).