mirror of
https://github.com/MariaDB/server.git
synced 2025-01-15 19:42:28 +01: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:
parent
2bf9f0d422
commit
aa9d5aea48
2 changed files with 10 additions and 6 deletions
|
@ -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 */
|
||||
|
|
|
@ -248,11 +248,11 @@ protected:
|
|||
Typically it's the same as session_value_ptr(), but it's different,
|
||||
for example, for ENUM, that is printed as a string, but stored as a number.
|
||||
*/
|
||||
__attribute_no_sanitize__
|
||||
ATTRIBUTE_NO_UBSAN
|
||||
uchar *session_var_ptr(THD *thd) const
|
||||
{ return ((uchar*)&(thd->variables)) + offset; }
|
||||
|
||||
__attribute_no_sanitize__
|
||||
ATTRIBUTE_NO_UBSAN
|
||||
uchar *global_var_ptr() const
|
||||
{ return ((uchar*)&global_system_variables) + offset; }
|
||||
|
||||
|
|
Loading…
Reference in a new issue