Subject: Re: [PATCH v2] compat/posix.h: enable UNUSED warning messages for Clang

From: Dominik Loidolt <[email-masked]>
Date: Fri, 5 Jun 2026 17:53:45 +0200

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