From e1dcf10ec448bfe8cfab183c88d453959fcec072 Mon Sep 17 00:00:00 2001 From: Norihiro Tanaka Date: Fri, 12 Dec 2014 12:46:50 +0900 Subject: [PATCH] grep: fails to build grep on a machine which has no PCRE with --enable-gcc-warnings src/pcresearch.c: empty_match variable is covered with HAVE_LIBPCRE guard. NEWS (Bug fixes): Add a new entry. --- NEWS | 5 +++++ src/pcresearch.c | 2 ++ 2 files changed, 7 insertions(+) diff --git a/NEWS b/NEWS index 6138c4e..e0d4b8d 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,11 @@ GNU grep NEWS -*- outline -*- * Noteworthy changes in release ?.? (????-??-??) [?] +** Bug fixes + + A warning is no longer output --enable-gcc-warnings even if build grep + on a machine which has no PCRE. + [bug introduced in grep-2.21] * Noteworthy changes in release 2.21 (2014-11-23) [stable] diff --git a/src/pcresearch.c b/src/pcresearch.c index 5451029..36cf4dd 100644 --- a/src/pcresearch.c +++ b/src/pcresearch.c @@ -38,9 +38,11 @@ static pcre_extra *extra; # endif #endif +#if HAVE_LIBPCRE /* Table, indexed by ! (flag & PCRE_NOTBOL), of whether the empty string matches when that flag is used. */ static int empty_match[2]; +#endif /* This must be at least 2; everything after that is for performance in pcre_exec. */ -- 2.2.0