[Tarantool-patches] [PATCH 2/2] cmake: split UB sanitations into separate flags.
Vladislav Shpilevoy
v.shpilevoy at tarantool.org
Tue Jun 16 01:19:36 MSK 2020
Hi! Thanks for the review!
> : diff --git a/cmake/compiler.cmake b/cmake/compiler.cmake
> : index 6c0fa635c..6de8219a0 100644
> : --- a/cmake/compiler.cmake
> : +++ b/cmake/compiler.cmake
> : @@ -269,19 +269,55 @@ macro(enable_tnt_compile_flags)
> : if (NOT CMAKE_COMPILER_IS_CLANG)
> : message(FATAL_ERROR "Undefined behaviour sanitizer only
> : available for clang")
> : else()
> : - set(SANITIZE_FLAGS "-fsanitize=undefined -fno-sanitize-
> : recover=undefined")
> : + string(JOIN "," SANITIZE_FLAGS
> : + "alignment"
> : + "bool"
> : + "bounds"
> : + "builtin"
> : + "enum"
> : + "float-cast-overflow"
> : + "float-divide-by-zero"
> : + "function"
> : + "integer-divide-by-zero"
> : + "return"
> : + "shift"
> : + "unreachable"
> : + "vla-bound"
> : + )
> : +
>
> You know, every time I see (unnecessary) quoted strings inside of cmake
> lists I want to run and fix it immediately. Because there is no actual
> need to quote them - in cmake almost everything is string literal at the end
>
> Thus I tried to make this construction compacter and less verbose, e.g.
I didn't know the quotes are not needed. Nice! Applied your diff.
More information about the Tarantool-patches
mailing list