All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Carlo Marcelo Arenas Belón" <carenas@gmail.com>
To: git@vger.kernel.org
Cc: pclouds@gmail.com, peff@peff.net, chriscool@tuxfamily.org,
	l.s.r@web.de, "Carlo Marcelo Arenas Belón" <carenas@gmail.com>
Subject: [PATCH v2 1/2] commit-slabs: move MAYBE_UNUSED out
Date: Tue, 23 Oct 2018 14:50:19 -0700	[thread overview]
Message-ID: <20181023215020.18550-2-carenas@gmail.com> (raw)
In-Reply-To: <20181023215020.18550-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>
---
 commit-slab-impl.h | 4 ++--
 git-compat-util.h  | 2 ++
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/commit-slab-impl.h b/commit-slab-impl.h
index ac1e6d409a..5c0eb91a5d 100644
--- a/commit-slab-impl.h
+++ b/commit-slab-impl.h
@@ -1,10 +1,10 @@
 #ifndef COMMIT_SLAB_IMPL_H
 #define COMMIT_SLAB_IMPL_H
 
-#define MAYBE_UNUSED __attribute__((__unused__))
+#include "git-compat-util.h"
 
 #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 9a64998b24..e4d3967a23 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


  reply	other threads:[~2018-10-23 21:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-23 11:34 [PATCH] khash: silence -Wunused-function Carlo Marcelo Arenas Belón
2018-10-23 15:44 ` Duy Nguyen
2018-10-23 21:50   ` [PATCH v2 0/2] delta-islands: avoid unused function messages Carlo Marcelo Arenas Belón
2018-10-23 21:50     ` Carlo Marcelo Arenas Belón [this message]
2018-10-23 22:00       ` [PATCH v2 1/2] commit-slabs: move MAYBE_UNUSED out Jeff King
2018-10-23 23:02         ` Carlo Arenas
2018-10-23 21:50     ` [PATCH v2 2/2] khash: silence -Wunused-function for delta-islands Carlo Marcelo Arenas Belón
2018-10-23 16:19 ` [PATCH] khash: silence -Wunused-function René Scharfe
2018-10-23 16:52   ` Carlo Arenas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181023215020.18550-2-carenas@gmail.com \
    --to=carenas@gmail.com \
    --cc=chriscool@tuxfamily.org \
    --cc=git@vger.kernel.org \
    --cc=l.s.r@web.de \
    --cc=pclouds@gmail.com \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.