summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2017-09-16 14:52:42 +0200
committerSergei Golubchik <serg@mariadb.org>2017-10-17 07:37:39 +0200
commitd76f5774fe70c51577cfbfdddcbfb3309d51f06e (patch)
tree579994269a0b9d569e0ac2b4ca024e8027dc4551
parent3b7aa3017b65dcf11d33617e954e1cb471703582 (diff)
downloadmariadb-git-d76f5774fe70c51577cfbfdddcbfb3309d51f06e.tar.gz
MDEV-13459 Warnings, when compiling with gcc-7.x
mostly caused by -Wimplicit-fallthrough
-rw-r--r--client/mysql.cc2
-rw-r--r--client/mysqldump.c1
-rw-r--r--extra/my_print_defaults.c21
-rw-r--r--extra/replace.c1
-rw-r--r--mysys/my_new.cc10
-rw-r--r--plugin/handler_socket/CMakeLists.txt6
-rw-r--r--sql-common/client.c1
-rw-r--r--sql/events.cc8
-rw-r--r--sql/field.cc2
-rw-r--r--sql/ha_partition.cc1
-rw-r--r--sql/item.cc2
-rw-r--r--sql/item_func.cc2
-rw-r--r--sql/item_strfunc.cc4
-rw-r--r--sql/log.cc5
-rw-r--r--sql/log_event.cc15
-rw-r--r--sql/opt_sum.cc1
-rw-r--r--sql/partition_info.cc2
-rw-r--r--sql/sp_head.cc2
-rw-r--r--sql/sql_admin.cc1
-rw-r--r--sql/sql_lex.cc4
-rw-r--r--sql/sql_parse.cc6
-rw-r--r--sql/sql_partition.cc2
-rw-r--r--sql/sql_plugin.cc74
-rw-r--r--sql/sql_prepare.cc1
-rw-r--r--sql/sql_repl.cc1
-rw-r--r--sql/sql_show.cc1
-rw-r--r--sql/sql_table.cc2
-rw-r--r--sql/sql_yacc.yy10
-rw-r--r--storage/federated/ha_federated.cc3
-rw-r--r--storage/federatedx/federatedx_io_mysql.cc9
-rw-r--r--storage/federatedx/ha_federatedx.cc2
-rw-r--r--storage/heap/hp_create.c2
-rw-r--r--storage/heap/hp_extra.c1
-rw-r--r--storage/innobase/handler/ha_innodb.cc5
-rw-r--r--storage/innobase/include/data0type.ic2
-rw-r--r--storage/innobase/include/page0zip.ic2
-rw-r--r--storage/innobase/row/row0mysql.c5
-rw-r--r--storage/innobase/row/row0purge.c4
-rw-r--r--storage/innobase/row/row0sel.c1
-rw-r--r--storage/maria/ma_extra.c3
-rw-r--r--storage/maria/ma_key_recover.c1
-rw-r--r--storage/maria/ma_recovery.c2
-rw-r--r--storage/myisam/mi_extra.c3
-rw-r--r--storage/sphinx/ha_sphinx.cc12
-rw-r--r--storage/tokudb/CMakeLists.txt1
-rw-r--r--storage/xtradb/handler/ha_innodb.cc5
-rw-r--r--storage/xtradb/include/data0type.ic2
-rw-r--r--storage/xtradb/include/page0zip.ic2
-rw-r--r--storage/xtradb/row/row0mysql.c4
-rw-r--r--storage/xtradb/row/row0purge.c4
-rw-r--r--storage/xtradb/row/row0sel.c1
-rw-r--r--strings/ctype-utf8.c17
-rw-r--r--strings/dtoa.c13
53 files changed, 170 insertions, 124 deletions
diff --git a/client/mysql.cc b/client/mysql.cc
index 9c76e30d96f..2a56caf23ef 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -1080,7 +1080,7 @@ static ulong start_timer(void);
static void end_timer(ulong start_time,char *buff);
static void mysql_end_timer(ulong start_time,char *buff);
static void nice_time(double sec,char *buff,bool part_second);
-extern "C" sig_handler mysql_end(int sig);
+extern "C" sig_handler mysql_end(int sig) __attribute__ ((noreturn));
extern "C" sig_handler handle_sigint(int sig);
#if defined(HAVE_TERMIOS_H) && defined(GWINSZ_IN_SYS_IOCTL)
static sig_handler window_resize(int sig);
diff --git a/client/mysqldump.c b/client/mysqldump.c
index 2e3270a2fed..4e611ed5cb2 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -2012,6 +2012,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;
diff --git a/extra/my_print_defaults.c b/extra/my_print_defaults.c
index 7558d6d00ae..4690b29e8a5 100644
--- a/extra/my_print_defaults.c
+++ b/extra/my_print_defaults.c
@@ -97,12 +97,16 @@ static struct my_option my_long_options[] =
};
-static void usage(my_bool version)
+static void version()
{
- printf("%s Ver 1.6 for %s at %s\n",my_progname,SYSTEM_TYPE,
- MACHINE_TYPE);
- if (version)
- return;
+ printf("%s Ver 1.6 for %s at %s\n",my_progname,SYSTEM_TYPE, MACHINE_TYPE);
+}
+
+
+static void usage() __attribute__ ((noreturn));
+static void usage()
+{
+ version();
puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license\n");
puts("Prints all arguments that is give to some program using the default files");
printf("Usage: %s [OPTIONS] [groups]\n", my_progname);
@@ -126,12 +130,13 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
exit(0);
case 'I':
case '?':
- usage(0);
+ usage();
case 'v':
verbose++;
break;
case 'V':
- usage(1);
+ version();
+ /* fall through */
case '#':
DBUG_PUSH(argument ? argument : default_dbug_option);
break;
@@ -179,7 +184,7 @@ int main(int argc, char **argv)
nargs+= array_elements(mysqld_groups);
if (nargs < 2)
- usage(0);
+ usage();
load_default_groups=(char**) my_malloc(nargs*sizeof(char*), MYF(MY_WME));
if (!load_default_groups)
diff --git a/extra/replace.c b/extra/replace.c
index 56cf02f2002..2ad4979c09e 100644
--- a/extra/replace.c
+++ b/extra/replace.c
@@ -174,6 +174,7 @@ register char **argv[];
break;
case 'V':
version=1;
+ /* fall through */
case 'I':
case '?':
help=1; /* Help text written */
diff --git a/mysys/my_new.cc b/mysys/my_new.cc
index 4266452da43..a401ccff135 100644
--- a/mysys/my_new.cc
+++ b/mysys/my_new.cc
@@ -47,6 +47,11 @@ void* operator new[](std::size_t sz, const std::nothrow_t&) throw()
return (void *) my_malloc (sz ? sz : 1, MYF(0));
}
+void operator delete (void *ptr, std::size_t)
+{
+ my_free(ptr);
+}
+
void operator delete (void *ptr)
{
my_free(ptr);
@@ -57,6 +62,11 @@ void operator delete[] (void *ptr) throw ()
my_free(ptr);
}
+void operator delete[] (void *ptr, std::size_t) throw ()
+{
+ my_free(ptr);
+}
+
void operator delete(void* ptr, const std::nothrow_t&) throw()
{
my_free(ptr);
diff --git a/plugin/handler_socket/CMakeLists.txt b/plugin/handler_socket/CMakeLists.txt
index 358139eda1e..a0cac0015d0 100644
--- a/plugin/handler_socket/CMakeLists.txt
+++ b/plugin/handler_socket/CMakeLists.txt
@@ -10,6 +10,12 @@ IF(CMAKE_COMPILER_IS_GNUCXX)
STRING(REPLACE "-fno-implicit-templates" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
ENDIF()
+include(CheckCXXCompilerFlag)
+check_cxx_compiler_flag(" -Wdeprecated-declarations" HAVE_CXX_WDEPRECATED_DECLARATIONS)
+IF (HAVE_CXX_WDEPRECATED_DECLARATIONS)
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations")
+ENDIF()
+
INCLUDE_DIRECTORIES(libhsclient)
# Handlersocket client library. We do not distribute it,
diff --git a/sql-common/client.c b/sql-common/client.c
index e0412fca6bc..7d92f71d69f 100644
--- a/sql-common/client.c
+++ b/sql-common/client.c
@@ -1276,6 +1276,7 @@ void mysql_read_default_options(struct st_mysql_options *options,
break;
case OPT_pipe:
options->protocol = MYSQL_PROTOCOL_PIPE;
+ break;
case OPT_connect_timeout:
case OPT_timeout:
if (opt_arg)
diff --git a/sql/events.cc b/sql/events.cc
index 763c75e77b0..008b6223702 100644
--- a/sql/events.cc
+++ b/sql/events.cc
@@ -185,8 +185,8 @@ common_1_lev_code:
expr= tmp_expr - (tmp_expr/60)*60;
/* the code after the switch will finish */
- }
break;
+ }
case INTERVAL_HOUR_SECOND:
{
ulonglong tmp_expr= expr;
@@ -202,8 +202,8 @@ common_1_lev_code:
expr= tmp_expr - (tmp_expr/60)*60;
/* the code after the switch will finish */
- }
break;
+ }
case INTERVAL_DAY_SECOND:
{
ulonglong tmp_expr= expr;
@@ -225,8 +225,8 @@ common_1_lev_code:
expr= tmp_expr - (tmp_expr/60)*60;
/* the code after the switch will finish */
- }
break;
+ }
case INTERVAL_DAY_MICROSECOND:
case INTERVAL_HOUR_MICROSECOND:
case INTERVAL_MINUTE_MICROSECOND:
@@ -240,6 +240,8 @@ common_1_lev_code:
break;
case INTERVAL_WEEK:
expr/= 7;
+ close_quote= FALSE;
+ break;
default:
close_quote= FALSE;
break;
diff --git a/sql/field.cc b/sql/field.cc
index 716d522a196..a2e0caaa50d 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -9218,7 +9218,7 @@ bool Create_field::init(THD *thd, char *fld_name, enum_field_types fld_type,
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;
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index e048dbad5e6..b2c2140d4dc 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -7331,6 +7331,7 @@ void ha_partition::print_error(int error, myf errflag)
m_err_rec= NULL;
DBUG_VOID_RETURN;
}
+ /* fall through */
default:
{
if (!(thd->lex->alter_info.flags & ALTER_TRUNCATE_PARTITION))
diff --git a/sql/item.cc b/sql/item.cc
index a8913e97fe9..3c633ddc9ca 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -6004,7 +6004,7 @@ Field *Item::tmp_table_field_from_field_type(TABLE *table, bool fixed_length)
collation.collation);
break;
}
- /* Fall through to make_string_field() */
+ /* fall through */
case MYSQL_TYPE_ENUM:
case MYSQL_TYPE_SET:
case MYSQL_TYPE_VAR_STRING:
diff --git a/sql/item_func.cc b/sql/item_func.cc
index cfccd66ea8a..00006a25a8d 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -863,6 +863,7 @@ void Item_func_num1::fix_length_and_dec()
break;
case TIME_RESULT:
cached_result_type= DECIMAL_RESULT;
+ /* fall through */
case DECIMAL_RESULT:
decimals= args[0]->decimal_scale(); // Do not preserve NOT_FIXED_DEC
max_length= args[0]->max_length;
@@ -2038,6 +2039,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;
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index 756ab5152ca..939e518e386 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -4430,7 +4430,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)
{
@@ -4443,7 +4443,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 */))
diff --git a/sql/log.cc b/sql/log.cc
index f8c256e645f..5b4ba87ef52 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -7261,8 +7261,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++)
{
@@ -7271,10 +7273,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));
}
diff --git a/sql/log_event.cc b/sql/log_event.cc
index d5b5b5a4870..18e4cfbf187 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -6437,21 +6437,6 @@ User_var_log_event(const char* buf, uint event_len,
we keep the flags set to UNDEF_F.
*/
uint bytes_read= ((val + val_len) - start);
-#ifndef DBUG_OFF
- bool old_pre_checksum_fd= description_event->is_version_before_checksum(
- &description_event->server_version_split);
-#endif
- DBUG_ASSERT((bytes_read == data_written -
- (old_pre_checksum_fd ||
- (description_event->checksum_alg ==
- BINLOG_CHECKSUM_ALG_OFF)) ?
- 0 : BINLOG_CHECKSUM_LEN)
- ||
- (bytes_read == data_written -1 -
- (old_pre_checksum_fd ||
- (description_event->checksum_alg ==
- BINLOG_CHECKSUM_ALG_OFF)) ?
- 0 : BINLOG_CHECKSUM_LEN));
if ((data_written - bytes_read) > 0)
{
flags= (uint) *(buf + UV_VAL_IS_NULL + UV_VAL_TYPE_SIZE +
diff --git a/sql/opt_sum.cc b/sql/opt_sum.cc
index 1a8c6be5f41..f717be5ba3f 100644
--- a/sql/opt_sum.cc
+++ b/sql/opt_sum.cc
@@ -1047,6 +1047,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:
{
diff --git a/sql/partition_info.cc b/sql/partition_info.cc
index d8b901701cb..512bf296135 100644
--- a/sql/partition_info.cc
+++ b/sql/partition_info.cc
@@ -34,8 +34,6 @@
partition_info *partition_info::get_clone()
{
- if (!this)
- return 0;
List_iterator<partition_element> part_it(partitions);
partition_element *part;
partition_info *clone= new partition_info();
diff --git a/sql/sp_head.cc b/sql/sp_head.cc
index 69364eaa43f..14a57914560 100644
--- a/sql/sp_head.cc
+++ b/sql/sp_head.cc
@@ -139,7 +139,7 @@ sp_get_item_value(THD *thd, Item *item, String *str)
case DECIMAL_RESULT:
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);
diff --git a/sql/sql_admin.cc b/sql/sql_admin.cc
index 55effcd7002..7cddf50a896 100644
--- a/sql/sql_admin.cc
+++ b/sql/sql_admin.cc
@@ -54,7 +54,6 @@ static bool admin_recreate_table(THD *thd, TABLE_LIST *table_list)
if (thd->stmt_da->is_ok())
thd->stmt_da->reset_diagnostics_area();
table_list->table= NULL;
- result_code= result_code ? HA_ADMIN_FAILED : HA_ADMIN_OK;
DBUG_RETURN(result_code);
}
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index 6611fd43876..6f94f1fbe63 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -1147,12 +1147,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)
@@ -1499,7 +1501,7 @@ static int lex_one_token(YYSTYPE *yylval, THD *thd)
state= MY_LEX_USER_VARIABLE_DELIMITER;
break;
}
- /* " used for strings */
+ /* fall through */ /* " used for strings */
case MY_LEX_STRING: // Incomplete text string
if (!(yylval->lex_str.str = get_text(lip, 1, 1)))
{
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index ba0520de4bb..d003a13ae09 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -2481,7 +2481,7 @@ case SQLCOM_PREPARE:
#ifdef WITH_PARTITION_STORAGE_ENGINE
{
partition_info *part_info= thd->lex->part_info;
- if (part_info && !(part_info= thd->lex->part_info->get_clone()))
+ if (part_info && !(part_info= part_info->get_clone()))
{
res= -1;
goto end_with_restore_list;
@@ -2850,8 +2850,8 @@ end_with_restore_list:
/* 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);
@@ -2961,6 +2961,7 @@ end_with_restore_list:
DBUG_PRINT("debug", ("Just after generate_incident()"));
}
#endif
+ /* fall through */
case SQLCOM_INSERT:
{
DBUG_ASSERT(first_table == all_tables && first_table != 0);
@@ -3698,6 +3699,7 @@ end_with_restore_list:
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;
diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc
index 0d9f6e6a1f5..bf34d328dc5 100644
--- a/sql/sql_partition.cc
+++ b/sql/sql_partition.cc
@@ -4640,7 +4640,7 @@ uint prep_alter_part_table(THD *thd, TABLE *table, Alter_info *alter_info,
thd->work_part_info= thd->lex->part_info;
if (thd->work_part_info &&
- !(thd->work_part_info= thd->lex->part_info->get_clone()))
+ !(thd->work_part_info= thd->work_part_info->get_clone()))
DBUG_RETURN(TRUE);
/* ALTER_ADMIN_PARTITION is handled in mysql_admin_table */
diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc
index 9eecd6a1345..d1e855e272e 100644
--- a/sql/sql_plugin.cc
+++ b/sql/sql_plugin.cc
@@ -1078,42 +1078,42 @@ static bool plugin_add(MEM_ROOT *tmp_root,
if (!name->str && plugin_find_internal(&tmp.name, MYSQL_ANY_PLUGIN))
continue; // already installed
- struct st_plugin_int *tmp_plugin_ptr;
- if (*(int*)plugin->info <
- min_plugin_info_interface_version[plugin->type] ||
- ((*(int*)plugin->info) >> 8) >
- (cur_plugin_info_interface_version[plugin->type] >> 8))
- {
- char buf[256];
- strxnmov(buf, sizeof(buf) - 1, "API version for ",
- plugin_type_names[plugin->type].str,
- " plugin ", tmp.name.str,
- " not supported by this version of the server", NullS);
- report_error(report, ER_CANT_OPEN_LIBRARY, dl->str, ENOEXEC, buf);
- goto err;
- }
- if (plugin_maturity_map[plugin->maturity] < plugin_maturity)
- {
- char buf[256];
- strxnmov(buf, sizeof(buf) - 1, "Loading of ",
- plugin_maturity_names[plugin->maturity],
- " plugin ", tmp.name.str,
- " is prohibited by --plugin-maturity=",
- plugin_maturity_names[plugin_maturity],
- NullS);
- report_error(report, ER_CANT_OPEN_LIBRARY, dl->str, EPERM, buf);
- goto err;
- }
- tmp.plugin= plugin;
- tmp.ref_count= 0;
- tmp.state= PLUGIN_IS_UNINITIALIZED;
- tmp.load_option= PLUGIN_ON;
+ struct st_plugin_int *tmp_plugin_ptr;
+ if (*(int*)plugin->info <
+ min_plugin_info_interface_version[plugin->type] ||
+ ((*(int*)plugin->info) >> 8) >
+ (cur_plugin_info_interface_version[plugin->type] >> 8))
+ {
+ char buf[256];
+ strxnmov(buf, sizeof(buf) - 1, "API version for ",
+ plugin_type_names[plugin->type].str,
+ " plugin ", tmp.name.str,
+ " not supported by this version of the server", NullS);
+ report_error(report, ER_CANT_OPEN_LIBRARY, dl->str, ENOEXEC, buf);
+ goto err;
+ }
+ if (plugin_maturity_map[plugin->maturity] < plugin_maturity)
+ {
+ char buf[256];
+ strxnmov(buf, sizeof(buf) - 1, "Loading of ",
+ plugin_maturity_names[plugin->maturity],
+ " plugin ", tmp.name.str,
+ " is prohibited by --plugin-maturity=",
+ plugin_maturity_names[plugin_maturity],
+ NullS);
+ report_error(report, ER_CANT_OPEN_LIBRARY, dl->str, EPERM, buf);
+ goto err;
+ }
+ tmp.plugin= plugin;
+ tmp.ref_count= 0;
+ tmp.state= PLUGIN_IS_UNINITIALIZED;
+ tmp.load_option= PLUGIN_ON;
- if (!(tmp_plugin_ptr= plugin_insert_or_reuse(&tmp)))
- goto err;
- if (my_hash_insert(&plugin_hash[plugin->type], (uchar*)tmp_plugin_ptr))
- tmp_plugin_ptr->state= PLUGIN_IS_FREED;
- init_alloc_root(&tmp_plugin_ptr->mem_root, 4096, 4096);
+ if (!(tmp_plugin_ptr= plugin_insert_or_reuse(&tmp)))
+ goto err;
+ if (my_hash_insert(&plugin_hash[plugin->type], (uchar*)tmp_plugin_ptr))
+ tmp_plugin_ptr->state= PLUGIN_IS_FREED;
+ init_alloc_root(&tmp_plugin_ptr->mem_root, 4096, 4096);
if (name->str)
DBUG_RETURN(FALSE); // all done
@@ -1822,10 +1822,10 @@ static bool plugin_load_list(MEM_ROOT *tmp_root, const char *list)
case '\0':
list= NULL; /* terminate the loop */
/* fall through */
+ case ';':
#ifndef __WIN__
case ':': /* can't use this as delimiter as it may be drive letter */
#endif
- case ';':
str->str[str->length]= '\0';
if (str == &name) // load all plugins in named module
{
@@ -1863,6 +1863,7 @@ static bool plugin_load_list(MEM_ROOT *tmp_root, const char *list)
str->str= p;
continue;
}
+ /* fall through */
default:
str->length++;
continue;
@@ -3947,4 +3948,3 @@ void add_plugin_options(DYNAMIC_ARRAY *options, MEM_ROOT *mem_root)
insert_dynamic(options, (uchar*) opt);
}
}
-
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc
index 851e4f7b8ab..faaeaf51573 100644
--- a/sql/sql_prepare.cc
+++ b/sql/sql_prepare.cc
@@ -2075,6 +2075,7 @@ static bool check_prepared_statement(Prepared_statement *stmt)
if (res != 2)
break;
+ /* fall through */
case SQLCOM_UPDATE_MULTI:
res= mysql_test_multiupdate(stmt, tables, res == 2);
break;
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc
index 871cb27f0d0..ca6e8d15e7a 100644
--- a/sql/sql_repl.cc
+++ b/sql/sql_repl.cc
@@ -1139,6 +1139,7 @@ impossible position";
loop_breaker = (flags & BINLOG_DUMP_NON_BLOCK);
break;
}
+ /* fall through */
default:
errmsg = "could not find next log";
my_errno= ER_MASTER_FATAL_ERROR_READING_BINLOG;
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 512548b1d51..8789f0c9f24 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -931,6 +931,7 @@ public:
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:
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 6ab39d7f8c6..e6490876352 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -5504,7 +5504,7 @@ bool alter_table_manage_keys(TABLE *table, int indexes_were_disabled,
case LEAVE_AS_IS:
if (!indexes_were_disabled)
break;
- /* fall-through: disabled indexes */
+ /* fall-through */
case DISABLE:
error= table->file->ha_disable_indexes(HA_KEY_SWITCH_NONUNIQ_SAVE);
}
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 35c7203ca0d..4805cd4c66a 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -4212,15 +4212,11 @@ size_number:
switch (end_ptr[0])
{
case 'g':
- case 'G':
- text_shift_number+=10;
+ case 'G': text_shift_number+=30; break;
case 'm':
- case 'M':
- text_shift_number+=10;
+ case 'M': text_shift_number+=20; break;
case 'k':
- case 'K':
- text_shift_number+=10;
- break;
+ case 'K': text_shift_number+=10; break;
default:
{
my_error(ER_WRONG_SIZE_NUMBER, MYF(0));
diff --git a/storage/federated/ha_federated.cc b/storage/federated/ha_federated.cc
index adf4f0f4db2..8680c3aac25 100644
--- a/storage/federated/ha_federated.cc
+++ b/storage/federated/ha_federated.cc
@@ -1421,6 +1421,7 @@ bool ha_federated::create_where_from_key(String *to,
}
break;
}
+ /* fall through */
case HA_READ_KEY_OR_NEXT:
DBUG_PRINT("info", ("federated HA_READ_KEY_OR_NEXT %d", i));
if (emit_key_part_name(&tmp, key_part) ||
@@ -1440,6 +1441,7 @@ bool ha_federated::create_where_from_key(String *to,
goto err;
break;
}
+ /* fall through */
case HA_READ_KEY_OR_PREV:
DBUG_PRINT("info", ("federated HA_READ_KEY_OR_PREV %d", i));
if (emit_key_part_name(&tmp, key_part) ||
@@ -2973,6 +2975,7 @@ int ha_federated::extra(ha_extra_function operation)
break;
case HA_EXTRA_PREPARE_FOR_DROP:
table_will_be_deleted = TRUE;
+ break;
default:
/* do nothing */
DBUG_PRINT("info",("unhandled operation: %d", (uint) operation));
diff --git a/storage/federatedx/federatedx_io_mysql.cc b/storage/federatedx/federatedx_io_mysql.cc
index a2eaa345a18..ef3b1388200 100644
--- a/storage/federatedx/federatedx_io_mysql.cc
+++ b/storage/federatedx/federatedx_io_mysql.cc
@@ -263,9 +263,8 @@ ulong federatedx_io_mysql::savepoint_release(ulong sp)
savept= dynamic_element(&savepoints, savepoints.elements - 1, SAVEPT *);
if (savept->level < sp)
break;
- if ((savept->flags & (SAVEPOINT_REALIZED |
- SAVEPOINT_RESTRICT)) == SAVEPOINT_REALIZED)
- last= savept;
+ if ((savept->flags & (SAVEPOINT_REALIZED | SAVEPOINT_RESTRICT)) == SAVEPOINT_REALIZED)
+ last= savept;
savepoints.elements--;
}
@@ -291,8 +290,8 @@ ulong federatedx_io_mysql::savepoint_rollback(ulong sp)
while (savepoints.elements)
{
savept= dynamic_element(&savepoints, savepoints.elements - 1, SAVEPT *);
- if (savept->level <= sp)
- break;
+ if (savept->level <= sp)
+ break;
savepoints.elements--;
}
diff --git a/storage/federatedx/ha_federatedx.cc b/storage/federatedx/ha_federatedx.cc
index c9b07a8f3c3..bafae614fab 100644
--- a/storage/federatedx/ha_federatedx.cc
+++ b/storage/federatedx/ha_federatedx.cc
@@ -1340,6 +1340,7 @@ bool ha_federatedx::create_where_from_key(String *to,
}
break;
}
+ /* fall through */
case HA_READ_KEY_OR_NEXT:
DBUG_PRINT("info", ("federatedx HA_READ_KEY_OR_NEXT %d", i));
if (emit_key_part_name(&tmp, key_part) ||
@@ -1359,6 +1360,7 @@ bool ha_federatedx::create_where_from_key(String *to,
goto err;
break;
}
+ /* fall through */
case HA_READ_KEY_OR_PREV:
DBUG_PRINT("info", ("federatedx HA_READ_KEY_OR_PREV %d", i));
if (emit_key_part_name(&tmp, key_part) ||
diff --git a/storage/heap/hp_create.c b/storage/heap/hp_create.c
index 2b705b0e3d7..0b5dc841ada 100644
--- a/storage/heap/hp_create.c
+++ b/storage/heap/hp_create.c
@@ -94,7 +94,7 @@ int heap_create(const char *name, HP_CREATE_INFO *create_info,
case HA_KEYTYPE_VARBINARY1:
/* Case-insensitiveness is handled in coll->hash_sort */
keyinfo->seg[j].type= HA_KEYTYPE_VARTEXT1;
- /* fall_through */
+ /* fall through */
case HA_KEYTYPE_VARTEXT1:
keyinfo->flag|= HA_VAR_LENGTH_KEY;
length+= 2;
diff --git a/storage/heap/hp_extra.c b/storage/heap/hp_extra.c
index c83efd5af61..9a19f818d3b 100644
--- a/storage/heap/hp_extra.c
+++ b/storage/heap/hp_extra.c
@@ -34,6 +34,7 @@ int heap_extra(register HP_INFO *info, enum ha_extra_function function)
switch (function) {
case HA_EXTRA_RESET_STATE:
heap_reset(info);
+ /* fall through */
case HA_EXTRA_NO_READCHECK:
info->opt_flag&= ~READ_CHECK_USED; /* No readcheck */
break;
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 780f3a6f82f..3aabfc319c6 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -5129,7 +5129,7 @@ ha_innobase::innobase_lock_autoinc(void)
break;
}
}
- /* Fall through to old style locking. */
+ /* fall through */
case AUTOINC_OLD_STYLE_LOCKING:
error = row_lock_table_autoinc_for_mysql(prebuilt);
@@ -7080,7 +7080,7 @@ create_options_are_valid(
case ROW_TYPE_DYNAMIC:
CHECK_ERROR_ROW_TYPE_NEEDS_FILE_PER_TABLE;
CHECK_ERROR_ROW_TYPE_NEEDS_GT_ANTELOPE;
- /* fall through since dynamic also shuns KBS */
+ /* fall through */ /* since dynamic also shuns KBS */
case ROW_TYPE_COMPACT:
case ROW_TYPE_REDUNDANT:
if (kbs_specified) {
@@ -7326,6 +7326,7 @@ ha_innobase::create(
thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_ILLEGAL_HA_CREATE_OPTION,
"InnoDB: assuming ROW_FORMAT=COMPACT.");
+ /* fall through */
case ROW_TYPE_DEFAULT:
case ROW_TYPE_COMPACT:
flags = DICT_TF_COMPACT;
diff --git a/storage/innobase/include/data0type.ic b/storage/innobase/include/data0type.ic
index 410970ac50e..515b6b249ef 100644
--- a/storage/innobase/include/data0type.ic
+++ b/storage/innobase/include/data0type.ic
@@ -477,7 +477,7 @@ dtype_get_fixed_size_low(
#else /* !UNIV_HOTBACKUP */
return(len);
#endif /* !UNIV_HOTBACKUP */
- /* fall through for variable-length charsets */
+ /* fall through */ /* for variable-length charsets */
case DATA_VARCHAR:
case DATA_BINARY:
case DATA_DECIMAL:
diff --git a/storage/innobase/include/page0zip.ic b/storage/innobase/include/page0zip.ic
index e26fa3e3d94..a2fa13c94df 100644
--- a/storage/innobase/include/page0zip.ic
+++ b/storage/innobase/include/page0zip.ic
@@ -170,7 +170,7 @@ page_zip_rec_needs_ext(
ignored if zip_size == 0 */
ulint zip_size) /*!< in: compressed page size in bytes, or 0 */
{
- ut_ad(rec_size > comp ? REC_N_NEW_EXTRA_BYTES : REC_N_OLD_EXTRA_BYTES);
+ ut_ad(rec_size > (comp ? REC_N_NEW_EXTRA_BYTES : REC_N_OLD_EXTRA_BYTES));
ut_ad(ut_is_2pow(zip_size));
ut_ad(comp || !zip_size);
diff --git a/storage/innobase/row/row0mysql.c b/storage/innobase/row/row0mysql.c
index 6206bef6b56..8804e2c4e03 100644
--- a/storage/innobase/row/row0mysql.c
+++ b/storage/innobase/row/row0mysql.c
@@ -3495,7 +3495,7 @@ check_next_foreign:
row_mysql_handle_errors(&err, trx, NULL, NULL);
- /* Fall through to raise error */
+ /* fall through */
default:
/* No other possible error returns */
@@ -4315,7 +4315,8 @@ loop:
fputs(" InnoDB: Warning: CHECK TABLE on ", stderr);
dict_index_name_print(stderr, prebuilt->trx, index);
fprintf(stderr, " returned %lu\n", ret);
- /* fall through (this error is ignored by CHECK TABLE) */
+ /* this error is ignored by CHECK TABLE */
+ /* fall through */
case DB_END_OF_INDEX:
func_exit:
mem_free(buf);
diff --git a/storage/innobase/row/row0purge.c b/storage/innobase/row/row0purge.c
index 5f3e4175544..7b25612ba4b 100644
--- a/storage/innobase/row/row0purge.c
+++ b/storage/innobase/row/row0purge.c
@@ -407,8 +407,8 @@ row_purge_remove_sec_if_poss_leaf(
goto func_exit;
}
}
- /* fall through (the index entry is still needed,
- or the deletion succeeded) */
+ /* the index entry is still needed, or the deletion succeeded */
+ /* fall through */
case ROW_NOT_DELETED_REF:
/* The index entry is still needed. */
case ROW_BUFFERED:
diff --git a/storage/innobase/row/row0sel.c b/storage/innobase/row/row0sel.c
index e027a382cee..f5f8153e116 100644
--- a/storage/innobase/row/row0sel.c
+++ b/storage/innobase/row/row0sel.c
@@ -2675,6 +2675,7 @@ row_sel_field_store_in_mysql_format(
case DATA_SYS:
/* These column types should never be shipped to MySQL. */
ut_ad(0);
+ /* fall through */
case DATA_CHAR:
case DATA_FIXBINARY:
diff --git a/storage/maria/ma_extra.c b/storage/maria/ma_extra.c
index 0847f3c729c..3ee70059e6f 100644
--- a/storage/maria/ma_extra.c
+++ b/storage/maria/ma_extra.c
@@ -157,6 +157,7 @@ int maria_extra(MARIA_HA *info, enum ha_extra_function function,
if (info->s->data_file_type != DYNAMIC_RECORD)
break;
/* Remove read/write cache if dynamic rows */
+ /* fall through */
case HA_EXTRA_NO_CACHE:
if (info->opt_flag & (READ_CACHE_USED | WRITE_CACHE_USED))
{
@@ -313,7 +314,7 @@ int maria_extra(MARIA_HA *info, enum ha_extra_function function,
share->state.open_count= 1;
share->changed= 1;
_ma_mark_file_changed_now(share);
- /* Fall trough */
+ /* fall through */
case HA_EXTRA_PREPARE_FOR_RENAME:
{
my_bool do_flush= test(function != HA_EXTRA_PREPARE_FOR_DROP);
diff --git a/storage/maria/ma_key_recover.c b/storage/maria/ma_key_recover.c
index 502ac2b8809..48f01b8f8dd 100644
--- a/storage/maria/ma_key_recover.c
+++ b/storage/maria/ma_key_recover.c
@@ -1169,6 +1169,7 @@ uint _ma_apply_redo_index(MARIA_HA *info,
goto err;
}
page_length= page.size;
+ break;
}
case KEY_OP_NONE:
default:
diff --git a/storage/maria/ma_recovery.c b/storage/maria/ma_recovery.c
index b2e8705b15e..75a8f4f4559 100644
--- a/storage/maria/ma_recovery.c
+++ b/storage/maria/ma_recovery.c
@@ -3059,7 +3059,7 @@ static MARIA_HA *get_MARIA_HA_from_REDO_record(const
case LOGREC_REDO_INDEX:
case LOGREC_REDO_INDEX_FREE_PAGE:
index_page_redo_entry= 1;
- /* Fall trough*/
+ /* fall through*/
case LOGREC_REDO_INSERT_ROW_HEAD:
case LOGREC_REDO_INSERT_ROW_TAIL:
case LOGREC_REDO_PURGE_ROW_HEAD:
diff --git a/storage/myisam/mi_extra.c b/storage/myisam/mi_extra.c
index dab1f66ed6d..9c5c1ad0c0d 100644
--- a/storage/myisam/mi_extra.c
+++ b/storage/myisam/mi_extra.c
@@ -150,6 +150,7 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function, void *extra_arg)
if (info->s->data_file_type != DYNAMIC_RECORD)
break;
/* Remove read/write cache if dynamic rows */
+ /* fall through */
case HA_EXTRA_NO_CACHE:
if (info->opt_flag & (READ_CACHE_USED | WRITE_CACHE_USED))
{
@@ -262,7 +263,7 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function, void *extra_arg)
//share->deleting= TRUE;
share->global_changed= FALSE; /* force writing changed flag */
_mi_mark_file_changed(info);
- /* Fall trough */
+ /* fall through */
case HA_EXTRA_PREPARE_FOR_RENAME:
mysql_mutex_lock(&THR_LOCK_myisam);
share->last_version= 0L; /* Impossible version */
diff --git a/storage/sphinx/ha_sphinx.cc b/storage/sphinx/ha_sphinx.cc
index 9edf6ea6570..b7a333c1715 100644
--- a/storage/sphinx/ha_sphinx.cc
+++ b/storage/sphinx/ha_sphinx.cc
@@ -1661,13 +1661,16 @@ bool CSphSEQuery::ParseField ( char * sField )
char * sLat = sValue;
char * p = sValue;
- if (!( p = strchr ( p, ',' ) )) break; *p++ = '\0';
+ if (!( p = strchr ( p, ',' ) )) break;
+ *p++ = '\0';
char * sLong = p;
- if (!( p = strchr ( p, ',' ) )) break; *p++ = '\0';
+ if (!( p = strchr ( p, ',' ) )) break;
+ *p++ = '\0';
char * sLatVal = p;
- if (!( p = strchr ( p, ',' ) )) break; *p++ = '\0';
+ if (!( p = strchr ( p, ',' ) )) break;
+ *p++ = '\0';
char * sLongVal = p;
m_sGeoLatAttr = chop(sLat);
@@ -1736,7 +1739,8 @@ bool CSphSEQuery::ParseField ( char * sField )
while ( sRest )
{
char * sId = sRest;
- if (!( sRest = strchr ( sRest, ':' ) )) break; *sRest++ = '\0';
+ if (!( sRest = strchr ( sRest, ':' ) )) break;
+ *sRest++ = '\0';
if (!( sRest - sId )) break;
char * sValue = sRest;
diff --git a/storage/tokudb/CMakeLists.txt b/storage/tokudb/CMakeLists.txt
index 2052d448a43..ab6bb0a8504 100644
--- a/storage/tokudb/CMakeLists.txt
+++ b/storage/tokudb/CMakeLists.txt
@@ -100,6 +100,7 @@ endmacro(append_cflags_if_supported)
set_cflags_if_supported(-Wno-missing-field-initializers)
append_cflags_if_supported(-Wno-vla)
+append_cflags_if_supported(-Wno-implicit-fallthrough)
ADD_SUBDIRECTORY(ft-index)
diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc
index 66fcc2799bb..00f345d4bc1 100644
--- a/storage/xtradb/handler/ha_innodb.cc
+++ b/storage/xtradb/handler/ha_innodb.cc
@@ -6144,7 +6144,7 @@ ha_innobase::innobase_lock_autoinc(void)
break;
}
}
- /* Fall through to old style locking. */
+ /* fall through */
case AUTOINC_OLD_STYLE_LOCKING:
error = row_lock_table_autoinc_for_mysql(prebuilt);
@@ -8190,7 +8190,7 @@ create_options_are_valid(
case ROW_TYPE_DYNAMIC:
CHECK_ERROR_ROW_TYPE_NEEDS_FILE_PER_TABLE;
CHECK_ERROR_ROW_TYPE_NEEDS_GT_ANTELOPE;
- /* fall through since dynamic also shuns KBS */
+ /* fall through */ /* since dynamic also shuns KBS */
case ROW_TYPE_COMPACT:
case ROW_TYPE_REDUNDANT:
if (kbs_specified) {
@@ -8436,6 +8436,7 @@ ha_innobase::create(
thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_ILLEGAL_HA_CREATE_OPTION,
"InnoDB: assuming ROW_FORMAT=COMPACT.");
+ /* fall through */
case ROW_TYPE_DEFAULT:
case ROW_TYPE_COMPACT:
flags = DICT_TF_COMPACT;
diff --git a/storage/xtradb/include/data0type.ic b/storage/xtradb/include/data0type.ic
index 410970ac50e..5848e5d6548 100644
--- a/storage/xtradb/include/data0type.ic
+++ b/storage/xtradb/include/data0type.ic
@@ -477,7 +477,7 @@ dtype_get_fixed_size_low(
#else /* !UNIV_HOTBACKUP */
return(len);
#endif /* !UNIV_HOTBACKUP */
- /* fall through for variable-length charsets */
+ /* fall through */
case DATA_VARCHAR:
case DATA_BINARY:
case DATA_DECIMAL:
diff --git a/storage/xtradb/include/page0zip.ic b/storage/xtradb/include/page0zip.ic
index e26fa3e3d94..a2fa13c94df 100644
--- a/storage/xtradb/include/page0zip.ic
+++ b/storage/xtradb/include/page0zip.ic
@@ -170,7 +170,7 @@ page_zip_rec_needs_ext(
ignored if zip_size == 0 */
ulint zip_size) /*!< in: compressed page size in bytes, or 0 */
{
- ut_ad(rec_size > comp ? REC_N_NEW_EXTRA_BYTES : REC_N_OLD_EXTRA_BYTES);
+ ut_ad(rec_size > (comp ? REC_N_NEW_EXTRA_BYTES : REC_N_OLD_EXTRA_BYTES));
ut_ad(ut_is_2pow(zip_size));
ut_ad(comp || !zip_size);
diff --git a/storage/xtradb/row/row0mysql.c b/storage/xtradb/row/row0mysql.c
index 0182752132a..5b01adf7c82 100644
--- a/storage/xtradb/row/row0mysql.c
+++ b/storage/xtradb/row/row0mysql.c
@@ -3635,7 +3635,7 @@ check_next_foreign:
row_mysql_handle_errors(&err, trx, NULL, NULL);
- /* Fall through to raise error */
+ /* fall through */ /* to raise error */
default:
/* No other possible error returns */
@@ -4455,7 +4455,7 @@ loop:
fputs(" InnoDB: Warning: CHECK TABLE on ", stderr);
dict_index_name_print(stderr, prebuilt->trx, index);
fprintf(stderr, " returned %lu\n", ret);
- /* fall through (this error is ignored by CHECK TABLE) */
+ /* fall through */ /* this error is ignored by CHECK TABLE */
case DB_END_OF_INDEX:
func_exit:
mem_free(buf);
diff --git a/storage/xtradb/row/row0purge.c b/storage/xtradb/row/row0purge.c
index 4186da884b6..77d60edb71f 100644
--- a/storage/xtradb/row/row0purge.c
+++ b/storage/xtradb/row/row0purge.c
@@ -407,8 +407,8 @@ row_purge_remove_sec_if_poss_leaf(
goto func_exit;
}
}
- /* fall through (the index entry is still needed,
- or the deletion succeeded) */
+ /* the index entry is still needed, or the deletion succeeded */
+ /* fall through */
case ROW_NOT_DELETED_REF:
/* The index entry is still needed. */
case ROW_BUFFERED:
diff --git a/storage/xtradb/row/row0sel.c b/storage/xtradb/row/row0sel.c
index 592ae963382..3b2568c6834 100644
--- a/storage/xtradb/row/row0sel.c
+++ b/storage/xtradb/row/row0sel.c
@@ -2678,6 +2678,7 @@ row_sel_field_store_in_mysql_format(
case DATA_SYS:
/* These column types should never be shipped to MySQL. */
ut_ad(0);
+ /* fall through */
case DATA_CHAR:
case DATA_FIXBINARY:
diff --git a/strings/ctype-utf8.c b/strings/ctype-utf8.c
index f2782657bea..7d39c9127c3 100644
--- a/strings/ctype-utf8.c
+++ b/strings/ctype-utf8.c
@@ -2488,14 +2488,18 @@ static int my_uni_utf8 (CHARSET_INFO *cs __attribute__((unused)),
return MY_CS_TOOSMALLN(count);
switch (count) {
- /* Fall through all cases!!! */
#ifdef UNICODE_32BIT
case 6: r[5] = (uchar) (0x80 | (wc & 0x3f)); wc = wc >> 6; wc |= 0x4000000;
+ /* fall through */
case 5: r[4] = (uchar) (0x80 | (wc & 0x3f)); wc = wc >> 6; wc |= 0x200000;
+ /* fall through */
case 4: r[3] = (uchar) (0x80 | (wc & 0x3f)); wc = wc >> 6; wc |= 0x10000;
+ /* fall through */
#endif
case 3: r[2] = (uchar) (0x80 | (wc & 0x3f)); wc = wc >> 6; wc |= 0x800;
+ /* fall through */
case 2: r[1] = (uchar) (0x80 | (wc & 0x3f)); wc = wc >> 6; wc |= 0xc0;
+ /* fall through */
case 1: r[0] = (uchar) wc;
}
return count;
@@ -2521,9 +2525,10 @@ static int my_uni_utf8_no_range(CHARSET_INFO *cs __attribute__((unused)),
switch (count)
{
- /* Fall through all cases!!! */
case 3: r[2]= (uchar) (0x80 | (wc & 0x3f)); wc= wc >> 6; wc |= 0x800;
+ /* fall through */
case 2: r[1]= (uchar) (0x80 | (wc & 0x3f)); wc= wc >> 6; wc |= 0xc0;
+ /* fall through */
case 1: r[0]= (uchar) wc;
}
return count;
@@ -4979,10 +4984,12 @@ my_wc_mb_utf8mb4(CHARSET_INFO *cs __attribute__((unused)),
return MY_CS_TOOSMALLN(count);
switch (count) {
- /* Fall through all cases!!! */
case 4: r[3] = (uchar) (0x80 | (wc & 0x3f)); wc = wc >> 6; wc |= 0x10000;
+ /* fall through */
case 3: r[2] = (uchar) (0x80 | (wc & 0x3f)); wc = wc >> 6; wc |= 0x800;
+ /* fall through */
case 2: r[1] = (uchar) (0x80 | (wc & 0x3f)); wc = wc >> 6; wc |= 0xc0;
+ /* fall through */
case 1: r[0] = (uchar) wc;
}
return count;
@@ -5011,10 +5018,12 @@ my_wc_mb_utf8mb4_no_range(CHARSET_INFO *cs __attribute__((unused)),
switch (count)
{
- /* Fall through all cases!!! */
case 4: r[3]= (uchar) (0x80 | (wc & 0x3f)); wc= wc >> 6; wc |= 0x10000;
+ /* fall through */
case 3: r[2]= (uchar) (0x80 | (wc & 0x3f)); wc= wc >> 6; wc |= 0x800;
+ /* fall through */
case 2: r[1]= (uchar) (0x80 | (wc & 0x3f)); wc= wc >> 6; wc |= 0xc0;
+ /* fall through */
case 1: r[0]= (uchar) wc;
}
return count;
diff --git a/strings/dtoa.c b/strings/dtoa.c
index 6b216056f66..5f50e10c9bf 100644
--- a/strings/dtoa.c
+++ b/strings/dtoa.c
@@ -1377,7 +1377,7 @@ static double my_strtod_int(const char *s00, char **se, int *error, char *buf, s
switch (*s) {
case '-':
sign= 1;
- /* no break */
+ /* fall through */
case '+':
s++;
goto break2;
@@ -1465,10 +1465,9 @@ static double my_strtod_int(const char *s00, char **se, int *error, char *buf, s
esign= 0;
if (++s < end)
switch (c= *s) {
- case '-':
- esign= 1;
- case '+':
- c= *++s;
+ case '-': esign= 1;
+ /* fall through */
+ case '+': c= *++s;
}
if (s < end && c >= '0' && c <= '9')
{
@@ -2360,7 +2359,7 @@ static char *dtoa(double dd, int mode, int ndigits, int *decpt, int *sign,
break;
case 2:
leftright= 0;
- /* no break */
+ /* fall through */
case 4:
if (ndigits <= 0)
ndigits= 1;
@@ -2368,7 +2367,7 @@ static char *dtoa(double dd, int mode, int ndigits, int *decpt, int *sign,
break;
case 3:
leftright= 0;
- /* no break */
+ /* fall through */
case 5:
i= ndigits + k + 1;
ilim= i;