[Commits] 7ef6793: MDEV-6650 - LINT_INIT emits code in non-debug builds

svoj at mariadb.org svoj at mariadb.org
Tue Feb 10 12:07:17 EET 2015


revision-id: 7ef679355dfe07eba88964e78a3303e6eddd618c
parent(s): f13939061d468a47985dee0268652a6fe2db7862
committer: Sergey Vojtovich
branch nick: 10.1
timestamp: 2015-02-10 14:05:49 +0400
message:

MDEV-6650 - LINT_INIT emits code in non-debug builds

Replaced all references to LINT_INIT with UNINIT_VAR and LINT_INIT_STRUCT.
Removed LINT_INIT macro.

---
 BUILD/SETUP.sh                     |  4 ++--
 client/mysql.cc                    | 12 ++++--------
 client/mysqltest.cc                |  6 ++----
 client/readline.cc                 |  3 +--
 include/my_global.h                | 13 -------------
 libmysql/libmysql.c                |  3 +--
 mysys/stacktrace.c                 |  3 +--
 plugin/semisync/semisync_master.cc |  2 --
 sql-common/client.c                |  3 +--
 sql/create_options.cc              |  3 +--
 sql/debug_sync.cc                  |  3 +--
 sql/derror.cc                      |  4 +---
 sql/event_db_repository.cc         |  4 +---
 sql/handler.cc                     |  3 +--
 sql/item_cmpfunc.cc                |  3 +--
 sql/item_strfunc.cc                |  9 +++------
 sql/key.cc                         | 18 +++++-------------
 sql/log.cc                         | 18 ++++++------------
 sql/log_event.cc                   |  9 +++------
 sql/multi_range_read.cc            |  3 +--
 sql/mysqld.cc                      | 12 ++++--------
 sql/opt_range.cc                   |  4 ++--
 sql/opt_subselect.cc               |  3 +--
 sql/partition_info.cc              |  3 +--
 sql/slave.cc                       |  3 +--
 sql/sp_head.cc                     |  4 +---
 sql/sql_base.cc                    |  8 ++------
 sql/sql_insert.cc                  |  3 +--
 sql/sql_lex.cc                     |  3 +--
 sql/sql_parse.cc                   |  3 +--
 sql/sql_select.cc                  | 12 ++++--------
 sql/sql_select.h                   |  2 +-
 sql/sql_statistics.cc              |  2 +-
 sql/sql_time.cc                    |  3 +--
 sql/table.cc                       |  6 ++----
 sql/tztime.cc                      |  4 +---
 storage/maria/ma_bitmap.c          |  3 +--
 storage/maria/ma_check.c           |  2 --
 storage/maria/ma_dynrec.c          |  3 +--
 storage/maria/ma_ft_nlq_search.c   |  2 --
 storage/maria/ma_open.c            |  3 +--
 storage/maria/ma_pagecache.c       |  3 +--
 storage/maria/ma_range.c           |  3 +--
 storage/maria/ma_rt_index.c        | 12 +++---------
 storage/maria/ma_search.c          |  4 +---
 storage/maria/ma_sort.c            |  8 ++------
 storage/maria/ma_update.c          |  6 ++----
 storage/maria/ma_write.c           |  3 +--
 storage/myisam/mi_check.c          |  1 -
 storage/myisam/mi_delete.c         |  1 -
 storage/myisam/mi_open.c           |  1 -
 storage/myisam/mi_packrec.c        |  1 -
 storage/myisam/mi_search.c         |  3 +--
 storage/myisam/mi_write.c          |  7 ++-----
 storage/myisam/rt_index.c          |  7 ++-----
 storage/myisam/sort.c              |  9 ++-------
 storage/myisammrg/myrg_open.c      |  1 -
 storage/tokudb/ha_tokudb.cc        |  3 +--
 strings/ctype-utf8.c               | 14 ++++----------
 59 files changed, 87 insertions(+), 214 deletions(-)

diff --git a/BUILD/SETUP.sh b/BUILD/SETUP.sh
index a0fddfb..8948cf2 100755
--- a/BUILD/SETUP.sh
+++ b/BUILD/SETUP.sh
@@ -157,8 +157,8 @@ fi
 # Set flags for various build configurations.
 # Used in -valgrind builds
 # Override -DFORCE_INIT_OF_VARS from debug_cflags. It enables the macro
-# LINT_INIT(), which is only useful for silencing spurious warnings
-# of static analysis tools. We want LINT_INIT() to be a no-op in Valgrind.
+# UNINIT_VAR(), which is only useful for silencing spurious warnings
+# of static analysis tools. We want UNINIT_VAR() to be a no-op in Valgrind.
 valgrind_flags="-DHAVE_valgrind -USAFEMALLOC"
 valgrind_flags="$valgrind_flags -UFORCE_INIT_OF_VARS -Wno-uninitialized"
 valgrind_flags="$valgrind_flags -DMYSQL_SERVER_SUFFIX=-valgrind-max"
