Fix "maybe uninitialized" warning.

This commit is contained in:
Philip.Hazel 2017-08-12 16:22:52 +00:00
parent 6a42f68b34
commit 18d7627293
3 changed files with 9 additions and 2 deletions

View File

@ -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. 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 Version 10.23 14-February-2017

View File

@ -124,6 +124,7 @@ if [ $? -eq 0 ] && grep GCC /tmp/pcre2ccversion >/dev/null; then
CFLAGS="$CFLAGS -Wnested-externs" CFLAGS="$CFLAGS -Wnested-externs"
CFLAGS="$CFLAGS -pedantic" CFLAGS="$CFLAGS -pedantic"
CFLAGS="$CFLAGS -Wuninitialized" CFLAGS="$CFLAGS -Wuninitialized"
CFLAGS="$CFLAGS -Wmaybe-uninitialized"
CFLAGS="$CFLAGS -Wmissing-prototypes" CFLAGS="$CFLAGS -Wmissing-prototypes"
CFLAGS="$CFLAGS -Wstrict-prototypes" CFLAGS="$CFLAGS -Wstrict-prototypes"
fi fi

View File

@ -5356,6 +5356,10 @@ for (;; pptr++)
options & ~PCRE2_CASELESS, cb, PRIV(vspace_list)); options & ~PCRE2_CASELESS, cb, PRIV(vspace_list));
break; 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:
case ESC_P: case ESC_P:
{ {
@ -5364,12 +5368,11 @@ for (;; pptr++)
*class_uchardata++ = (escape == ESC_p)? XCL_PROP : XCL_NOTPROP; *class_uchardata++ = (escape == ESC_p)? XCL_PROP : XCL_NOTPROP;
*class_uchardata++ = ptype; *class_uchardata++ = ptype;
*class_uchardata++ = pdata; *class_uchardata++ = pdata;
#ifdef SUPPORT_WIDE_CHARS
xclass_has_prop = TRUE; xclass_has_prop = TRUE;
#endif
class_has_8bitchar--; /* Undo! */ class_has_8bitchar--; /* Undo! */
} }
break; break;
#endif
} }
goto CONTINUE_CLASS; goto CONTINUE_CLASS;