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

[PATCH] reftable: make REFTABLE_UNUSED C99 compatible

From
Carlo Marcelo Arenas Belón <carenas@gmail.com>
Date
May 29, 2025, 10:11 UTC
Message-ID
<20250529101136.16219-1-carenas@gmail.com>
In-Reply-To
<046901dbd002$a0c245c0$e246d140$@nexbridge.com>

Since f93b2a0424 (reftable/basics: introduce `REFTABLE_UNUSED` annotation, 2025-02-18), the reftable library was migrated to use an internal version of `UNUSED`, which unconditionally sets a GNU __attribute__ to avoid warnings function parameters that are not being used.

Make the definition conditional to prevent breaking the build with non GNU compilers.

Reported-by: "Randall S. Becker" <rsbecker@nexbridge.com>
Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
---
 reftable/basics.h | 4 ++++
 1 file changed, 4 insertions(+)
diff --git a/reftable/basics.h b/reftable/basics.h
index d8888c1262..7d22f96261 100644
--- a/reftable/basics.h
+++ b/reftable/basics.h
@@ -16,7 +16,11 @@
 #include "system.h"
 #include "reftable-basics.h"
 
+#ifdef __GNUC__
 #define REFTABLE_UNUSED __attribute__((__unused__))
+#else
+#define REFTABLE_UNUSED
+#endif
 
 /*
  * Initialize the buffer such that it is ready for use. This is equivalent to
-- 
2.50.0.rc0.1.gb4243b6ac8
Previous: rsbecker@nexbridge.comNext: Junio C Hamano
Message 2 of 13 in “Build Failure: Git 2.50.0-rc0 on NonStop”
  1. rsbecker@nexbridge.comMay 28, 2025
  2. reftable: make REFTABLE_UNUSED C99 compatibleCarlo Marcelo Arenas Belón, May 29, 2025
  3. Junio C HamanoMay 29, 2025
  4. brian m. carlsonMay 29, 2025
  5. Junio C HamanoMay 30, 2025
  6. Patrick SteinhardtMay 30, 2025
  7. Jeff KingMay 30, 2025
  8. Patrick SteinhardtMay 30, 2025
  9. Junio C HamanoMay 30, 2025
  10. [Bug] Build Failure: Git 2.50.0-rc0 on NonStoprsbecker@nexbridge.com, May 30, 2025
  11. Kristoffer HaugsbakkMay 30, 2025
  12. Patrick SteinhardtMay 30, 2025
  13. rsbecker@nexbridge.comJun 1, 2025

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.