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:
@@ -71,10 +71,14 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* gcc 7.5.0 does not support __attribute__((no_sanitize("undefined")) */
|
/* gcc 7.5.0 does not support __attribute__((no_sanitize("undefined")) */
|
||||||
#if defined(__clang__)
|
#ifndef ATTRIBUTE_NO_UBSAN
|
||||||
#define __attribute_no_sanitize__ __attribute__((no_sanitize("undefined")))
|
# if (GCC_VERSION >= 8000) || defined(__clang__)
|
||||||
#else
|
# define ATTRIBUTE_NO_UBSAN __attribute__((no_sanitize("undefined")))
|
||||||
#define __attribute_no_sanitize__
|
# elif (GCC_VERSION >= 6001)
|
||||||
|
# define ATTRIBUTE_NO_UBSAN __attribute__((no_sanitize_undefined))
|
||||||
|
# else
|
||||||
|
# define ATTRIBUTE_NO_UBSAN
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* _my_attribute_h */
|
#endif /* _my_attribute_h */
|
||||||
|
@@ -248,11 +248,11 @@ protected:
|
|||||||
Typically it's the same as session_value_ptr(), but it's different,
|
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.
|
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
|
uchar *session_var_ptr(THD *thd) const
|
||||||
{ return ((uchar*)&(thd->variables)) + offset; }
|
{ return ((uchar*)&(thd->variables)) + offset; }
|
||||||
|
|
||||||
__attribute_no_sanitize__
|
ATTRIBUTE_NO_UBSAN
|
||||||
uchar *global_var_ptr() const
|
uchar *global_var_ptr() const
|
||||||
{ return ((uchar*)&global_system_variables) + offset; }
|
{ return ((uchar*)&global_system_variables) + offset; }
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user