summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorDavi Arnaut <davi.arnaut@oracle.com>2010-07-20 15:07:36 -0300
committerDavi Arnaut <davi.arnaut@oracle.com>2010-07-20 15:07:36 -0300
commitc96b249fc3912f7a86f885cc62da1a3eeed537c6 (patch)
tree3be217b0b2b0e9c76e6f41abe8c7fa3aeb35d373 /client
parentd676c3ff0eef8613ac689df8ed07ecdd0a39817b (diff)
downloadmariadb-git-c96b249fc3912f7a86f885cc62da1a3eeed537c6.tar.gz
Bug#45288: pb2 returns a lot of compilation warnings on linux
Fix warnings flagged by the new warning option -Wunused-but-set-variable that was added to GCC 4.6 and that is enabled by -Wunused and -Wall. The option causes a warning whenever a local variable is assigned to but is later unused. It also warns about meaningless pointer dereferences.
Diffstat (limited to 'client')
-rw-r--r--client/mysql.cc4
-rw-r--r--client/mysql_upgrade.c5
2 files changed, 6 insertions, 3 deletions
diff --git a/client/mysql.cc b/client/mysql.cc
index edcc72b60bf..5b90f318629 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -3639,7 +3639,7 @@ xmlencode_print(const char *src, uint length)
tee_fputs("NULL", PAGER);
else
{
- for (const char *p = src; length; *p++, length--)
+ for (const char *p = src; length; p++, length--)
{
const char *t;
if ((t = array_value(xmlmeta, *p)))
@@ -4726,7 +4726,7 @@ static const char* construct_prompt()
struct tm *t = localtime(&lclock);
/* parse thru the settings for the prompt */
- for (char *c = current_prompt; *c ; *c++)
+ for (char *c = current_prompt; *c ; c++)
{
if (*c != PROMPT_CHAR)
processed_prompt.append(*c);
diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c
index 0b8b43775ed..3122cc25731 100644
--- a/client/mysql_upgrade.c
+++ b/client/mysql_upgrade.c
@@ -595,7 +595,10 @@ static int upgrade_already_done(void)
my_fclose(in, MYF(0));
- return (strncmp(buf, MYSQL_SERVER_VERSION,
+ if (!res)
+ return 0; /* Could not read from file => not sure */
+
+ return (strncmp(res, MYSQL_SERVER_VERSION,
sizeof(MYSQL_SERVER_VERSION)-1)==0);
}