Skip to content
Permalink
Browse files
Silence bogus GCC 7 warnings -Wimplicit-fallthrough
Do not silence uncertain cases, or fix any bugs.

The only functional change should be that ha_federated::extra()
is not calling DBUG_PRINT to report an unhandled case for
HA_EXTRA_PREPARE_FOR_DROP.
  • Loading branch information
dr-m committed May 17, 2017
1 parent 03dca7a commit 71cd205
Show file tree
Hide file tree
Showing 64 changed files with 175 additions and 80 deletions.
@@ -2168,6 +2168,7 @@ static void print_xml_comment(FILE *xml_file, size_t len,
case '-':
if (*(comment_string + 1) == '-') /* Only one hyphen allowed. */
break;
/* fall through */
default:
fputc(*comment_string, xml_file);
break;
@@ -174,6 +174,7 @@ register char **argv[];
break;
case 'V':
version=1;
/* fall through */
case 'I':
case '?':
help=1; /* Help text written */
@@ -1,5 +1,6 @@
/*
Copyright (c) 2005, 2013, Oracle and/or its affiliates.
Copyright (c) 2017, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -242,6 +243,7 @@ Events::reconstruct_interval_expression(String *buf, interval_type interval,
break;
case INTERVAL_WEEK:
expr/= 7;
/* fall through */
default:
close_quote= FALSE;
break;
@@ -10126,7 +10126,7 @@ bool Create_field::check(THD *thd)
case MYSQL_TYPE_DATE:
/* We don't support creation of MYSQL_TYPE_DATE anymore */
sql_type= MYSQL_TYPE_NEWDATE;
/* fall trough */
/* fall through */
case MYSQL_TYPE_NEWDATE:
length= MAX_DATE_WIDTH;
break;
@@ -1,6 +1,6 @@
/*
Copyright (c) 2000, 2016, Oracle and/or its affiliates.
Copyright (c) 2010, 2016, MariaDB
Copyright (c) 2010, 2017, MariaDB

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -5824,7 +5824,7 @@ Field *Item::tmp_table_field_from_field_type(TABLE *table,
Field_string(max_length, maybe_null, name, collation.collation);
break;
}
/* Fall through to make_string_field() */
/* Fall through */
case MYSQL_TYPE_ENUM:
case MYSQL_TYPE_SET:
case MYSQL_TYPE_VAR_STRING:
@@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2015, Oracle and/or its affiliates.
Copyright (c) 2009, 2015, MariaDB
Copyright (c) 2009, 2017, MariaDB

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -1944,6 +1944,7 @@ my_decimal *Item_func_mod::decimal_op(my_decimal *decimal_value)
return decimal_value;
case E_DEC_DIV_ZERO:
signal_divide_by_null();
/* fall through */
default:
null_value= 1;
return 0;
@@ -226,7 +226,7 @@ String *Item_func_sha2::val_str_ascii(String *str)
break;
case 0: // SHA-256 is the default
digest_length= 256;
/* fall trough */
/* fall through */
case 256:
my_sha256(digest_buf, input_ptr, input_len);
break;
@@ -272,7 +272,7 @@ void Item_func_sha2::fix_length_and_dec()
switch (sha_variant) {
case 0: // SHA-256 is the default
sha_variant= 256;
/* fall trough */
/* fall through */
case 512:
case 384:
case 256:
@@ -5060,7 +5060,7 @@ bool Item_dyncol_get::get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date)
goto null;
case DYN_COL_INT:
signed_value= 1; // For error message
/* fall_trough */
/* fall through */
case DYN_COL_UINT:
if (signed_value || val.x.ulong_value <= LONGLONG_MAX)
{
@@ -5073,7 +5073,7 @@ bool Item_dyncol_get::get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date)
}
/* let double_to_datetime_with_warn() issue the warning message */
val.x.double_value= static_cast<double>(ULONGLONG_MAX);
/* fall_trough */
/* fall through */
case DYN_COL_DOUBLE:
if (double_to_datetime_with_warn(val.x.double_value, ltime, fuzzy_date,
0 /* TODO */))
@@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2016, Oracle and/or its affiliates.
Copyright (c) 2009, 2016, MariaDB
Copyright (c) 2009, 2017, MariaDB

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -9186,8 +9186,10 @@ void TC_LOG_MMAP::close()
mysql_cond_destroy(&COND_pool);
mysql_cond_destroy(&COND_active);
mysql_cond_destroy(&COND_queue_busy);
/* fall through */
case 5:
data[0]='A'; // garble the first (signature) byte, in case mysql_file_delete fails
/* fall through */
case 4:
for (i=0; i < npages; i++)
{
@@ -9196,10 +9198,13 @@ void TC_LOG_MMAP::close()
mysql_mutex_destroy(&pages[i].lock);
mysql_cond_destroy(&pages[i].cond);
}
/* fall through */
case 3:
my_free(pages);
/* fall through */
case 2:
my_munmap((char*)data, (size_t)file_length);
/* fall through */
case 1:
mysql_file_close(fd, MYF(0));
}
@@ -9269,6 +9269,9 @@ mysql_getopt_value(const char *name, uint length,
return (uchar**) &key_cache->changed_blocks_hash_size;
}
}
/* We return in all cases above. Let us silence -Wimplicit-fallthrough */
DBUG_ASSERT(0);
/* fall through */
#ifdef HAVE_REPLICATION
case OPT_REPLICATE_DO_DB:
case OPT_REPLICATE_DO_TABLE:
@@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
Copyright (c) 2008-2011 Monty Program Ab
Copyright (c) 2008, 2017, MariaDB Corporation.

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -1042,6 +1042,7 @@ static int maxmin_in_range(bool max_fl, Field* field, COND *cond)
case Item_func::LT_FUNC:
case Item_func::LE_FUNC:
less_fl= 1;
/* fall through */
case Item_func::GT_FUNC:
case Item_func::GE_FUNC:
{
@@ -2046,7 +2046,7 @@ gtid_waiting::wait_for_pos(THD *thd, String *gtid_str, longlong timeout_us)
{
case -1:
status_var_increment(thd->status_var.master_gtid_wait_timeouts);
/* Deliberate fall through. */
/* fall through */
case 0:
status_var_add(thd->status_var.master_gtid_wait_time,
microsecond_interval_timer() - before);
@@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2016, Oracle and/or its affiliates.
Copyright (c) 2009, 2016, MariaDB
Copyright (c) 2009, 2017, MariaDB

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -6072,9 +6072,8 @@ static int queue_event(Master_info* mi,const char* buf, ulong event_len)
mi->last_queued_gtid.seq_no == 1000)
goto skip_relay_logging;
});
/* Fall through to default case ... */
#endif

