summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlistair Delva <adelva@google.com>2020-08-05 10:32:17 -0700
committerAlistair Delva <adelva@google.com>2020-08-13 09:19:37 -0700
commitbaf2fbb98fbc7fa9da895f687d855dbeda7a422b (patch)
tree077e4f5cb19b1e36d14f0432c75a468dfce725ee
parent46e17f1458e312c5a5b4213adefffbdab4b05540 (diff)
downloadswig-baf2fbb98fbc7fa9da895f687d855dbeda7a422b.tar.gz
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
-rw-r--r--Source/Swig/naming.c1
1 files changed, 1 insertions, 0 deletions
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 */