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

Re: [PATCH v2 1/2] commit-slabs: move MAYBE_UNUSED out

From
Carlo Arenas <carenas@gmail.com>
Date
Oct 23, 2018, 23:02 UTC
Message-ID
<CAPUEspiAhmJ5+qTUcA6x+eSPc9jmOLdF7QsSsSfwJSy5r=06PA@mail.gmail.com>
In-Reply-To
<20181023220019.GA31613@sigill.intra.peff.net>
On Tue, Oct 23, 2018 at 3:00 PM Jeff King <peff@peff.net> wrote:
Show 6 quoted lines
> On Tue, Oct 23, 2018 at 02:50:19PM -0700, Carlo Marcelo Arenas Belón wrote:
> >  #define implement_static_commit_slab(slabname, elemtype) \
> > -     implement_commit_slab(slabname, elemtype, static MAYBE_UNUSED)
> > +     implement_commit_slab(slabname, elemtype, MAYBE_UNUSED static)
>
> Is this hunk necessary?

it works eitherway but the proposed syntax is IMHO better aligned (when used in a function definition) as it matches better the syntax from C++ attribute: maybe_unused (since C++17) [1]

__attribute__(unused) (the GCC extension) is meant to be applied to function declarations, but we are not generating those.

Carlo
[1] https://en.cppreference.com/w/cpp/language/attributes/maybe_unused
Previous: Jeff KingNext: Carlo Marcelo Arenas Belón
Message 6 of 9 in “khash: silence -Wunused-function”
  1. khash: silence -Wunused-functionCarlo Marcelo Arenas Belón, Oct 23, 2018
  2. Duy NguyenOct 23, 2018
  3. 0/2 delta-islands: avoid unused function messagesCarlo Marcelo Arenas Belón, Oct 23, 2018
  4. 1/2 commit-slabs: move MAYBE_UNUSED outCarlo Marcelo Arenas Belón, Oct 23, 2018
  5. Jeff KingOct 23, 2018
  6. Carlo ArenasOct 23, 2018
  7. 2/2 khash: silence -Wunused-function for delta-islandsCarlo Marcelo Arenas Belón, Oct 23, 2018
  8. René ScharfeOct 23, 2018
  9. Carlo ArenasOct 23, 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.