Skip to content

Commit 4548b01

Browse files
peffgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 2c3c3d8 commit 4548b01

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

grep.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -452,18 +452,20 @@ static void free_pcre2_pattern(struct grep_pat *p)
452452
pcre2_general_context_free(p->pcre2_general_context);
453453
}
454454
#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)
456457
{
457458
die("cannot use Perl-compatible regexes when not compiled with USE_LIBPCRE");
458459
}
459460

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)
462464
{
463465
return 1;
464466
}
465467

466-
static void free_pcre2_pattern(struct grep_pat *p)
468+
static void free_pcre2_pattern(struct grep_pat *p UNUSED)
467469
{
468470
}
469471

0 commit comments

Comments
 (0)