summaryrefslogtreecommitdiff
path: root/src/debug/debug_new.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-07-06 22:22:23 +0300
committerAndrei Karas <akaras@inbox.ru>2017-07-06 22:22:23 +0300
commit5d80bf4f75f838867d3186de315225ec8265eae2 (patch)
tree6647243e0be8c0f3632b3b43b487bd81e8f27afa /src/debug/debug_new.cpp
parentc3d07bbf19a83f74748d0df628c6d4be9d7f7a20 (diff)
downloadplus-5d80bf4f75f838867d3186de315225ec8265eae2.tar.gz
plus-5d80bf4f75f838867d3186de315225ec8265eae2.tar.bz2
plus-5d80bf4f75f838867d3186de315225ec8265eae2.tar.xz
plus-5d80bf4f75f838867d3186de315225ec8265eae2.zip
Fix different issues in debug_new.cpp
Diffstat (limited to 'src/debug/debug_new.cpp')
-rw-r--r--src/debug/debug_new.cpp23
1 files changed, 17 insertions, 6 deletions
diff --git a/src/debug/debug_new.cpp b/src/debug/debug_new.cpp
index 0daa66fe1..594796570 100644
--- a/src/debug/debug_new.cpp
+++ b/src/debug/debug_new.cpp
@@ -34,6 +34,14 @@
* @date 2016-10-14
*/
+#include "localconsts.h"
+
+PRAGMACLANG6GCC(GCC diagnostic push)
+PRAGMACLANG6GCC(GCC diagnostic ignored "-Wold-style-cast")
+
+PRAGMA45(GCC diagnostic push)
+PRAGMA45(GCC diagnostic ignored "-Wcast-qual")
+
#include <new> // std::bad_alloc/nothrow_t
#include <assert.h> // assert
#include <stdio.h> // fprintf/stderr
@@ -199,9 +207,9 @@
*
* Value of the padding bytes at the end of a memory block.
*/
-#ifndef _DEBUG_NEW_TAILCHECK_CHAR
-#define _DEBUG_NEW_TAILCHECK_CHAR 0xCC
-#endif
+//#ifndef _DEBUG_NEW_TAILCHECK_CHAR
+//#define _DEBUG_NEW_TAILCHECK_CHAR 0xCC
+//#endif
/**
* @def _DEBUG_NEW_USE_ADDR2LINE
@@ -1036,7 +1044,7 @@ void* operator new[](size_t size, const char* file, int line)
* insufficient (#_DEBUG_NEW_STD_OPER_NEW is 0)
* @throw bad_alloc memory is insufficient (#_DEBUG_NEW_STD_OPER_NEW is 1)
*/
-void* operator new(size_t size) throw(std::bad_alloc)
+void* operator new(size_t size)
{
return operator new(size, (char*)_DEBUG_NEW_CALLER_ADDRESS, 0);
}
@@ -1049,7 +1057,7 @@ void* operator new(size_t size) throw(std::bad_alloc)
* insufficient (#_DEBUG_NEW_STD_OPER_NEW is 0)
* @throw bad_alloc memory is insufficient (#_DEBUG_NEW_STD_OPER_NEW is 1)
*/
-void* operator new[](size_t size) throw(std::bad_alloc)
+void* operator new[](size_t size)
{
return operator new[](size, (char*)_DEBUG_NEW_CALLER_ADDRESS, 0);
}
@@ -1183,4 +1191,7 @@ void operator delete[](void* ptr, const std::nothrow_t&) _NOEXCEPT
// This is to make Doxygen happy
#undef _DEBUG_NEW_REMEMBER_STACK_TRACE
-#define _DEBUG_NEW_REMEMBER_STACK_TRACE 0
+//#define _DEBUG_NEW_REMEMBER_STACK_TRACE 0
+
+PRAGMA45(GCC diagnostic pop)
+PRAGMACLANG6GCC(GCC diagnostic pop)