From: Dominik Loidolt <dominik.loidolt@univie•ac.at>
To: Patrick Steinhardt <ps@pks•im>
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: Fri, 5 Jun 2026 17:53:45 +0200 [thread overview]
Message-ID: <aiLxCWp8Bv-KQoLf@four.local> (raw)
In-Reply-To: <aiLNqQgiQPlviB5X@pks.im>
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.
Dominik
[0] https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=4360eafdd20769fa9d42c075853271debd06f7d1
[1] https://github.com/NetBSD/src/commit/2fffc76da21e012509677f5310464f62797bd1bf
prev parent reply other threads:[~2026-06-05 15:53 UTC|newest]
Thread overview: 9+ 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 [this message]
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=aiLxCWp8Bv-KQoLf@four.local \
--to=dominik.loidolt@univie$(echo .)ac.at \
--cc=asedeno@google$(echo .)com \
--cc=asedeno@mit$(echo .)edu \
--cc=avarab@gmail$(echo .)com \
--cc=git@vger$(echo .)kernel.org \
--cc=gitster@pobox$(echo .)com \
--cc=ps@pks$(echo .)im \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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