]> Kevux Git Server - rit/commit
compat/posix.h: enable UNUSED warning messages for Clang
authorDominik Loidolt <dominik.loidolt@univie.ac.at>
Sat, 13 Jun 2026 12:27:09 +0000 (14:27 +0200)
committerJunio C Hamano <gitster@pobox.com>
Sat, 13 Jun 2026 15:45:26 +0000 (08:45 -0700)
commit689dc92e501e25ae1ed67410ff51b4359a4f5c3c
tree881125e79ea546b115dccd7f60f12ff761cafbb9
parent9ac3f193c05c2237e2b14ebaa1149e9fc8a1abe0
compat/posix.h: enable UNUSED warning messages for Clang

Use a dedicated Clang version check for the UNUSED macro.

Commit 7c07f36ad2 (git-compat-util.h: GCC deprecated message arg only in
GCC 4.5+, 2022-10-05) restricted use of the deprecated attribute's
message argument in the UNUSED macro to GCC 4.5 or newer.

Clang identifies itself as GNUC 4.2.1 for compatibility, so
GIT_GNUC_PREREQ(4, 5) does not detect whether Clang supports the
deprecated("...") form. Add GIT_CLANG_PREREQ() macro and use it to
enable the UNUSED warning message for Clang 2.9 and newer.

Signed-off-by: Dominik Loidolt <dominik.loidolt@univie.ac.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
compat/posix.h