diff options
author | Monty <monty@mariadb.org> | 2016-06-24 02:25:14 +0300 |
---|---|---|
committer | Monty <monty@mariadb.org> | 2016-06-24 02:25:14 +0300 |
commit | 4dc50758603d6ed2891412fdb6d37cd8b5541999 (patch) | |
tree | c31def9d565271ff6ca10ec9c15433a12e91bba6 | |
parent | ec38c7e60bf8dbe54b1551e75254337bec1993a4 (diff) | |
download | mariadb-git-4dc50758603d6ed2891412fdb6d37cd8b5541999.tar.gz |
Fixed compiler warnings and test failures found by buildbot
Fixed ccfilter to detect errors where the column is included in the error message
54 files changed, 312 insertions, 264 deletions
diff --git a/extra/comp_err.c b/extra/comp_err.c index 2bab6b60be7..a5530305317 100644 --- a/extra/comp_err.c +++ b/extra/comp_err.c @@ -327,7 +327,8 @@ static int create_sys_files(struct languages *lang_head, uint error_count) { FILE *to; - uint csnum= 0, length, i, row_nr; + uint csnum= 0, i, row_nr; + ulong length; uchar head[HEADER_LENGTH]; char outfile[FN_REFLEN], *outfile_end; long start_pos; @@ -397,8 +398,8 @@ static int create_sys_files(struct languages *lang_head, DBUG_ASSERT(error_count == row_nr); /* continue with header of the errmsg.sys file */ - length= (my_ftell(to, MYF(0)) - HEADER_LENGTH - - (error_count + section_count) * 2); + length= (ulong) (my_ftell(to, MYF(0)) - HEADER_LENGTH - + (error_count + section_count) * 2); bzero((uchar*) head, HEADER_LENGTH); bmove((uchar*) head, (uchar*) file_head, 4); head[4]= 1; diff --git a/extra/innochecksum.cc b/extra/innochecksum.cc index 1ebcbf198ef..622df93fbd5 100644 --- a/extra/innochecksum.cc +++ b/extra/innochecksum.cc @@ -395,7 +395,7 @@ parse_page( } if (per_page_details) { printf("index %lu page %lu leaf %u n_recs %lu data_bytes %lu" - "\n", id, page_no, is_leaf, n_recs, data_bytes); + "\n", (ulong) id, page_no, is_leaf, n_recs, data_bytes); } /* update per-index statistics */ { diff --git a/mysql-test/suite/rpl/r/show_status_stop_slave_race-7126.result b/mysql-test/suite/rpl/r/show_status_stop_slave_race-7126.result index de89fbaf67c..64219e3908d 100644 --- a/mysql-test/suite/rpl/r/show_status_stop_slave_race-7126.result +++ b/mysql-test/suite/rpl/r/show_status_stop_slave_race-7126.result @@ -1,8 +1,8 @@ include/master-slave.inc [connection master] -connection slave; call mtr.add_suppression("Master is configured to log replication events"); connection slave; +connection slave; start slave; connection master; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/show_status_stop_slave_race-7126.test b/mysql-test/suite/rpl/t/show_status_stop_slave_race-7126.test index 80282b33e77..88d7076b1e4 100644 --- a/mysql-test/suite/rpl/t/show_status_stop_slave_race-7126.test +++ b/mysql-test/suite/rpl/t/show_status_stop_slave_race-7126.test @@ -3,10 +3,10 @@ # --source include/master-slave.inc ---connection slave - call mtr.add_suppression("Master is configured to log replication events"); +--connection slave + # If everything is okay, the test will end in several seconds; maybe a minute. # If the problem shows up, it will hang until testcase timeout is exceeded. diff --git a/mysys/lf_hash.c b/mysys/lf_hash.c index 6be11edbfcf..98a34647844 100644 --- a/mysys/lf_hash.c +++ b/mysys/lf_hash.c @@ -308,7 +308,7 @@ static inline const uchar* hash_key(const LF_HASH *hash, @note, that the hash value is limited to 2^31, because we need one bit to distinguish between normal and dummy nodes. */ -static inline my_hash_value_type calc_hash(const CHARSET_INFO *cs, +static inline my_hash_value_type calc_hash(CHARSET_INFO *cs, const uchar *key, size_t keylen) { diff --git a/mysys/ma_dyncol.c b/mysys/ma_dyncol.c index db7d199bcd2..4d281b98d1c 100644 --- a/mysys/ma_dyncol.c +++ b/mysys/ma_dyncol.c @@ -566,7 +566,7 @@ static my_bool type_and_offset_read_named(DYNAMIC_COLUMN_TYPE *type, return 1; } *type= (val & 0xf) + 1; - *offset= val >> 4; + *offset= (size_t) (val >> 4); return (*offset >= lim); } @@ -2803,7 +2803,7 @@ dynamic_column_update_copy(DYNAMIC_COLUMN *str, PLAN *plan, else if (offs < first_offset) goto err; - offs+= plan[i].ddelta; + offs+= (size_t) plan[i].ddelta; { DYNAMIC_COLUMN_VALUE val; val.type= tp; // only the type used in the header @@ -2969,7 +2969,7 @@ dynamic_column_update_move_left(DYNAMIC_COLUMN *str, PLAN *plan, return ER_DYNCOL_FORMAT; } - offs+= plan[i].ddelta; + offs+= (size_t) plan[i].ddelta; int2store(write, nm); /* write rest of data at write + COLUMN_NUMBER_SIZE */ type_and_offset_store_num(write, new_offset_size, tp, offs); @@ -3023,9 +3023,9 @@ dynamic_column_update_move_left(DYNAMIC_COLUMN *str, PLAN *plan, memmove((header_base + new_header_size + plan[i].mv_offset + plan[i].ddelta), header_base + header_size + plan[i].mv_offset, - plan[i].mv_length); + (size_t) plan[i].mv_length); } - str->length+= plan[i].mv_length; + str->length+= (size_t) plan[i].mv_length; /* new data adding */ if (i < add_column_count) @@ -3514,8 +3514,8 @@ dynamic_column_update_many_fmt(DYNAMIC_COLUMN *str, Check if it is only "increasing" or only "decreasing" plan for (header and data separately). */ - new_header.data_size= header.data_size + data_delta; - new_header.nmpool_size= new_header.nmpool_size + name_delta; + new_header.data_size= (size_t) (header.data_size + data_delta); + new_header.nmpool_size= (size_t) (new_header.nmpool_size + name_delta); DBUG_ASSERT(new_header.format != dyncol_fmt_num || new_header.nmpool_size == 0); if ((new_header.offset_size= diff --git a/mysys/mf_iocache.c b/mysys/mf_iocache.c index db8d0b51ada..af1e0830aee 100644 --- a/mysys/mf_iocache.c +++ b/mysys/mf_iocache.c @@ -517,7 +517,7 @@ int _my_b_write(IO_CACHE *info, const uchar *Buffer, size_t Count) { my_off_t old_pos_in_file= info->pos_in_file; res= info->write_function(info, Buffer, Count); - Count-= info->pos_in_file - old_pos_in_file; + Count-= (size_t) (info->pos_in_file - old_pos_in_file); Buffer+= info->pos_in_file - old_pos_in_file; } else @@ -1226,7 +1226,7 @@ static int _my_b_cache_read_r(IO_CACHE *cache, uchar *Buffer, size_t Count) static void copy_to_read_buffer(IO_CACHE *write_cache, const uchar *write_buffer, my_off_t pos_in_file) { - size_t write_length= write_cache->pos_in_file - pos_in_file; + size_t write_length= (size_t) (write_cache->pos_in_file - pos_in_file); IO_CACHE_SHARE *cshare= write_cache->share; DBUG_ASSERT(cshare->source_cache == write_cache); diff --git a/mysys/mulalloc.c b/mysys/mulalloc.c index fceecdc1dc7..e230cdf9b71 100644 --- a/mysys/mulalloc.c +++ b/mysys/mulalloc.c @@ -80,7 +80,7 @@ void *my_multi_malloc_large(myf myFlags, ...) { va_list args; char **ptr,*start,*res; - size_t tot_length,length; + ulonglong tot_length,length; DBUG_ENTER("my_multi_malloc"); va_start(args,myFlags); @@ -92,7 +92,7 @@ void *my_multi_malloc_large(myf myFlags, ...) } va_end(args); - if (!(start=(char *) my_malloc(tot_length, myFlags))) + if (!(start=(char *) my_malloc((size_t) tot_length, myFlags))) DBUG_RETURN(0); /* purecov: inspected */ va_start(args,myFlags); diff --git a/sql/item_windowfunc.h b/sql/item_windowfunc.h index 40f48cc7dc5..3674a45b5ca 100644 --- a/sql/item_windowfunc.h +++ b/sql/item_windowfunc.h @@ -433,7 +433,7 @@ class Item_sum_ntile : public Item_sum_window_with_row_count double val_real() { - return val_int(); + return (double) val_int(); } longlong val_int() diff --git a/sql/log.cc b/sql/log.cc index d230b1ceb0d..39f001af554 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -1681,13 +1681,13 @@ static int binlog_close_connection(handlerton *hton, THD *thd) size_t len=0; wsrep_write_cache_buf(cache, &buf, &len); WSREP_WARN("binlog trx cache not empty (%lu bytes) @ connection close %lld", - len, (longlong) thd->thread_id); + (ulong) len, (longlong) thd->thread_id); if (len > 0) wsrep_dump_rbr_buf(thd, buf, len); cache = cache_mngr->get_binlog_cache_log(false); wsrep_write_cache_buf(cache, &buf, &len); WSREP_WARN("binlog stmt cache not empty (%lu bytes) @ connection close %lld", - len, (longlong) thd->thread_id); + (ulong) len, (longlong) thd->thread_id); if (len > 0) wsrep_dump_rbr_buf(thd, buf, len); } #endif /* WITH_WSREP */ diff --git a/sql/mdl.cc b/sql/mdl.cc index 61591ec9f57..cb616c30b1e 100644 --- a/sql/mdl.cc +++ b/sql/mdl.cc @@ -669,7 +669,7 @@ int mdl_iterate(int (*callback)(MDL_ticket *ticket, void *arg), void *arg) my_hash_value_type mdl_hash_function(CHARSET_INFO *cs, const uchar *key, size_t length) { - MDL_key *mdl_key= (MDL_key*) (key - offsetof(MDL_key, m_ptr)); + MDL_key *mdl_key= (MDL_key*) (key - my_offsetof(MDL_key, m_ptr)); return mdl_key->hash_value(); } diff --git a/sql/rpl_gtid.cc b/sql/rpl_gtid.cc index 5a94e1c5b54..4adea76b3cb 100644 --- a/sql/rpl_gtid.cc +++ b/sql/rpl_gtid.cc @@ -1015,8 +1015,8 @@ gtid_parser_helper(char **ptr, char *end, rpl_gtid *out_gtid) if (err != 0) return 1; - out_gtid->domain_id= v1; - out_gtid->server_id= v2; + out_gtid->domain_id= (uint32) v1; + out_gtid->server_id= (uint32) v2; out_gtid->seq_no= v3; *ptr= q; return 0; diff --git a/sql/sql_cte.h b/sql/sql_cte.h index 0cbc9247af9..761d01ccd7f 100644 --- a/sql/sql_cte.h +++ b/sql/sql_cte.h @@ -41,7 +41,7 @@ private: LEX_STRING unparsed_spec; /* Return the map where 1 is set only in the position for this element */ - table_map get_elem_map() { return 1 << number; } + table_map get_elem_map() { return (table_map) 1 << number; } public: /* diff --git a/sql/sql_test.cc b/sql/sql_test.cc index 76586a9fbba..8177a0baa53 100644 --- a/sql/sql_test.cc +++ b/sql/sql_test.cc @@ -559,7 +559,6 @@ C_MODE_END void mysql_print_status() { char current_dir[FN_REFLEN]; - char llbuff[10][22]; STATUS_VAR tmp; uint count; @@ -616,6 +615,7 @@ Next alarm time: %lu\n", display_table_locks(); #ifdef HAVE_MALLINFO struct mallinfo info= mallinfo(); + char llbuff[10][22]; printf("\nMemory status:\n\ Non-mmapped space allocated from system: %s\n\ Number of free chunks: %lu\n\ diff --git a/sql/sql_time.cc b/sql/sql_time.cc index eddf14bfbf3..5ef036965b8 100644 --- a/sql/sql_time.cc +++ b/sql/sql_time.cc @@ -427,7 +427,7 @@ bool decimal_to_datetime_with_warn(const my_decimal *value, MYSQL_TIME *ltime, bool int_to_datetime_with_warn(bool neg, ulonglong value, MYSQL_TIME *ltime, ulonglong fuzzydate, const char *field_name) { - const ErrConvInteger str(neg ? -value : value, !neg); + const ErrConvInteger str(neg ? - (longlong) value : (longlong) value, !neg); return number_to_time_with_warn(neg, value, 0, ltime, fuzzydate, &str, field_name); } diff --git a/sql/sql_window.cc b/sql/sql_window.cc index e3e42fc4f75..4c5ef53d854 100644 --- a/sql/sql_window.cc +++ b/sql/sql_window.cc @@ -696,7 +696,7 @@ public: - in table->record[0].. - rownum parameter has the row number. */ - void on_next_partition(int rownum) + void on_next_partition(ha_rows rownum) { /* Remember the sort key value from the new partition */ bound_tracker.check_if_next_group(); @@ -706,7 +706,7 @@ public: /* Moves to a new row. The row is assumed to be within the current partition */ - void move_to(int rownum) { tbl_cursor.move_to(rownum); } + void move_to(ha_rows rownum) { tbl_cursor.move_to(rownum); } /* This returns -1 when end of partition was reached. @@ -796,8 +796,8 @@ public: - The callee may move tbl->file and tbl->record[0] to point to some other row. */ - virtual void pre_next_partition(longlong rownum, Item_sum* item){}; - virtual void next_partition(longlong rownum, Item_sum* item)=0; + virtual void pre_next_partition(ha_rows rownum, Item_sum* item){}; + virtual void next_partition(ha_rows rownum, Item_sum* item)=0; /* The current row has moved one row forward. @@ -872,13 +872,13 @@ public: item_add->fix_fields(thd, &item_add); } - void pre_next_partition(longlong rownum, Item_sum* item) + void pre_next_partition(ha_rows rownum, Item_sum* item) { // Save the value of FUNC(current_row) range_expr->fetch_value_from(item_add); } - void next_partition(longlong rownum, Item_sum* item) + void next_partition(ha_rows rownum, Item_sum* item) { cursor.move_to(rownum); walk_till_non_peer(item); @@ -982,7 +982,7 @@ public: item_add->fix_fields(thd, &item_add); } - void pre_next_partition(longlong rownum, Item_sum* item) + void pre_next_partition(ha_rows rownum, Item_sum* item) { // Save the value of FUNC(current_row) range_expr->fetch_value_from(item_add); @@ -991,7 +991,7 @@ public: end_of_partition= false; } - void next_partition(longlong rownum, Item_sum* item) + void next_partition(ha_rows rownum, Item_sum* item) { cursor.move_to(rownum); walk_till_non_peer(item); @@ -1068,7 +1068,7 @@ public: peer_tracker.init(thd, order_list); } - void pre_next_partition(longlong rownum, Item_sum* item) + void pre_next_partition(ha_rows rownum, Item_sum* item) { // Save the value of the current_row peer_tracker.check_if_next_group(); @@ -1080,7 +1080,7 @@ public: } } - void next_partition(longlong rownum, Item_sum* item) + void next_partition(ha_rows rownum, Item_sum* item) { walk_till_non_peer(item); } @@ -1158,14 +1158,14 @@ public: peer_tracker.init(thd, order_list); } - void pre_next_partition(longlong rownum, Item_sum* item) + void pre_next_partition(ha_rows rownum, Item_sum* item) { // Fetch the value from the first row peer_tracker.check_if_next_group(); cursor.move_to(rownum+1); } - void next_partition(longlong rownum, Item_sum* item) {} + void next_partition(ha_rows rownum, Item_sum* item) {} void pre_next_row(Item_sum* item) { @@ -1214,7 +1214,7 @@ public: class Frame_unbounded_preceding : public Frame_cursor { public: - void next_partition(longlong rownum, Item_sum* item) + void next_partition(ha_rows rownum, Item_sum* item) { /* UNBOUNDED PRECEDING frame end just stays on the first row. @@ -1245,12 +1245,12 @@ public: cursor.init(thd, info, partition_list); } - void pre_next_partition(longlong rownum, Item_sum* item) + void pre_next_partition(ha_rows rownum, Item_sum* item) { cursor.on_next_partition(rownum); } - void next_partition(longlong rownum, Item_sum* item) + void next_partition(ha_rows rownum, Item_sum* item) { if (!rownum) { @@ -1279,9 +1279,9 @@ class Frame_unbounded_following_set_count : public Frame_unbounded_following public: // pre_next_partition is inherited - void next_partition(longlong rownum, Item_sum* item) + void next_partition(ha_rows rownum, Item_sum* item) { - ulonglong num_rows_in_partition= 0; + ha_rows num_rows_in_partition= 0; if (!rownum) { /* Read the first row */ @@ -1330,7 +1330,7 @@ public: cursor.init(info); } - void next_partition(longlong rownum, Item_sum* item) + void next_partition(ha_rows rownum, Item_sum* item) { /* Position our cursor to point at the first row in the new partition @@ -1391,11 +1391,11 @@ public: class Frame_rows_current_row_bottom : public Frame_cursor { public: - void pre_next_partition(longlong rownum, Item_sum* item) + void pre_next_partition(ha_rows rownum, Item_sum* item) { item->add(); } - void next_partition(longlong rownum, Item_sum* item) {} + void next_partition(ha_rows rownum, Item_sum* item) {} void pre_next_row(Item_sum* item) { /* Temp table's current row is current_row. Add it to the window func */ @@ -1456,7 +1456,7 @@ public: at_partition_end= false; } - void pre_next_partition(longlong rownum, Item_sum* item) + void pre_next_partition(ha_rows rownum, Item_sum* item) { at_partition_end= false; @@ -1476,10 +1476,10 @@ public: } /* Move our cursor to be n_rows ahead. */ - void next_partition(longlong rownum, Item_sum* item) + void next_partition(ha_rows rownum, Item_sum* item) { - longlong i_end= n_rows + ((rownum==0)?1:0)- is_top_bound; - for (longlong i= 0; i < i_end; i++) + ha_rows i_end= n_rows + ((rownum==0)?1:0)- is_top_bound; + for (ha_rows i= 0; i < i_end; i++) { if (next_row_intern(item)) break; @@ -1561,10 +1561,10 @@ Frame_cursor *get_frame_cursor(Window_frame *frame, bool is_top_bound) if (frame->units == Window_frame::UNITS_ROWS) { - longlong n_rows= bound->offset->val_int(); + ha_rows n_rows= bound->offset->val_int(); /* These should be handled in the parser */ DBUG_ASSERT(!bound->offset->null_value); - DBUG_ASSERT(n_rows >= 0); + DBUG_ASSERT((longlong) n_rows >= 0); if (is_preceding) return new Frame_n_rows_preceding(is_top_bound, n_rows); else @@ -1676,7 +1676,7 @@ void get_window_func_required_cursors( bool compute_window_func_with_frames(Item_window_func *item_win, TABLE *tbl, READ_RECORD *info) { - THD *thd= current_thd; + THD *thd= tbl->in_use; int err= 0; Item_sum *sum_func= item_win->window_func(); @@ -1695,7 +1695,7 @@ bool compute_window_func_with_frames(Item_window_func *item_win, } bool is_error= false; - longlong rownum= 0; + ha_rows rownum= 0; uchar *rowid_buf= (uchar*) my_malloc(tbl->file->ref_length, MYF(0)); while (true) diff --git a/storage/connect/connect.h b/storage/connect/connect.h index bbefda52274..b877f1ffb6c 100644 --- a/storage/connect/connect.h +++ b/storage/connect/connect.h @@ -57,6 +57,7 @@ class DOXDEF: public DOSDEF { /* This is the DOS/UNIX Access Method base class declaration. */ /***********************************************************************/ class TDBDOX: public TDBDOS { + TDBDOX(): TDBDOS((PGLOBAL)0,(PTDBDOS) 0) {} /* Never called */ friend int MakeIndex(PGLOBAL, PTDB, PIXDEF); friend int CntCloseTable(PGLOBAL, PTDB, bool, bool); friend int CntIndexInit(PGLOBAL, PTDB, int, bool); diff --git a/storage/connect/csort.cpp b/storage/connect/csort.cpp index 2f918782c80..e89c5ecdbc9 100644 --- a/storage/connect/csort.cpp +++ b/storage/connect/csort.cpp @@ -721,7 +721,7 @@ int CSORT::Qsortc(void) void CSORT::Qstc(int *base, int *max) { register int *i, *j, *jj, *lt, *eq, *gt, *mid; - int c, lo, hi, rc; + int c= 0, lo, hi, rc; size_t zlo, zhi, cnm; zlo = zhi = cnm = 0; // Avoid warning message @@ -775,7 +775,11 @@ void CSORT::Qstc(int *base, int *max) /* Small group. Do special quicker processing. */ /*****************************************************************/ if ((rc = Qcompare(base, (i = base + 1))) > 0) - c = *base, *base = *i, *i = c; + { + c = *base; + *base = *i; + *i = c; + } if (Pof) Pof[base - Pex] = Pof[i - Pex] = (rc) ? 1 : 2; diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc index 7fda7d86ece..434f7b4060c 100644 --- a/storage/connect/ha_connect.cc +++ b/storage/connect/ha_connect.cc @@ -1098,7 +1098,7 @@ bool GetBooleanTableOption(PGLOBAL g, PTOS options, char *opname, bool bdef) /****************************************************************************/ int GetIntegerTableOption(PGLOBAL g, PTOS options, char *opname, int idef) { - ulonglong opval= NO_IVAL; + ulonglong opval= (ulonglong) NO_IVAL; if (!options) return idef; diff --git a/storage/connect/jsonudf.cpp b/storage/connect/jsonudf.cpp index 6987230121a..a60dacd80fb 100644 --- a/storage/connect/jsonudf.cpp +++ b/storage/connect/jsonudf.cpp @@ -1302,7 +1302,7 @@ static my_bool CalcLen(UDF_ARGS *args, my_bool obj, { char fn[_MAX_PATH]; unsigned long i, k, m, n; - long fl, j = -1; + long fl= 0, j = -1; reslen = args->arg_count + 2; @@ -1370,7 +1370,6 @@ static my_bool CalcLen(UDF_ARGS *args, my_bool obj, memlen += (k + sizeof(JOBJECT) + sizeof(JPAIR)); } else memlen += sizeof(JARRAY); - fl= 0; switch (args->arg_type[i]) { case STRING_RESULT: if (n == 2 && args->args[i]) { diff --git a/storage/connect/tabodbc.cpp b/storage/connect/tabodbc.cpp index c555f2a5abb..aca4ae92927 100644 --- a/storage/connect/tabodbc.cpp +++ b/storage/connect/tabodbc.cpp @@ -681,7 +681,7 @@ bool TDBODBC::MakeCommand(PGLOBAL g) } else { sprintf(g->Message, "Cannot use this %s command", (Mode == MODE_UPDATE) ? "UPDATE" : "DELETE"); - return NULL; + return false; } // endif p Query = new(g) STRING(g, 0, stmt); diff --git a/storage/innobase/btr/btr0cur.cc b/storage/innobase/btr/btr0cur.cc index a6bb258344f..3b41fcf34fc 100644 --- a/storage/innobase/btr/btr0cur.cc +++ b/storage/innobase/btr/btr0cur.cc @@ -4070,7 +4070,7 @@ btr_estimate_number_of_different_key_vals( */ if (index->stat_index_size > 1) { n_sample_pages = (srv_stats_transient_sample_pages < index->stat_index_size) ? - ut_min(index->stat_index_size, + (ulint) ut_min((double) index->stat_index_size, log2(index->stat_index_size)*srv_stats_transient_sample_pages) : index->stat_index_size; diff --git a/storage/innobase/btr/btr0defragment.cc b/storage/innobase/btr/btr0defragment.cc index 26bab936de5..4d9eab8f2bd 100644 --- a/storage/innobase/btr/btr0defragment.cc +++ b/storage/innobase/btr/btr0defragment.cc @@ -151,7 +151,7 @@ void btr_defragment_init() { srv_defragment_interval = ut_microseconds_to_timer( - 1000000.0 / srv_defragment_frequency); + (ulonglong) (1000000.0 / srv_defragment_frequency)); mutex_create(btr_defragment_mutex_key, &btr_defragment_mutex, SYNC_ANY_LATCH); os_thread_create(btr_defragment_thread, NULL, NULL); diff --git a/storage/innobase/buf/buf0flu.cc b/storage/innobase/buf/buf0flu.cc index 780230b38ba..30b3b6f4698 100644 --- a/storage/innobase/buf/buf0flu.cc +++ b/storage/innobase/buf/buf0flu.cc @@ -2066,7 +2066,7 @@ ulint af_get_pct_for_dirty() /*==================*/ { - ulint dirty_pct = buf_get_modified_ratio_pct(); + ulint dirty_pct = (ulint) buf_get_modified_ratio_pct(); if (dirty_pct > 0 && srv_max_buf_pool_modified_pct == 0) { return(100); @@ -2086,7 +2086,7 @@ af_get_pct_for_dirty() } } else if (dirty_pct > srv_max_dirty_pages_pct_lwm) { /* We should start flushing pages gradually. */ - return((dirty_pct * 100) + return (ulint) ((dirty_pct * 100) / (srv_max_buf_pool_modified_pct + 1)); } @@ -2104,8 +2104,8 @@ af_get_pct_for_lsn( { lsn_t max_async_age; lsn_t lsn_age_factor; - lsn_t af_lwm = (srv_adaptive_flushing_lwm - * log_get_capacity()) / 100; + lsn_t af_lwm = (lsn_t) ((srv_adaptive_flushing_lwm + * log_get_capacity()) / 100); if (age < af_lwm) { /* No adaptive flushing. */ diff --git a/storage/innobase/fil/fil0crypt.cc b/storage/innobase/fil/fil0crypt.cc index ceffa950739..2db3063d6b5 100644 --- a/storage/innobase/fil/fil0crypt.cc +++ b/storage/innobase/fil/fil0crypt.cc @@ -474,7 +474,7 @@ fil_parse_write_crypt_data( 4 + // size of key_id 1; // fil_encryption_t - if (end_ptr - ptr < entry_size){ + if ((uint) (end_ptr - ptr) < entry_size){ return NULL; } @@ -500,7 +500,7 @@ fil_parse_write_crypt_data( fil_encryption_t encryption = (fil_encryption_t)mach_read_from_1(ptr); ptr +=1; - if (end_ptr - ptr < len) { + if ((uint) (end_ptr - ptr) < len) { return NULL; } @@ -1351,7 +1351,7 @@ fil_crypt_space_needs_rotation( last_scrub_completed; bool need_scrubbing = crypt_data->rotate_state.scrubbing.is_active - && diff >= srv_background_scrub_data_interval; + && diff >= (time_t) srv_background_scrub_data_interval; if (need_key_rotation == false && need_scrubbing == false) break; @@ -2247,7 +2247,7 @@ DECLARE_THREAD(fil_crypt_thread)( time_t waited = time(0) - wait_start; - if (waited >= srv_background_scrub_data_check_interval) { + if (waited >= (time_t) srv_background_scrub_data_check_interval) { break; } } diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index a7987f1596e..dc4b4487eeb 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -17753,7 +17753,7 @@ innodb_defragment_frequency_update( { srv_defragment_frequency = (*static_cast<const uint*>(save)); srv_defragment_interval = ut_microseconds_to_timer( - 1000000.0 / srv_defragment_frequency); + (ulonglong) (1000000.0 / srv_defragment_frequency)); } /****************************************************************//** diff --git a/storage/innobase/lock/lock0lock.cc b/storage/innobase/lock/lock0lock.cc index bc7ec1d221b..2798cf00d1f 100644 --- a/storage/innobase/lock/lock0lock.cc +++ b/storage/innobase/lock/lock0lock.cc @@ -2387,7 +2387,7 @@ lock_rec_add_to_queue( if (wsrep_debug) { fprintf(stderr, "BF skipping wait: %lu\n", - trx->id); + (ulong) trx->id); lock_rec_print(stderr, lock); } } else @@ -4961,7 +4961,7 @@ lock_table_other_has_incompatible( #ifdef WITH_WSREP if(wsrep_thd_is_wsrep(trx->mysql_thd)) { if (wsrep_debug) { - fprintf(stderr, "WSREP: trx %ld table lock abort\n", + fprintf(stderr, "WSREP: trx " TRX_ID_FMT " table lock abort\n", trx->id); } trx_mutex_enter(lock->trx); diff --git a/storage/innobase/log/log0crypt.cc b/storage/innobase/log/log0crypt.cc index db2e84d7e45..f518845b1a8 100644 --- a/storage/innobase/log/log0crypt.cc +++ b/storage/innobase/log/log0crypt.cc @@ -144,11 +144,11 @@ log_crypt_print_checkpoint_keys( ib_uint64_t checkpoint_no = log_block_get_checkpoint_no(log_block); if (crypt_info.size()) { - fprintf(stderr, "InnoDB: redo log checkpoint: %lu [ chk key ]: ", checkpoint_no); + fprintf(stderr, "InnoDB: redo log checkpoint: %lu [ chk key ]: ", (ulong) checkpoint_no); for (size_t i = 0; i < crypt_info.size(); i++) { struct crypt_info_t* it = &crypt_info[i]; fprintf(stderr, "[ %lu %u ] ", - it->checkpoint_no, + (ulong) it->checkpoint_no, it->key_version); } fprintf(stderr, "\n"); diff --git a/storage/innobase/os/os0file.cc b/storage/innobase/os/os0file.cc index 3a0bd1fc328..5948aadf220 100644 --- a/storage/innobase/os/os0file.cc +++ b/storage/innobase/os/os0file.cc @@ -2402,7 +2402,7 @@ os_file_set_size( fprintf(stderr, "InnoDB: Error: preallocating file " "space for file \'%s\' failed. Current size " "%lu, desired size %lu\n", - name, current_size, size); + name, (ulong) current_size, (ulong) size); os_file_handle_error_no_exit(name, "posix_fallocate", FALSE, __FILE__, __LINE__); return(FALSE); @@ -6298,7 +6298,7 @@ os_file_trim( fprintf(stderr, " InnoDB: Warning: fallocate call failed with error code %d.\n" " InnoDB: start: %lu len: %lu payload: %lu\n" - " InnoDB: Disabling fallocate for now.\n", errno, off, trim_len, len); + " InnoDB: Disabling fallocate for now.\n", errno, (ulong) off, (ulong) trim_len, (ulong) len); os_file_handle_error_no_exit(slot->name, " fallocate(FALLOC_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE) ", diff --git a/storage/innobase/row/row0merge.cc b/storage/innobase/row/row0merge.cc index 36ae979e965..e8f3ad97c67 100644 --- a/storage/innobase/row/row0merge.cc +++ b/storage/innobase/row/row0merge.cc @@ -109,9 +109,9 @@ row_merge_encrypt_buf( if (! ((rc == MY_AES_OK) && ((ulint)dstlen == srv_sort_buf_size-ROW_MERGE_RESERVE_SIZE))) { ib_logf(IB_LOG_LEVEL_FATAL, "Unable to encrypt data-block " - " src: %p srclen: %lu buf: %p buflen: %d." + " src: %p srclen: %lu buf: %p buflen: %u." " return-code: %d. Can't continue!\n", - input_buf, (size_t)srv_sort_buf_size, + input_buf, (ulong) srv_sort_buf_size, crypted_buf, dstlen, rc); ut_error; } @@ -153,7 +153,7 @@ row_merge_decrypt_buf( "Unable to encrypt data-block " " src: %p srclen: %lu buf: %p buflen: %d." " return-code: %d. Can't continue!\n", - input_buf, (size_t)srv_sort_buf_size, + input_buf, (ulong) srv_sort_buf_size, crypted_buf, dstlen, rc); ut_error; } @@ -2067,7 +2067,7 @@ write_buffers: pct_cost : ((pct_cost * read_rows) / table_total_rows); /* presenting 10.12% as 1012 integer */ - onlineddl_pct_progress = curr_progress * 100; + onlineddl_pct_progress = (ulint) (curr_progress * 100); } } @@ -2603,7 +2603,7 @@ row_merge_sort( /* Find the number N which 2^N is greater or equal than num_runs */ /* N is merge sort running count */ - total_merge_sort_count = ceil(my_log2f(num_runs)); + total_merge_sort_count = (ulint) ceil(my_log2f(num_runs)); if(total_merge_sort_count <= 0) { total_merge_sort_count=1; } @@ -2650,7 +2650,7 @@ row_merge_sort( pct_cost : ((pct_cost * merge_count) / total_merge_sort_count); /* presenting 10.12% as 1012 integer */; - onlineddl_pct_progress = (pct_progress + curr_progress) * 100; + onlineddl_pct_progress = (ulint) ((pct_progress + curr_progress) * 100); } if (error != DB_SUCCESS) { @@ -2933,7 +2933,7 @@ row_merge_insert_index_tuples( ((pct_cost * inserted_rows) / table_total_rows); /* presenting 10.12% as 1012 integer */; - onlineddl_pct_progress = (pct_progress + curr_progress) * 100; + onlineddl_pct_progress = (ulint) ((pct_progress + curr_progress) * 100); } } } diff --git a/storage/maria/ma_check_standalone.h b/storage/maria/ma_check_standalone.h index 6626a62c4ef..890d6ba3d31 100644 --- a/storage/maria/ma_check_standalone.h +++ b/storage/maria/ma_check_standalone.h @@ -23,7 +23,7 @@ void _mi_report_crashed(void *file __attribute__((unused)), { } -static unsigned int no_key() +static unsigned int no_key(unsigned int not_used __attribute__((unused))) { return ENCRYPTION_KEY_VERSION_INVALID; } diff --git a/storage/maria/ma_checksum.c b/storage/maria/ma_checksum.c index da2d40d3687..48b29946cea 100644 --- a/storage/maria/ma_checksum.c +++ b/storage/maria/ma_checksum.c @@ -58,7 +58,7 @@ ha_checksum _ma_checksum(MARIA_HA *info, const uchar *record) length= _ma_calc_blob_length(blob_size_length, pos); if (length) { - memcpy(&pos, pos + blob_size_length, sizeof(char*)); + memcpy((char**) &pos, pos + blob_size_length, sizeof(char*)); crc= my_checksum(crc, pos, length); } continue; diff --git a/storage/maria/ma_ft_update.c b/storage/maria/ma_ft_update.c index a166b7b21fb..59c134cd4d3 100644 --- a/storage/maria/ma_ft_update.c +++ b/storage/maria/ma_ft_update.c @@ -83,7 +83,7 @@ uint _ma_ft_segiterator(register FT_SEG_ITERATOR *ftsi) if (ftsi->seg->flag & HA_BLOB_PART) { ftsi->len= _ma_calc_blob_length(ftsi->seg->bit_start,ftsi->pos); - memcpy(&ftsi->pos, ftsi->pos+ftsi->seg->bit_start, sizeof(char*)); + memcpy((char**) &ftsi->pos, ftsi->pos+ftsi->seg->bit_start, sizeof(char*)); DBUG_RETURN(1); } ftsi->len=ftsi->seg->length; diff --git a/storage/maria/ma_sort.c b/storage/maria/ma_sort.c index ef6e8506ac6..e90b1d96a4a 100644 --- a/storage/maria/ma_sort.c +++ b/storage/maria/ma_sort.c @@ -195,8 +195,10 @@ int _ma_create_index_by_sort(MARIA_SORT_PARAM *info, my_bool no_messages, while ((maxbuffer= (uint) (records/(keys-1)+1)) != maxbuffer_org); } - if ((sort_keys=(uchar**) my_malloc(keys*(sort_length+sizeof(char*))+ - HA_FT_MAXBYTELEN, MYF(0)))) + if ((sort_keys= ((uchar**) + my_malloc((size_t) (keys*(sort_length+sizeof(char*))+ + HA_FT_MAXBYTELEN), + MYF(0))))) { if (my_init_dynamic_array(&buffpek, sizeof(BUFFPEK), maxbuffer, MY_MIN(maxbuffer/2, 1000), MYF(0))) @@ -436,13 +438,15 @@ pthread_handler_t _ma_thr_find_all_keys(void *arg) } while ((maxbuffer= (uint) (idx/(keys-1)+1)) != maxbuffer_org); } - if ((sort_keys= (uchar **) - my_malloc(keys*(sort_length+sizeof(char*))+ - ((sort_param->keyinfo->flag & HA_FULLTEXT) ? - HA_FT_MAXBYTELEN : 0), MYF(0)))) + if ((sort_keys= ((uchar **) + my_malloc((size_t) + (keys*(sort_length+sizeof(char*))+ + ((sort_param->keyinfo->flag & HA_FULLTEXT) ? + HA_FT_MAXBYTELEN : 0)), MYF(0))))) { if (my_init_dynamic_array(&sort_param->buffpek, sizeof(BUFFPEK), - maxbuffer, MY_MIN(maxbuffer/2, 1000), MYF(0))) + maxbuffer, MY_MIN(maxbuffer/2, 1000), + MYF(0))) { my_free(sort_keys); sort_keys= (uchar **) NULL; /* for err: label */ @@ -624,7 +628,7 @@ int _ma_thr_write_keys(MARIA_SORT_PARAM *sort_param) length=param->sort_buffer_length; while (length >= MIN_SORT_MEMORY) { - if ((mergebuf= my_malloc(length, MYF(0)))) + if ((mergebuf= my_malloc((size_t) length, MYF(0)))) break; length=length*3/4; } @@ -728,8 +732,8 @@ static int write_keys(MARIA_SORT_PARAM *info, register uchar **sort_keys, if (!buffpek) DBUG_RETURN(1); /* Out of memory */ - my_qsort2((uchar*) sort_keys,count,sizeof(uchar*),(qsort2_cmp) info->key_cmp, - info); + my_qsort2((uchar*) sort_keys,(size_t) count, sizeof(uchar*), + (qsort2_cmp) info->key_cmp, info); if (!my_b_inited(tempfile) && open_cached_file(tempfile, my_tmpdir(info->tmpdir), "ST", DISK_BUFFER_SIZE, info->sort_info->param->myf_rw)) @@ -774,8 +778,8 @@ static int write_keys_varlen(MARIA_SORT_PARAM *info, if (!buffpek) DBUG_RETURN(1); /* Out of memory */ - my_qsort2((uchar*) sort_keys,count,sizeof(uchar*),(qsort2_cmp) info->key_cmp, - info); + my_qsort2((uchar*) sort_keys, (size_t) count, sizeof(uchar*), + (qsort2_cmp) info->key_cmp, info); if (!my_b_inited(tempfile) && open_cached_file(tempfile, my_tmpdir(info->tmpdir), "ST", DISK_BUFFER_SIZE, info->sort_info->param->myf_rw)) @@ -917,7 +921,8 @@ static my_off_t read_to_buffer(IO_CACHE *fromfile, BUFFPEK *buffpek, register ha_keys count; my_off_t length; - if ((count= (ha_keys) MY_MIN((ha_rows) buffpek->max_keys,buffpek->count))) + if ((count= (ha_keys) MY_MIN((ha_rows) buffpek->max_keys, + (ha_rows) buffpek->count))) { if (my_b_pread(fromfile, (uchar*) buffpek->base, (length= sort_length * count), buffpek->file_pos)) @@ -985,7 +990,7 @@ static int write_merge_key(MARIA_SORT_PARAM *info __attribute__((unused)), IO_CACHE *to_file, uchar *key, uint sort_length, ha_keys count) { - return my_b_write(to_file, key, ((size_t) sort_length) * count); + return my_b_write(to_file, key, (size_t) (sort_length * count)); } /* @@ -1045,7 +1050,7 @@ merge_buffers(MARIA_SORT_PARAM *info, ha_keys keys, IO_CACHE *from_file, if (to_file) { if (info->write_key(info,to_file, buffpek->key, - (uint) sort_length,1)) + sort_length, 1)) goto err; /* purecov: inspected */ } else @@ -1062,7 +1067,7 @@ merge_buffers(MARIA_SORT_PARAM *info, ha_keys keys, IO_CACHE *from_file, if (!(read_length= info->read_to_buffer(from_file,buffpek,sort_length))) { uchar *base= buffpek->base; - uint max_keys=buffpek->max_keys; + ha_keys max_keys=buffpek->max_keys; queue_remove_top(&queue); diff --git a/storage/mroonga/vendor/groonga/lib/com.c b/storage/mroonga/vendor/groonga/lib/com.c index a16a446022c..5455d1f8e09 100644 --- a/storage/mroonga/vendor/groonga/lib/com.c +++ b/storage/mroonga/vendor/groonga/lib/com.c @@ -738,7 +738,7 @@ grn_com_send(grn_ctx *ctx, grn_com *cs, msg.msg_namelen = 0; msg.msg_iov = msg_iov; msg.msg_iovlen = 2; - msg_iov[0].iov_base = header; + msg_iov[0].iov_base = (char*) header; msg_iov[0].iov_len = sizeof(grn_com_header); msg_iov[1].iov_base = (char *)body; msg_iov[1].iov_len = size; diff --git a/storage/mroonga/vendor/groonga/lib/ctx.c b/storage/mroonga/vendor/groonga/lib/ctx.c index 92caba561eb..c4a485527c1 100644 --- a/storage/mroonga/vendor/groonga/lib/ctx.c +++ b/storage/mroonga/vendor/groonga/lib/ctx.c @@ -51,7 +51,8 @@ #define GRN_CTX_INITIALIZER(enc) \ { GRN_SUCCESS, 0, enc, 0, GRN_LOG_NOTICE,\ - GRN_CTX_FIN, 0, 0, 0, 0, {0}, NULL, NULL, NULL, NULL, NULL } + GRN_CTX_FIN, 0, 0, 0, 0, {0}, NULL, NULL, NULL, NULL, NULL, \ + {NULL, NULL,NULL, NULL,NULL, NULL,NULL, NULL,NULL, NULL,NULL, NULL,NULL, NULL,NULL, NULL}, ""} #define GRN_CTX_CLOSED(ctx) ((ctx)->stat == GRN_CTX_FIN) diff --git a/storage/mroonga/vendor/groonga/lib/db.c b/storage/mroonga/vendor/groonga/lib/db.c index e213812d926..05e4d73e5ed 100644 --- a/storage/mroonga/vendor/groonga/lib/db.c +++ b/storage/mroonga/vendor/groonga/lib/db.c @@ -4137,7 +4137,7 @@ grn_column_create(grn_ctx *ctx, grn_obj *table, { grn_db *s; uint32_t value_size; - grn_obj *db, *res = NULL; + grn_obj *db= NULL, *res = NULL; grn_id id = GRN_ID_NIL; grn_id range = GRN_ID_NIL; grn_id domain = GRN_ID_NIL; diff --git a/storage/mroonga/vendor/groonga/lib/ii.c b/storage/mroonga/vendor/groonga/lib/ii.c index 388e0566756..df6e4ba3a34 100644 --- a/storage/mroonga/vendor/groonga/lib/ii.c +++ b/storage/mroonga/vendor/groonga/lib/ii.c @@ -385,7 +385,7 @@ chunk_free(grn_ctx *ctx, grn_ii *ii, uint32_t offset, uint32_t dummy, uint32_t s } */ grn_io_win iw, iw_; - grn_ii_ginfo *ginfo; + grn_ii_ginfo *ginfo= 0; uint32_t seg, m, *gseg; seg = offset >> GRN_II_N_CHUNK_VARIATION; if (size > S_CHUNK) { diff --git a/storage/myisam/ft_update.c b/storage/myisam/ft_update.c index 10a36650b0a..8f437476121 100644 --- a/storage/myisam/ft_update.c +++ b/storage/myisam/ft_update.c @@ -83,7 +83,7 @@ uint _mi_ft_segiterator(register FT_SEG_ITERATOR *ftsi) if (ftsi->seg->flag & HA_BLOB_PART) { ftsi->len=_mi_calc_blob_length(ftsi->seg->bit_start,ftsi->pos); - memcpy(&ftsi->pos, ftsi->pos+ftsi->seg->bit_start, sizeof(char*)); + memcpy((char**) &ftsi->pos, ftsi->pos+ftsi->seg->bit_start, sizeof(char*)); DBUG_RETURN(1); } ftsi->len=ftsi->seg->length; diff --git a/storage/myisam/mi_unique.c b/storage/myisam/mi_unique.c index 5192d404939..dae453beaec 100644 --- a/storage/myisam/mi_unique.c +++ b/storage/myisam/mi_unique.c @@ -112,7 +112,7 @@ ha_checksum mi_unique_hash(MI_UNIQUEDEF *def, const uchar *record) else if (keyseg->flag & HA_BLOB_PART) { uint tmp_length=_mi_calc_blob_length(keyseg->bit_start,pos); - memcpy(&pos, pos+keyseg->bit_start, sizeof(char*)); + memcpy((char**) &pos, pos+keyseg->bit_start, sizeof(char*)); if (!length || length > tmp_length) length=tmp_length; /* The whole blob */ } @@ -207,8 +207,8 @@ int mi_unique_comp(MI_UNIQUEDEF *def, const uchar *a, const uchar *b, set_if_smaller(a_length, keyseg->length); set_if_smaller(b_length, keyseg->length); } - memcpy(&pos_a, pos_a+keyseg->bit_start, sizeof(char*)); - memcpy(&pos_b, pos_b+keyseg->bit_start, sizeof(char*)); + memcpy((char**) &pos_a, pos_a+keyseg->bit_start, sizeof(char*)); + memcpy((char**) &pos_b, pos_b+keyseg->bit_start, sizeof(char*)); } if (type == HA_KEYTYPE_TEXT || type == HA_KEYTYPE_VARTEXT1 || type == HA_KEYTYPE_VARTEXT2) diff --git a/storage/myisam/sort.c b/storage/myisam/sort.c index f490e5f0b44..17e2ca4190b 100644 --- a/storage/myisam/sort.c +++ b/storage/myisam/sort.c @@ -191,8 +191,9 @@ int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages, while ((maxbuffer= (uint) (records/(keys-1)+1)) != maxbuffer_org); } - if ((sort_keys=(uchar **)my_malloc(keys*(sort_length+sizeof(char*))+ - HA_FT_MAXBYTELEN, MYF(0)))) + if ((sort_keys= ((uchar **) + my_malloc((size_t) (keys*(sort_length+sizeof(char*))+ + HA_FT_MAXBYTELEN), MYF(0))))) { if (my_init_dynamic_array(&buffpek, sizeof(BUFFPEK), maxbuffer, MY_MIN(maxbuffer/2, 1000), MYF(0))) @@ -417,13 +418,15 @@ pthread_handler_t thr_find_all_keys(void *arg) } while ((maxbuffer= (uint) (idx/(keys-1)+1)) != maxbuffer_org); } - if ((sort_keys= (uchar**) - my_malloc(keys*(sort_length+sizeof(char*))+ - ((sort_param->keyinfo->flag & HA_FULLTEXT) ? - HA_FT_MAXBYTELEN : 0), MYF(0)))) + if ((sort_keys= ((uchar**) + my_malloc((size_t) + (keys*(sort_length+sizeof(char*))+ + ((sort_param->keyinfo->flag & HA_FULLTEXT) ? + HA_FT_MAXBYTELEN : 0)), MYF(0))))) { if (my_init_dynamic_array(&sort_param->buffpek, sizeof(BUFFPEK), - maxbuffer, MY_MIN(maxbuffer/2, 1000), MYF(0))) + maxbuffer, MY_MIN(maxbuffer/2, 1000), + MYF(0))) { my_free(sort_keys); sort_keys= (uchar **) NULL; /* for err: label */ @@ -603,7 +606,7 @@ int thr_write_keys(MI_SORT_PARAM *sort_param) length=param->sort_buffer_length; while (length >= MIN_SORT_BUFFER) { - if ((mergebuf= my_malloc(length, MYF(0)))) + if ((mergebuf= my_malloc((size_t) length, MYF(0)))) break; length=length*3/4; } @@ -695,8 +698,8 @@ static int write_keys(MI_SORT_PARAM *info, register uchar **sort_keys, if (!buffpek) DBUG_RETURN(1); /* Out of memory */ - my_qsort2((uchar*) sort_keys,count,sizeof(uchar*),(qsort2_cmp) info->key_cmp, - info); + my_qsort2((uchar*) sort_keys,(size_t) count, sizeof(uchar*), + (qsort2_cmp) info->key_cmp, info); if (!my_b_inited(tempfile) && open_cached_file(tempfile, my_tmpdir(info->tmpdir), "ST", DISK_BUFFER_SIZE, info->sort_info->param->myf_rw)) @@ -741,8 +744,8 @@ static int write_keys_varlen(MI_SORT_PARAM *info, if (!buffpek) DBUG_RETURN(1); /* Out of memory */ - my_qsort2((uchar*) sort_keys,count,sizeof(uchar*),(qsort2_cmp) info->key_cmp, - info); + my_qsort2((uchar*) sort_keys, (size_t) count, sizeof(uchar*), + (qsort2_cmp) info->key_cmp, info); if (!my_b_inited(tempfile) && open_cached_file(tempfile, my_tmpdir(info->tmpdir), "ST", DISK_BUFFER_SIZE, info->sort_info->param->myf_rw)) @@ -865,10 +868,12 @@ static my_off_t read_to_buffer(IO_CACHE *fromfile, BUFFPEK *buffpek, register ha_keys count; my_off_t length; - if ((count= (ha_keys) MY_MIN((ha_rows) buffpek->max_keys,buffpek->count))) + if ((count= (ha_keys) MY_MIN((ha_rows) buffpek->max_keys, + (ha_rows) buffpek->count))) { if (my_b_pread(fromfile, (uchar*) buffpek->base, - (length= sort_length * count), buffpek->file_pos)) + (length= (my_off_t) (sort_length * count)), + buffpek->file_pos)) return(HA_OFFSET_ERROR); buffpek->key=buffpek->base; buffpek->file_pos+= length; /* New filepos */ @@ -933,7 +938,7 @@ static int write_merge_key(MI_SORT_PARAM *info __attribute__((unused)), IO_CACHE *to_file, uchar *key, uint sort_length, ha_keys count) { - return my_b_write(to_file, key, ((size_t) sort_length) * count); + return my_b_write(to_file, key, (size_t) (sort_length * count)); } /* @@ -993,7 +998,7 @@ merge_buffers(MI_SORT_PARAM *info, ha_keys keys, IO_CACHE *from_file, if (to_file) { if (info->write_key(info,to_file,(uchar*) buffpek->key, - (uint) sort_length,1)) + sort_length, 1)) { error=1; goto err; /* purecov: inspected */ } @@ -1016,7 +1021,7 @@ merge_buffers(MI_SORT_PARAM *info, ha_keys keys, IO_CACHE *from_file, if (!(read_length= info->read_to_buffer(from_file,buffpek,sort_length))) { uchar *base= buffpek->base; - uint max_keys=buffpek->max_keys; + ha_keys max_keys=buffpek->max_keys; queue_remove_top(&queue); diff --git a/storage/xtradb/btr/btr0cur.cc b/storage/xtradb/btr/btr0cur.cc index 5bb94dfce2a..7ee37836bfb 100644 --- a/storage/xtradb/btr/btr0cur.cc +++ b/storage/xtradb/btr/btr0cur.cc @@ -4257,7 +4257,7 @@ btr_estimate_number_of_different_key_vals( */ if (index->stat_index_size > 1) { n_sample_pages = (srv_stats_transient_sample_pages < index->stat_index_size) ? - ut_min(index->stat_index_size, + (ulint) ut_min((double) index->stat_index_size, log2(index->stat_index_size)*srv_stats_transient_sample_pages) : index->stat_index_size; diff --git a/storage/xtradb/btr/btr0defragment.cc b/storage/xtradb/btr/btr0defragment.cc index 6e7a3fd2411..8de85e746ca 100644 --- a/storage/xtradb/btr/btr0defragment.cc +++ b/storage/xtradb/btr/btr0defragment.cc @@ -151,7 +151,7 @@ void btr_defragment_init() { srv_defragment_interval = ut_microseconds_to_timer( - 1000000.0 / srv_defragment_frequency); + (ulonglong) (1000000.0 / srv_defragment_frequency)); mutex_create(btr_defragment_mutex_key, &btr_defragment_mutex, SYNC_ANY_LATCH); os_thread_create(btr_defragment_thread, NULL, NULL); diff --git a/storage/xtradb/buf/buf0flu.cc b/storage/xtradb/buf/buf0flu.cc index 5d64b75784a..ec13673a56c 100644 --- a/storage/xtradb/buf/buf0flu.cc +++ b/storage/xtradb/buf/buf0flu.cc @@ -2425,7 +2425,7 @@ ulint af_get_pct_for_dirty() /*==================*/ { - ulint dirty_pct = buf_get_modified_ratio_pct(); + ulint dirty_pct = (ulint) buf_get_modified_ratio_pct(); if (dirty_pct > 0 && srv_max_buf_pool_modified_pct == 0) { return(100); @@ -2445,7 +2445,7 @@ af_get_pct_for_dirty() } } else if (dirty_pct > srv_max_dirty_pages_pct_lwm) { /* We should start flushing pages gradually. */ - return((dirty_pct * 100) + return (ulint) ((dirty_pct * 100) / (srv_max_buf_pool_modified_pct + 1)); } @@ -2463,8 +2463,8 @@ af_get_pct_for_lsn( { lsn_t max_async_age; lsn_t lsn_age_factor; - lsn_t af_lwm = (srv_adaptive_flushing_lwm - * log_get_capacity()) / 100; + lsn_t af_lwm = (lsn_t) ((srv_adaptive_flushing_lwm + * log_get_capacity()) / 100); if (age < af_lwm) { /* No adaptive flushing. */ diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc index 38cd3177ade..3a5e98fcb32 100644 --- a/storage/xtradb/handler/ha_innodb.cc +++ b/storage/xtradb/handler/ha_innodb.cc @@ -18361,7 +18361,7 @@ innodb_defragment_frequency_update( { srv_defragment_frequency = (*static_cast<const uint*>(save)); srv_defragment_interval = ut_microseconds_to_timer( - 1000000.0 / srv_defragment_frequency); + (ulonglong) (1000000.0 / srv_defragment_frequency)); } /****************************************************************//** diff --git a/storage/xtradb/lock/lock0lock.cc b/storage/xtradb/lock/lock0lock.cc index 6d69f441019..4f7a60c1c7a 100644 --- a/storage/xtradb/lock/lock0lock.cc +++ b/storage/xtradb/lock/lock0lock.cc @@ -2409,7 +2409,7 @@ lock_rec_add_to_queue( if (wsrep_debug) { fprintf(stderr, "BF skipping wait: %lu\n", - trx->id); + (ulong) trx->id); lock_rec_print(stderr, lock); } } else @@ -4998,7 +4998,7 @@ lock_table_other_has_incompatible( #ifdef WITH_WSREP if(wsrep_thd_is_wsrep(trx->mysql_thd)) { if (wsrep_debug) { - fprintf(stderr, "WSREP: trx %ld table lock abort\n", + fprintf(stderr, "WSREP: trx " TRX_ID_FMT " table lock abort\n", trx->id); } trx_mutex_enter(lock->trx); diff --git a/storage/xtradb/log/log0crypt.cc b/storage/xtradb/log/log0crypt.cc index db2e84d7e45..f518845b1a8 100644 --- a/storage/xtradb/log/log0crypt.cc +++ b/storage/xtradb/log/log0crypt.cc @@ -144,11 +144,11 @@ log_crypt_print_checkpoint_keys( ib_uint64_t checkpoint_no = log_block_get_checkpoint_no(log_block); if (crypt_info.size()) { - fprintf(stderr, "InnoDB: redo log checkpoint: %lu [ chk key ]: ", checkpoint_no); + fprintf(stderr, "InnoDB: redo log checkpoint: %lu [ chk key ]: ", (ulong) checkpoint_no); for (size_t i = 0; i < crypt_info.size(); i++) { struct crypt_info_t* it = &crypt_info[i]; fprintf(stderr, "[ %lu %u ] ", - it->checkpoint_no, + (ulong) it->checkpoint_no, it->key_version); } fprintf(stderr, "\n"); diff --git a/storage/xtradb/os/os0file.cc b/storage/xtradb/os/os0file.cc index 2bb094e115d..7cb283dba75 100644 --- a/storage/xtradb/os/os0file.cc +++ b/storage/xtradb/os/os0file.cc @@ -6364,7 +6364,7 @@ os_file_trim( fprintf(stderr, " InnoDB: Warning: fallocate call failed with error code %d.\n" " InnoDB: start: %lu len: %lu payload: %lu\n" - " InnoDB: Disabling fallocate for now.\n", errno, off, trim_len, len); + " InnoDB: Disabling fallocate for now.\n", errno, (ulong) off, (ulong) trim_len, (ulong) len); os_file_handle_error_no_exit(slot->name, " fallocate(FALLOC_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE) ", diff --git a/storage/xtradb/row/row0merge.cc b/storage/xtradb/row/row0merge.cc index 1b1d2cb56e5..49dd12ae96f 100644 --- a/storage/xtradb/row/row0merge.cc +++ b/storage/xtradb/row/row0merge.cc @@ -109,9 +109,9 @@ row_merge_encrypt_buf( if (! ((rc == MY_AES_OK) && ((ulint)dstlen == srv_sort_buf_size-ROW_MERGE_RESERVE_SIZE))) { ib_logf(IB_LOG_LEVEL_FATAL, "Unable to encrypt data-block " - " src: %p srclen: %lu buf: %p buflen: %d." + " src: %p srclen: %lu buf: %p buflen: %u." " return-code: %d. Can't continue!\n", - input_buf, (size_t)srv_sort_buf_size, + input_buf, (ulong) srv_sort_buf_size, crypted_buf, dstlen, rc); ut_error; } @@ -153,7 +153,7 @@ row_merge_decrypt_buf( "Unable to encrypt data-block " " src: %p srclen: %lu buf: %p buflen: %d." " return-code: %d. Can't continue!\n", - input_buf, (size_t)srv_sort_buf_size, + input_buf, (ulong) srv_sort_buf_size, crypted_buf, dstlen, rc); ut_error; } @@ -2010,7 +2010,7 @@ write_buffers: pct_cost : ((pct_cost * read_rows) / table_total_rows); /* presenting 10.12% as 1012 integer */ - onlineddl_pct_progress = curr_progress * 100; + onlineddl_pct_progress = (ulint) (curr_progress * 100); } } @@ -2545,7 +2545,7 @@ row_merge_sort( /* Find the number N which 2^N is greater or equal than num_runs */ /* N is merge sort running count */ - total_merge_sort_count = ceil(my_log2f(num_runs)); + total_merge_sort_count = (ulint) ceil(my_log2f(num_runs)); if(total_merge_sort_count <= 0) { total_merge_sort_count=1; } @@ -2592,7 +2592,7 @@ row_merge_sort( pct_cost : ((pct_cost * merge_count) / total_merge_sort_count); /* presenting 10.12% as 1012 integer */; - onlineddl_pct_progress = (pct_progress + curr_progress) * 100; + onlineddl_pct_progress = (ulint) ((pct_progress + curr_progress) * 100); } if (error != DB_SUCCESS) { @@ -2875,7 +2875,7 @@ row_merge_insert_index_tuples( ((pct_cost * inserted_rows) / table_total_rows); /* presenting 10.12% as 1012 integer */; - onlineddl_pct_progress = (pct_progress + curr_progress) * 100; + onlineddl_pct_progress = (ulint) ((pct_progress + curr_progress) * 100); } } } diff --git a/strings/ctype-uca.c b/strings/ctype-uca.c index 0b279b620fd..c3a3d620be8 100644 --- a/strings/ctype-uca.c +++ b/strings/ctype-uca.c @@ -20448,7 +20448,7 @@ my_uca_scanner_contraction_find(my_uca_scanner *scanner, my_wc_t *wc) size_t clen= 1; int flag; const uchar *s, *beg[MY_UCA_MAX_CONTRACTION]; - memset(beg, 0, sizeof(beg)); + memset((void*) beg, 0, sizeof(beg)); /* Scan all contraction candidates */ for (s= scanner->sbeg, flag= MY_UCA_CNT_MID1; diff --git a/strings/my_vsnprintf.c b/strings/my_vsnprintf.c index 3cc7a4e7ea8..846803d9b24 100644 --- a/strings/my_vsnprintf.c +++ b/strings/my_vsnprintf.c @@ -495,7 +495,7 @@ start: char errmsg_buff[MYSYS_STRERROR_SIZE]; *to++= ' '; *to++= '"'; - my_strerror(errmsg_buff, sizeof(errmsg_buff), larg); + my_strerror(errmsg_buff, sizeof(errmsg_buff), (int) larg); to= process_str_arg(cs, to, real_end, width, errmsg_buff, print_arr[i].flags); if (real_end > to) *to++= '"'; @@ -675,7 +675,7 @@ size_t my_vsnprintf_ex(CHARSET_INFO *cs, char *to, size_t n, char errmsg_buff[MYSYS_STRERROR_SIZE]; *to++= ' '; *to++= '"'; - my_strerror(errmsg_buff, sizeof(errmsg_buff), larg); + my_strerror(errmsg_buff, sizeof(errmsg_buff), (int) larg); to= process_str_arg(cs, to, real_end, width, errmsg_buff, print_type); if (real_end > to) *to++= '"'; } diff --git a/support-files/ccfilter b/support-files/ccfilter index e2957cd3228..4e2c6f57836 100644 --- a/support-files/ccfilter +++ b/support-files/ccfilter @@ -7,14 +7,20 @@ # # Use by setting CC="ccfilter gcc" CXX="ccfilter gcc" before ./configure. # +# When testing from command line, you can run it as +# perl ccfilter cat logfile > /dev/null +# to see the errors that are not filtered +# # By default, just filters the output for suppressed warnings. If the # FAILONWARNING environment variable is set, then instead will fail the # compile on encountering a non-suppressed warnings. + use strict; use warnings; my $suppressions; +my $filter_stderr= $ARGV[0] ne "cat"; open STDOUT_COPY, ">&STDOUT" or die "Failed to dup stdout: $!]n"; @@ -27,11 +33,14 @@ if (!defined($pid)) { # Child. # actually want to send the STDERR to the parent, not the STDOUT. # So shuffle things around a bit. - open STDERR, ">&STDOUT" - or die "Child: Failed to dup pipe to parent: $!\n"; - open STDOUT, ">&STDOUT_COPY" - or die "Child: Failed to dup parent stdout: $!\n"; - close STDOUT_COPY; + if ($filter_stderr) + { + open STDERR, ">&STDOUT" + or die "Child: Failed to dup pipe to parent: $!\n"; + open STDOUT, ">&STDOUT_COPY" + or die "Child: Failed to dup parent stdout: $!\n"; + close STDOUT_COPY; + } exec { $ARGV[0] } @ARGV; die "Child: exec() failed: $!\n"; } else { @@ -41,9 +50,9 @@ if (!defined($pid)) { chomp($cwd); while (<PIPE>) { my $line= $_; - if (/^(.*?):([0-9]+): [Ww]arning: (.*)$/) { + if (/^(.*?):([0-9]+):(?:[0-9]+:)? [Ww]arning: (.*)$/) { my ($file, $lineno, $msg)= ($1, $2, $3); - $file= "$cwd/$file"; + $file= "$cwd/$file" if (length($file) > 0 && substr($file,0,1) ne "/"); next if check_if_suppressed($file, $lineno, $msg); @@ -52,8 +61,14 @@ if (!defined($pid)) { print STDERR $line; next; } - - print STDERR $line; + if ($filter_stderr) + { + print STDERR $line; + } + else + { + print STDOUT $line; + } } close(PIPE); } diff --git a/support-files/compiler_warnings.supp b/support-files/compiler_warnings.supp index 727c2f2818a..6b82d83a8fe 100644 --- a/support-files/compiler_warnings.supp +++ b/support-files/compiler_warnings.supp @@ -3,61 +3,61 @@ # be ignored for various reasons. # -integer.cpp: .*control reaches end of non-void function.*: 1288-1427 -integer.cpp: .*no return statement in function returning non-void.*: 1288-1427 -DictTabInfo.cpp : .*invalid access to non-static.* -DictTabInfo.cpp : .*macro was used incorrectly.* -DbdihMain.cpp : .*unused variable.* : 6666-7013 -DbtupExecQuery.cpp : .*unused variable.* : 1823 -kernel_types.h : .*only defines private constructors and has no friends.* : 51 -Dbtup.hpp: .*only defines private constructors and has no friends.* -diskpage.hpp: .*only defines private constructors and has no friends.* -tuppage.hpp: .*only defines private constructors and has no friends.* -sql_yacc.cc : .*label 'yyerrlab1' defined but not used.* -kernel_types.h : .*'struct Local_key' only defines private constructors and has no friends.* -lgman.hpp : .*'struct Lgman::Buffer_idx' only defines private constructors and has no friends.* -SchemaFile.hpp : .*'struct SchemaFile::TableEntry' only defines private constructors and has no friends.* -sql_yacc.cc : .*switch statement contains 'default' but no 'case' labels.* +.*/integer.cpp: .*control reaches end of non-void function.*: 1288-1427 +.*/integer.cpp: .*no return statement in function returning non-void.*: 1288-1427 +.*/DictTabInfo.cpp : .*invalid access to non-static.* +.*/DictTabInfo.cpp : .*macro was used incorrectly.* +.*/DbdihMain.cpp : .*unused variable.* : 6666-7013 +.*/DbtupExecQuery.cpp : .*unused variable.* : 1823 +.*/kernel_types.h : .*only defines private constructors and has no friends.* : 51 +.*/Dbtup.hpp: .*only defines private constructors and has no friends.* +.*/diskpage.hpp: .*only defines private constructors and has no friends.* +.*/tuppage.hpp: .*only defines private constructors and has no friends.* +.*/sql_yacc.cc : .*label 'yyerrlab1' defined but not used.* +.*/kernel_types.h : .*'struct Local_key' only defines private constructors and has no friends.* +.*/lgman.hpp : .*'struct Lgman::Buffer_idx' only defines private constructors and has no friends.* +.*/SchemaFile.hpp : .*'struct SchemaFile::TableEntry' only defines private constructors and has no friends.* +.*/sql_yacc.cc : .*switch statement contains 'default' but no 'case' labels.* # # Things that can be ignored in InnoDB # -pars0grm.tab.c: .*'yyerrorlab' : unreferenced label.* -pars0grm.c: 'yyerrorlab' : unreferenced label -_flex_tmp.c: .*not enough actual parameters for macro 'yywrap'.* -lexyy.c : not enough actual parameters for macro 'yywrap' -pars0lex.l: .*conversion from 'ulint' to 'int', possible loss of data.* -include/buf0buf\.ic: unused parameter .*mtr.* -fil/fil0fil\.c: pointer targets in passing argument.*differ in signedness -fil/fil0fil\.c: comparison between signed and unsigned : 3100-3199 -fil/fil0fil\.c: unused parameter -log/log0recv\.c: unused variable -os/os0file\.c: unused parameter -os/os0file\.c: pointer targets in assignment differ in signedness -handler/i_s\.cc: unused variable -sync/sync0rw\.c: unused parameter -sync/sync0sync\.c: unused parameter -sync/sync0sync\.c: unused variable -ut/ut0ut\.c: ignoring return value of -srv/srv0srv\.c: value computed is not used -buf/buf0buf\.c: .*block_mutex.* might be used uninitialized -btr/btr0cur\.c: null argument where non-null required: 1800-3000 -btr/btr0btr\.c: null argument where non-null required -btr/btr0cur\.c: .*value computed is not used.*: 3175-3375 -btr/btr0sea\.c: passing argument 2 .* discards qualifiers from pointer target type -ibuf/ibuf0ibuf.c: null argument where non-null required: 700-1000 -fsp0fsp\.c: result of 32-bit shift implicitly converted to 64 bits -log/log0log\.c : passing arg 1 of `atomic_add_64_nv' from incompatible pointer type -log/log0online\.c : passing arg 1 of `atomic_add_64_nv' from incompatible pointer type -buf/buf0buf\.c : label.*loop2.* defined but not used +.*/pars0grm.tab.c: .*'yyerrorlab' : unreferenced label.* +.*/pars0grm.c: 'yyerrorlab' : unreferenced label +.*/_flex_tmp.c: .*not enough actual parameters for macro 'yywrap'.* +.*/lexyy.c : not enough actual parameters for macro 'yywrap' +.*/pars0lex.l: .*conversion from 'ulint' to 'int', possible loss of data.* +.*/include/buf0buf\.ic: unused parameter .*mtr.* +.*/fil/fil0fil\.c: pointer targets in passing argument.*differ in signedness +.*/fil/fil0fil\.c: comparison between signed and unsigned : 3100-3199 +.*/fil/fil0fil\.c: unused parameter +.*/log/log0recv\.c: unused variable +.*/os/os0file\.c: unused parameter +.*/os/os0file\.c: pointer targets in assignment differ in signedness +.*/handler/i_s\.cc: unused variable +.*/sync/sync0rw\.c: unused parameter +.*/sync/sync0sync\.c: unused parameter +.*/sync/sync0sync\.c: unused variable +.*/ut/ut0ut\.c: ignoring return value of +.*/srv/srv0srv\.c: value computed is not used +.*/buf/buf0buf\.c: .*block_mutex.* might be used uninitialized +.*/btr/btr0cur\.c: null argument where non-null required: 1800-3000 +.*/btr/btr0btr\.c: null argument where non-null required +.*/btr/btr0cur\.c: .*value computed is not used.*: 3175-3375 +.*/btr/btr0sea\.c: passing argument 2 .* discards qualifiers from pointer target type +.*/ibuf/ibuf0ibuf.c: null argument where non-null required: 700-1000 +.*/fsp0fsp\.c: result of 32-bit shift implicitly converted to 64 bits +.*/log/log0log\.c : passing arg 1 of `atomic_add_64_nv' from incompatible pointer type +.*/log/log0online\.c : passing arg 1 of `atomic_add_64_nv' from incompatible pointer type +.*/buf/buf0buf\.c : label.*loop2.* defined but not used # # Xtradb engine # -storage/xtradb/handler/ha_innodb\.cc: ignoring return value of -storage/xtradb/row/row0log\.cc: ignoring return value of -storage/xtradb/btr/btr0cur\.cc : null argument where non-null required -storage/xtradb/btr/btr0scrub\.cc : null argument where non-null required +.*/storage/xtradb/handler/ha_innodb\.cc: ignoring return value of +.*/storage/xtradb/row/row0log\.cc: ignoring return value of +.*/storage/xtradb/btr/btr0cur\.cc : null argument where non-null required +.*/storage/xtradb/btr/btr0scrub\.cc : null argument where non-null required # # bdb is not critical to keep up to date @@ -66,29 +66,29 @@ storage/xtradb/btr/btr0scrub\.cc : null argument where non-null required .*/bdb/.* : .*unused parameter.* .*/bdb/.* : .*may be used uninitialized.* .*/bdb/.* : .*empty body in an if-statement.* -db_vrfy.c : .*comparison is always false due to limited range of data type.* +.*/db_vrfy.c : .*comparison is always false due to limited range of data type.* # # readline is not maintained by us # .*/cmd-line-utils/readline/.* : .* -readline\.c : unused parameter -term\.c : unused parameter -vi\.c : unused parameter -common\.c : unused parameter -term\.c : .* +.*/readline\.c : unused parameter +.*/term\.c : unused parameter +.*/vi\.c : unused parameter +.*/common\.c : unused parameter +.*/term\.c : .* # # Ignore some warnings in libevent, which is not maintained by us. # .*/extra/libevent/.* : .*unused parameter.* .*/extra/libevent/select\.c : .*comparison between signed and unsigned.* : 270-280 -signal\.c : .*unused parameter.* +.*/signal\.c : .*unused parameter.* # # Ignore warnings from system libraries # -/usr/share/aclocal/audiofile.m4 : .* +.*/aclocal/audiofile.m4 : .* # # Ignore strict-aliasing warnings (for now) @@ -131,30 +131,30 @@ signal\.c : .*unused parameter.* # # Aria warning that is ok in debug builds # -storage/maria/ma_pagecache.c: .*'info_check_pin' defined but not used +.*/storage/maria/ma_pagecache.c: .*'info_check_pin' defined but not used # # oqgraph errors that are hard to fix # -oqgraph/graphcore\.cc : may be used uninitialized in this function +.*/oqgraph/graphcore\.cc : may be used uninitialized in this function # # Yassl # -include/runtime.hpp: .*pure_error.* +.*/include/runtime.hpp: .*pure_error.* .*/extra/yassl/.*taocrypt/.*: comparison with string literal .*/extra/yassl/taocrypt/src/blowfish\.cpp: array subscript is above array bounds .*/extra/yassl/taocrypt/src/file\.cpp: ignoring return value .*/extra/yassl/taocrypt/src/integer\.cpp: control reaches end of non-void function -mySTL/algorithm\.hpp: is used uninitialized in this function -include/pwdbased\.hpp: comparison of unsigned expression +.*/mySTL/algorithm\.hpp: is used uninitialized in this function +.*/include/pwdbased\.hpp: comparison of unsigned expression # # OpenSSL # # The following comes because of different prototype between yassl and openssl. # Save as the argument is a function withing the library. -vio/viosslfactories\.c: discards ~const~ qualifier from pointer target type +.*/vio/viosslfactories\.c: discards ~const~ qualifier from pointer target type # # Groff warnings on OpenSUSE. @@ -166,88 +166,105 @@ vio/viosslfactories\.c: discards ~const~ qualifier from pointer target type # Warnings on OpenSolaris # .*/my_config\.h : _FILE_OFFSET_BITS -/usr/include/sys/feature_tests.h : this is the location of the previous definition -.*auth_pam\.c : initialization from incompatible pointer type : 100-200 +.*/include/sys/feature_tests.h : this is the location of the previous definition +.*/auth_pam\.c : initialization from incompatible pointer type : 100-200 +.*/mysys/my_lock\.c : incompatible pointer # # jemalloc # -jemalloc/src/jemalloc\.c: always_inline function might not be inlinable -jemalloc/src/jemalloc\.c: set but not used +.*/jemalloc/src/jemalloc\.c: always_inline function might not be inlinable +.*/jemalloc/src/jemalloc\.c: set but not used # # Connect engine # -storage/connect/ha_connect\.cc: might be clobbered by.*longjmp -storage/connect/connect\.cc: might be clobbered by.*longjmp -storage/connect/filamvct\.cpp: ignoring return value of -storage/connect/filamvct\.cpp: might be clobbered by -storage/connect/xindex\.cpp: ignoring return value of -storage/connect/value\.cpp: always false -storage/connect/json\.cpp: might be clobbered by +.*/storage/connect/ha_connect\.cc: might be clobbered by.*longjmp +.*/storage/connect/connect\.cc: might be clobbered by.*longjmp +.*/storage/connect/filamvct\.cpp: ignoring return value of +.*/storage/connect/filamvct\.cpp: might be clobbered by +.*/storage/connect/xindex\.cpp: ignoring return value of +.*/storage/connect/value\.cpp: always false : 1000-1020 +.*/storage/connect/json\.cpp: might be clobbered by # # mroonga # -groonga/lib/expr\.c: propagation disabled -groonga/lib/expr\.c: PRE disabled -groonga/lib/expr\.c: always false +.*/groonga/lib/expr\.c : GCSE disabled +.*/groonga/lib/expr\.c : NULL pointer checks disabled +.*/groonga/lib/expr\.c : PRE disabled +.*/groonga/lib/expr\.c : always false +.*/groonga/lib/expr\.c : jump bypassing disabled +.*/groonga/lib/expr\.c : propagation disabled +.*/groonga/lib/nfkc\.c : GCSE disabled +.*/groonga/lib/nfkc\.c : NULL pointer checks disabled +.*/groonga/lib/nfkc\.c : jump bypassing disabled +.*/groonga/lib/str\.c : comparing floating point +.*/groonga/lib/db\.c : missing initializer +.*/groonga/lib/ii\.c : missing initializer +.*/groonga/lib/normalizer\.c : missing initializer +.*/groonga/lib/proc\.c : missing initializer +.*/groonga/lib/tokenizer\.c : missing initializer # -# Mroonga +# TokuDB # -groonga/lib/expr\.c : const/copy propagation disabled + +# This one is marked with __attribute__, but we still get a (wrong) warning +.*/liblzma/lz/lz_encoder\.c : variable.*in_used.*set but not used # # Unexplanable (?) stuff # -listener\.cc : .*conversion from 'SOCKET' to 'int'.* -net_serv\.cc : .*conversion from 'SOCKET' to 'int'.* +.*/listener\.cc : .*conversion from 'SOCKET' to 'int'.* +.*/net_serv\.cc : .*conversion from 'SOCKET' to 'int'.* # # Ignorable warnings from header files # -backward_warning\.h : This file includes at least one +.*/backward_warning\.h : This file includes at least one /usr/include/i386-linux-gnu/bits/string3\.h: memset used with constant zero length parameter -bits/string3.h : might overflow destination buffer +.*/bits/string3.h : might overflow destination buffer # allow a little moving space for the warning below -mi_packrec\.c : .*result of 32-bit shift implicitly converted to 64 bits.* : 560-600 -ma_packrec\.c : .*result of 32-bit shift implicitly converted to 64 bits.* : 550-650 +.*/mi_packrec\.c : .*result of 32-bit shift implicitly converted to 64 bits.* : 560-600 +.*/ma_packrec\.c : .*result of 32-bit shift implicitly converted to 64 bits.* : 550-650 # # Wrong compiler warnings # .* : .*no matching operator delete found; memory will not be freed if initialization throws an exception.* -ctype-simple\.c : .*unary minus operator applied to unsigned type, result still unsigned.* -sql/sys_vars\.cc : invalid access to non-static data member -string3\.h : memset used with constant zero length parameter +.*/ctype-simple\.c : .*unary minus operator applied to unsigned type, result still unsigned.* +.*/sql/sys_vars\.cc : invalid access to non-static data member +.*/string3\.h : memset used with constant zero length parameter +.*/sql/wsrep_hton\.cc : NULL used in arithmetic : 500-600 +.* : missing-declarations.*is valid # # Ignorable errors on mac # -my_aes\.c: deprecated -my_sha1\.cc: deprecated -my_md5\.cc: deprecated -my_rnd\.cc: deprecated -mdl\.cc: invalid access -mdl\.cc: offsetoff +.*/my_aes\.c: deprecated +.*/my_sha1\.cc: deprecated +.*/my_md5\.cc: deprecated +.*/my_rnd\.cc: deprecated +.*/mdl\.cc: invalid access +.*/mdl\.cc: offsetoff # Wrong warning due to GCC bug: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29478 -regexec\.c : passing argument 3 of.*matcher.* discards qualifiers from pointer target type -libmysql\.c: passing argument 2 of .*memcpy.* discards qualifiers from pointer target type : 3000-4000 -storage/.*/dict/dict0dict\.c : passing argument 1 of .*strcpy.* discards qualifiers from pointer target type : 2500-3500 -storage/.*/sync/sync0rw\.c : passing argument 1 of .*memset.* discards qualifiers from pointer target type : 200-300 -storage/.*/btr/btr0sea\.c : passing argument 2 of .*btr_cur_position.* discards qualifiers from pointer +.*/regexec\.c : passing argument 3 of.*matcher.* discards qualifiers from pointer target type +.*/libmysql\.c: passing argument 2 of .*memcpy.* discards qualifiers from pointer target type : 3000-4000 +.*/storage/.*/dict/dict0dict\.c : passing argument 1 of .*strcpy.* discards qualifiers from pointer target type : 2500-3500 +.*/storage/.*/sync/sync0rw\.c : passing argument 1 of .*memset.* discards qualifiers from pointer target type : 200-300 +.*/storage/.*/btr/btr0sea\.c : passing argument 2 of .*btr_cur_position.* discards qualifiers from pointer # Fixed wrong warning in GCC due to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61520 - -strings/decimal.c: array subscript is below array bounds +.*/strings/decimal\.c : array subscript is .* array bounds # # Strange things from autoconf that is probably safe to ignore # -configure.in : warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body -configure.in : config/ac-macros/character_sets.m4.*prefer named diversions -warning: File listed twice +.*configure.in : warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body +.*configure.in : config/ac-macros/character_sets.m4.*prefer named diversions warning: File listed twice +.*/include/mysql/client_plugin\.h : _mysql_client_plugin_declaration_ +.*/plugin/auth_gssapi/client_plugin\.cc: _mysql_client_plugin_declaration_ diff --git a/unittest/sql/mf_iocache-t.cc b/unittest/sql/mf_iocache-t.cc index e0c8c98f4e9..8bbe4db53cf 100644 --- a/unittest/sql/mf_iocache-t.cc +++ b/unittest/sql/mf_iocache-t.cc @@ -93,7 +93,7 @@ IO_CACHE info; #define CACHE_SIZE 16384 #define INFO_TAIL ", pos_in_file = %llu, pos_in_mem = %lu", \ - info.pos_in_file, (*info.current_pos - info.request_pos) + info.pos_in_file, (ulong) (*info.current_pos - info.request_pos) #define FILL 0x5A |