Build: Remove -fno-sized-deallocation -Wno-sized-deallocation

Add sized variants of the global operator delete functions so we don't
have to use these GCC options anymore.
This commit is contained in:
Andreas Kling 2020-01-25 16:59:21 +01:00
parent 81ddd2dae0
commit 603bf6fb4a
Notes: sideshowbarker 2024-07-19 09:50:03 +09:00
3 changed files with 12 additions and 20 deletions

View file

@ -47,6 +47,7 @@
# define krealloc realloc
# ifdef __serenity__
inline void* operator new(size_t size)
{
return kmalloc(size);
@ -57,6 +58,11 @@ inline void operator delete(void* ptr)
return kfree(ptr);
}
inline void operator delete(void* ptr, size_t)
{
return kfree(ptr);
}
inline void* operator new[](size_t size)
{
return kmalloc(size);
@ -67,6 +73,11 @@ inline void operator delete[](void* ptr)
return kfree(ptr);
}
inline void operator delete[](void* ptr, size_t)
{
return kfree(ptr);
}
inline void* operator new(size_t, void* ptr)
{
return ptr;

View file

@ -239,22 +239,3 @@ void* operator new[](size_t size)
return kmalloc(size);
}
void operator delete(void* ptr)
{
return kfree(ptr);
}
void operator delete[](void* ptr)
{
return kfree(ptr);
}
void operator delete(void* ptr, size_t)
{
return kfree(ptr);
}
void operator delete[](void* ptr, size_t)
{
return kfree(ptr);
}

View file

@ -1,7 +1,7 @@
MAKEFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
SERENITY_BASE_DIR := $(patsubst %/,%,$(dir $(MAKEFILE_PATH)))
CXX_STANDARD_FLAGS = -std=c++17 -Wno-sized-deallocation -fno-sized-deallocation
CXX_STANDARD_FLAGS = -std=c++17
CXX_WARNING_FLAGS = -Werror -Wextra -Wall -Wno-nonnull-compare -Wno-deprecated-copy -Wno-address-of-packed-member -Wundef -Wcast-qual -Wwrite-strings -Wimplicit-fallthrough -Wno-expansion-to-defined
CXX_FLAVOR_FLAGS = -fno-exceptions -fno-rtti -fstack-protector
#CXX_SUGGEST_FLAGS = -Wsuggest-final-types -Wsuggest-final-methods -Wsuggest-override #-Wsuggest-attribute=noreturn