[PATCH 17/22] grep: mark unused parmaeters in pcre fallbacks
- From
Jeff King <peff@peff.net>
- Date
- Aug 28, 2023, 21:48 UTC
- Message-ID
- <20230828214812.GQ3831137@coredump.intra.peff.net>
- In-Reply-To
- <20230828214604.GA3830831@coredump.intra.peff.net>
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> --- grep.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/grep.c b/grep.c index 0124eb1960..fc2d0c837a 100644 --- a/grep.c +++ b/grep.c @@ -452,18 +452,20 @@ static void free_pcre2_pattern(struct grep_pat *p) pcre2_general_context_free(p->pcre2_general_context); } #else /* !USE_LIBPCRE2 */ -static void compile_pcre2_pattern(struct grep_pat *p, const struct grep_opt *opt) +static void compile_pcre2_pattern(struct grep_pat *p UNUSED, + const struct grep_opt *opt UNUSED) { die("cannot use Perl-compatible regexes when not compiled with USE_LIBPCRE"); } -static int pcre2match(struct grep_pat *p, const char *line, const char *eol, - regmatch_t *match, int eflags) +static int pcre2match(struct grep_pat *p UNUSED, const char *line UNUSED, + const char *eol UNUSED, regmatch_t *match UNUSED, + int eflags UNUSED) { return 1; } -static void free_pcre2_pattern(struct grep_pat *p) +static void free_pcre2_pattern(struct grep_pat *p UNUSED) { }
-- 2.42.0.505.g4c6fb48dec