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 13:50:29 +0200 [thread overview]
Message-ID: <aiK4BR86cuq5bmCe@four.local> (raw)
In-Reply-To: <aiKnqlI7WdcskDAs@pks.im>
Thanks for the review!
I noticed that the version-check style now differs between GCC and the newly
introduced Clang checks, would it make sense to make them consistent? Like:
diff --git a/compat/posix.h b/compat/posix.h
index faaae1b655..e20f8ec61e 100644
--- a/compat/posix.h
+++ b/compat/posix.h
@@ -17,7 +17,8 @@
*/
#if defined(__GNUC__) && defined(__GNUC_MINOR__)
# define GIT_GNUC_PREREQ(maj, min) \
- ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
+ ((__GNUC__ > (maj)) || \
+ (__GNUC__ == (maj) && (__GNUC_MINOR__ >= (min))))
#else
#define GIT_GNUC_PREREQ(maj, min) 0
#endif
I think the current GCC bit-shift check is harder to read.
If you agree, I could send a 2-patch v3 series, which would also clean up the
comment style nit.
Dominik
next prev parent reply other threads:[~2026-06-05 11:50 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 [this message]
2026-06-05 13:22 ` Patrick Steinhardt
2026-06-05 15:53 ` 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=aiK4BR86cuq5bmCe@four.local \
--to=dominik.loidolt@univie.ac.at \
--cc=asedeno@google.com \
--cc=asedeno@mit.edu \
--cc=avarab@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=ps@pks.im \
/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