Re: [PATCH 0/13] parseopt fixes from -Wunused-parameters
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Nov 5, 2018, 16:51 UTC
- Message-ID
- <CACsJy8Dz5Meu2fnNOiFXcw4LTROxBAn05OSZhYBih7ac0jQFzA@mail.gmail.com>
- In-Reply-To
- <20181105063718.GA24877@sigill.intra.peff.net>
On Mon, Nov 5, 2018 at 7:39 AM Jeff King <peff@peff.net> wrote:
Show 10 quoted lines
> > 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?
-- Duy