Tarantool development patches archive
 help / color / mirror / Atom feed
From: "Timur Safin" <tsafin@tarantool.org>
To: 'Vladislav Shpilevoy' <v.shpilevoy@tarantool.org>,
	tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH 2/2] cmake: split UB sanitations into separate flags.
Date: Mon, 15 Jun 2020 18:41:00 +0300	[thread overview]
Message-ID: <157801d6432b$5f77cdb0$1e676910$@tarantool.org> (raw)
In-Reply-To: <c84614d839fe354963bbf11c2e6c83a5093f8e17.1592151487.git.v.shpilevoy@tarantool.org>



: Sent: Sunday, June 14, 2020 7:25 PM
: Subject: [PATCH 2/2] cmake: split UB sanitations into separate flags.
: 


: 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.

diff --git a/cmake/compiler.cmake b/cmake/compiler.cmake                                              
index 6de8219a0..5a1141ebd 100644                                                                     
--- a/cmake/compiler.cmake                                                                            
+++ b/cmake/compiler.cmake                                                                            
@@ -270,19 +270,9 @@ macro(enable_tnt_compile_flags)                                                  
             message(FATAL_ERROR "Undefined behaviour sanitizer only available for clang")            
         else()                                                                                       
             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"                                                                          
+                alignment bool bounds builtin enum float-cast-overflow                               
+                float-divide-by-zero function integer-divide-by-zero return                          
+                shift unreachable vla-bound                                                          
             )                                                                                        
                                                                                                      
             # Exclude "object-size".                                                                 
                                                                                                      

---
But it did not add any readability penny, so I'm not insisting on using it.


Hence, LGTM 

  reply	other threads:[~2020-06-15 15:41 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-14 16:24 [Tarantool-patches] [PATCH 0/2] ASAN build Vladislav Shpilevoy
2020-06-14 16:24 ` [Tarantool-patches] [PATCH 1/2] sql: don't build sql as a separate library Vladislav Shpilevoy
2020-06-15 15:42   ` Timur Safin
2020-06-14 16:24 ` [Tarantool-patches] [PATCH 2/2] cmake: split UB sanitations into separate flags Vladislav Shpilevoy
2020-06-15 15:41   ` Timur Safin [this message]
2020-06-15 22:19     ` Vladislav Shpilevoy
2020-06-15 14:01 ` [Tarantool-patches] [PATCH 0/2] ASAN build Alexander Turenko
2020-06-15 22:21   ` Vladislav Shpilevoy
2020-06-15 23:04     ` Alexander Turenko
2020-06-15 23:15       ` Vladislav Shpilevoy
2020-06-15 15:43 ` Timur Safin
2020-06-16  8:56 ` Kirill Yukhin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='157801d6432b$5f77cdb0$1e676910$@tarantool.org' \
    --to=tsafin@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH 2/2] cmake: split UB sanitations into separate flags.' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox