Fix 'no_sanitize_undefined' attribute for GCC4.8 (#5090)
authorVladimir Glavnyy <31897320+vglavnyy@users.noreply.github.com>
Mon, 17 Dec 2018 19:50:31 +0000 (02:50 +0700)
committerWouter van Oortmerssen <aardappel@gmail.com>
Mon, 17 Dec 2018 19:50:31 +0000 (11:50 -0800)
CMakeLists.txt
include/flatbuffers/base.h

index b42c4d1..b9d94b9 100644 (file)
@@ -219,7 +219,7 @@ function(add_fsanitize_to_target _target _sanitizer)
   # FLATBUFFERS_CODE_SANITIZE: boolean {ON,OFF,YES,NO} or string with list of sanitizer.
   # List of sanitizer is string starts with '=': "=address,undefined,thread,memory".
   if((${CMAKE_CXX_COMPILER_ID} MATCHES "Clang") OR
-    ((${CMAKE_CXX_COMPILER_ID} MATCHES "GNU") AND NOT (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.8"))
+    ((${CMAKE_CXX_COMPILER_ID} MATCHES "GNU") AND NOT (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.9"))
   )
     set(_sanitizer_flags "=address,undefined")
     if(_sanitizer MATCHES "=.*")
index 3166602..a0c78fc 100644 (file)
 // - __supress_ubsan__("signed-integer-overflow")
 #if defined(__clang__)
   #define __supress_ubsan__(type) __attribute__((no_sanitize(type)))
-#elif defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 408)
+#elif defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 409)
   #define __supress_ubsan__(type) __attribute__((no_sanitize_undefined))
 #else
   #define __supress_ubsan__(type)