From: Aleajndro R Sedeño Date: Mon, 03 Oct 2022 21:23:18 GMT Subject: [PATCH] git-compat-util.h: GCC deprecated only takes a message in GCC 4.5+ Message-ID: <20221003212318.3092010-1-asedeno@google.com> From: Alejandro R. Sedeño Signed-off-by: Alejandro R. Sedeño Signed-off-by: Alejandro R Sedeño --- git-compat-util.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 -- 2.38.0.rc1.362.ged0d419d3c-goog