git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH 0/13] parseopt fixes from -Wunused-parameters
@ 2018-11-05  6:37 Jeff King
  2018-11-05  6:38 ` [PATCH 01/13] apply: mark include/exclude options as NONEG Jeff King
                   ` (13 more replies)
  0 siblings, 14 replies; 21+ messages in thread
From: Jeff King @ 2018-11-05  6:37 UTC (permalink / raw)
  To: git

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.

But this series fixes real bugs. These first four fix segfaults:

  [01/13]: apply: mark include/exclude options as NONEG
  [02/13]: am: handle --no-patch-format option
  [03/13]: ls-files: mark exclude options as NONEG
  [04/13]: pack-objects: mark index-version option as NONEG

And these four fix cases where we just quietly do the wrong thing:

  [05/13]: cat-file: mark batch options with NONEG
  [06/13]: status: mark --find-renames option with NONEG
  [07/13]: format-patch: mark "--no-numbered" option with NONEG
  [08/13]: show-branch: mark --reflog option as NONEG

These ones are just message improvements:

  [09/13]: tag: mark "--message" option with NONEG
  [10/13]: cat-file: report an error on multiple --batch options
  [11/13]: apply: return -1 from option callback instead of calling exit(1)

This one is a segfault, but it has no callers. ;)

  [12/13]: parse-options: drop OPT_DATE()

And then this last one is mostly about annotating the callbacks. It
doesn't strictly need to happen here, but the alternative is that I'd
eventually have to deal with it in the later series I mentioned.

  [13/13]: assert NOARG/NONEG behavior of parse-options callbacks

 apply.c                       | 24 +++++++++++++++++++++---
 builtin/am.c                  |  4 +++-
 builtin/blame.c               |  4 ++++
 builtin/cat-file.c            | 10 +++++++---
 builtin/checkout-index.c      |  2 ++
 builtin/clean.c               |  1 +
 builtin/commit.c              |  5 ++++-
 builtin/fetch.c               |  2 ++
 builtin/grep.c                | 14 +++++++++++++-
 builtin/init-db.c             |  1 +
 builtin/interpret-trailers.c  |  2 ++
 builtin/log.c                 | 12 +++++++++++-
 builtin/ls-files.c            | 14 +++++++++++---
 builtin/merge-file.c          |  2 ++
 builtin/merge.c               |  1 +
 builtin/notes.c               |  7 +++++++
 builtin/pack-objects.c        |  5 ++++-
 builtin/read-tree.c           |  3 +++
 builtin/rebase.c              |  6 ++++++
 builtin/show-branch.c         |  3 ++-
 builtin/show-ref.c            |  1 +
 builtin/tag.c                 |  6 ++++--
 builtin/update-index.c        | 21 +++++++++++++++++++--
 parse-options-cb.c            | 14 +++++++-------
 parse-options.h               | 18 ++++++++++++++----
 ref-filter.c                  |  2 ++
 t/helper/test-parse-options.c |  2 +-
 t/t0040-parse-options.sh      | 22 ----------------------
 28 files changed, 155 insertions(+), 53 deletions(-)

-Peff

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2018-11-05 18:52 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-05  6:37 [PATCH 0/13] parseopt fixes from -Wunused-parameters Jeff King
2018-11-05  6:38 ` [PATCH 01/13] apply: mark include/exclude options as NONEG Jeff King
2018-11-05  7:07   ` Junio C Hamano
2018-11-05  6:38 ` [PATCH 02/13] am: handle --no-patch-format option Jeff King
2018-11-05  7:08   ` Junio C Hamano
2018-11-05  6:39 ` [PATCH 03/13] ls-files: mark exclude options as NONEG Jeff King
2018-11-05  6:39 ` [PATCH 04/13] pack-objects: mark index-version option " Jeff King
2018-11-05  6:40 ` [PATCH 05/13] cat-file: mark batch options with NONEG Jeff King
2018-11-05  6:40 ` [PATCH 06/13] status: mark --find-renames option " Jeff King
2018-11-05  6:41 ` [PATCH 07/13] format-patch: mark "--no-numbered" " Jeff King
2018-11-05  6:42 ` [PATCH 08/13] show-branch: mark --reflog option as NONEG Jeff King
2018-11-05  6:43 ` [PATCH 09/13] tag: mark "--message" option with NONEG Jeff King
2018-11-05  6:43 ` [PATCH 10/13] cat-file: report an error on multiple --batch options Jeff King
2018-11-05  6:43 ` [PATCH 11/13] apply: return -1 from option callback instead of calling exit(1) Jeff King
2018-11-05  6:44 ` [PATCH 12/13] parse-options: drop OPT_DATE() Jeff King
2018-11-05 18:34   ` [PATCH] parse-options: deprecate OPT_DATE Carlo Marcelo Arenas Belón
2018-11-05 18:49     ` Jeff King
2018-11-05  6:45 ` [PATCH 13/13] assert NOARG/NONEG behavior of parse-options callbacks Jeff King
2018-11-05 16:51 ` [PATCH 0/13] parseopt fixes from -Wunused-parameters Duy Nguyen
2018-11-05 18:49   ` Jeff King
2018-11-05 18:51     ` Duy Nguyen

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).