diff --git a/client/mysql.cc b/client/mysql.cc
index b299ab9..92324c6 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -3040,9 +3040,7 @@ static int com_server_help(String *buffer __attribute__((unused)),
       init_pager();
       char last_char= 0;
 
-      int num_name= 0, num_cat= 0;
-      LINT_INIT(num_name);
-      LINT_INIT(num_cat);
+      int UNINIT_VAR(num_name), UNINIT_VAR(num_cat);
 
       if (num_fields == 2)
       {
@@ -3179,7 +3177,7 @@ static int com_server_help(String *buffer __attribute__((unused)),
   }
 
   /* Remove garbage for nicer messages */
-  LINT_INIT(buff[0]);
+  LINT_INIT_STRUCT(buff[0]);
   remove_cntrl(*buffer);
 
   if (buffer->is_empty())
@@ -4698,8 +4696,7 @@ char *mysql_authentication_dialog_ask(MYSQL *mysql, int type,
   const char *status_str;
   char buff[40];
   ulonglong id;
-  MYSQL_RES *result;
-  LINT_INIT(result);
+  MYSQL_RES *UNINIT_VAR(result);
 
   if (mysql_real_query_for_lazy(
         C_STRING_WITH_LEN("select DATABASE(), USER() limit 1")))
@@ -5258,8 +5255,7 @@ static void init_username()
   my_free(full_username);
   my_free(part_username);
 
-  MYSQL_RES *result;
-  LINT_INIT(result);
+  MYSQL_RES *UNINIT_VAR(result);
   if (!mysql_query(&mysql,"select USER()") &&
       (result=mysql_use_result(&mysql)))
   {
diff --git a/client/mysqltest.cc b/client/mysqltest.cc
index 5118b02..5a54c67 100644
--- a/client/mysqltest.cc
+++ b/client/mysqltest.cc
@@ -2617,12 +2617,11 @@ void var_query_set(VAR *var, const char *query, const char** query_end)
 {
   char *end = (char*)((query_end && *query_end) ?
 		      *query_end : query + strlen(query));
-  MYSQL_RES *res;
+  MYSQL_RES *UNINIT_VAR(res);
   MYSQL_ROW row;
   MYSQL* mysql = cur_con->mysql;
   DYNAMIC_STRING ds_query;
   DBUG_ENTER("var_query_set");
-  LINT_INIT(res);
 
   if (!mysql)
   {
@@ -2801,7 +2800,7 @@ void var_set_query_get_value(struct st_command *command, VAR *var)
 {
   long row_no;
   int col_no= -1;
-  MYSQL_RES* res;
+  MYSQL_RES* UNINIT_VAR(res);
   MYSQL* mysql= cur_con->mysql;
 
   static DYNAMIC_STRING ds_query;
@@ -2814,7 +2813,6 @@ void var_set_query_get_value(struct st_command *command, VAR *var)
   };
 
   DBUG_ENTER("var_set_query_get_value");
-  LINT_INIT(res);
 
   if (!mysql)
   {
diff --git a/client/readline.cc b/client/readline.cc
index b6643b8..23b1f8d 100644
--- a/client/readline.cc
+++ b/client/readline.cc
@@ -57,8 +57,7 @@ LINE_BUFFER *batch_readline_init(ulong max_size,FILE *file)
 char *batch_readline(LINE_BUFFER *line_buff, bool binary_mode)
 {
   char *pos;
-  ulong out_length;
-  LINT_INIT(out_length);
+  ulong UNINIT_VAR(out_length);
 
   if (!(pos=intern_read_line(line_buff, &out_length)))
     return 0;
diff --git a/include/my_global.h b/include/my_global.h
index 4a1cc8c..e026f8a 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -457,19 +457,6 @@
 #define STDERR_FILENO 2
 #endif
 
-/*
-  Deprecated workaround for false-positive uninitialized variables
-  warnings. Those should be silenced using tool-specific heuristics.
-
-  Enabled by default for g++ due to the bug referenced below.
-*/
-#if defined(_lint) || defined(FORCE_INIT_OF_VARS) || \
-    (defined(__GNUC__) && defined(__cplusplus))
-#define LINT_INIT(var) var= 0
-#else
-#define LINT_INIT(var)
-#endif
-
 #ifndef SO_EXT
 #ifdef _WIN32
 #define SO_EXT ".dll"
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c
index a0bfe4e..8f444c9 100644
--- a/libmysql/libmysql.c
+++ b/libmysql/libmysql.c
@@ -859,12 +859,11 @@ MYSQL_FIELD *cli_list_fields(MYSQL *mysql)
 MYSQL_RES * STDCALL
 mysql_list_processes(MYSQL *mysql)
 {
-  MYSQL_DATA *fields;
+  MYSQL_DATA *UNINIT_VAR(fields);
   uint field_count;
   uchar *pos;
   DBUG_ENTER("mysql_list_processes");
 
-  LINT_INIT(fields);
   if (simple_command(mysql,COM_PROCESS_INFO,0,0,0))
     DBUG_RETURN(0);
   free_old_query(mysql);
diff --git a/mysys/stacktrace.c b/mysys/stacktrace.c
index 613911e..4cc767f 100644
--- a/mysys/stacktrace.c
+++ b/mysys/stacktrace.c
@@ -315,12 +315,11 @@ inline uint32* find_prev_pc(uint32* pc, uchar** fp)
 
 void my_print_stacktrace(uchar* stack_bottom, ulong thread_stack)
 {
-  uchar** fp;
+  uchar** UNINIT_VAR(fp);
   uint frame_count = 0, sigreturn_frame_count;
 #if defined(__alpha__) && defined(__GNUC__)
   uint32* pc;
 #endif
-  LINT_INIT(fp);
 
 
 #ifdef __i386__
diff --git a/plugin/semisync/semisync_master.cc b/plugin/semisync/semisync_master.cc
index 55f8105..c88c162 100644
--- a/plugin/semisync/semisync_master.cc
+++ b/plugin/semisync/semisync_master.cc
@@ -1050,8 +1050,6 @@ int ReplSemiSyncMaster::readSlaveReply(NET *net, uint32 server_id,
   ulong trc_level = trace_level_;
   LINT_INIT_STRUCT(start_ts);
 
-  LINT_INIT_STRUCT(start_ts);
-
   function_enter(kWho);
 
   assert((unsigned char)event_buf[1] == kPacketMagicNum);
diff --git a/sql-common/client.c b/sql-common/client.c
index e53a125..782daf2 100644
--- a/sql-common/client.c
+++ b/sql-common/client.c
@@ -3211,7 +3211,7 @@ int run_plugin_auth(MYSQL *mysql, char *data, uint data_len,
 		       uint port, const char *unix_socket,ulong client_flag)
 {
   char		buff[NAME_LEN+USERNAME_LENGTH+100];
-  int           scramble_data_len, pkt_scramble_len= 0;
+  int           scramble_data_len, UNINIT_VAR(pkt_scramble_len);
   char          *end,*host_info= 0, *server_version_end, *pkt_end;
   char          *scramble_data;
   const char    *scramble_plugin;
@@ -3224,7 +3224,6 @@ int run_plugin_auth(MYSQL *mysql, char *data, uint data_len,
   struct	sockaddr_un UNIXaddr;
 #endif
   DBUG_ENTER("mysql_real_connect");
-  LINT_INIT(pkt_scramble_len);
 
   DBUG_PRINT("enter",("host: %s  db: %s  user: %s (client)",
 		      host ? host : "(Null)",
diff --git a/sql/create_options.cc b/sql/create_options.cc
index 5800003..86fb805 100644
--- a/sql/create_options.cc
+++ b/sql/create_options.cc
@@ -762,9 +762,8 @@ engine_option_value *merge_engine_table_options(engine_option_value *first,
                                                 engine_option_value *second,
                                                 MEM_ROOT *root)
 {
-  engine_option_value *end, *opt;
+  engine_option_value *UNINIT_VAR(end), *opt;
   DBUG_ENTER("merge_engine_table_options");
-  LINT_INIT(end);
 
   /* Create copy of first list */
   for (opt= first, first= 0; opt; opt= opt->next)
diff --git a/sql/debug_sync.cc b/sql/debug_sync.cc
index 5802d72..2ace83c 100644
--- a/sql/debug_sync.cc
+++ b/sql/debug_sync.cc
@@ -1348,8 +1348,7 @@ static void debug_sync_execute(THD *thd, st_debug_sync_action *action)
 
   if (action->execute)
   {
-    const char  *old_proc_info;
-    LINT_INIT(old_proc_info);
+    const char  *UNINIT_VAR(old_proc_info);
 
     action->execute--;
 
diff --git a/sql/derror.cc b/sql/derror.cc
index f19f732..7ac0683 100644
--- a/sql/derror.cc
+++ b/sql/derror.cc
@@ -152,13 +152,11 @@ bool read_texts(const char *file_name, const char *language,
   File file;
   char name[FN_REFLEN];
   char lang_path[FN_REFLEN];
-  uchar *buff;
+  uchar *UNINIT_VAR(buff);
   uchar head[32],*pos;
   DBUG_ENTER("read_texts");
 
   *point= 0;
-
-  LINT_INIT(buff);
   funktpos=0;
   convert_dirname(lang_path, language, NullS);
   (void) my_load_path(lang_path, lang_path, lc_messages_dir);
diff --git a/sql/event_db_repository.cc b/sql/event_db_repository.cc
index 30dffc3..87ed9b4 100644
--- a/sql/event_db_repository.cc
+++ b/sql/event_db_repository.cc
@@ -414,9 +414,7 @@ class Event_db_intact : public Table_check_intact
   CHARSET_INFO *scs= system_charset_info;
   KEY *key_info;
   uint key_len;
-  uchar *key_buf= NULL;
-  LINT_INIT(key_buf);
-
+  uchar *key_buf;
   DBUG_ENTER("Event_db_repository::index_read_for_db_for_i_s");
 
   DBUG_PRINT("info", ("Using prefix scanning on PK"));
diff --git a/sql/handler.cc b/sql/handler.cc
index 41e6860..5f3b8e1 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -5412,8 +5412,7 @@ int handler::index_read_idx_map(uchar * buf, uint index, const uchar * key,
                                 key_part_map keypart_map,
                                 enum ha_rkey_function find_flag)
 {
-  int error, error1;
-  LINT_INIT(error1);
+  int error, UNINIT_VAR(error1);
 
   error= ha_index_init(index, 0);
   if (!error)
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index 110797b..f2afeee 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -470,8 +470,7 @@ static bool convert_const_to_int(THD *thd, Item_field *field_item,
     my_bitmap_map *old_maps[2];
     ulonglong UNINIT_VAR(orig_field_val); /* original field value if valid */
 
-    LINT_INIT(old_maps[0]);
-    LINT_INIT(old_maps[1]);
+    LINT_INIT_STRUCT(old_maps);
 
     /* table->read_set may not be set if we come here from a CREATE TABLE */
     if (table && table->read_set)
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index 25d5613..c1a9d07 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -1948,8 +1948,7 @@ String *Item_func_ltrim::val_str(String *str)
   char buff[MAX_FIELD_WIDTH], *ptr, *end;
   String tmp(buff,sizeof(buff),system_charset_info);
   String *res, *remove_str;
-  uint remove_length;
-  LINT_INIT(remove_length);
+  uint UNINIT_VAR(remove_length);
 
   res= args[0]->val_str(str);
   if ((null_value=args[0]->null_value))
@@ -1994,8 +1993,7 @@ String *Item_func_rtrim::val_str(String *str)
   char buff[MAX_FIELD_WIDTH], *ptr, *end;
   String tmp(buff, sizeof(buff), system_charset_info);
   String *res, *remove_str;
-  uint remove_length;
-  LINT_INIT(remove_length);
+  uint UNINIT_VAR(remove_length);
 
   res= args[0]->val_str(str);
   if ((null_value=args[0]->null_value))
@@ -2075,8 +2073,7 @@ String *Item_func_trim::val_str(String *str)
   const char *r_ptr;
   String tmp(buff, sizeof(buff), system_charset_info);
   String *res, *remove_str;
-  uint remove_length;
-  LINT_INIT(remove_length);
+  uint UNINIT_VAR(remove_length);
 
   res= args[0]->val_str(str);
   if ((null_value=args[0]->null_value))
diff --git a/sql/key.cc b/sql/key.cc
index e3787ea..aaecbda 100644
--- a/sql/key.cc
+++ b/sql/key.cc
@@ -656,9 +656,8 @@ int key_tuple_cmp(KEY_PART_INFO *part, uchar *key1, uchar *key2,
                   uint tuple_length)
 {
   uchar *key1_end= key1 + tuple_length;
-  int len;
+  int UNINIT_VAR(len);
   int res;
-  LINT_INIT(len);
   for (;key1 < key1_end; key1 += len, key2 += len, part++)
   {
     len= part->store_length;
@@ -709,12 +708,9 @@ ulong key_hashnr(KEY *key_info, uint used_key_parts, const uchar *key)
   for (; key_part < end_key_part; key_part++)
   {
     uchar *pos= (uchar*)key;
-    CHARSET_INFO *cs;
-    uint length, pack_length;
+    CHARSET_INFO *UNINIT_VAR(cs);
+    uint UNINIT_VAR(length), UNINIT_VAR(pack_length);
     bool is_string= TRUE;
-    LINT_INIT(cs);
-    LINT_INIT(length);
-    LINT_INIT(pack_length);
 
     key+= key_part->length;
     if (key_part->null_bit)
@@ -816,13 +812,9 @@ bool key_buf_cmp(KEY *key_info, uint used_key_parts,
   {
     uchar *pos1= (uchar*)key1;
     uchar *pos2= (uchar*)key2;
-    CHARSET_INFO *cs;
-    uint length1, length2, pack_length;
+    CHARSET_INFO *UNINIT_VAR(cs);
+    uint UNINIT_VAR(length1), UNINIT_VAR(length2), UNINIT_VAR(pack_length);
     bool is_string= TRUE;
-    LINT_INIT(cs);
-    LINT_INIT(length1);
-    LINT_INIT(length2);
-    LINT_INIT(pack_length);
 
     key1+= key_part->length;
     key2+= key_part->length;
diff --git a/sql/log.cc b/sql/log.cc
index 0eb4754..5a36366 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -1502,8 +1502,7 @@ bool LOGGER::activate_log_handler(THD* thd, uint log_type)
 void LOGGER::deactivate_log_handler(THD *thd, uint log_type)
 {
   my_bool *tmp_opt= 0;
-  MYSQL_LOG *file_log;
-  LINT_INIT(file_log);
+  MYSQL_LOG *UNINIT_VAR(file_log);
 
   switch (log_type) {
   case QUERY_LOG_SLOW:
@@ -4878,8 +4877,7 @@ int MYSQL_BIN_LOG::new_file_impl(bool need_lock)
   char new_name[FN_REFLEN], *new_name_ptr, *old_name, *file_to_open;
   uint close_flag;
   bool delay_close= false;
-  File old_file;
-  LINT_INIT(old_file);
+  File UNINIT_VAR(old_file);
 
   DBUG_ENTER("MYSQL_BIN_LOG::new_file_impl");
   if (!is_open())
@@ -5852,9 +5850,8 @@ bool MYSQL_BIN_LOG::write(Log_event *event_info, my_bool *with_annotate)
   bool is_trans_cache= FALSE;
   bool using_trans= event_info->use_trans_cache();
   bool direct= event_info->use_direct_logging();
-  ulong prev_binlog_id;
+  ulong UNINIT_VAR(prev_binlog_id);
   DBUG_ENTER("MYSQL_BIN_LOG::write(Log_event *)");
-  LINT_INIT(prev_binlog_id);
 
   if (thd->variables.option_bits & OPTION_GTID_BEGIN)
   {
@@ -7295,10 +7292,9 @@ bool MYSQL_BIN_LOG::write_incident(THD *thd)
   group_commit_entry *current, *last_in_queue;
   group_commit_entry *queue= NULL;
   bool check_purge= false;
-  ulong binlog_id;
+  ulong UNINIT_VAR(binlog_id);
   uint64 commit_id;
   DBUG_ENTER("MYSQL_BIN_LOG::trx_group_commit_leader");
-  LINT_INIT(binlog_id);
 
   {
     DBUG_EXECUTE_IF("inject_binlog_commit_before_get_LOCK_log",
@@ -8274,8 +8270,7 @@ int TC_LOG_MMAP::log_and_order(THD *thd, my_xid xid, bool all,
 {
   int cookie;
   struct commit_entry entry;
-  bool is_group_commit_leader;
-  LINT_INIT(is_group_commit_leader);
+  bool UNINIT_VAR(is_group_commit_leader);
 
   if (need_prepare_ordered)
   {
@@ -9734,8 +9729,7 @@ ulonglong mysql_bin_log_file_pos(void)
 {
   ulong value=  *((ulong *)save);
   bool check_purge= false;
-  ulong prev_binlog_id;
-  LINT_INIT(prev_binlog_id);
+  ulong UNINIT_VAR(prev_binlog_id);
 
   mysql_mutex_lock(mysql_bin_log.get_log_lock());
   if(mysql_bin_log.is_open())
diff --git a/sql/log_event.cc b/sql/log_event.cc
index 4a7b1e2..b8896f0 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -7058,8 +7058,7 @@ bool Intvar_log_event::write(IO_CACHE* file)
 void Intvar_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
 {
   char llbuff[22];
-  const char *msg;
-  LINT_INIT(msg);
+  const char *UNINIT_VAR(msg);
   Write_on_release_cache cache(&print_event_info->head_cache, file,
                                Write_on_release_cache::FLUSH_F);
 
@@ -11704,14 +11703,12 @@ static bool record_compare(TABLE *table)
 int Rows_log_event::find_key()
 {
   uint i, best_key_nr, last_part;
-  KEY *key, *best_key;
-  ulong best_rec_per_key, tmp;
+  KEY *key, *UNINIT_VAR(best_key);
+  ulong UNINIT_VAR(best_rec_per_key), tmp;
   DBUG_ENTER("Rows_log_event::find_key");
   DBUG_ASSERT(m_table);
 
   best_key_nr= MAX_KEY;
-  LINT_INIT(best_key);
-  LINT_INIT(best_rec_per_key);
 
   /*
     Keys are sorted so that any primary key is first, followed by unique keys,
diff --git a/sql/multi_range_read.cc b/sql/multi_range_read.cc
index 20b1c5d..61f344d 100644
--- a/sql/multi_range_read.cc
+++ b/sql/multi_range_read.cc
@@ -817,12 +817,11 @@ int DsMrr_impl::dsmrr_init(handler *h_arg, RANGE_SEQ_IF *seq_funcs,
   THD *thd= current_thd;
   int res;
   Key_parameters keypar;
-  uint key_buff_elem_size;
+  uint UNINIT_VAR(key_buff_elem_size); /* set/used when do_sort_keys==TRUE */
   handler *h_idx;
   Mrr_ordered_rndpos_reader *disk_strategy= NULL;
   bool do_sort_keys= FALSE;
   DBUG_ENTER("DsMrr_impl::dsmrr_init");
-  LINT_INIT(key_buff_elem_size); /* set/used when do_sort_keys==TRUE */
   /*
     index_merge may invoke a scan on an object for which dsmrr_info[_const]
     has not been called, so set the owner handler here as well.
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 8113d90..3f78a3f 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -1535,8 +1535,7 @@ static void close_connections(void)
   while (select_thread_in_use)
   {
     struct timespec abstime;
-    int error;
-    LINT_INIT(error);
+    int UNINIT_VAR(error);
     DBUG_PRINT("info",("Waiting for select thread"));
 
 #ifndef DONT_USE_THR_ALARM
@@ -7516,8 +7515,7 @@ static int show_slave_running(THD *thd, SHOW_VAR *var, char *buff,
                               enum enum_var_type scope)
 {
   Master_info *mi= NULL;
-  bool tmp;
-  LINT_INIT(tmp);
+  bool UNINIT_VAR(tmp);
 
   var->type= SHOW_MY_BOOL;
   var->value= buff;
@@ -7544,8 +7542,7 @@ static int show_slave_received_heartbeats(THD *thd, SHOW_VAR *var, char *buff,
                                           enum enum_var_type scope)
 {
   Master_info *mi= NULL;
-  longlong tmp;
-  LINT_INIT(tmp);
+  longlong UNINIT_VAR(tmp);
 
   var->type= SHOW_LONGLONG;
   var->value= buff;
@@ -7571,8 +7568,7 @@ static int show_heartbeat_period(THD *thd, SHOW_VAR *var, char *buff,
                                  enum enum_var_type scope)
 {
   Master_info *mi= NULL;
-  float tmp;
-  LINT_INIT(tmp);
+  float UNINIT_VAR(tmp);
 
   var->type= SHOW_CHAR;
   var->value= buff;
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index 3cac6e5..fedc8f0 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -3235,8 +3235,8 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use,
       {
         /* Try creating index_merge/ROR-union scan. */
         SEL_IMERGE *imerge;
-        TABLE_READ_PLAN *best_conj_trp= NULL, *new_conj_trp;
-        LINT_INIT(new_conj_trp); /* no empty index_merge lists possible */
+        TABLE_READ_PLAN *best_conj_trp= NULL,
+          *UNINIT_VAR(new_conj_trp); /* no empty index_merge lists possible */
         DBUG_PRINT("info",("No range reads possible,"
                            " trying to construct index_merge"));
         List_iterator_fast<SEL_IMERGE> it(tree->merges);
diff --git a/sql/opt_subselect.cc b/sql/opt_subselect.cc
index 6503d11..72d9329 100644
--- a/sql/opt_subselect.cc
+++ b/sql/opt_subselect.cc
@@ -3292,8 +3292,7 @@ void fix_semijoin_strategies_for_picked_join_order(JOIN *join)
   {
     POSITION *pos= join->best_positions + tablenr;
     JOIN_TAB *s= pos->table;
-    uint first;
-    LINT_INIT(first); // Set by every branch except SJ_OPT_NONE which doesn't use it
+    uint UNINIT_VAR(first); // Set by every branch except SJ_OPT_NONE which doesn't use it
 
     if ((handled_tabs & s->table->map) || pos->sj_strategy == SJ_OPT_NONE)
     {
diff --git a/sql/partition_info.cc b/sql/partition_info.cc
index 34381b3..0d26563 100644
--- a/sql/partition_info.cc
+++ b/sql/partition_info.cc
@@ -2047,8 +2047,7 @@ bool partition_info::set_up_charset_field_preps()
     i= 0;
     while ((field= *(ptr++)))
     {
-      uchar *field_buf;
-      LINT_INIT(field_buf);
+      uchar *UNINIT_VAR(field_buf);
 
       if (!field_is_partition_charset(field))
         continue;
diff --git a/sql/slave.cc b/sql/slave.cc
index 6d64534..334ed7d 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -3568,8 +3568,7 @@ static int exec_relay_log_event(THD* thd, Relay_log_info* rli,
 
     if (slave_trans_retries)
     {
-      int temp_err;
-      LINT_INIT(temp_err);
+      int UNINIT_VAR(temp_err);
       if (exec_res && (temp_err= has_temporary_error(thd)))
       {
         const char *errmsg;
diff --git a/sql/sp_head.cc b/sql/sp_head.cc
index c0b1b99..acf3473 100644
--- a/sql/sp_head.cc
+++ b/sql/sp_head.cc
@@ -1695,7 +1695,7 @@ void sp_head::recursion_level_error(THD *thd)
 sp_head::execute_function(THD *thd, Item **argp, uint argcount,
                           Field *return_value_fld)
 {
-  ulonglong binlog_save_options;
+  ulonglong UNINIT_VAR(binlog_save_options);
   bool need_binlog_call= FALSE;
   uint arg_no;
   sp_rcontext *octx = thd->spcont;
@@ -1709,8 +1709,6 @@ void sp_head::recursion_level_error(THD *thd)
   DBUG_ENTER("sp_head::execute_function");
   DBUG_PRINT("info", ("function %s", m_name.str));
 
-  LINT_INIT(binlog_save_options);
-
   /*
     Check that the function is called with all specified arguments.
 
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index a5d7881..be581de 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -6098,17 +6098,14 @@ bool open_temporary_tables(THD *thd, TABLE_LIST *tl_list)
   List_iterator_fast<Natural_join_column>
     field_it(*(table_ref->join_columns));
   Natural_join_column *nj_col, *curr_nj_col;
-  Field *found_field;
-  Query_arena *arena, backup;
+  Field *UNINIT_VAR(found_field);
+  Query_arena *UNINIT_VAR(arena), backup;
   DBUG_ENTER("find_field_in_natural_join");
   DBUG_PRINT("enter", ("field name: '%s', ref 0x%lx",
 		       name, (ulong) ref));
   DBUG_ASSERT(table_ref->is_natural_join && table_ref->join_columns);
   DBUG_ASSERT(*actual_table == NULL);
 
-  LINT_INIT(arena);
-  LINT_INIT(found_field);
-
   for (nj_col= NULL, curr_nj_col= field_it++; curr_nj_col; 
        curr_nj_col= field_it++)
   {
@@ -6128,7 +6125,6 @@ bool open_temporary_tables(THD *thd, TABLE_LIST *tl_list)
   if (nj_col->view_field)
   {
     Item *item;
-    LINT_INIT(arena);
     if (register_tree_change)
       arena= thd->activate_stmt_arena_if_needed(&backup);
     /*
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index 9f4d521..7b37f29 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -331,8 +331,7 @@ static int check_update_fields(THD *thd, TABLE_LIST *insert_table_list,
                                table_map *map)
 {
   TABLE *table= insert_table_list->table;
-  my_bool autoinc_mark;
-  LINT_INIT(autoinc_mark);
+  my_bool UNINIT_VAR(autoinc_mark);
 
   table->next_number_field_updated= FALSE;
 
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index 0c1c3b3..d33745a 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -1028,7 +1028,7 @@ int MYSQLlex(YYSTYPE *yylval, THD *thd)
 
 static int lex_one_token(YYSTYPE *yylval, THD *thd)
 {
-  reg1	uchar c;
+  reg1	uchar UNINIT_VAR(c);
   bool comment_closed;
   int	tokval, result_state;
   uint length;
@@ -1039,7 +1039,6 @@ static int lex_one_token(YYSTYPE *yylval, THD *thd)
   const uchar *const state_map= cs->state_map;
   const uchar *const ident_map= cs->ident_map;
 
-  LINT_INIT(c);
   lip->yylval=yylval;			// The global state
 
   lip->start_token();
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 64e016f..24b76b0 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -7278,11 +7278,10 @@ TABLE_LIST *st_select_lex::add_table_to_list(THD *thd,
                                              LEX_STRING *option)
 {
   register TABLE_LIST *ptr;
-  TABLE_LIST *previous_table_ref; /* The table preceding the current one. */
+  TABLE_LIST *UNINIT_VAR(previous_table_ref); /* The table preceding the current one. */
   char *alias_str;
   LEX *lex= thd->lex;
   DBUG_ENTER("add_table_to_list");
-  LINT_INIT(previous_table_ref);
 
   if (!table)
     DBUG_RETURN(0);				// End of memory
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 90c3110..fe9a00d 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -3397,7 +3397,7 @@ static ha_rows get_quick_record_count(THD *thd, SQL_SELECT *select,
                      DYNAMIC_ARRAY *keyuse_array)
 {
   int error= 0;
-  TABLE *table;
+  TABLE *UNINIT_VAR(table); /* inited in all loops */
   uint i,table_count,const_count,key;
   table_map found_const_table_map, all_table_map, found_ref, refs;
   key_map const_ref, eq_part;
@@ -3412,7 +3412,6 @@ static ha_rows get_quick_record_count(THD *thd, SQL_SELECT *select,
   TABLE_LIST *tables;
   DBUG_ENTER("make_join_statistics");
 
-  LINT_INIT(table); /* inited in all loops */
   table_count=join->table_count;
 
   /*
@@ -12052,13 +12051,12 @@ static void update_depend_map_for_order(JOIN *join, ORDER *order)
     return change_list ? 0 : first_order;		// No need to sort
 
   ORDER *order,**prev_ptr, *tmp_order;
-  table_map first_table;
+  table_map UNINIT_VAR(first_table); /* protected by first_is_base_table */
   table_map not_const_tables= ~join->const_table_map;
   table_map ref;
   bool first_is_base_table= FALSE;
   DBUG_ENTER("remove_const");
   
-  LINT_INIT(first_table); /* protected by first_is_base_table */
   if (join->join_tab[join->const_tables].table)
   {
     first_table= join->join_tab[join->const_tables].table->map;
@@ -15484,8 +15482,7 @@ static Field *create_tmp_field_from_item(THD *thd, Item *item, TABLE *table,
                                          uint convert_blob_length)
 {
   bool maybe_null= item->maybe_null;
-  Field *new_field;
-  LINT_INIT(new_field);
+  Field *UNINIT_VAR(new_field);
 
   switch (item->result_type()) {
   case REAL_RESULT:
@@ -17438,9 +17435,8 @@ Next_select_func setup_end_select_func(JOIN *join)
 {
   int rc= 0;
   enum_nested_loop_state error= NESTED_LOOP_OK;
-  JOIN_TAB *join_tab;
+  JOIN_TAB *UNINIT_VAR(join_tab);
   DBUG_ENTER("do_select");
-  LINT_INIT(join_tab);
   
   join->procedure=procedure;
   join->tmp_table= table;			/* Save for easy recursion */
diff --git a/sql/sql_select.h b/sql/sql_select.h
index a50ed13..34676d4 100644
--- a/sql/sql_select.h
+++ b/sql/sql_select.h
@@ -762,7 +762,7 @@ class Sj_materialization_picker : public Semi_join_strategy_picker
   void set_empty()
   {
     sjm_scan_need_tables= 0;
-    LINT_INIT(sjm_scan_last_inner);
+    LINT_INIT_STRUCT(sjm_scan_last_inner);
     is_used= FALSE;
   }
   void set_from_prev(struct st_position *prev);
diff --git a/sql/sql_statistics.cc b/sql/sql_statistics.cc
index 4ce1f3e..021e4c3 100644
--- a/sql/sql_statistics.cc
+++ b/sql/sql_statistics.cc
@@ -1551,7 +1551,7 @@ class Index_prefix_calc: public Sql_alloc
     uint key_parts= table->actual_n_key_parts(key_info);
     empty= TRUE;
     prefixes= 0;
-    LINT_INIT(calc_state);
+    LINT_INIT_STRUCT(calc_state);
 
     is_single_comp_pk= FALSE;
     uint pk= table->s->primary_key;
diff --git a/sql/sql_time.cc b/sql/sql_time.cc
index ca689d5..267b183 100644
--- a/sql/sql_time.cc
+++ b/sql/sql_time.cc
@@ -545,8 +545,7 @@ bool parse_date_time_format(timestamp_type format_type,
   {
     if (*ptr == '%' && ptr+1 != end)
     {
-      uint position;
-      LINT_INIT(position);
+      uint UNINIT_VAR(position);
       switch (*++ptr) {
       case 'y':					// Year
       case 'Y':
diff --git a/sql/table.cc b/sql/table.cc
index 9b6b64b..0e2cf84 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -4807,9 +4807,8 @@ bool TABLE_LIST::is_leaf_for_name_resolution()
 
 TABLE_LIST *TABLE_LIST::first_leaf_for_name_resolution()
 {
-  TABLE_LIST *cur_table_ref;
+  TABLE_LIST *UNINIT_VAR(cur_table_ref);
   NESTED_JOIN *cur_nested_join;
-  LINT_INIT(cur_table_ref);
 
   if (is_leaf_for_name_resolution())
     return this;
@@ -5528,10 +5527,9 @@ GRANT_INFO *Field_iterator_table_ref::grant()
 {
   Natural_join_column *nj_col;
   bool is_created= TRUE;
-  uint field_count;
+  uint UNINIT_VAR(field_count);
   TABLE_LIST *add_table_ref= parent_table_ref ?
                              parent_table_ref : table_ref;
-  LINT_INIT(field_count);
 
   if (field_it == &table_field_it)
   {
diff --git a/sql/tztime.cc b/sql/tztime.cc
index 1cb1f5a..9fa065e 100644
--- a/sql/tztime.cc
+++ b/sql/tztime.cc
@@ -327,7 +327,7 @@
 prepare_tz_info(TIME_ZONE_INFO *sp, MEM_ROOT *storage)
 {
   my_time_t cur_t= MY_TIME_T_MIN;
-  my_time_t cur_l, end_t, end_l;
+  my_time_t cur_l, end_t, UNINIT_VAR(end_l);
   my_time_t cur_max_seen_l= MY_TIME_T_MIN;
   long cur_offset, cur_corr, cur_off_and_corr;
   uint next_trans_idx, next_leap_idx;
@@ -340,8 +340,6 @@
   my_time_t revts[TZ_MAX_REV_RANGES];
   REVT_INFO revtis[TZ_MAX_REV_RANGES];
 
-  LINT_INIT(end_l);
-
   /*
     Let us setup fallback time type which will be used if we have not any
     transitions or if we have moment of time before first transition.
diff --git a/storage/maria/ma_bitmap.c b/storage/maria/ma_bitmap.c
index e1ccceb..fad7deb 100644
--- a/storage/maria/ma_bitmap.c
+++ b/storage/maria/ma_bitmap.c
@@ -1697,11 +1697,10 @@ static my_bool find_blob(MARIA_HA *info, ulong length)
   uint full_page_size= FULL_PAGE_SIZE(info->s->block_size);
   ulong pages;
   uint rest_length, used;
-  uint first_block_pos;
+  uint UNINIT_VAR(first_block_pos);
   MARIA_BITMAP_BLOCK *first_block= 0;
   DBUG_ENTER("find_blob");
   DBUG_PRINT("enter", ("length: %lu", length));
-  LINT_INIT(first_block_pos);
 
   pages= length / full_page_size;
   rest_length= (uint) (length - pages * full_page_size);
diff --git a/storage/maria/ma_check.c b/storage/maria/ma_check.c
index 0a89bab..a26573a 100644
--- a/storage/maria/ma_check.c
+++ b/storage/maria/ma_check.c
@@ -1862,8 +1862,6 @@ static int check_block_record(HA_CHECK *param, MARIA_HA *info, int extend,
          page_type, bitmap_pattern;
     uint bitmap_for_page;
 
-    LINT_INIT(empty_space);
-
     if (_ma_killed_ptr(param))
     {
       _ma_scan_end_block_record(info);
diff --git a/storage/maria/ma_dynrec.c b/storage/maria/ma_dynrec.c
index 9fed9db..eb6352b 100644
--- a/storage/maria/ma_dynrec.c
+++ b/storage/maria/ma_dynrec.c
@@ -1593,9 +1593,8 @@ my_bool _ma_cmp_dynamic_record(register MARIA_HA *info,
   uchar *buffer;
   MARIA_BLOCK_INFO block_info;
   my_bool error= 1;
-  size_t buffer_length;
+  size_t UNINIT_VAR(buffer_length);
   DBUG_ENTER("_ma_cmp_dynamic_record");
-  LINT_INIT(buffer_length);
 
   if (info->opt_flag & WRITE_CACHE_USED)
   {
diff --git a/storage/maria/ma_ft_nlq_search.c b/storage/maria/ma_ft_nlq_search.c
index 613f13e..5eb9161 100644
--- a/storage/maria/ma_ft_nlq_search.c
+++ b/storage/maria/ma_ft_nlq_search.c
@@ -83,8 +83,6 @@ static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio)
 #error
 #endif
   DBUG_ENTER("walk_and_match");
-  LINT_INIT(subkeys.i);
-
   LINT_INIT_STRUCT(subkeys);
 
   word->weight=LWS_FOR_QUERY;
diff --git a/storage/maria/ma_open.c b/storage/maria/ma_open.c
index 1d274d7..5a221d4 100644
--- a/storage/maria/ma_open.c
+++ b/storage/maria/ma_open.c
@@ -279,7 +279,7 @@ MARIA_HA *maria_open(const char *name, int mode, uint open_flags)
   char name_buff[FN_REFLEN], org_name[FN_REFLEN], index_name[FN_REFLEN],
        data_name[FN_REFLEN];
   uchar *disk_cache, *disk_pos, *end_pos;
-  MARIA_HA info,*m_info,*old_info;
+  MARIA_HA info, *UNINIT_VAR(m_info), *old_info;
   MARIA_SHARE share_buff,*share;
   double *rec_per_key_part;
   ulong  *nulls_per_key_part;
@@ -289,7 +289,6 @@ MARIA_HA *maria_open(const char *name, int mode, uint open_flags)
   File data_file= -1;
   DBUG_ENTER("maria_open");
 
-  LINT_INIT(m_info);
   kfile= -1;
   errpos= 0;
   head_length=sizeof(share_buff.state.header);
diff --git a/storage/maria/ma_pagecache.c b/storage/maria/ma_pagecache.c
index ac66fdf..5fb2e2a 100644
--- a/storage/maria/ma_pagecache.c
+++ b/storage/maria/ma_pagecache.c
@@ -3367,8 +3367,7 @@ uchar *pagecache_read(PAGECACHE *pagecache,
     /* Key cache is used */
     PAGECACHE_BLOCK_LINK *block;
     uint status;
-    int page_st;
-    LINT_INIT(page_st);
+    int UNINIT_VAR(page_st);
 
     pagecache_pthread_mutex_lock(&pagecache->cache_lock);
     if (!pagecache->can_be_used)
diff --git a/storage/maria/ma_range.c b/storage/maria/ma_range.c
index 7747df6..7216480 100644
--- a/storage/maria/ma_range.c
+++ b/storage/maria/ma_range.c
@@ -209,14 +209,13 @@ static double _ma_search_pos(MARIA_HA *info, MARIA_KEY *key,
 			     uint32 nextflag, my_off_t pos)
 {
   int flag;
-  uint keynr, max_keynr;
+  uint keynr, UNINIT_VAR(max_keynr);
   my_bool after_key;
   uchar *keypos;
   double offset;
   MARIA_KEYDEF *keyinfo= key->keyinfo;
   MARIA_PAGE page;
   DBUG_ENTER("_ma_search_pos");
-  LINT_INIT(max_keynr);
 
   if (pos == HA_OFFSET_ERROR)
     DBUG_RETURN(0.0);
diff --git a/storage/maria/ma_rt_index.c b/storage/maria/ma_rt_index.c
index 0d187c8..320418c 100644
--- a/storage/maria/ma_rt_index.c
+++ b/storage/maria/ma_rt_index.c
@@ -523,19 +523,15 @@ static const uchar *maria_rtree_pick_key(const MARIA_KEY *key,
                                          const MARIA_PAGE *page)
 {
   double increase;
-  double best_incr;
+  double UNINIT_VAR(best_incr);
   double perimeter;
-  double best_perimeter;
+  double UNINIT_VAR(best_perimeter);
   uchar *best_key= NULL;
   const MARIA_HA *info= page->info;
 
   uchar *k= rt_PAGE_FIRST_KEY(info->s, page->buf, page->node);
   uchar *last= rt_PAGE_END(info, page);
 
-  LINT_INIT(best_perimeter);
-  LINT_INIT(best_key);
-  LINT_INIT(best_incr);
-
   for (; k < last; k= rt_PAGE_NEXT_KEY(k, key->data_length, nod_flag))
   {
     if ((increase= maria_rtree_perimeter_increase(keyinfo->seg, k, key,
@@ -563,13 +559,11 @@ static const uchar *maria_rtree_pick_key(const MARIA_KEY *key,
   double increase;
   double best_incr= DBL_MAX;
   double area;
-  double best_area;
+  double UNINIT_VAR(best_area);
   const uchar *best_key= NULL;
   const uchar *k= rt_PAGE_FIRST_KEY(share, page->buff, page->node);
   const uchar *last= rt_PAGE_END(page);
 
-  LINT_INIT(best_area);
-
   for (; k < last;
        k= rt_PAGE_NEXT_KEY(share, k, key->data_length, page->node))
   {
diff --git a/storage/maria/ma_search.c b/storage/maria/ma_search.c
index d38bc7a..14ff084 100644
--- a/storage/maria/ma_search.c
+++ b/storage/maria/ma_search.c
@@ -269,7 +269,7 @@ int _ma_bin_search(const MARIA_KEY *key, const MARIA_PAGE *ma_page,
                    uint32 comp_flag, uchar **ret_pos,
                    uchar *buff __attribute__((unused)), my_bool *last_key)
 {
-  int flag;
+  int UNINIT_VAR(flag);
   uint page_flag;
   uint start, mid, end, save_end, totlength, nod_flag;
   uint not_used[2];
@@ -278,8 +278,6 @@ int _ma_bin_search(const MARIA_KEY *key, const MARIA_PAGE *ma_page,
   uchar *page;
   DBUG_ENTER("_ma_bin_search");
 
-  LINT_INIT(flag);
-
   page_flag= ma_page->flag;
   if (page_flag & KEYPAGE_FLAG_HAS_TRANSID)
   {
diff --git a/storage/maria/ma_sort.c b/storage/maria/ma_sort.c
index 421dc83..d511c1e 100644
--- a/storage/maria/ma_sort.c
+++ b/storage/maria/ma_sort.c
@@ -110,7 +110,7 @@ int _ma_create_index_by_sort(MARIA_SORT_PARAM *info, my_bool no_messages,
   uint sort_length, maxbuffer;
   size_t memavl, old_memavl;
   DYNAMIC_ARRAY buffpek;
-  ha_rows records, keys;
+  ha_rows records, UNINIT_VAR(keys);
   uchar **sort_keys;
   IO_CACHE tempfile, tempfile_for_exceptions;
   DBUG_ENTER("_ma_create_index_by_sort");
@@ -140,7 +140,6 @@ int _ma_create_index_by_sort(MARIA_SORT_PARAM *info, my_bool no_messages,
   memavl=MY_MAX(sortbuff_size,MIN_SORT_MEMORY);
   records=	info->sort_info->max_records;
   sort_length=	info->key_length;
-  LINT_INIT(keys);
 
   while (memavl >= MIN_SORT_MEMORY)
   {
@@ -363,13 +362,11 @@ pthread_handler_t _ma_thr_find_all_keys(void *arg)
   int error;
   size_t memavl, old_memavl;
   longlong sortbuff_size;
-  ha_keys keys, idx;
+  ha_keys UNINIT_VAR(keys), idx;
   uint sort_length;
   uint maxbuffer;
   uchar **sort_keys=0;
 
-  LINT_INIT(keys);
-
   error=1;
 
   if (my_thread_init())
@@ -1029,7 +1026,6 @@ static int write_merge_key(MARIA_SORT_PARAM *info __attribute__((unused)),
   count= 0;
   maxcount= keys/((uint) (Tb-Fb) +1);
   DBUG_ASSERT(maxcount > 0);
-  LINT_INIT(to_start_filepos);
   if (to_file)
     to_start_filepos=my_b_tell(to_file);
   strpos= (uchar*) sort_keys;
diff --git a/storage/maria/ma_update.c b/storage/maria/ma_update.c
index e0e804c..4385f2d 100644
--- a/storage/maria/ma_update.c
+++ b/storage/maria/ma_update.c
@@ -26,14 +26,12 @@ int maria_update(register MARIA_HA *info, const uchar *oldrec, uchar *newrec)
   int flag,key_changed,save_errno;
   reg3 my_off_t pos;
   uint i;
-  uchar old_key_buff[MARIA_MAX_KEY_BUFF],*new_key_buff;
+  uchar old_key_buff[MARIA_MAX_KEY_BUFF], *UNINIT_VAR(new_key_buff);
   my_bool auto_key_changed= 0;
-  ulonglong changed;
+  ulonglong UNINIT_VAR(changed);
   MARIA_SHARE *share= info->s;
   MARIA_KEYDEF *keyinfo;
   DBUG_ENTER("maria_update");
-  LINT_INIT(new_key_buff);
-  LINT_INIT(changed);
 
   DBUG_EXECUTE_IF("maria_pretend_crashed_table_on_usage",
                   maria_print_error(info->s, HA_ERR_CRASHED);
diff --git a/storage/maria/ma_write.c b/storage/maria/ma_write.c
index 629b774..652fdb4 100644
--- a/storage/maria/ma_write.c
+++ b/storage/maria/ma_write.c
@@ -972,7 +972,7 @@ int _ma_split_page(MARIA_HA *info, MARIA_KEY *key, MARIA_PAGE *split_page,
 {
   uint length,a_length,key_ref_length,t_length,nod_flag,key_length;
   uint page_length, split_length, page_flag;
-  uchar *key_pos,*pos, *after_key;
+  uchar *key_pos, *pos, *UNINIT_VAR(after_key);
   MARIA_KEY_PARAM s_temp;
   MARIA_PINNED_PAGE tmp_page_link, *page_link= &tmp_page_link;
   MARIA_SHARE *share= info->s;
@@ -982,7 +982,6 @@ int _ma_split_page(MARIA_HA *info, MARIA_KEY *key, MARIA_PAGE *split_page,
   int res;
   DBUG_ENTER("_ma_split_page");
 
-  LINT_INIT(after_key);
   DBUG_DUMP("buff", split_page->buff, split_page->size);
 
   info->page_changed=1;			/* Info->buff is used */
diff --git a/storage/myisam/mi_check.c b/storage/myisam/mi_check.c
index b79d6c8..be0b90b 100644
--- a/storage/myisam/mi_check.c
+++ b/storage/myisam/mi_check.c
@@ -3292,7 +3292,6 @@ static int sort_get_next_record(MI_SORT_PARAM *sort_param)
       }
     }
   case DYNAMIC_RECORD:
-    LINT_INIT(to);
     pos=sort_param->pos;
     searching=(sort_param->fix_datafile && (param->testflag & T_EXTEND));
     parallel_flag= (sort_param->read_cache.file < 0) ? READING_NEXT : 0;
diff --git a/storage/myisam/mi_delete.c b/storage/myisam/mi_delete.c
index 3fffa55..6a023f3 100644
--- a/storage/myisam/mi_delete.c
+++ b/storage/myisam/mi_delete.c
@@ -305,7 +305,6 @@ static int d_search(register MI_INFO *info, register MI_KEYDEF *keyinfo,
     }
   }
   leaf_buff=0;
-  LINT_INIT(leaf_page);
   if (nod_flag)
   {
     leaf_page=_mi_kpos(nod_flag,keypos);
diff --git a/storage/myisam/mi_open.c b/storage/myisam/mi_open.c
index 060017f..b8cbefe 100644
--- a/storage/myisam/mi_open.c
+++ b/storage/myisam/mi_open.c
@@ -721,7 +721,6 @@ uchar *mi_alloc_rec_buff(MI_INFO *info, ulong length, uchar **buf)
 {
   uint extra;
   uint32 UNINIT_VAR(old_length);
-  LINT_INIT(old_length);
 
   if (! *buf || length > (old_length=mi_get_rec_buff_len(info, *buf)))
   {
diff --git a/storage/myisam/mi_packrec.c b/storage/myisam/mi_packrec.c
index d1ad911..3687cfc 100644
--- a/storage/myisam/mi_packrec.c
+++ b/storage/myisam/mi_packrec.c
@@ -1364,7 +1364,6 @@ uint _mi_pack_get_block_info(MI_INFO *myisam, MI_BIT_BUFF *bit_buff,
 {
   uchar *header=info->header;
   uint head_length, UNINIT_VAR(ref_length);
-  LINT_INIT(ref_length);
 
   if (file >= 0)
   {
diff --git a/storage/myisam/mi_search.c b/storage/myisam/mi_search.c
index 3ce112f..60a34c6 100644
--- a/storage/myisam/mi_search.c
+++ b/storage/myisam/mi_search.c
@@ -187,11 +187,10 @@ int _mi_bin_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page,
                    uchar *buff __attribute__((unused)), my_bool *last_key)
 {
   reg4 int start,mid,end,save_end;
-  int flag;
+  int UNINIT_VAR(flag);
   uint totlength,nod_flag,not_used[2];
   DBUG_ENTER("_mi_bin_search");
 
-  LINT_INIT(flag);
   totlength=keyinfo->keylength+(nod_flag=mi_test_if_nod(page));
   start=0; mid=1;
   save_end=end=(int) ((mi_getint(page)-2-nod_flag)/totlength-1);
diff --git a/storage/myisam/mi_write.c b/storage/myisam/mi_write.c
index 2b922bb..ff96ee8 100644
--- a/storage/myisam/mi_write.c
+++ b/storage/myisam/mi_write.c
@@ -595,11 +595,10 @@ int _mi_split_page(register MI_INFO *info, register MI_KEYDEF *keyinfo,
 		   my_bool insert_last_key)
 {
   uint length,a_length,key_ref_length,t_length,nod_flag,key_length;
-  uchar *key_pos,*pos, *after_key;
+  uchar *key_pos,*pos, *UNINIT_VAR(after_key);
   my_off_t new_pos;
   MI_KEY_PARAM s_temp;
   DBUG_ENTER("mi_split_page");
-  LINT_INIT(after_key);
   DBUG_DUMP("buff",(uchar*) buff,mi_getint(buff));
 
   if (info->s->keyinfo+info->lastinx == keyinfo)
@@ -710,13 +709,11 @@ static uchar *_mi_find_last_pos(MI_KEYDEF *keyinfo, uchar *page,
 				uchar *key, uint *return_key_length,
 				uchar **after_key)
 {
-  uint keys,length,last_length,key_ref_length;
+  uint keys, length, UNINIT_VAR(last_length), key_ref_length;
   uchar *end,*lastpos,*prevpos;
   uchar key_buff[HA_MAX_KEY_BUFF];
   DBUG_ENTER("_mi_find_last_pos");
 
-  LINT_INIT(last_length);
-
   key_ref_length=2;
   length=mi_getint(page)-key_ref_length;
   page+=key_ref_length;
diff --git a/storage/myisam/rt_index.c b/storage/myisam/rt_index.c
index fc0c034..b3b7fd0 100644
--- a/storage/myisam/rt_index.c
+++ b/storage/myisam/rt_index.c
@@ -469,14 +469,11 @@ static uchar *rtree_pick_key(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *key,
   double increase;
   double best_incr = DBL_MAX;
   double perimeter;
-  double best_perimeter;
-  uchar *best_key;
+  double UNINIT_VAR(best_perimeter);
+  uchar *UNINIT_VAR(best_key);
   uchar *k = rt_PAGE_FIRST_KEY(page_buf, nod_flag);
   uchar *last = rt_PAGE_END(page_buf);
 
-  LINT_INIT(best_perimeter);
-  LINT_INIT(best_key);
-
   for (; k < last; k = rt_PAGE_NEXT_KEY(k, key_length, nod_flag))
   {
     if ((increase = rtree_perimeter_increase(keyinfo->seg, k, key, key_length,
diff --git a/storage/myisam/sort.c b/storage/myisam/sort.c
index 8e45ca1..f65d1e8 100644
--- a/storage/myisam/sort.c
+++ b/storage/myisam/sort.c
@@ -107,7 +107,7 @@ int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages,
   uint sort_length, maxbuffer;
   ulonglong memavl, old_memavl;
   DYNAMIC_ARRAY buffpek;
-  ha_rows records, keys;
+  ha_rows records, UNINIT_VAR(keys);
   uchar **sort_keys;
   IO_CACHE tempfile, tempfile_for_exceptions;
   DBUG_ENTER("_create_index_by_sort");
@@ -135,7 +135,6 @@ int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages,
   memavl= MY_MAX(sortbuff_size, MIN_SORT_BUFFER);
   records=	info->sort_info->max_records;
   sort_length=	info->key_length;
-  LINT_INIT(keys);
 
   while (memavl >= MIN_SORT_BUFFER)
   {
@@ -342,13 +341,11 @@ pthread_handler_t thr_find_all_keys(void *arg)
   MI_SORT_PARAM *sort_param= (MI_SORT_PARAM*) arg;
   int error;
   ulonglong memavl, old_memavl, sortbuff_size;
-  ha_keys keys, idx;
+  ha_keys UNINIT_VAR(keys), idx;
   uint sort_length;
   uint maxbuffer;
   uchar **sort_keys=0;
 
-  LINT_INIT(keys);
-
   error=1;
 
   if (my_thread_init())
@@ -552,7 +549,6 @@ int thr_write_keys(MI_SORT_PARAM *sort_param)
   MI_SORT_PARAM *sinfo;
   uchar *mergebuf=0;
   DBUG_ENTER("thr_write_keys");
-  LINT_INIT(length);
 
   for (i= 0, sinfo= sort_param ;
        i < sort_info->total_keys ;
@@ -977,7 +973,6 @@ static int write_merge_key(MI_SORT_PARAM *info __attribute__((unused)),
   count=error=0;
   maxcount= keys/((uint) (Tb-Fb) +1);
   DBUG_ASSERT(maxcount > 0);
-  LINT_INIT(to_start_filepos);
   if (to_file)
     to_start_filepos=my_b_tell(to_file);
   strpos=(uchar*) sort_keys;
diff --git a/storage/myisammrg/myrg_open.c b/storage/myisammrg/myrg_open.c
index c4a6857..7f3937f 100644
--- a/storage/myisammrg/myrg_open.c
+++ b/storage/myisammrg/myrg_open.c
@@ -239,7 +239,6 @@ MYRG_INFO *myrg_parent_open(const char *parent_name,
   rc= 1;
   errpos= 0;
   bzero((char*) &file_cache, sizeof(file_cache));
-  LINT_INIT(m_info);
 
   /* Open MERGE meta file. */
   if ((fd= mysql_file_open(rg_key_file_MRG,
diff --git a/storage/tokudb/ha_tokudb.cc b/storage/tokudb/ha_tokudb.cc
index 532ce70..21045f9 100644
--- a/storage/tokudb/ha_tokudb.cc
+++ b/storage/tokudb/ha_tokudb.cc
@@ -4035,7 +4035,7 @@ bool ha_tokudb::key_changed(uint keynr, const uchar * old_row, const uchar * new
 int ha_tokudb::update_row(const uchar * old_row, uchar * new_row) {
     TOKUDB_HANDLER_DBUG_ENTER("");
     DBT prim_key, old_prim_key, prim_row, old_prim_row;
-    int error;
+    int UNINIT_VAR(error);
     bool has_null;
     THD* thd = ha_thd();
     DB_TXN* sub_trans = NULL;
@@ -4043,7 +4043,6 @@ int ha_tokudb::update_row(const uchar * old_row, uchar * new_row) {
     tokudb_trx_data* trx = (tokudb_trx_data *) thd_get_ha_data(thd, tokudb_hton);
     uint curr_num_DBs;
 
-    LINT_INIT(error);
     memset((void *) &prim_key, 0, sizeof(prim_key));
     memset((void *) &old_prim_key, 0, sizeof(old_prim_key));
     memset((void *) &prim_row, 0, sizeof(prim_row));
diff --git a/strings/ctype-utf8.c b/strings/ctype-utf8.c
index d0a64d1..14f0750 100644
--- a/strings/ctype-utf8.c
+++ b/strings/ctype-utf8.c
@@ -4629,14 +4629,13 @@ int my_wildcmp_unicode_impl(CHARSET_INFO *cs,
                     uchar *dst, size_t dstlen, uint nweights,
                     const uchar *src, size_t srclen, uint flags)
 {
-  my_wc_t wc;
+  my_wc_t UNINIT_VAR(wc);
   int res;
   uchar *dst0= dst;
   uchar *de= dst + dstlen;
   const uchar *se= src + srclen;
   MY_UNICASE_INFO *uni_plane= (cs->state & MY_CS_BINSORT) ?
                                NULL : cs->caseinfo;
-  LINT_INIT(wc);
   DBUG_ASSERT(!srclen || src);
 
   for (; dst < de && nweights; nweights--)
@@ -4683,12 +4682,11 @@ int my_wildcmp_unicode_impl(CHARSET_INFO *cs,
                              uchar *dst, size_t dstlen, uint nweights,
                              const uchar *src, size_t srclen, uint flags)
 {
-  my_wc_t wc;
+  my_wc_t UNINIT_VAR(wc);
   uchar *dst0= dst;
   uchar *de= dst + dstlen;
   const uchar *se = src + srclen;
 
-  LINT_INIT(wc);
   DBUG_ASSERT(!srclen || src);
   DBUG_ASSERT(cs->state & MY_CS_BINSORT);
 
@@ -7729,12 +7727,10 @@ int main()
                      const uchar *t, size_t tlen,
                      my_bool t_is_prefix)
 {
-  my_wc_t s_wc,t_wc;
+  my_wc_t UNINIT_VAR(s_wc), UNINIT_VAR(t_wc);
   const uchar *se= s + slen;
   const uchar *te= t + tlen;
   MY_UNICASE_INFO *uni_plane= cs->caseinfo;
-  LINT_INIT(s_wc);
-  LINT_INIT(t_wc);
 
   while ( s < se && t < te )
   {
@@ -7797,11 +7793,9 @@ int main()
                        my_bool diff_if_only_endspace_difference)
 {
   int res;
-  my_wc_t s_wc, t_wc;
+  my_wc_t UNINIT_VAR(s_wc), UNINIT_VAR(t_wc);
   const uchar *se= s + slen, *te= t + tlen;
   MY_UNICASE_INFO *uni_plane= cs->caseinfo;
-  LINT_INIT(s_wc);
-  LINT_INIT(t_wc);
 
 #ifndef VARCHAR_WITH_DIFF_ENDSPACE_ARE_DIFFERENT_FOR_UNIQUE
   diff_if_only_endspace_difference= FALSE;


More information about the commits mailing list