Re: [PATCH 0/13] parseopt fixes from -Wunused-parameters
- From
Jeff King <peff@peff.net>
- Date
- Nov 5, 2018, 18:49 UTC
- Message-ID
- <20181105184900.GA30690@sigill.intra.peff.net>
- In-Reply-To
- <CACsJy8Dz5Meu2fnNOiFXcw4LTROxBAn05OSZhYBih7ac0jQFzA@mail.gmail.com>
On Mon, Nov 05, 2018 at 05:51:07PM +0100, Duy Nguyen wrote:
Show 23 quoted lines
> On Mon, Nov 5, 2018 at 7:39 AM Jeff King <peff@peff.net> wrote:
> >
> > Continuing my exploration of what -Wunused-parameters can show us, here
> > are some bug-fixes related to parse-options callbacks.
> >
> > This is the last of the actual bug-fixes I've found. After this, I have
> > about 60 patches worth of cleanups (i.e., dropping the unused
> > parameters), and then I have a series to annotate parameters that must
> > be unused (e.g., for functions that must conform to callback
> > interfaces). After we can start compiling with -Wunused-parameters,
> > assuming we don't find the annotations too cumbersome.
>
> Another good thing from this series is there are fewer --no-options to complete.
>
> About the annotating unused parameters related to segfault bug fixes
> in this series. Should we just add something like
>
> if (unset)
> BUG("This code does not support --no-stuff");
>
> which could be done in the same patches that fix the segfault, and it
> extends the diff context a bit to see what these callbacks do without
> opening up the editor, and also serves as a kind of annotation?That's done in the final patch. I did originally do it alongside the actual segfault fixes, but since it needs doing in so many other callbacks, too, it made sense to me to do it all together.
-Peff