[Pcre-svn] [852] code/trunk: Fix "maybe uninitialized" warni…

Top Page
Delete this message
Author: Subversion repository
Date:  
To: pcre-svn
Subject: [Pcre-svn] [852] code/trunk: Fix "maybe uninitialized" warning.
Revision: 852
          http://www.exim.org/viewvc/pcre2?view=rev&revision=852
Author:   ph10
Date:     2017-08-12 17:22:52 +0100 (Sat, 12 Aug 2017)
Log Message:
-----------
Fix "maybe uninitialized" warning.


Modified Paths:
--------------
    code/trunk/ChangeLog
    code/trunk/maint/ManyConfigTests
    code/trunk/src/pcre2_compile.c


Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog    2017-08-01 08:26:01 UTC (rev 851)
+++ code/trunk/ChangeLog    2017-08-12 16:22:52 UTC (rev 852)
@@ -232,6 +232,9 @@


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

Modified: code/trunk/maint/ManyConfigTests
===================================================================
--- code/trunk/maint/ManyConfigTests    2017-08-01 08:26:01 UTC (rev 851)
+++ code/trunk/maint/ManyConfigTests    2017-08-12 16:22:52 UTC (rev 852)
@@ -124,6 +124,7 @@
   CFLAGS="$CFLAGS -Wnested-externs"
   CFLAGS="$CFLAGS -pedantic"
   CFLAGS="$CFLAGS -Wuninitialized"
+  CFLAGS="$CFLAGS -Wmaybe-uninitialized" 
   CFLAGS="$CFLAGS -Wmissing-prototypes"
   CFLAGS="$CFLAGS -Wstrict-prototypes"
 fi


Modified: code/trunk/src/pcre2_compile.c
===================================================================
--- code/trunk/src/pcre2_compile.c    2017-08-01 08:26:01 UTC (rev 851)
+++ code/trunk/src/pcre2_compile.c    2017-08-12 16:22:52 UTC (rev 852)
@@ -5356,6 +5356,10 @@
             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 @@
             *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;