enable pointer cast warnings

This commit is contained in:
Daniel Micay 2018-10-21 15:50:26 -04:00
parent 9a43302868
commit ac8c68de53
2 changed files with 3 additions and 3 deletions

View File

@ -2,7 +2,7 @@ CONFIG_CXX_ALLOCATOR := true
CONFIG_UBSAN := false
CPPFLAGS := -D_GNU_SOURCE
SHARED_FLAGS := -O2 -flto -fPIC -fvisibility=hidden -fno-plt -pipe -Wall -Wextra
SHARED_FLAGS := -O2 -flto -fPIC -fvisibility=hidden -fno-plt -pipe -Wall -Wextra -Wcast-align=strict -Wcast-qual -Wwrite-strings
CFLAGS := -std=c11 $(SHARED_FLAGS) -Wmissing-prototypes
CXXFLAGS := -std=c++14 $(SHARED_FLAGS)
LDFLAGS := -Wl,-z,defs,-z,relro,-z,now,-z,nodlopen,-z,text

View File

@ -296,13 +296,13 @@ static void *slot_pointer(size_t size, void *slab, size_t slot) {
return (char *)slab + slot * size;
}
static void write_after_free_check(const char *p, size_t size) {
static void write_after_free_check(const void *p, size_t size) {
if (!WRITE_AFTER_FREE_CHECK) {
return;
}
for (size_t i = 0; i < size; i += sizeof(u64)) {
if (*(u64 *)(p + i)) {
if (*(const u64 *)(p + i)) {
fatal_error("detected write after free");
}
}