Message ID | 20181105063718.GA24877@sigill.intra.peff.net (mailing list archive) |
---|---|
Headers | show |
Series | parseopt fixes from -Wunused-parameters | expand |
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?
On Mon, Nov 05, 2018 at 05:51:07PM +0100, Duy Nguyen wrote: > 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
On Mon, Nov 5, 2018 at 7:49 PM Jeff King <peff@peff.net> wrote: > > On Mon, Nov 05, 2018 at 05:51:07PM +0100, Duy Nguyen wrote: > > > 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. Oops. I guess I stopped reading the series too early. Sorry for the noise.