/* fall through */
default:
default_action:
DBUG_EXECUTE_IF("kill_slave_io_after_2_events",
@@ -1,6 +1,6 @@
/*
Copyright (c) 2002, 2016, Oracle and/or its affiliates.
Copyright (c) 2011, 2016, MariaDB
Copyright (c) 2011, 2017, MariaDB

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -142,6 +142,7 @@ sp_get_item_value(THD *thd, Item *item, String *str)
if (item->field_type() != MYSQL_TYPE_BIT)
return item->val_str(str);
else {/* Bit type is handled as binary string */}
/* fall through */
case STRING_RESULT:
{
String *result= item->val_str(str);
@@ -5532,6 +5532,7 @@ bool xid_cache_insert(THD *thd, XID_STATE *xid_state)
break;
case 1:
my_error(ER_XAER_DUPID, MYF(0));
/* fall through */
default:
xid_state->xid_cache_element= 0;
}
@@ -1,4 +1,5 @@
/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2017, MariaDB Corporation.

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -454,7 +455,8 @@ sql_digest_state* digest_add_token(sql_digest_state *state,
}
} while (found_unary);
}
/* fall through, for case NULL_SYM below */
/* for case NULL_SYM below */
/* fall through */
case LEX_HOSTNAME:
case TEXT_STRING:
case NCHAR_STRING:
@@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2014, Oracle and/or its affiliates.
Copyright (c) 2009, 2016, MariaDB
Copyright (c) 2009, 2017, MariaDB

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -1395,12 +1395,14 @@ static int lex_one_token(YYSTYPE *yylval, THD *thd)
state= MY_LEX_HEX_NUMBER;
break;
}
/* fall through */
case MY_LEX_IDENT_OR_BIN:
if (lip->yyPeek() == '\'')
{ // Found b'bin-number'
state= MY_LEX_BIN_NUMBER;
break;
}
/* fall through */
case MY_LEX_IDENT:
const char *start;
#if defined(USE_MB) && defined(USE_MB_IDENT)
@@ -1745,6 +1747,7 @@ static int lex_one_token(YYSTYPE *yylval, THD *thd)
break;
}
/* " used for strings */
/* fall through */
case MY_LEX_STRING: // Incomplete text string
{
uint sep;
@@ -2932,8 +2932,8 @@ mysql_execute_command(THD *thd)
MYF(0));
goto error;
}
/* no break; fall through */
}
/* fall through */
case SQLCOM_SHOW_STATUS_PROC:
case SQLCOM_SHOW_STATUS_FUNC:
case SQLCOM_SHOW_DATABASES:
@@ -2947,7 +2947,7 @@ mysql_execute_command(THD *thd)
case SQLCOM_SELECT:
if (WSREP_CLIENT(thd) && wsrep_sync_wait(thd))
goto error;

