]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'ab/unused-annotation' into maint-2.38
authorJunio C Hamano <gitster@pobox.com>
Thu, 27 Oct 2022 22:24:12 +0000 (15:24 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 27 Oct 2022 22:24:12 +0000 (15:24 -0700)
Compilation fix for ancient compilers.

* ab/unused-annotation:
  git-compat-util.h: GCC deprecated message arg only in GCC 4.5+

git-compat-util.h

index b90b64718eb610f9303fde76b0f207e22a4c9be6..045b47f83adef894583823786be4b5e707c05806 100644 (file)
@@ -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