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