]> git.ipfire.org Git - thirdparty/git.git/commitdiff
parse-options: mark unused parameters in noop callback
authorJeff King <peff@peff.net>
Thu, 31 Aug 2023 21:22:20 +0000 (17:22 -0400)
committerJunio C Hamano <gitster@pobox.com>
Tue, 5 Sep 2023 21:48:17 +0000 (14:48 -0700)
Unsurprisingly, the noop options callback doesn't bother to look at any
of its parameters. Let's mark them so that -Wunused-parameter does not
complain.

Another option would be to drop the callback and have parse-options
itself recognize OPT_NOOP_NOARG. But that seems like extra work for no
real benefit.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
parse-options-cb.c

index a24521dee0fca3de6284a9c59cd3bd8cefdb4942..bdc7fae49719dfef060739854ae7491045afb6f2 100644 (file)
@@ -227,7 +227,9 @@ int parse_opt_strvec(const struct option *opt, const char *arg, int unset)
        return 0;
 }
 
-int parse_opt_noop_cb(const struct option *opt, const char *arg, int unset)
+int parse_opt_noop_cb(const struct option *opt UNUSED,
+                     const char *arg UNUSED,
+                     int unset UNUSED)
 {
        return 0;
 }