aboutsummaryrefslogtreecommitdiff
path: root/libiberty/regex.c
diff options
context:
space:
mode:
authorMark Wielaard <mjw@redhat.com>2016-11-04 23:55:01 +0000
committerMark Wielaard <mark@gcc.gnu.org>2016-11-04 23:55:01 +0000
commitc4ec8585dcc2d8b6bc7372f2765aef438575eb94 (patch)
tree3df95a30e4d33af6c4197800347e9b803d1b2f2d /libiberty/regex.c
parent8d48126dc7fc47684bf655d298951766a456c7ec (diff)
downloadgcc-c4ec8585dcc2d8b6bc7372f2765aef438575eb94.zip
gcc-c4ec8585dcc2d8b6bc7372f2765aef438575eb94.tar.gz
gcc-c4ec8585dcc2d8b6bc7372f2765aef438575eb94.tar.bz2
libiberty: Fix -Wimplicit-fallthrough warnings.
Adjust some comments, add some explicit fall through comments or explicit returns where necessary to not get implicit-fallthrough warnings. All fall throughs were deliberate. In one case I added an explicit return false for clarity instead of falling through a default case (that also would return false). libiberty/ChangeLog: * cplus-dem.c (demangle_signature): Move fall through comment. (demangle_fund_type): Add fall through comment between 'G' and 'I'. * hashtab.c (iterative_hash): Add fall through comments. * regex.c (regex_compile): Add Fall through comment after '+'/'?'. (byte_re_match_2_internal): Add Fall through comment after jump_n. Change "Note fall through" to "Fall through". (common_op_match_null_string_p): Return false after set_number_at instead of fall through. From-SVN: r241864
Diffstat (limited to 'libiberty/regex.c')
-rw-r--r--libiberty/regex.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libiberty/regex.c b/libiberty/regex.c
index 9ffc3f4..6854e3b 100644
--- a/libiberty/regex.c
+++ b/libiberty/regex.c
@@ -2493,6 +2493,7 @@ PREFIX(regex_compile) (const char *ARG_PREFIX(pattern),
if ((syntax & RE_BK_PLUS_QM)
|| (syntax & RE_LIMITED_OPS))
goto normal_char;
+ /* Fall through. */
handle_plus:
case '*':
/* If there is no previous pattern... */
@@ -6697,6 +6698,7 @@ byte_re_match_2_internal (struct re_pattern_buffer *bufp,
{
case jump_n:
is_a_jump_n = true;
+ /* Fall through. */
case pop_failure_jump:
case maybe_pop_jump:
case jump:
@@ -7125,7 +7127,7 @@ byte_re_match_2_internal (struct re_pattern_buffer *bufp,
DEBUG_PRINT1 (" Match => jump.\n");
goto unconditional_jump;
}
- /* Note fall through. */
+ /* Fall through. */
/* The end of a simple repeat has a pop_failure_jump back to
@@ -7150,7 +7152,7 @@ byte_re_match_2_internal (struct re_pattern_buffer *bufp,
dummy_low_reg, dummy_high_reg,
reg_dummy, reg_dummy, reg_info_dummy);
}
- /* Note fall through. */
+ /* Fall through. */
unconditional_jump:
#ifdef _LIBC
@@ -7453,6 +7455,7 @@ byte_re_match_2_internal (struct re_pattern_buffer *bufp,
{
case jump_n:
is_a_jump_n = true;
+ /* Fall through. */
case maybe_pop_jump:
case pop_failure_jump:
case jump:
@@ -7718,6 +7721,7 @@ PREFIX(common_op_match_null_string_p) (UCHAR_T **p, UCHAR_T *end,
case set_number_at:
p1 += 2 * OFFSET_ADDRESS_SIZE;
+ return false;
default:
/* All other opcodes mean we cannot match the empty string. */