From: Alex Riesen Date: Thu, 05 May 2011 07:43:50 GMT Subject: Re: [PATCH V2 4/5] git-grep: Learn PCRE Message-ID: In-Reply-To: <1304546421-25439-5-git-send-email-michal.kiedrowicz@gmail.com> 2011/5/5 Michał Kiedrowicz : > +#ifdef NO_LIBPCRE > +static void compile_pcre_regexp(struct grep_pat *p, struct grep_opt *opt) > +{ > +       die("cannot use Perl-compatible regexes when libpcre is not compiled in"); > +} Looks like these two functions below can be just left empty, because you will exit when calling compile_pcre_regexp in compile_regexp. > +static int pcrematch(struct grep_pat *p, char *line, char *eol, > +               regmatch_t *match, int eflags) > +{ > +       die("cannot use Perl-compatible regexes when libpcre is not compiled in"); > +} > + > +static void free_pcre_regexp(struct grep_pat *p) > +{ > +       die("cannot use Perl-compatible regexes when libpcre is not compiled in"); > +} > + These will be never called, because... > @@ -70,6 +135,11 @@ static void compile_regexp(struct grep_pat *p, struct grep_opt *opt) >        if (p->fixed) >                return; > > +       if (opt->pcre) { > +               compile_pcre_regexp(p, opt); > +               return; > +       } ... you die here, if PCRE not available.