Re: [pcre-dev] PCRE1 8.39-RC1 test release

Kezdőlap
Üzenet törlése
Szerző: Petr Pisar
Dátum:  
Címzett: pcre-dev
Tárgy: Re: [pcre-dev] PCRE1 8.39-RC1 test release
On Tue, May 24, 2016 at 09:34:11AM +0200, Petr Pisar wrote:
> On Mon, May 23, 2016 at 04:24:21PM +0100, ph10@??? wrote:
> > I have put a test release of PCRE1 here:
> >
> A new GCC 6.0.0 reports two kinds of warnings (not new to pcre-8.39-RC1,
> I only noticed now):
>

Attached patches should resolve both the issues.

-- Petr
From 3aff6d75b073849284670f557fe425bc9962dc3c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@???>
Date: Tue, 24 May 2016 09:42:25 +0200
Subject: [PATCH] Silent a warnings about indentation
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

GCC 6.0.0 warns about indentation:

pcrecpp.cc:171:3: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
   if (&ptr1  == &no_arg) goto done; args[n++] = &ptr1;
   ^~
pcrecpp.cc:171:37: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if'
   if (&ptr1  == &no_arg) goto done; args[n++] = &ptr1;
                                     ^~~~


This patch silents the warnings by addding curly brackets.

Signed-off-by: Petr Písař <ppisar@???>
---
pcrecpp.cc | 128 ++++++++++++++++++++++++++++++-------------------------------
1 file changed, 64 insertions(+), 64 deletions(-)

