diff options
author | Vladislav Vaintroub <wlad@mariadb.com> | 2018-02-06 23:32:02 +0000 |
---|---|---|
committer | Vladislav Vaintroub <wlad@mariadb.com> | 2018-02-07 20:19:40 +0000 |
commit | 8fe04a3df37d65254142c6d1297eda32c1013f7f (patch) | |
tree | 46942e3ffc78ca7de8ae593d759993f83fd85c68 | |
parent | 282b652028ca79baa5a43aa5356d779a688947a8 (diff) | |
download | mariadb-git-8fe04a3df37d65254142c6d1297eda32c1013f7f.tar.gz |
Windows, compile : reenable previously disabled warning C4291
no matching operator delete found; memory will not be freed if initialization throws an exception
Added a no-op delete() for MEM_ROOT based placement-new()
-rw-r--r-- | cmake/os/Windows.cmake | 2 | ||||
-rw-r--r-- | sql/sql_acl.cc | 2 | ||||
-rw-r--r-- | sql/sql_alloc.h | 5 | ||||
-rw-r--r-- | sql/sql_cursor.h | 1 | ||||
-rw-r--r-- | sql/sql_prepare.h | 1 | ||||
-rw-r--r-- | sql/sql_select.cc | 2 | ||||
-rw-r--r-- | sql/sql_select.h | 1 | ||||
-rw-r--r-- | sql/sql_show.cc | 1 | ||||
-rw-r--r-- | storage/federatedx/ha_federatedx.h | 2 |
9 files changed, 12 insertions, 5 deletions
diff --git a/cmake/os/Windows.cmake b/cmake/os/Windows.cmake index 8490cb3b1a9..851a42e7ad1 100644 --- a/cmake/os/Windows.cmake +++ b/cmake/os/Windows.cmake @@ -147,7 +147,7 @@ IF(MSVC) #TODO: update the code and remove the disabled warnings SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /we4700 /we4311 /we4477 /we4302 /we4090") - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4291 /we4099 /we4700 /we4311 /we4477 /we4302 /we4090") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /we4099 /we4700 /we4311 /we4477 /we4302 /we4090") ADD_DEFINITIONS(-D_CRT_NONSTDC_NO_WARNINGS) IF(MYSQL_MAINTAINER_MODE MATCHES "ERR") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /WX") diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index cc4393008e6..da12a2191a9 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -247,7 +247,7 @@ class ACL_USER_BASE :public ACL_ACCESS public: static void *operator new(size_t size, MEM_ROOT *mem_root) { return (void*) alloc_root(mem_root, size); } - + static void operator delete(void *, MEM_ROOT *){} uchar flags; // field used to store various state information LEX_CSTRING user; /* list to hold references to granted roles (ACL_ROLE instances) */ diff --git a/sql/sql_alloc.h b/sql/sql_alloc.h index 4db12964f0a..9b596aa51a4 100644 --- a/sql/sql_alloc.h +++ b/sql/sql_alloc.h @@ -37,11 +37,10 @@ public: } static void *operator new[](size_t size, MEM_ROOT *mem_root) throw () { return alloc_root(mem_root, size); } - static void *operator new(size_t size, MEM_ROOT *mem_root) throw () + static void *operator new(size_t size, MEM_ROOT *mem_root) { return alloc_root(mem_root, size); } static void operator delete(void *ptr, size_t size) { TRASH(ptr, size); } - static void operator delete(void *ptr, MEM_ROOT *mem_root) - { /* never called */ } + static void operator delete(void *, MEM_ROOT *){} static void operator delete[](void *ptr, MEM_ROOT *mem_root) { /* never called */ } static void operator delete[](void *ptr, size_t size) { TRASH(ptr, size); } diff --git a/sql/sql_cursor.h b/sql/sql_cursor.h index 6fa72a2005d..740a658b7c0 100644 --- a/sql/sql_cursor.h +++ b/sql/sql_cursor.h @@ -62,6 +62,7 @@ public: virtual ~Server_side_cursor(); static void operator delete(void *ptr, size_t size); + static void operator delete(void *, MEM_ROOT *){} }; diff --git a/sql/sql_prepare.h b/sql/sql_prepare.h index 4eb50b9b9d8..ca040da341f 100644 --- a/sql/sql_prepare.h +++ b/sql/sql_prepare.h @@ -130,6 +130,7 @@ public: size_t get_field_count() const { return m_column_count; } static void operator delete(void *ptr, size_t size) throw (); + static void operator delete(void *, MEM_ROOT *){} private: Ed_result_set(const Ed_result_set &); /* not implemented */ Ed_result_set &operator=(Ed_result_set &); /* not implemented */ diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 68f1f6068e6..70eb29378c4 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -13355,6 +13355,8 @@ public: size_t size __attribute__((unused))) { TRASH(ptr, size); } + static void operator delete(void *, MEM_ROOT*) {} + Item *and_level; Item_bool_func2 *cmp_func; COND_CMP(Item *a,Item_bool_func2 *b) :and_level(a),cmp_func(b) {} diff --git a/sql/sql_select.h b/sql/sql_select.h index 4642fe04dbc..b3646599f90 100644 --- a/sql/sql_select.h +++ b/sql/sql_select.h @@ -2115,6 +2115,7 @@ public: */ static void *operator new(size_t size, THD *thd) throw(); static void operator delete(void *ptr, size_t size) { TRASH(ptr, size); } + static void operator delete(void *, THD *) throw(){} Virtual_tmp_table(THD *thd) { diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 2e06b912891..eb0c014f060 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -2699,6 +2699,7 @@ public: static void operator delete(void *ptr __attribute__((unused)), size_t size __attribute__((unused))) { TRASH(ptr, size); } + static void operator delete(void *, MEM_ROOT *){} my_thread_id thread_id; uint32 os_thread_id; diff --git a/storage/federatedx/ha_federatedx.h b/storage/federatedx/ha_federatedx.h index f5affebc426..8ae5d8bbc8e 100644 --- a/storage/federatedx/ha_federatedx.h +++ b/storage/federatedx/ha_federatedx.h @@ -170,6 +170,8 @@ public: { return alloc_root(mem_root, size); } static void operator delete(void *ptr, size_t size) { TRASH(ptr, size); } + static void operator delete(void *, MEM_ROOT *) + { } virtual int query(const char *buffer, size_t length)=0; virtual FEDERATEDX_IO_RESULT *store_result()=0; |