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

[PATCH v3 2/3] khash: silence -Wunused-function in delta-islands from khash

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

showing the following when compiled with latest clang (OpenBSD, Fedora and macOS):

delta-islands.c:23:1: warning: unused function 'kh_destroy_str'
      [-Wunused-function]
delta-islands.c:23:1: warning: unused function 'kh_clear_str'
      [-Wunused-function]
delta-islands.c:23:1: warning: unused function 'kh_del_str' [-Wunused-function]
Reported-by: René Scharfe <l.s.r@web.de>
Suggested-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 khash.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/khash.h b/khash.h
index d10caa0c35..532109c87f 100644
--- a/khash.h
+++ b/khash.h
@@ -234,7 +234,7 @@ static const double __ac_HASH_UPPER = 0.77;
 	__KHASH_IMPL(name, SCOPE, khkey_t, khval_t, kh_is_map, __hash_func, __hash_equal)
 
 #define KHASH_INIT(name, khkey_t, khval_t, kh_is_map, __hash_func, __hash_equal) \
-	KHASH_INIT2(name, static inline, khkey_t, khval_t, kh_is_map, __hash_func, __hash_equal)
+	KHASH_INIT2(name, MAYBE_UNUSED static inline, khkey_t, khval_t, kh_is_map, __hash_func, __hash_equal)
 
 /* Other convenient macros... */
 
-- 
2.19.1
Previous: Carlo Marcelo Arenas BelónNext: SZEDER Gábor
Message 3 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.