grep: mark unused parmaeters in pcre fallbacks

When USE_LIBPCRE2 is not defined, we compile several noop fallbacks. These need to have their parameters annotated to avoid -Wunused-parameter warnings (and obviously we cannot remove the parameters, since the functions must match the non-fallback versions). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff King committed Aug 29, 2023 at 19:45 UTC 4548b0145f17c633de5e267b6c7932c72824e9d3
1 file changed +6 -4
grep.c
+6 -4
@@ -452,18 +452,20 @@ static void free_pcre2_pattern(struct grep_pat *p)
452 pcre2_general_context_free(p->pcre2_general_context);
453 }
454 #else /* !USE_LIBPCRE2 */
455 -static void compile_pcre2_pattern(struct grep_pat *p, const struct grep_opt *opt)
455 +static void compile_pcre2_pattern(struct grep_pat *p UNUSED,
456 + const struct grep_opt *opt UNUSED)
457 {
458 die("cannot use Perl-compatible regexes when not compiled with USE_LIBPCRE");
459 }
460
460 -static int pcre2match(struct grep_pat *p, const char *line, const char *eol,
461 - regmatch_t *match, int eflags)
461 +static int pcre2match(struct grep_pat *p UNUSED, const char *line UNUSED,
462 + const char *eol UNUSED, regmatch_t *match UNUSED,
463 + int eflags UNUSED)
464 {
465 return 1;
466 }
467
466 -static void free_pcre2_pattern(struct grep_pat *p)
468 +static void free_pcre2_pattern(struct grep_pat *p UNUSED)
469 {
470 }
471