[Pcre-svn] [819] code/trunk/src: Add suitable "fall through"…

Top Page
Delete this message
Author: Subversion repository
Date:  
To: pcre-svn
Subject: [Pcre-svn] [819] code/trunk/src: Add suitable "fall through" comments for latest gcc warnings.
Revision: 819
          http://www.exim.org/viewvc/pcre2?view=rev&revision=819
Author:   ph10
Date:     2017-06-03 18:50:03 +0100 (Sat, 03 Jun 2017)
Log Message:
-----------
Add suitable "fall through" comments for latest gcc warnings.


Modified Paths:
--------------
    code/trunk/src/pcre2_compile.c
    code/trunk/src/pcre2_dfa_match.c
    code/trunk/src/pcre2_jit_compile.c
    code/trunk/src/pcre2_match.c
    code/trunk/src/pcre2_study.c
    code/trunk/src/pcre2grep.c


Modified: code/trunk/src/pcre2_compile.c
===================================================================
--- code/trunk/src/pcre2_compile.c    2017-06-03 16:42:58 UTC (rev 818)
+++ code/trunk/src/pcre2_compile.c    2017-06-03 17:50:03 UTC (rev 819)
@@ -1613,8 +1613,8 @@


     if (c >= CHAR_8) break;


-    /* Fall through with a digit less than 8 */
-
+    /* Fall through */ 
+     
     /* \0 always starts an octal number, but we may drop through to here with a
     larger first octal digit. The original code used just to take the least
     significant 8 bits of octal numbers (I think this is what early Perls used
@@ -6425,8 +6425,8 @@
       length_prevgroup = 3 + 3*LINK_SIZE;
       group_return = -1;  /* Set "may match empty string" */


-      /* Now fall through and treat as a repeated OP_BRA. */
-      /* VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV */
+      /* Now treat as a repeated OP_BRA. */
+      /* Fall through */ 


       /* If previous was a bracket group, we may have to replicate it in
       certain cases. Note that at this point we can encounter only the "basic"
@@ -8552,7 +8552,8 @@
       goto RECURSE_OR_BACKREF_LENGTH;
       }


-    /* Fall through for groups >= 10 - picking up group twice does no harm. */
+    /* Fall through */ 
+    /* For groups >= 10 - picking up group twice does no harm. */


     /* A true recursion implies not fixed length, but a subroutine call may
     be OK. Back reference "recursions" are also failed. */


Modified: code/trunk/src/pcre2_dfa_match.c
===================================================================
--- code/trunk/src/pcre2_dfa_match.c    2017-06-03 16:42:58 UTC (rev 818)
+++ code/trunk/src/pcre2_dfa_match.c    2017-06-03 17:50:03 UTC (rev 819)
@@ -2129,6 +2129,7 @@
         case 0x2029:
 #endif  /* Not EBCDIC */
         if (mb->bsr_convention == PCRE2_BSR_ANYCRLF) break;
+        /* Fall through */ 


         case CHAR_LF:
         ADD_NEW(state_offset + 1, 0);


Modified: code/trunk/src/pcre2_jit_compile.c
===================================================================
--- code/trunk/src/pcre2_jit_compile.c    2017-06-03 16:42:58 UTC (rev 818)
+++ code/trunk/src/pcre2_jit_compile.c    2017-06-03 17:50:03 UTC (rev 819)
@@ -3829,6 +3829,7 @@
     {
     case OP_CHARI:
     caseless = TRUE;
+    /* Fall through */ 
     case OP_CHAR:
     last = FALSE;
     cc++;
@@ -3860,6 +3861,7 @@
     case OP_MINPLUSI:
     case OP_POSPLUSI:
     caseless = TRUE;
+    /* Fall through */ 
     case OP_PLUS:
     case OP_MINPLUS:
     case OP_POSPLUS:
@@ -3868,6 +3870,7 @@


     case OP_EXACTI:
     caseless = TRUE;
+    /* Fall through */ 
     case OP_EXACT:
     repeat = GET2(cc, 1);
     last = FALSE;
@@ -3878,6 +3881,7 @@
     case OP_MINQUERYI:
     case OP_POSQUERYI:
     caseless = TRUE;
+    /* Fall through */ 
     case OP_QUERY:
     case OP_MINQUERY:
     case OP_POSQUERY:


Modified: code/trunk/src/pcre2_match.c
===================================================================
--- code/trunk/src/pcre2_match.c    2017-06-03 16:42:58 UTC (rev 818)
+++ code/trunk/src/pcre2_match.c    2017-06-03 17:50:03 UTC (rev 819)
@@ -5352,10 +5352,11 @@
                 (char *)assert_accept_frame + offsetof(heapframe, ovector),
                 assert_accept_frame->offset_top * sizeof(PCRE2_SIZE));
           Foffset_top = assert_accept_frame->offset_top;
+           
+          /* Fall through */ 
+          /* In the case of a match, the captures have already been put into
+          the current frame. */


-          /* Fall through. In the case of a match, the captures have already
-          been put into the current frame. */
-
           case MATCH_MATCH:
           condition = Lpositive;   /* TRUE for positive assertion */
           break;
@@ -5649,8 +5650,7 @@
     if ((mb->moptions & PCRE2_NOTEOL) != 0) RRETURN(MATCH_NOMATCH);
     if ((mb->poptions & PCRE2_DOLLAR_ENDONLY) == 0) goto ASSERT_NL_OR_EOS;


-    /* ... else fall through for endonly */
-
+    /* Fall through */ 
     /* Unconditional end of subject assertion (\z) */


     case OP_EOD:


Modified: code/trunk/src/pcre2_study.c
===================================================================
--- code/trunk/src/pcre2_study.c    2017-06-03 16:42:58 UTC (rev 818)
+++ code/trunk/src/pcre2_study.c    2017-06-03 17:50:03 UTC (rev 819)
@@ -1448,6 +1448,10 @@
       classmap = ((tcode[1 + LINK_SIZE] & XCL_MAP) == 0)? NULL :
         (uint8_t *)(tcode + 1 + LINK_SIZE + 1);
 #endif
+      /* It seems that the fall through comment must be outside the #ifdef if
+      it is to avoid the gcc compiler warning. */
+        
+      /* Fall through */


       /* Enter here for a negative non-XCLASS. In the 8-bit library, if we are
       in UTF mode, any byte with a value >= 0xc4 is a potentially valid starter


Modified: code/trunk/src/pcre2grep.c
===================================================================
--- code/trunk/src/pcre2grep.c    2017-06-03 16:42:58 UTC (rev 818)
+++ code/trunk/src/pcre2grep.c    2017-06-03 17:50:03 UTC (rev 819)
@@ -3218,7 +3218,7 @@
 switch(letter)
   {
   case N_FOFFSETS: file_offsets = TRUE; break;
-  case N_HELP: help(); pcre2grep_exit(0);
+  case N_HELP: help(); pcre2grep_exit(0); break; /* Stops compiler warning */
   case N_LBUFFER: line_buffered = TRUE; break;
   case N_LOFFSETS: line_offsets = number = TRUE; break;
   case N_NOJIT: use_jit = FALSE; break;