git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Duy Nguyen <pclouds@gmail.com>
To: Carlo Arenas <carenas@gmail.com>
Cc: Git Mailing List <git@vger.kernel.org>, Jeff King <peff@peff.net>
Subject: Re: [PATCH] khash: silence -Wunused-function
Date: Tue, 23 Oct 2018 17:44:41 +0200	[thread overview]
Message-ID: <CACsJy8AXjhbY9WWjYtMk128TZHLBCf4Ye4fe-ryXhoP9j2jtdw@mail.gmail.com> (raw)
In-Reply-To: <20181023113416.90958-1-carenas@gmail.com>

On Tue, Oct 23, 2018 at 1:42 PM Carlo Marcelo Arenas Belón
<carenas@gmail.com> wrote:
>
> after 36da893114 ("config.mak.dev: enable -Wunused-function", 2018-10-18)
> macro generated code should use a similar solution than commit-slab to
> silence the compiler.
>
> Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
> ---
>  khash.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/khash.h b/khash.h
> index d10caa0c35..39c2833877 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, __attribute__((__unused__)) static inline, khkey_t, khval_t, kh_is_map, __hash_func, __hash_equal)

Maybe move MAYBE_UNUSED from commit-slab-impl.h to git-compat-util.h
and use it here so we have an easier time if we have to use a
different way to mark unused functions on some exotic platform.

>
>  /* Other convenient macros... */
>
> --
> 2.19.1
>


-- 
Duy

  reply	other threads:[~2018-10-23 15:45 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 [this message]
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     ` [PATCH v2 1/2] commit-slabs: move MAYBE_UNUSED out Carlo Marcelo Arenas Belón
2018-10-23 22:00       ` 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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=CACsJy8AXjhbY9WWjYtMk128TZHLBCf4Ye4fe-ryXhoP9j2jtdw@mail.gmail.com \
    --to=pclouds@gmail.com \
    --cc=carenas@gmail.com \
    --cc=git@vger.kernel.org \
    --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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).