Commit 2aa7463b authored by Davi Arnaut's avatar Davi Arnaut

Add a maintainer target to the warning-mode of the build scripts.

Fix assorted warnings in order for the warning-mode to be effective.
parent fd2fc601
......@@ -15,7 +15,7 @@ Usage: $0 [-h|-n] [configure-options]
-n, --just-print Don't actually run any commands; just print them.
-c, --just-configure Stop after running configure.
--with-debug=full Build with full debug.
--warning-mode=[old|pedantic]
--warning-mode=[old|pedantic|maintainer]
Influences the debug flags. Old is default.
--prefix=path Build with prefix 'path'.
......@@ -62,6 +62,7 @@ just_print=
just_configure=
full_debug=
warning_mode=
maintainer_mode=
parse_options "$@"
......@@ -88,7 +89,21 @@ AM_MAKEFLAGS="-j 6"
# Ex --with-ssl=/usr
SSL_LIBRARY=--with-ssl
if [ "x$warning_mode" != "xpedantic" ]; then
if [ "x$warning_mode" = "xpedantic" ]; then
warnings="-W -Wall -ansi -pedantic -Wno-long-long -Wno-unused -D_POSIX_SOURCE"
c_warnings="$warnings"
cxx_warnings="$warnings -std=c++98"
# NOTE: warning mode should not influence optimize/debug mode.
# Please feel free to add a separate option if you don't feel it's an overkill.
debug_extra_cflags="-O0"
# Reset CPU flags (-mtune), they don't work in -pedantic mode
check_cpu_cflags=""
elif [ "x$warning_mode" = "xmaintainer" ]; then
c_warnings="-Wall -Wextra"
cxx_warnings="$c_warnings -Wno-unused-parameter"
maintainer_mode="--enable-mysql-maintainer-mode"
debug_extra_cflags="-g3"
else
# Both C and C++ warnings
warnings="-Wall -Wextra -Wunused -Wwrite-strings"
......@@ -103,15 +118,6 @@ if [ "x$warning_mode" != "xpedantic" ]; then
cxx_warnings="$cxx_warnings -Wctor-dtor-privacy -Wnon-virtual-dtor"
# Added unless --with-debug=full
debug_extra_cflags="-O0 -g3 -gdwarf-2"
else
warnings="-W -Wall -ansi -pedantic -Wno-long-long -Wno-unused -D_POSIX_SOURCE"
c_warnings="$warnings"
cxx_warnings="$warnings -std=c++98"
# NOTE: warning mode should not influence optimize/debug mode.
# Please feel free to add a separate option if you don't feel it's an overkill.
debug_extra_cflags="-O0"
# Reset CPU flags (-mtune), they don't work in -pedantic mode
check_cpu_cflags=""
fi
# Set flags for various build configurations.
......@@ -147,7 +153,7 @@ fi
base_configs="--prefix=$prefix --enable-assembler "
base_configs="$base_configs --with-extra-charsets=complex "
base_configs="$base_configs --enable-thread-safe-client "
base_configs="$base_configs --with-big-tables"
base_configs="$base_configs --with-big-tables $maintainer_mode"
if test -d "$path/../cmd-line-utils/readline"
then
......
......@@ -238,7 +238,8 @@ unpack_row(Relay_log_info const *rli,
conv_field ? conv_field : *field_ptr;
DBUG_PRINT("debug", ("Conversion %srequired for field '%s' (#%ld)",
conv_field ? "" : "not ",
(*field_ptr)->field_name, field_ptr - begin_ptr));
(*field_ptr)->field_name,
(long) (field_ptr - begin_ptr)));
DBUG_ASSERT(f != NULL);
/*
......
......@@ -643,7 +643,7 @@ extern "C" MI_INFO *myisammrg_attach_children_callback(void *callback_param)
my_errno= HA_ERR_WRONG_MRG_TABLE_DEF;
}
DBUG_PRINT("myrg", ("MyISAM handle: 0x%lx my_errno: %d",
my_errno ? NULL : (long) myisam, my_errno));
my_errno ? 0L : (long) myisam, my_errno));
end:
DBUG_RETURN(myisam);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment