Add suitable "fall through" comments for latest gcc warnings.

This commit is contained in:
Philip.Hazel 2017-06-03 17:50:03 +00:00
parent e4c86e2ced
commit f850015168
6 changed files with 21 additions and 11 deletions

View File

@ -1613,8 +1613,8 @@ else
if (c >= CHAR_8) break; 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 /* \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 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 significant 8 bits of octal numbers (I think this is what early Perls used
@ -6425,8 +6425,8 @@ for (;; pptr++)
length_prevgroup = 3 + 3*LINK_SIZE; length_prevgroup = 3 + 3*LINK_SIZE;
group_return = -1; /* Set "may match empty string" */ group_return = -1; /* Set "may match empty string" */
/* Now fall through and treat as a repeated OP_BRA. */ /* Now treat as a repeated OP_BRA. */
/* VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV */ /* Fall through */
/* If previous was a bracket group, we may have to replicate it in /* 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" certain cases. Note that at this point we can encounter only the "basic"
@ -8552,7 +8552,8 @@ for (;; pptr++)
goto RECURSE_OR_BACKREF_LENGTH; 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 /* A true recursion implies not fixed length, but a subroutine call may
be OK. Back reference "recursions" are also failed. */ be OK. Back reference "recursions" are also failed. */

View File

@ -2129,6 +2129,7 @@ for (;;)
case 0x2029: case 0x2029:
#endif /* Not EBCDIC */ #endif /* Not EBCDIC */
if (mb->bsr_convention == PCRE2_BSR_ANYCRLF) break; if (mb->bsr_convention == PCRE2_BSR_ANYCRLF) break;
/* Fall through */
case CHAR_LF: case CHAR_LF:
ADD_NEW(state_offset + 1, 0); ADD_NEW(state_offset + 1, 0);

View File

@ -3829,6 +3829,7 @@ while (TRUE)
{ {
case OP_CHARI: case OP_CHARI:
caseless = TRUE; caseless = TRUE;
/* Fall through */
case OP_CHAR: case OP_CHAR:
last = FALSE; last = FALSE;
cc++; cc++;
@ -3860,6 +3861,7 @@ while (TRUE)
case OP_MINPLUSI: case OP_MINPLUSI:
case OP_POSPLUSI: case OP_POSPLUSI:
caseless = TRUE; caseless = TRUE;
/* Fall through */
case OP_PLUS: case OP_PLUS:
case OP_MINPLUS: case OP_MINPLUS:
case OP_POSPLUS: case OP_POSPLUS:
@ -3868,6 +3870,7 @@ while (TRUE)
case OP_EXACTI: case OP_EXACTI:
caseless = TRUE; caseless = TRUE;
/* Fall through */
case OP_EXACT: case OP_EXACT:
repeat = GET2(cc, 1); repeat = GET2(cc, 1);
last = FALSE; last = FALSE;
@ -3878,6 +3881,7 @@ while (TRUE)
case OP_MINQUERYI: case OP_MINQUERYI:
case OP_POSQUERYI: case OP_POSQUERYI:
caseless = TRUE; caseless = TRUE;
/* Fall through */
case OP_QUERY: case OP_QUERY:
case OP_MINQUERY: case OP_MINQUERY:
case OP_POSQUERY: case OP_POSQUERY:

View File

@ -5352,9 +5352,10 @@ fprintf(stderr, "++ op=%d\n", *Fecode);
(char *)assert_accept_frame + offsetof(heapframe, ovector), (char *)assert_accept_frame + offsetof(heapframe, ovector),
assert_accept_frame->offset_top * sizeof(PCRE2_SIZE)); assert_accept_frame->offset_top * sizeof(PCRE2_SIZE));
Foffset_top = assert_accept_frame->offset_top; Foffset_top = assert_accept_frame->offset_top;
/* Fall through. In the case of a match, the captures have already /* Fall through */
been put into the current frame. */ /* In the case of a match, the captures have already been put into
the current frame. */
case MATCH_MATCH: case MATCH_MATCH:
condition = Lpositive; /* TRUE for positive assertion */ condition = Lpositive; /* TRUE for positive assertion */
@ -5649,8 +5650,7 @@ fprintf(stderr, "++ op=%d\n", *Fecode);
if ((mb->moptions & PCRE2_NOTEOL) != 0) RRETURN(MATCH_NOMATCH); if ((mb->moptions & PCRE2_NOTEOL) != 0) RRETURN(MATCH_NOMATCH);
if ((mb->poptions & PCRE2_DOLLAR_ENDONLY) == 0) goto ASSERT_NL_OR_EOS; 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) */ /* Unconditional end of subject assertion (\z) */
case OP_EOD: case OP_EOD:

View File

@ -1448,6 +1448,10 @@ do
classmap = ((tcode[1 + LINK_SIZE] & XCL_MAP) == 0)? NULL : classmap = ((tcode[1 + LINK_SIZE] & XCL_MAP) == 0)? NULL :
(uint8_t *)(tcode + 1 + LINK_SIZE + 1); (uint8_t *)(tcode + 1 + LINK_SIZE + 1);
#endif #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 /* 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 in UTF mode, any byte with a value >= 0xc4 is a potentially valid starter

View File

@ -3218,7 +3218,7 @@ handle_option(int letter, int options)
switch(letter) switch(letter)
{ {
case N_FOFFSETS: file_offsets = TRUE; break; 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_LBUFFER: line_buffered = TRUE; break;
case N_LOFFSETS: line_offsets = number = TRUE; break; case N_LOFFSETS: line_offsets = number = TRUE; break;
case N_NOJIT: use_jit = FALSE; break; case N_NOJIT: use_jit = FALSE; break;