summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorph10 <ph10@6239d852-aaf2-0410-a92c-79f79f948069>2017-08-12 16:22:52 +0000
committerph10 <ph10@6239d852-aaf2-0410-a92c-79f79f948069>2017-08-12 16:22:52 +0000
commit6e9e0f0a2d1652855ae802863858fcc7635f39e7 (patch)
treed8c24d2f915495ebaef1dce4d8244441492a0c44
parent37ec46f23ad6bfbd89dea110595e18cdb2a12ce5 (diff)
downloadpcre2-6e9e0f0a2d1652855ae802863858fcc7635f39e7.tar.gz
Fix "maybe uninitialized" warning.
git-svn-id: svn://vcs.exim.org/pcre2/code/trunk@852 6239d852-aaf2-0410-a92c-79f79f948069
-rw-r--r--ChangeLog3
-rwxr-xr-xmaint/ManyConfigTests1
-rw-r--r--src/pcre2_compile.c7
3 files changed, 9 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index e58c18f..188ab3c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -232,6 +232,9 @@ not doing so for [\d-X] (and similar escapes), as is documented.
54. Fixed a MIPS issue in the JIT compiler reported by Joshua Kinard.
+55. Fixed a "maybe uninitialized" warning for class_uchardata in \p handling in
+pcre2_compile() which could never actually trigger (code should have been cut
+out when Unicode support is disabled).
Version 10.23 14-February-2017
diff --git a/maint/ManyConfigTests b/maint/ManyConfigTests
index e14f871..5860b39 100755
--- a/maint/ManyConfigTests
+++ b/maint/ManyConfigTests
@@ -124,6 +124,7 @@ if [ $? -eq 0 ] && grep GCC /tmp/pcre2ccversion >/dev/null; then
CFLAGS="$CFLAGS -Wnested-externs"
CFLAGS="$CFLAGS -pedantic"
CFLAGS="$CFLAGS -Wuninitialized"
+ CFLAGS="$CFLAGS -Wmaybe-uninitialized"
CFLAGS="$CFLAGS -Wmissing-prototypes"
CFLAGS="$CFLAGS -Wstrict-prototypes"
fi
diff --git a/src/pcre2_compile.c b/src/pcre2_compile.c
index c801ee4..44ee250 100644
--- a/src/pcre2_compile.c
+++ b/src/pcre2_compile.c
@@ -5356,6 +5356,10 @@ for (;; pptr++)
options & ~PCRE2_CASELESS, cb, PRIV(vspace_list));
break;
+ /* If Unicode is not supported, \P and \p are not allowed and are
+ faulted at parse time, so will never appear here. */
+
+#ifdef SUPPORT_UNICODE
case ESC_p:
case ESC_P:
{
@@ -5364,12 +5368,11 @@ for (;; pptr++)
*class_uchardata++ = (escape == ESC_p)? XCL_PROP : XCL_NOTPROP;
*class_uchardata++ = ptype;
*class_uchardata++ = pdata;
-#ifdef SUPPORT_WIDE_CHARS
xclass_has_prop = TRUE;
-#endif
class_has_8bitchar--; /* Undo! */
}
break;
+#endif
}
goto CONTINUE_CLASS;