mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
Bug #53445 Build with -Wall and fix warnings that it generates
Add -Wall to gcc/g++ Fix most warnings reported in dbg and opt mode. cmd-line-utils/libedit/filecomplete.c: Remove unused auto variables. configure.cmake: Add -Wall to gcc. extra/comp_err.c: Cast to correct type. extra/perror.c: Fix segfault (but warnings about deprecated features remain) extra/yassl/taocrypt/include/runtime.hpp: Comparing two literals was reported as undefined behaviour. include/my_global.h: Add a template for aligning character buffers. mysys/lf_alloc-pin.c: Initialize pointer. sql/mysqld.cc: Use UNINIT_VAR rather than LINT_INIT. sql/partition_info.cc: Use UNINIT_VAR rather than LINT_INIT. sql/rpl_handler.cc: Use char[] rather than unsigned long[] array for placement buffer. sql/spatial.cc: Use char[] rather than unsigned void*[] array for placement buffer. sql/spatial.h: Use char[] rather than unsigned void*[] array for placement buffer. sql/sql_partition.cc: Initialize auto variable. sql/sql_table.cc: Initialize auto variables. Add parens around assignment within if() sql/sys_vars.cc: Use UNINIT_VAR. storage/innobase/os/os0file.c: Init first slot in auto variable. storage/myisam/mi_create.c: Use UNINIT_VAR rather than LINT_INIT. storage/myisam/mi_open.c: Remove (wrong) casting. storage/myisam/mi_page.c: Remove (wrong) casting. storage/myisam/mi_search.c: Cast to uchar* rather than char*. strings/ctype-ucs2.c: Use UNINIT_VAR rather than LINT_INIT. Add (uchar*) casting.
This commit is contained in:
@@ -89,21 +89,24 @@ int get_user_var_str(const char *name, char *value,
|
||||
|
||||
int delegates_init()
|
||||
{
|
||||
static unsigned long trans_mem[sizeof(Trans_delegate) / sizeof(unsigned long) + 1];
|
||||
static unsigned long storage_mem[sizeof(Binlog_storage_delegate) / sizeof(unsigned long) + 1];
|
||||
static Aligned_char_array<sizeof(Trans_delegate)> trans_mem;
|
||||
static Aligned_char_array<sizeof(Binlog_storage_delegate)> storage_mem;
|
||||
#ifdef HAVE_REPLICATION
|
||||
static unsigned long transmit_mem[sizeof(Binlog_transmit_delegate) / sizeof(unsigned long) + 1];
|
||||
static unsigned long relay_io_mem[sizeof(Binlog_relay_IO_delegate)/ sizeof(unsigned long) + 1];
|
||||
static Aligned_char_array<sizeof(Binlog_transmit_delegate)> transmit_mem;
|
||||
static Aligned_char_array<sizeof(Binlog_relay_IO_delegate)> relay_io_mem;
|
||||
#endif
|
||||
|
||||
if (!(transaction_delegate= new (trans_mem) Trans_delegate)
|
||||
|
||||
if (!(transaction_delegate= new (trans_mem.arr()) Trans_delegate)
|
||||
|| (!transaction_delegate->is_inited())
|
||||
|| !(binlog_storage_delegate= new (storage_mem) Binlog_storage_delegate)
|
||||
|| !(binlog_storage_delegate=
|
||||
new (storage_mem.arr()) Binlog_storage_delegate)
|
||||
|| (!binlog_storage_delegate->is_inited())
|
||||
#ifdef HAVE_REPLICATION
|
||||
|| !(binlog_transmit_delegate= new (transmit_mem) Binlog_transmit_delegate)
|
||||
|| !(binlog_transmit_delegate=
|
||||
new (transmit_mem.arr()) Binlog_transmit_delegate)
|
||||
|| (!binlog_transmit_delegate->is_inited())
|
||||
|| !(binlog_relay_io_delegate= new (relay_io_mem) Binlog_relay_IO_delegate)
|
||||
|| !(binlog_relay_io_delegate=
|
||||
new (relay_io_mem.arr()) Binlog_relay_IO_delegate)
|
||||
|| (!binlog_relay_io_delegate->is_inited())
|
||||
#endif /* HAVE_REPLICATION */
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user