mirror of
https://github.com/MariaDB/server.git
synced 2025-01-28 17:54:16 +01:00
Fix MariadDB to compile with gcc 7.5.0
gcc 7.5.0 does not understand __attribute__((no_sanitize("undefined")) I moved the usage of this attribute from sql/set_var.h to include/my_attribute.h and created a macro for it depending on compiler used.
This commit is contained in:
parent
818c84ad45
commit
8e9aa9c6b0
2 changed files with 10 additions and 3 deletions
|
@ -70,5 +70,11 @@
|
|||
# endif /* GNUC >= 3.1 */
|
||||
#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__
|
||||
#endif
|
||||
|
||||
#endif /* _my_attribute_h */
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#endif
|
||||
|
||||
#include <my_getopt.h>
|
||||
#include <my_attribute.h>
|
||||
|
||||
class sys_var;
|
||||
class set_var;
|
||||
|
@ -247,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("undefined")))
|
||||
__attribute_no_sanitize__
|
||||
uchar *session_var_ptr(THD *thd) const
|
||||
{ return ((uchar*)&(thd->variables)) + offset; }
|
||||
|
||||
__attribute__((no_sanitize("undefined")))
|
||||
__attribute_no_sanitize__
|
||||
uchar *global_var_ptr() const
|
||||
{ return ((uchar*)&global_system_variables) + offset; }
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue