summaryrefslogtreecommitdiff
path: root/sql/sql_help.cc
diff options
context:
space:
mode:
authorDavi Arnaut <davi.arnaut@oracle.com>2010-10-20 16:21:40 -0200
committerDavi Arnaut <davi.arnaut@oracle.com>2010-10-20 16:21:40 -0200
commit031c5d92719a8a941ff987febfcd6bf7815cd94a (patch)
treed427278052923d3b649a03292a823b7468075b95 /sql/sql_help.cc
parent9605de051facb8658ce31aa22917d02f97d5b9e1 (diff)
downloadmariadb-git-031c5d92719a8a941ff987febfcd6bf7815cd94a.tar.gz
Bug#45288: pb2 returns a lot of compilation warnings
Fix assorted warnings that are generated in optimized builds. Most of it is silencing variables that are set but unused. This patch also introduces the MY_ASSERT_UNREACHABLE macro which helps the compiler to deduce that a certain piece of code is unreachable. include/my_compiler.h: Use GCC's __builtin_unreachable if available. It allows GCC to deduce the unreachability of certain code paths, thus avoiding warnings that, for example, accused that a variable could be used without being initialized (due to unreachable code paths).
Diffstat (limited to 'sql/sql_help.cc')
-rw-r--r--sql/sql_help.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/sql_help.cc b/sql/sql_help.cc
index 2818aa5082c..c21968cb86e 100644
--- a/sql/sql_help.cc
+++ b/sql/sql_help.cc
@@ -686,7 +686,7 @@ bool mysqld_help(THD *thd, const char *mask)
if (count_topics == 0)
{
- int key_id;
+ int UNINIT_VAR(key_id);
if (!(select=
prepare_select_for_name(thd,mask,mlen,tables,tables[3].table,
used_fields[help_keyword_name].field,