cxx: enabled sized-deallocation on clang

This commit is contained in:
Danny Robson 2023-01-11 11:13:05 +10:00
parent 1bfe9561d8
commit 4aa60cc306
2 changed files with 7 additions and 1 deletions

View File

@ -89,6 +89,10 @@ append_compile_flag("-fvisibility=hidden")
append_compile_flag("-fvisibility-inlines-hidden") append_compile_flag("-fvisibility-inlines-hidden")
append_compile_flag("-fPIC") append_compile_flag("-fPIC")
# Clang doesn't enabled sized deallocation (__cpp_sized_deallocation) by
# default, at least by clang-15, so we have to enable it explicitly.
append_compile_flag("-fsized-deallocation")
# We want a build-id so that we can attribute minidumps # We want a build-id so that we can attribute minidumps
append_link_flag("-Wl,--build-id") append_link_flag("-Wl,--build-id")

View File

@ -53,6 +53,9 @@ append_compile_flag(-Wswitch)
# with language primitives like range-for. # with language primitives like range-for.
# append_compile_flag(-Wunsafe-loop-optimizations) # append_compile_flag(-Wunsafe-loop-optimizations)
# gcc warnings with unknown version
append_compile_flag(-Wsized-deallocation)
# gcc-6.1.0 warnings # gcc-6.1.0 warnings
append_compile_flag(-Wshift-negative-value) append_compile_flag(-Wshift-negative-value)
append_compile_flag(-Wnull-dereference) append_compile_flag(-Wnull-dereference)
@ -101,7 +104,6 @@ append_compile_flag(-Wbitwise-instead-of-logical)
append_compile_flag(-Wunaligned-access) append_compile_flag(-Wunaligned-access)
append_compile_flag(-Wunreachable-code-fallthrough) append_compile_flag(-Wunreachable-code-fallthrough)
# ------------------------------------------------------------------------- # -------------------------------------------------------------------------
# Required extensions # Required extensions
#AX_APPEND_COMPILE_FLAGS([-Wgnu-flexible-array-union-member], [], [-Werror]) #AX_APPEND_COMPILE_FLAGS([-Wgnu-flexible-array-union-member], [], [-Werror])