From: Patrick Steinhardt <ps@pks.im>
To: Dominik Loidolt <dominik.loidolt@univie.ac.at>
Cc: gitster@pobox.com, git@vger.kernel.org, asedeno@mit.edu,
asedeno@google.com, avarab@gmail.com
Subject: Re: [PATCH v2] compat/posix.h: enable UNUSED warning messages for Clang
Date: Mon, 8 Jun 2026 08:20:17 +0200 [thread overview]
Message-ID: <aiZfIc8k-9Et25g6@pks.im> (raw)
In-Reply-To: <aiLxCWp8Bv-KQoLf@four.local>
On Fri, Jun 05, 2026 at 05:53:45PM +0200, Dominik Loidolt wrote:
> On Fri, Jun 05, 2026 at 03:22:49PM +0200, Patrick Steinhardt wrote:
> > I was wondering about that, too. The question that I have is whether
> > there's any particular reason why the check was written that way. So in
> > the best case we'd do some digging into the history to figure out why
> > this looks the way it looks like.
>
> I think the current bit-shift style introduced by 89c855ed3c (git-compat-util.h:
> implement a different ARRAY_SIZE macro for for safely deriving the size of
> array, 2015-04-30) was inherited from glibc [0].
>
> I found that NetBSD [1] has long used the more explicit comparison form instead
> of the bit-shift style, and other BSDs seem to do the same. So there is at
> least established precedent for writing the version check that way. :-)
>
> I see no obvious reason to prefer the bit-shift style today.
Thanks for digging!
I don't really see a reason to keep the bitshift style, either. It could
make a difference if it was ever evaluated at runtime, as we would
evaluate the arguments multiple times with youur version. But all of the
instances we have are evaluated at compile time anwyay, so that doesn't
matter much to us.
I'll leave it up to you whether you want to send another iteration of
this patch series that also adapts the preexisting callsite to use the
new style.
Thanks!
Patrick
next prev parent reply other threads:[~2026-06-08 6:20 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-03 15:12 [PATCH] compat/posix.h: enable UNUSED warning messages for Clang Dominik Loidolt
2026-05-04 1:10 ` Junio C Hamano
2026-05-04 1:41 ` Junio C Hamano
2026-06-05 8:44 ` Dominik Loidolt
2026-06-05 9:46 ` [PATCH v2] " Dominik Loidolt
2026-06-05 10:40 ` Patrick Steinhardt
2026-06-05 11:50 ` Dominik Loidolt
2026-06-05 13:22 ` Patrick Steinhardt
2026-06-05 15:53 ` Dominik Loidolt
2026-06-08 6:20 ` Patrick Steinhardt [this message]
2026-06-08 12:44 ` [PATCH v3 1/2] " Dominik Loidolt
2026-06-08 12:44 ` [PATCH v3 2/2] compat/posix.h: simplify GIT_GNUC_PREREQ() comparison Dominik Loidolt
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=aiZfIc8k-9Et25g6@pks.im \
--to=ps@pks.im \
--cc=asedeno@google.com \
--cc=asedeno@mit.edu \
--cc=avarab@gmail.com \
--cc=dominik.loidolt@univie.ac.at \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/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