diff --git a/pcrecpp.cc b/pcrecpp.cc
index c595cbc..142a0c0 100644
--- a/pcrecpp.cc
+++ b/pcrecpp.cc
@@ -168,22 +168,22 @@ bool RE::FullMatch(const StringPiece& text,
                    const Arg& ptr16) const {
   const Arg* args[kMaxArgs];
   int n = 0;
-  if (&ptr1  == &no_arg) goto done; args[n++] = &ptr1;
-  if (&ptr2  == &no_arg) goto done; args[n++] = &ptr2;
-  if (&ptr3  == &no_arg) goto done; args[n++] = &ptr3;
-  if (&ptr4  == &no_arg) goto done; args[n++] = &ptr4;
-  if (&ptr5  == &no_arg) goto done; args[n++] = &ptr5;
-  if (&ptr6  == &no_arg) goto done; args[n++] = &ptr6;
-  if (&ptr7  == &no_arg) goto done; args[n++] = &ptr7;
-  if (&ptr8  == &no_arg) goto done; args[n++] = &ptr8;
-  if (&ptr9  == &no_arg) goto done; args[n++] = &ptr9;
-  if (&ptr10 == &no_arg) goto done; args[n++] = &ptr10;
-  if (&ptr11 == &no_arg) goto done; args[n++] = &ptr11;
-  if (&ptr12 == &no_arg) goto done; args[n++] = &ptr12;
-  if (&ptr13 == &no_arg) goto done; args[n++] = &ptr13;
-  if (&ptr14 == &no_arg) goto done; args[n++] = &ptr14;
-  if (&ptr15 == &no_arg) goto done; args[n++] = &ptr15;
-  if (&ptr16 == &no_arg) goto done; args[n++] = &ptr16;
+  if (&ptr1  == &no_arg) { goto done; } args[n++] = &ptr1;
+  if (&ptr2  == &no_arg) { goto done; } args[n++] = &ptr2;
+  if (&ptr3  == &no_arg) { goto done; } args[n++] = &ptr3;
+  if (&ptr4  == &no_arg) { goto done; } args[n++] = &ptr4;
+  if (&ptr5  == &no_arg) { goto done; } args[n++] = &ptr5;
+  if (&ptr6  == &no_arg) { goto done; } args[n++] = &ptr6;
+  if (&ptr7  == &no_arg) { goto done; } args[n++] = &ptr7;
+  if (&ptr8  == &no_arg) { goto done; } args[n++] = &ptr8;
+  if (&ptr9  == &no_arg) { goto done; } args[n++] = &ptr9;
+  if (&ptr10 == &no_arg) { goto done; } args[n++] = &ptr10;
+  if (&ptr11 == &no_arg) { goto done; } args[n++] = &ptr11;
+  if (&ptr12 == &no_arg) { goto done; } args[n++] = &ptr12;
+  if (&ptr13 == &no_arg) { goto done; } args[n++] = &ptr13;
+  if (&ptr14 == &no_arg) { goto done; } args[n++] = &ptr14;
+  if (&ptr15 == &no_arg) { goto done; } args[n++] = &ptr15;
+  if (&ptr16 == &no_arg) { goto done; } args[n++] = &ptr16;
  done:


   int consumed;
@@ -210,22 +210,22 @@ bool RE::PartialMatch(const StringPiece& text,
                       const Arg& ptr16) const {
   const Arg* args[kMaxArgs];
   int n = 0;
-  if (&ptr1  == &no_arg) goto done; args[n++] = &ptr1;
-  if (&ptr2  == &no_arg) goto done; args[n++] = &ptr2;
-  if (&ptr3  == &no_arg) goto done; args[n++] = &ptr3;
-  if (&ptr4  == &no_arg) goto done; args[n++] = &ptr4;
-  if (&ptr5  == &no_arg) goto done; args[n++] = &ptr5;
-  if (&ptr6  == &no_arg) goto done; args[n++] = &ptr6;
-  if (&ptr7  == &no_arg) goto done; args[n++] = &ptr7;
-  if (&ptr8  == &no_arg) goto done; args[n++] = &ptr8;
-  if (&ptr9  == &no_arg) goto done; args[n++] = &ptr9;
-  if (&ptr10 == &no_arg) goto done; args[n++] = &ptr10;
-  if (&ptr11 == &no_arg) goto done; args[n++] = &ptr11;
-  if (&ptr12 == &no_arg) goto done; args[n++] = &ptr12;
-  if (&ptr13 == &no_arg) goto done; args[n++] = &ptr13;
-  if (&ptr14 == &no_arg) goto done; args[n++] = &ptr14;
-  if (&ptr15 == &no_arg) goto done; args[n++] = &ptr15;
-  if (&ptr16 == &no_arg) goto done; args[n++] = &ptr16;
+  if (&ptr1  == &no_arg) { goto done; } args[n++] = &ptr1;
+  if (&ptr2  == &no_arg) { goto done; } args[n++] = &ptr2;
+  if (&ptr3  == &no_arg) { goto done; } args[n++] = &ptr3;
+  if (&ptr4  == &no_arg) { goto done; } args[n++] = &ptr4;
+  if (&ptr5  == &no_arg) { goto done; } args[n++] = &ptr5;
+  if (&ptr6  == &no_arg) { goto done; } args[n++] = &ptr6;
+  if (&ptr7  == &no_arg) { goto done; } args[n++] = &ptr7;
+  if (&ptr8  == &no_arg) { goto done; } args[n++] = &ptr8;
+  if (&ptr9  == &no_arg) { goto done; } args[n++] = &ptr9;
+  if (&ptr10 == &no_arg) { goto done; } args[n++] = &ptr10;
+  if (&ptr11 == &no_arg) { goto done; } args[n++] = &ptr11;
+  if (&ptr12 == &no_arg) { goto done; } args[n++] = &ptr12;
+  if (&ptr13 == &no_arg) { goto done; } args[n++] = &ptr13;
+  if (&ptr14 == &no_arg) { goto done; } args[n++] = &ptr14;
+  if (&ptr15 == &no_arg) { goto done; } args[n++] = &ptr15;
+  if (&ptr16 == &no_arg) { goto done; } args[n++] = &ptr16;
  done:


   int consumed;
@@ -252,22 +252,22 @@ bool RE::Consume(StringPiece* input,
                  const Arg& ptr16) const {
   const Arg* args[kMaxArgs];
   int n = 0;
-  if (&ptr1  == &no_arg) goto done; args[n++] = &ptr1;
-  if (&ptr2  == &no_arg) goto done; args[n++] = &ptr2;
-  if (&ptr3  == &no_arg) goto done; args[n++] = &ptr3;
-  if (&ptr4  == &no_arg) goto done; args[n++] = &ptr4;
-  if (&ptr5  == &no_arg) goto done; args[n++] = &ptr5;
-  if (&ptr6  == &no_arg) goto done; args[n++] = &ptr6;
-  if (&ptr7  == &no_arg) goto done; args[n++] = &ptr7;
-  if (&ptr8  == &no_arg) goto done; args[n++] = &ptr8;
-  if (&ptr9  == &no_arg) goto done; args[n++] = &ptr9;
-  if (&ptr10 == &no_arg) goto done; args[n++] = &ptr10;
-  if (&ptr11 == &no_arg) goto done; args[n++] = &ptr11;
-  if (&ptr12 == &no_arg) goto done; args[n++] = &ptr12;
-  if (&ptr13 == &no_arg) goto done; args[n++] = &ptr13;
-  if (&ptr14 == &no_arg) goto done; args[n++] = &ptr14;
-  if (&ptr15 == &no_arg) goto done; args[n++] = &ptr15;
-  if (&ptr16 == &no_arg) goto done; args[n++] = &ptr16;
+  if (&ptr1  == &no_arg) { goto done; } args[n++] = &ptr1;
+  if (&ptr2  == &no_arg) { goto done; } args[n++] = &ptr2;
+  if (&ptr3  == &no_arg) { goto done; } args[n++] = &ptr3;
+  if (&ptr4  == &no_arg) { goto done; } args[n++] = &ptr4;
+  if (&ptr5  == &no_arg) { goto done; } args[n++] = &ptr5;
+  if (&ptr6  == &no_arg) { goto done; } args[n++] = &ptr6;
+  if (&ptr7  == &no_arg) { goto done; } args[n++] = &ptr7;
+  if (&ptr8  == &no_arg) { goto done; } args[n++] = &ptr8;
+  if (&ptr9  == &no_arg) { goto done; } args[n++] = &ptr9;
+  if (&ptr10 == &no_arg) { goto done; } args[n++] = &ptr10;
+  if (&ptr11 == &no_arg) { goto done; } args[n++] = &ptr11;
+  if (&ptr12 == &no_arg) { goto done; } args[n++] = &ptr12;
+  if (&ptr13 == &no_arg) { goto done; } args[n++] = &ptr13;
+  if (&ptr14 == &no_arg) { goto done; } args[n++] = &ptr14;
+  if (&ptr15 == &no_arg) { goto done; } args[n++] = &ptr15;
+  if (&ptr16 == &no_arg) { goto done; } args[n++] = &ptr16;
  done:


   int consumed;
@@ -300,22 +300,22 @@ bool RE::FindAndConsume(StringPiece* input,
                         const Arg& ptr16) const {
   const Arg* args[kMaxArgs];
   int n = 0;
-  if (&ptr1  == &no_arg) goto done; args[n++] = &ptr1;
-  if (&ptr2  == &no_arg) goto done; args[n++] = &ptr2;
-  if (&ptr3  == &no_arg) goto done; args[n++] = &ptr3;
-  if (&ptr4  == &no_arg) goto done; args[n++] = &ptr4;
-  if (&ptr5  == &no_arg) goto done; args[n++] = &ptr5;
-  if (&ptr6  == &no_arg) goto done; args[n++] = &ptr6;
-  if (&ptr7  == &no_arg) goto done; args[n++] = &ptr7;
-  if (&ptr8  == &no_arg) goto done; args[n++] = &ptr8;
-  if (&ptr9  == &no_arg) goto done; args[n++] = &ptr9;
-  if (&ptr10 == &no_arg) goto done; args[n++] = &ptr10;
-  if (&ptr11 == &no_arg) goto done; args[n++] = &ptr11;
-  if (&ptr12 == &no_arg) goto done; args[n++] = &ptr12;
-  if (&ptr13 == &no_arg) goto done; args[n++] = &ptr13;
-  if (&ptr14 == &no_arg) goto done; args[n++] = &ptr14;
-  if (&ptr15 == &no_arg) goto done; args[n++] = &ptr15;
-  if (&ptr16 == &no_arg) goto done; args[n++] = &ptr16;
+  if (&ptr1  == &no_arg) { goto done; } args[n++] = &ptr1;
+  if (&ptr2  == &no_arg) { goto done; } args[n++] = &ptr2;
+  if (&ptr3  == &no_arg) { goto done; } args[n++] = &ptr3;
+  if (&ptr4  == &no_arg) { goto done; } args[n++] = &ptr4;
+  if (&ptr5  == &no_arg) { goto done; } args[n++] = &ptr5;
+  if (&ptr6  == &no_arg) { goto done; } args[n++] = &ptr6;
+  if (&ptr7  == &no_arg) { goto done; } args[n++] = &ptr7;
+  if (&ptr8  == &no_arg) { goto done; } args[n++] = &ptr8;
+  if (&ptr9  == &no_arg) { goto done; } args[n++] = &ptr9;
+  if (&ptr10 == &no_arg) { goto done; } args[n++] = &ptr10;
+  if (&ptr11 == &no_arg) { goto done; } args[n++] = &ptr11;
+  if (&ptr12 == &no_arg) { goto done; } args[n++] = &ptr12;
+  if (&ptr13 == &no_arg) { goto done; } args[n++] = &ptr13;
+  if (&ptr14 == &no_arg) { goto done; } args[n++] = &ptr14;
+  if (&ptr15 == &no_arg) { goto done; } args[n++] = &ptr15;
+  if (&ptr16 == &no_arg) { goto done; } args[n++] = &ptr16;
  done:


int consumed;
--
2.5.5

From 6b85eb442e4f89c392b31da3aa9990bd56e4f3c2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@???>
Date: Tue, 24 May 2016 09:45:56 +0200
Subject: [PATCH] Fix a typo in testing ovectors for UTF-16 and UTF-32
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Petr Písař <ppisar@???>
---
pcre_jit_test.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pcre_jit_test.c b/pcre_jit_test.c
index 01f549d..9b61ec0 100644
--- a/pcre_jit_test.c
+++ b/pcre_jit_test.c
@@ -1560,10 +1560,10 @@ static int regression_tests(void)
                             is_successful = 0;
                         }
 #endif
-#if defined SUPPORT_PCRE16 && defined SUPPORT_PCRE16
-                        if (ovector16_1[i] != ovector16_2[i] || ovector16_1[i] != ovector16_1[i] || ovector16_1[i] != ovector16_2[i]) {
-                            printf("\n16 and 16 bit: Ovector[%d] value differs(J16:%d,I16:%d,J32:%d,I32:%d): [%d] '%s' @ '%s' \n",
-                                i, ovector16_1[i], ovector16_2[i], ovector16_1[i], ovector16_2[i],
+#if defined SUPPORT_PCRE16 && defined SUPPORT_PCRE32
+                        if (ovector16_1[i] != ovector16_2[i] || ovector16_1[i] != ovector32_1[i] || ovector16_1[i] != ovector32_2[i]) {
+                            printf("\n16 and 32 bit: Ovector[%d] value differs(J16:%d,I16:%d,J32:%d,I32:%d): [%d] '%s' @ '%s' \n",
+                                i, ovector16_1[i], ovector16_2[i], ovector32_1[i], ovector32_2[i],
                                 total, current->pattern, current->input);
                             is_successful = 0;
                         }
-- 
2.5.5