summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Vojtovich <svoj@mariadb.org>2014-12-19 23:17:59 +0400
committerSergey Vojtovich <svoj@mariadb.org>2014-12-19 23:17:59 +0400
commit094640c036a333c0f2b6f909b01a0ca39997f716 (patch)
treefb162343d3a3fd48485731e4fc827ebf9e712478
parent0f64a927a93239f7f0f5e413b893f7fc1233de15 (diff)
downloadmariadb-git-094640c036a333c0f2b6f909b01a0ca39997f716.tar.gz
Fixed a couple of compiler warnings.
-rw-r--r--cmake/maintainer.cmake4
-rw-r--r--mysys/my_context.c13
-rw-r--r--sql-common/client_plugin.c5
-rw-r--r--storage/innobase/include/dict0dict.h2
-rw-r--r--storage/xtradb/include/dict0dict.h2
5 files changed, 12 insertions, 14 deletions
diff --git a/cmake/maintainer.cmake b/cmake/maintainer.cmake
index 5d3ce4d1f75..872d61d9aac 100644
--- a/cmake/maintainer.cmake
+++ b/cmake/maintainer.cmake
@@ -36,8 +36,8 @@ ENDIF()
# Turn on Werror (warning => error) when using maintainer mode.
IF(MYSQL_MAINTAINER_MODE MATCHES "ON")
- SET(MY_C_WARNING_FLAGS "${MY_C_WARNING_FLAGS} -Werror")
- SET(MY_CXX_WARNING_FLAGS "${MY_CXX_WARNING_FLAGS} -Werror")
+ SET(MY_C_WARNING_FLAGS "${MY_C_WARNING_FLAGS} -DFORCE_INIT_OF_VARS -Werror")
+ SET(MY_CXX_WARNING_FLAGS "${MY_CXX_WARNING_FLAGS} -DFORCE_INIT_OF_VARS -Werror")
ENDIF()
# Set warning flags for GCC/Clang
diff --git a/mysys/my_context.c b/mysys/my_context.c
index 9be5ab80468..80156df4495 100644
--- a/mysys/my_context.c
+++ b/mysys/my_context.c
@@ -729,33 +729,36 @@ my_context_continue(struct my_context *c)
#ifdef MY_CONTEXT_DISABLE
int
-my_context_continue(struct my_context *c)
+my_context_continue(struct my_context *c __attribute__((unused)))
{
return -1;
}
int
-my_context_spawn(struct my_context *c, void (*f)(void *), void *d)
+my_context_spawn(struct my_context *c __attribute__((unused)),
+ void (*f)(void *) __attribute__((unused)),
+ void *d __attribute__((unused)))
{
return -1;
}
int
-my_context_yield(struct my_context *c)
+my_context_yield(struct my_context *c __attribute__((unused)))
{
return -1;
}
int
-my_context_init(struct my_context *c, size_t stack_size)
+my_context_init(struct my_context *c __attribute__((unused)),
+ size_t stack_size __attribute__((unused)))
{
return -1; /* Out of memory */
}
void
-my_context_destroy(struct my_context *c)
+my_context_destroy(struct my_context *c __attribute__((unused)))
{
}
diff --git a/sql-common/client_plugin.c b/sql-common/client_plugin.c
index f31ddb22a6a..d96f9648011 100644
--- a/sql-common/client_plugin.c
+++ b/sql-common/client_plugin.c
@@ -28,11 +28,6 @@
There is no reference counting and no unloading either.
*/
-#if _MSC_VER
-/* Silence warnings about variable 'unused' being used. */
-#define FORCE_INIT_OF_VARS 1
-#endif
-
#include <my_global.h>
#include "mysql.h"
#include <my_sys.h>
diff --git a/storage/innobase/include/dict0dict.h b/storage/innobase/include/dict0dict.h
index 0ad3cb3bcce..bb1119b3c19 100644
--- a/storage/innobase/include/dict0dict.h
+++ b/storage/innobase/include/dict0dict.h
@@ -1139,7 +1139,7 @@ recalculated
*/
#define DICT_TABLE_CHANGED_TOO_MUCH(t) \
((ib_int64_t) (t)->stat_modified_counter > (srv_stats_modified_counter ? \
- ut_min(srv_stats_modified_counter, (16 + (t)->stat_n_rows / 16)) : \
+ (ib_int64_t) ut_min(srv_stats_modified_counter, (16 + (t)->stat_n_rows / 16)) : \
16 + (t)->stat_n_rows / 16))
/*********************************************************************//**
diff --git a/storage/xtradb/include/dict0dict.h b/storage/xtradb/include/dict0dict.h
index b03d25818c9..2b53a33e103 100644
--- a/storage/xtradb/include/dict0dict.h
+++ b/storage/xtradb/include/dict0dict.h
@@ -1139,7 +1139,7 @@ recalculated
*/
#define DICT_TABLE_CHANGED_TOO_MUCH(t) \
((ib_int64_t) (t)->stat_modified_counter > (srv_stats_modified_counter ? \
- ut_min(srv_stats_modified_counter, (16 + (t)->stat_n_rows / 16)) : \
+ (ib_int64_t) ut_min(srv_stats_modified_counter, (16 + (t)->stat_n_rows / 16)) : \
16 + (t)->stat_n_rows / 16))
/*********************************************************************//**