mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-29 17:22:03 +00:00
Fix 'no_sanitize_undefined' attribute for GCC4.8 (#5090)
This commit is contained in:
committed by
Wouter van Oortmerssen
parent
dba962ebb8
commit
9ad73bf5a7
@@ -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.
|
# 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".
|
# List of sanitizer is string starts with '=': "=address,undefined,thread,memory".
|
||||||
if((${CMAKE_CXX_COMPILER_ID} MATCHES "Clang") OR
|
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")
|
set(_sanitizer_flags "=address,undefined")
|
||||||
if(_sanitizer MATCHES "=.*")
|
if(_sanitizer MATCHES "=.*")
|
||||||
|
|||||||
@@ -212,7 +212,7 @@
|
|||||||
// - __supress_ubsan__("signed-integer-overflow")
|
// - __supress_ubsan__("signed-integer-overflow")
|
||||||
#if defined(__clang__)
|
#if defined(__clang__)
|
||||||
#define __supress_ubsan__(type) __attribute__((no_sanitize(type)))
|
#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))
|
#define __supress_ubsan__(type) __attribute__((no_sanitize_undefined))
|
||||||
#else
|
#else
|
||||||
#define __supress_ubsan__(type)
|
#define __supress_ubsan__(type)
|
||||||
|
|||||||
Reference in New Issue
Block a user