diff options
author | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-11-07 04:56:24 +0000 |
---|---|---|
committer | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-11-07 04:56:24 +0000 |
commit | 9722ed0e52aba80177960458d7d3deb3dde59c53 (patch) | |
tree | d3294b4331d992da288ee2878af19faad5cf56ed /internal.h | |
parent | 234ffbce0e17464b0c174e3567ffe34917277229 (diff) |
suppress GCC warning about unknown sanitizers
See also: https://travis-ci.org/ruby/ruby/jobs/451710726#L1941
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65590 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'internal.h')
-rw-r--r-- | internal.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/internal.h b/internal.h index 2f3124f791..1a030566d3 100644 --- a/internal.h +++ b/internal.h @@ -68,6 +68,16 @@ extern "C" { # define ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS(x) x #endif +#if defined(NO_SANITIZE) && defined(__GNUC__) &&! defined(__clang__) +/* GCC warns about unknown sanitizer, which is annoying. */ +#undef NO_SANITIZE +#define NO_SANITIZE(x, y) \ + COMPILER_WARNING_PUSH; \ + COMPILER_WARNING_IGNORED(-Wattributes); \ + __attribute__((__no_sanitize__(x))) y; \ + COMPILER_WARNING_POP +#endif + #ifndef NO_SANITIZE # define NO_SANITIZE(x, y) y #endif |