/* fall through */
case SQLCOM_SHOW_PLUGINS:
case SQLCOM_SHOW_VARIABLES:
case SQLCOM_SHOW_CHARSETS:
@@ -3776,8 +3776,8 @@ mysql_execute_command(THD *thd)
/* mysql_update return 2 if we need to switch to multi-update */
if (up_result != 2)
break;
/* Fall through */
}
/* Fall through */
case SQLCOM_UPDATE_MULTI:
{
DBUG_ASSERT(first_table == all_tables && first_table != 0);
@@ -3895,6 +3895,7 @@ mysql_execute_command(THD *thd)
}
#endif
}
/* fall through */
case SQLCOM_INSERT:
{
DBUG_ASSERT(first_table == all_tables && first_table != 0);
@@ -4809,6 +4810,7 @@ mysql_execute_command(THD *thd)
initialize this variable because RESET shares the same code as FLUSH
*/
lex->no_write_to_binlog= 1;
/* fall through */
case SQLCOM_FLUSH:
{
int write_to_binlog;
@@ -1,6 +1,6 @@
/*
Copyright (c) 2005, 2013, Oracle and/or its affiliates.
Copyright (c) 2010, 2014, SkySQL Ab.
Copyright (c) 2010, 2017, MariaDB Corporation.

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -1848,8 +1848,8 @@ static bool plugin_load_list(MEM_ROOT *tmp_root, const char *list)
switch ((*(p++)= *(list++))) {
case '\0':
list= NULL; /* terminate the loop */
/* fall through */
#ifndef __WIN__
/* fall through */
case ':': /* can't use this as delimiter as it may be drive letter */
#endif
case ';':
@@ -1890,6 +1890,7 @@ static bool plugin_load_list(MEM_ROOT *tmp_root, const char *list)
str->str= p;
continue;
}
/* fall through */
default:
str->length++;
continue;
@@ -1,5 +1,5 @@
/* Copyright (c) 2002, 2015, Oracle and/or its affiliates.
Copyright (c) 2008, 2015, MariaDB
Copyright (c) 2008, 2017, MariaDB

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -2298,7 +2298,7 @@ static bool check_prepared_statement(Prepared_statement *stmt)
/* mysql_test_update returns 2 if we need to switch to multi-update */
if (res != 2)
break;

/* fall through */
case SQLCOM_UPDATE_MULTI:
res= mysql_test_multiupdate(stmt, tables, res == 2);
break;
@@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2015, Oracle and/or its affiliates.
Copyright (c) 2009, 2016, MariaDB
Copyright (c) 2009, 2017, MariaDB

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -1079,6 +1079,7 @@ class Show_create_error_handler : public Internal_error_handler {
is_handled= FALSE;
break;
}
/* fall through */
case ER_COLUMNACCESS_DENIED_ERROR:
case ER_VIEW_NO_EXPLAIN: /* Error was anonymized, ignore all the same. */
case ER_PROCACCESS_DENIED_ERROR:
@@ -6880,7 +6880,8 @@ bool alter_table_manage_keys(TABLE *table, int indexes_were_disabled,
case Alter_info::LEAVE_AS_IS:
if (!indexes_were_disabled)
break;
/* fall-through: disabled indexes */
/* disabled indexes */
/* fall through */
case Alter_info::DISABLE:
error= table->file->ha_disable_indexes(HA_KEY_SWITCH_NONUNIQ_SAVE);
}
@@ -4680,9 +4680,11 @@ size_number:
case 'g':
case 'G':
text_shift_number+=10;
/* fall through */
case 'm':
case 'M':
text_shift_number+=10;
/* fall through */
case 'k':
case 'K':
text_shift_number+=10;
@@ -382,7 +382,8 @@ static void wsrep_replication_process(THD *thd)
case WSREP_TRX_MISSING:
/* these suggests a bug in provider code */
WSREP_WARN("bad return from recv() call: %d", rcode);
/* fall through to node shutdown */
/* Shut down this node. */
/* fall through */
case WSREP_FATAL:
/* Cluster connectivity is lost.
*

0 comments on commit 71cd205

Please sign in to comment.