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

[PATCH v3 1/3] commit-slab: move MAYBE_UNUSED into git-compat-util

From
Carlo Marcelo Arenas Belón <carenas@gmail.com>
Date
Oct 25, 2018, 11:04 UTC
Message-ID
<20181025110427.13655-2-carenas@gmail.com>
In-Reply-To
<20181025110427.13655-1-carenas@gmail.com>

after 36da893114 ("config.mak.dev: enable -Wunused-function", 2018-10-18) it is expected to be used to prevent -Wunused-function warnings for code that was macro generated

Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 commit-slab-impl.h | 4 +---
 git-compat-util.h  | 2 ++
 2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/commit-slab-impl.h b/commit-slab-impl.h
index ac1e6d409a..e352c2f8c1 100644
--- a/commit-slab-impl.h
+++ b/commit-slab-impl.h
@@ -1,10 +1,8 @@
 #ifndef COMMIT_SLAB_IMPL_H
 #define COMMIT_SLAB_IMPL_H
 
-#define MAYBE_UNUSED __attribute__((__unused__))
-
 #define implement_static_commit_slab(slabname, elemtype) \
-	implement_commit_slab(slabname, elemtype, static MAYBE_UNUSED)
+	implement_commit_slab(slabname, elemtype, MAYBE_UNUSED static)
 
 #define implement_shared_commit_slab(slabname, elemtype) \
 	implement_commit_slab(slabname, elemtype, )
diff --git a/git-compat-util.h b/git-compat-util.h
index 48c955541e..8121b73b4a 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -408,6 +408,8 @@ static inline char *git_find_last_dir_sep(const char *path)
 #define LAST_ARG_MUST_BE_NULL
 #endif
 
+#define MAYBE_UNUSED __attribute__((__unused__))
+
 #include "compat/bswap.h"
 
 #include "wildmatch.h"
-- 
2.19.1
Previous: Carlo Marcelo Arenas BelónNext: Carlo Marcelo Arenas Belón
Message 2 of 9 in “delta-islands: avoid unused function messages”
  1. 0/3 delta-islands: avoid unused function messagesCarlo Marcelo Arenas Belón, Oct 25, 2018
  2. 1/3 commit-slab: move MAYBE_UNUSED into git-compat-utilCarlo Marcelo Arenas Belón, Oct 25, 2018
  3. 2/3 khash: silence -Wunused-function in delta-islands from khashCarlo Marcelo Arenas Belón, Oct 25, 2018
  4. SZEDER GáborOct 25, 2018
  5. 3/3 commit-slab: missing definitions and forward declarations (hdr-check)Carlo Marcelo Arenas Belón, Oct 25, 2018
  6. Ramsay JonesOct 25, 2018
  7. Ramsay JonesOct 25, 2018
  8. Carlo ArenasOct 26, 2018
  9. Ramsay JonesOct 27, 2018

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.