From: Patrick Steinhardt Date: Mon, 08 Jun 2026 06:20:17 GMT Subject: Re: [PATCH v2] compat/posix.h: enable UNUSED warning messages for Clang Message-ID: In-Reply-To: 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