From 9ad73bf5a7ebc5d52e4c553707e5d3bdc5207965 Mon Sep 17 00:00:00 2001 From: Vladimir Glavnyy <31897320+vglavnyy@users.noreply.github.com> Date: Tue, 18 Dec 2018 02:50:31 +0700 Subject: [PATCH] Fix 'no_sanitize_undefined' attribute for GCC4.8 (#5090) --- CMakeLists.txt | 2 +- include/flatbuffers/base.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b42c4d14b..b9d94b94b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 "=.*") diff --git a/include/flatbuffers/base.h b/include/flatbuffers/base.h index 3166602bd..a0c78fc2a 100644 --- a/include/flatbuffers/base.h +++ b/include/flatbuffers/base.h @@ -212,7 +212,7 @@ // - __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)