diff options
author | Davi Arnaut <davi.arnaut@oracle.com> | 2010-10-20 16:21:40 -0200 |
---|---|---|
committer | Davi Arnaut <davi.arnaut@oracle.com> | 2010-10-20 16:21:40 -0200 |
commit | 3e9c52250a3ab6664c53ea6b3923acfbe8e09e4e (patch) | |
tree | d427278052923d3b649a03292a823b7468075b95 /client | |
parent | b5bb13ec0380624c2e663a4e9b4b29fe574b3e05 (diff) | |
download | mariadb-git-3e9c52250a3ab6664c53ea6b3923acfbe8e09e4e.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 'client')
-rw-r--r-- | client/mysqltest.cc | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/client/mysqltest.cc b/client/mysqltest.cc index 38862210cba..d790b3f0ee7 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -5258,8 +5258,13 @@ void do_connect(struct st_command *command) opt_charsets_dir); #ifdef HAVE_OPENSSL - if (opt_use_ssl || con_ssl) + if (opt_use_ssl) + con_ssl= 1; +#endif + + if (con_ssl) { +#ifdef HAVE_OPENSSL mysql_ssl_set(&con_slot->mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca, opt_ssl_capath, opt_ssl_cipher); #if MYSQL_VERSION_ID >= 50000 @@ -5268,36 +5273,37 @@ void do_connect(struct st_command *command) mysql_options(&con_slot->mysql, MYSQL_OPT_SSL_VERIFY_SERVER_CERT, &opt_ssl_verify_server_cert); #endif - } #endif + } -#ifdef __WIN__ if (con_pipe) { +#ifdef __WIN__ opt_protocol= MYSQL_PROTOCOL_PIPE; - } #endif + } if (opt_protocol) mysql_options(&con_slot->mysql, MYSQL_OPT_PROTOCOL, (char*) &opt_protocol); -#ifdef HAVE_SMEM if (con_shm) { +#ifdef HAVE_SMEM uint protocol= MYSQL_PROTOCOL_MEMORY; if (!ds_shm.length) die("Missing shared memory base name"); mysql_options(&con_slot->mysql, MYSQL_SHARED_MEMORY_BASE_NAME, ds_shm.str); mysql_options(&con_slot->mysql, MYSQL_OPT_PROTOCOL, &protocol); +#endif } - else if(shared_memory_base_name) +#ifdef HAVE_SMEM + else if (shared_memory_base_name) { mysql_options(&con_slot->mysql, MYSQL_SHARED_MEMORY_BASE_NAME, - shared_memory_base_name); + shared_memory_base_name); } #endif - /* Use default db name */ if (ds_database.length == 0) dynstr_set(&ds_database, opt_db); |