From baf2fbb98fbc7fa9da895f687d855dbeda7a422b Mon Sep 17 00:00:00 2001 From: Alistair Delva Date: Wed, 5 Aug 2020 10:32:17 -0700 Subject: naming: Add unreachable return to !HAVE_PCRE path Android builds all host tools with -Werror=no-return, which generates a false positive in name_regexmatch_value() if HAVE_PCRE is not present. Fix this by adding a return code to the !HAVE_PCRE path. This return will not be reached but will suppress the compiler warning. If/when SWIG can require C++11 compilers, a better fix would be to make SWIG_exit() [[noreturn]]. Closes #1860 --- Source/Swig/naming.c | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/Swig/naming.c b/Source/Swig/naming.c index 6689ceb7a..1d78e7a47 100644 --- a/Source/Swig/naming.c +++ b/Source/Swig/naming.c @@ -1132,6 +1132,7 @@ static int name_regexmatch_value(Node *n, String *pattern, String *s) { Swig_error("SWIG", Getline(n), "PCRE regex matching is not available in this SWIG build.\n"); SWIG_exit(EXIT_FAILURE); + return 0; } #endif /* HAVE_PCRE/!HAVE_PCRE */ -- cgit v1.2.1