summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2011-06-21 18:12:04 +0200
committerJim Meyering <meyering@redhat.com>2011-06-21 19:18:47 +0200
commit920a2d8ad2b3fa66f3b3be3178c077b9e90a6f1f (patch)
tree0448cce72e9adcb7dc7a144c9540fd611cde32ff
parent8a54f203127575f11b9a809e002aba22a365aebe (diff)
downloadgrep-920a2d8ad2b3fa66f3b3be3178c077b9e90a6f1f.tar.gz
build: avoid a warning when building with --disable-perl-regexp...
and --enable-gcc-warnings. * src/pcresearch.c (WITHOUT_PCRE_NORETURN): Define. Remove the unreachable return statement. Reported by Eric Blake.
-rw-r--r--src/pcresearch.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/pcresearch.c b/src/pcresearch.c
index e8c7f4b3..f8581e08 100644
--- a/src/pcresearch.c
+++ b/src/pcresearch.c
@@ -101,13 +101,19 @@ Pcompile (char const *pattern, size_t size)
#endif
}
-size_t
+/* Pexecute is a no-return function when building --without-pcre. */
+#if !HAVE_LIBPCRE
+# define WITHOUT_PCRE_NORETURN _GL_ATTRIBUTE_NORETURN
+#else
+# define WITHOUT_PCRE_NORETURN /* empty */
+#endif
+
+size_t WITHOUT_PCRE_NORETURN
Pexecute (char const *buf, size_t size, size_t *match_size,
char const *start_ptr)
{
#if !HAVE_LIBPCRE
abort ();
- return -1;
#else
/* This array must have at least two elements; everything after that
is just for performance improvement in pcre_exec. */