summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2022-10-28 00:24:12 +0200
committerJunio C Hamano <gitster@pobox.com>2022-10-28 00:24:12 +0200
commitcf649a36138a99c66d6f3d4ccc7f80b29cc463e0 (patch)
tree8d9beab2c1e0016a3e96989aea8bd436d200cef5
parentMerge branch 'tb/midx-repack-ignore-cruft-packs' into maint-2.38 (diff)
parentgit-compat-util.h: GCC deprecated message arg only in GCC 4.5+ (diff)
downloadgit-cf649a36138a99c66d6f3d4ccc7f80b29cc463e0.tar.xz
git-cf649a36138a99c66d6f3d4ccc7f80b29cc463e0.zip
Merge branch 'ab/unused-annotation' into maint-2.38
Compilation fix for ancient compilers. * ab/unused-annotation: git-compat-util.h: GCC deprecated message arg only in GCC 4.5+
-rw-r--r--git-compat-util.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/git-compat-util.h b/git-compat-util.h
index b90b64718e..045b47f83a 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -189,9 +189,12 @@ struct strbuf;
#define _NETBSD_SOURCE 1
#define _SGI_SOURCE 1
-#if defined(__GNUC__)
+#if GIT_GNUC_PREREQ(4, 5)
#define UNUSED __attribute__((unused)) \
__attribute__((deprecated ("parameter declared as UNUSED")))
+#elif defined(__GNUC__)
+#define UNUSED __attribute__((unused)) \
+ __attribute__((deprecated))
#else
#define UNUSED
#endif