1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

MDEV-34770 GCC warning fix

kvm-bintar-trusty-x86: warning: ‘no_sanitize’ attribute directive
ignored [-Wattributes]

The attribute is supported since gcc 8.
This commit is contained in:
Aleksey Midenkov
2024-12-04 15:39:10 +03:00
parent 2bf9f0d422
commit aa9d5aea48
2 changed files with 10 additions and 6 deletions

View File

@@ -71,10 +71,14 @@
#endif
/* gcc 7.5.0 does not support __attribute__((no_sanitize("undefined")) */
#if defined(__clang__)
#define __attribute_no_sanitize__ __attribute__((no_sanitize("undefined")))
#else
#define __attribute_no_sanitize__
#ifndef ATTRIBUTE_NO_UBSAN
# if (GCC_VERSION >= 8000) || defined(__clang__)
# define ATTRIBUTE_NO_UBSAN __attribute__((no_sanitize("undefined")))
# elif (GCC_VERSION >= 6001)
# define ATTRIBUTE_NO_UBSAN __attribute__((no_sanitize_undefined))
# else
# define ATTRIBUTE_NO_UBSAN
# endif
#endif
#endif /* _my_attribute_h */