From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp32.i.mail.ru (smtp32.i.mail.ru [94.100.177.92]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 72E1F4429E1 for ; Mon, 15 Jun 2020 18:41:02 +0300 (MSK) From: "Timur Safin" References: In-Reply-To: Date: Mon, 15 Jun 2020 18:41:00 +0300 Message-ID: <157801d6432b$5f77cdb0$1e676910$@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Content-Language: ru Subject: Re: [Tarantool-patches] [PATCH 2/2] cmake: split UB sanitations into separate flags. List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: 'Vladislav Shpilevoy' , tarantool-patches@dev.tarantool.org : Sent: Sunday, June 14, 2020 7:25 PM : Subject: [PATCH 2/2] cmake: split UB sanitations into separate flags. :=20 : 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=3Dundefined -fno-sanitize- : recover=3Dundefined") : + 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=20 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. diff --git a/cmake/compiler.cmake b/cmake/compiler.cmake = =20 index 6de8219a0..5a1141ebd 100644 = =20 --- a/cmake/compiler.cmake = =20 +++ b/cmake/compiler.cmake = =20 @@ -270,19 +270,9 @@ macro(enable_tnt_compile_flags) = =20 message(FATAL_ERROR "Undefined behaviour sanitizer only = available for clang") =20 else() = =20 string(JOIN "," SANITIZE_FLAGS = =20 - "alignment" = =20 - "bool" = =20 - "bounds" = =20 - "builtin" = =20 - "enum" = =20 - "float-cast-overflow" = =20 - "float-divide-by-zero" = =20 - "function" = =20 - "integer-divide-by-zero" = =20 - "return" = =20 - "shift" = =20 - "unreachable" = =20 - "vla-bound" = =20 + alignment bool bounds builtin enum float-cast-overflow = =20 + float-divide-by-zero function integer-divide-by-zero = return =20 + shift unreachable vla-bound = =20 ) = =20 = =20 # Exclude "object-size". = =20 = =20 --- But it did not add any readability penny, so I'm not insisting on using = it. Hence, LGTM=20