git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] git-compat-util.h: GCC deprecated only takes a message in GCC 4.5+

From
Aleajndro R Sedeño <asedeno@google.com>
Date
Oct 3, 2022, 21:23 UTC
Message-ID
<20221003212318.3092010-1-asedeno@google.com>
From: Alejandro R. Sedeño <asedeno@mit.edu>
Signed-off-by: Alejandro R. Sedeño <asedeno@mit.edu>
Signed-off-by: Alejandro R Sedeño <asedeno@google.com>
---
 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
Next: brian m. carlson
Message 1 of 9 in “git-compat-util.h: GCC deprecated only takes a message in GCC 4.5+”
  1. git-compat-util.h: GCC deprecated only takes a message in GCC 4.5+Aleajndro R Sedeño, Oct 3, 2022
  2. brian m. carlsonOct 3, 2022
  3. Alejandro R. SedeñoOct 3, 2022
  4. Jeff KingOct 5, 2022
  5. Ævar Arnfjörð BjarmasonOct 6, 2022
  6. Jeff KingOct 6, 2022
  7. Ævar Arnfjörð BjarmasonOct 6, 2022
  8. Jeff KingOct 11, 2022
  9. Ævar Arnfjörð BjarmasonOct 6, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.