Skip to content

Commit 094640c

Browse files
committed
Fixed a couple of compiler warnings.
1 parent 0f64a92 commit 094640c

File tree

5 files changed

+12
-14
lines changed

5 files changed

+12
-14
lines changed

cmake/maintainer.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ ENDIF()
3636

3737
# Turn on Werror (warning => error) when using maintainer mode.
3838
IF(MYSQL_MAINTAINER_MODE MATCHES "ON")
39-
SET(MY_C_WARNING_FLAGS "${MY_C_WARNING_FLAGS} -Werror")
40-
SET(MY_CXX_WARNING_FLAGS "${MY_CXX_WARNING_FLAGS} -Werror")
39+
SET(MY_C_WARNING_FLAGS "${MY_C_WARNING_FLAGS} -DFORCE_INIT_OF_VARS -Werror")
40+
SET(MY_CXX_WARNING_FLAGS "${MY_CXX_WARNING_FLAGS} -DFORCE_INIT_OF_VARS -Werror")
4141
ENDIF()
4242

4343
# Set warning flags for GCC/Clang

mysys/my_context.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -729,33 +729,36 @@ my_context_continue(struct my_context *c)
729729

730730
#ifdef MY_CONTEXT_DISABLE
731731
int
732-
my_context_continue(struct my_context *c)
732+
my_context_continue(struct my_context *c __attribute__((unused)))
733733
{
734734
return -1;
735735
}
736736

737737

738738
int
739-
my_context_spawn(struct my_context *c, void (*f)(void *), void *d)
739+
my_context_spawn(struct my_context *c __attribute__((unused)),
740+
void (*f)(void *) __attribute__((unused)),
741+
void *d __attribute__((unused)))
740742
{
741743
return -1;
742744
}
743745

744746

745747
int
746-
my_context_yield(struct my_context *c)
748+
my_context_yield(struct my_context *c __attribute__((unused)))
747749
{
748750
return -1;
749751
}
750752

751753
int
752-
my_context_init(struct my_context *c, size_t stack_size)
754+
my_context_init(struct my_context *c __attribute__((unused)),
755+
size_t stack_size __attribute__((unused)))
753756
{
754757
return -1; /* Out of memory */
755758
}
756759

757760
void
758-
my_context_destroy(struct my_context *c)
761+
my_context_destroy(struct my_context *c __attribute__((unused)))
759762
{
760763
}
761764

sql-common/client_plugin.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,6 @@
2828
There is no reference counting and no unloading either.
2929
*/
3030

31-
#if _MSC_VER
32-
/* Silence warnings about variable 'unused' being used. */
33-
#define FORCE_INIT_OF_VARS 1
34-
#endif
35-
3631
#include <my_global.h>
3732
#include "mysql.h"
3833
#include <my_sys.h>

storage/innobase/include/dict0dict.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1139,7 +1139,7 @@ recalculated
11391139
*/
11401140
#define DICT_TABLE_CHANGED_TOO_MUCH(t) \
11411141
((ib_int64_t) (t)->stat_modified_counter > (srv_stats_modified_counter ? \
1142-
ut_min(srv_stats_modified_counter, (16 + (t)->stat_n_rows / 16)) : \
1142+
(ib_int64_t) ut_min(srv_stats_modified_counter, (16 + (t)->stat_n_rows / 16)) : \
11431143
16 + (t)->stat_n_rows / 16))
11441144

11451145
/*********************************************************************//**

storage/xtradb/include/dict0dict.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1139,7 +1139,7 @@ recalculated
11391139
*/
11401140
#define DICT_TABLE_CHANGED_TOO_MUCH(t) \
11411141
((ib_int64_t) (t)->stat_modified_counter > (srv_stats_modified_counter ? \
1142-
ut_min(srv_stats_modified_counter, (16 + (t)->stat_n_rows / 16)) : \
1142+
(ib_int64_t) ut_min(srv_stats_modified_counter, (16 + (t)->stat_n_rows / 16)) : \
11431143
16 + (t)->stat_n_rows / 16))
11441144

11451145
/*********************************************************************//**

0 commit comments

Comments
 (0)