--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/mysql-5-6/patches/bug22932576.patch Sat Jun 25 10:48:59 2016 -0700
@@ -0,0 +1,19424 @@
+Developed in-house, not fed back.
+Solaris-specific
+stlport is no longer supported/maintained, so we had to switch to std=c++03
+For Sun Studio we must build with -std=c++03 flag
+Since Sun Studio depends on seeing __attribute__ ((__weakref__)) in order to generate correct code.
+Introduced MY_ATTRIBUTE: sed -i -e 's/__attribute__/MY_ATTRIBUTE/g' `cat <all srouce files>`
+
+--- a/client/mysql.cc
++++ b/client/mysql.cc
[email protected]@ -1819,7 +1819,7 @@ static void usage(int version)
+
+
+ my_bool
+-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
++get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)),
+ char *argument)
+ {
+ switch(optid) {
[email protected]@ -2755,8 +2755,8 @@ static void initialize_readline (char *name)
+ */
+
+ static char **new_mysql_completion(const char *text,
+- int start __attribute__((unused)),
+- int end __attribute__((unused)))
++ int start MY_ATTRIBUTE((unused)),
++ int end MY_ATTRIBUTE((unused)))
+ {
+ if (!status.batch && !quick)
+ #if defined(USE_NEW_READLINE_INTERFACE)
[email protected]@ -3166,8 +3166,8 @@ static void print_help_item(MYSQL_ROW *cur, int num_name, int num_cat, char *las
+ }
+
+
+-static int com_server_help(String *buffer __attribute__((unused)),
+- char *line __attribute__((unused)), char *help_arg)
++static int com_server_help(String *buffer MY_ATTRIBUTE((unused)),
++ char *line MY_ATTRIBUTE((unused)), char *help_arg)
+ {
+ MYSQL_ROW cur;
+ const char *server_cmd;
[email protected]@ -3273,8 +3273,8 @@ err:
+ }
+
+ static int
+-com_help(String *buffer __attribute__((unused)),
+- char *line __attribute__((unused)))
++com_help(String *buffer MY_ATTRIBUTE((unused)),
++ char *line MY_ATTRIBUTE((unused)))
+ {
+ reg1 int i, j;
+ char * help_arg= strchr(line,' '), buff[32], *end;
[email protected]@ -3313,7 +3313,7 @@ com_help(String *buffer __attribute__((unused)),
+
+ /* ARGSUSED */
+ static int
+-com_clear(String *buffer,char *line __attribute__((unused)))
++com_clear(String *buffer,char *line MY_ATTRIBUTE((unused)))
+ {
+ #ifdef HAVE_READLINE
+ if (status.add_to_history)
[email protected]@ -3325,7 +3325,7 @@ com_clear(String *buffer,char *line __attribute__((unused)))
+
+ /* ARGSUSED */
+ static int
+-com_charset(String *buffer __attribute__((unused)), char *line)
++com_charset(String *buffer MY_ATTRIBUTE((unused)), char *line)
+ {
+ char buff[256], *param;
+ const CHARSET_INFO *new_cs;
[email protected]@ -3357,7 +3357,7 @@ com_charset(String *buffer __attribute__((unused)), char *line)
+
+
+ static int
+-com_go(String *buffer,char *line __attribute__((unused)))
++com_go(String *buffer,char *line MY_ATTRIBUTE((unused)))
+ {
+ char buff[200]; /* about 110 chars used so far */
+ char time_buff[52+3+1]; /* time max + space&parens + NUL */
[email protected]@ -4118,8 +4118,8 @@ print_tab_data(MYSQL_RES *result)
+ }
+
+ static int
+-com_tee(String *buffer __attribute__((unused)),
+- char *line __attribute__((unused)))
++com_tee(String *buffer MY_ATTRIBUTE((unused)),
++ char *line MY_ATTRIBUTE((unused)))
+ {
+ char file_name[FN_REFLEN], *end, *param;
+
[email protected]@ -4161,8 +4161,8 @@ com_tee(String *buffer __attribute__((unused)),
+
+
+ static int
+-com_notee(String *buffer __attribute__((unused)),
+- char *line __attribute__((unused)))
++com_notee(String *buffer MY_ATTRIBUTE((unused)),
++ char *line MY_ATTRIBUTE((unused)))
+ {
+ if (opt_outfile)
+ end_tee();
[email protected]@ -4176,8 +4176,8 @@ com_notee(String *buffer __attribute__((unused)),
+
+ #ifdef USE_POPEN
+ static int
+-com_pager(String *buffer __attribute__((unused)),
+- char *line __attribute__((unused)))
++com_pager(String *buffer MY_ATTRIBUTE((unused)),
++ char *line MY_ATTRIBUTE((unused)))
+ {
+ char pager_name[FN_REFLEN], *end, *param;
+
[email protected]@ -4220,8 +4220,8 @@ com_pager(String *buffer __attribute__((unused)),
+
+
+ static int
+-com_nopager(String *buffer __attribute__((unused)),
+- char *line __attribute__((unused)))
++com_nopager(String *buffer MY_ATTRIBUTE((unused)),
++ char *line MY_ATTRIBUTE((unused)))
+ {
+ strmov(pager, "stdout");
+ opt_nopager=1;
[email protected]@ -4238,7 +4238,7 @@ com_nopager(String *buffer __attribute__((unused)),
+
+ #ifdef USE_POPEN
+ static int
+-com_edit(String *buffer,char *line __attribute__((unused)))
++com_edit(String *buffer,char *line MY_ATTRIBUTE((unused)))
+ {
+ char filename[FN_REFLEN],buff[160];
+ int fd,tmp;
[email protected]@ -4282,16 +4282,16 @@ err:
+ /* If arg is given, exit without errors. This happens on command 'quit' */
+
+ static int
+-com_quit(String *buffer __attribute__((unused)),
+- char *line __attribute__((unused)))
++com_quit(String *buffer MY_ATTRIBUTE((unused)),
++ char *line MY_ATTRIBUTE((unused)))
+ {
+ status.exit_status=0;
+ return 1;
+ }
+
+ static int
+-com_rehash(String *buffer __attribute__((unused)),
+- char *line __attribute__((unused)))
++com_rehash(String *buffer MY_ATTRIBUTE((unused)),
++ char *line MY_ATTRIBUTE((unused)))
+ {
+ #ifdef HAVE_READLINE
+ build_completion_hash(1, 0);
[email protected]@ -4302,8 +4302,8 @@ com_rehash(String *buffer __attribute__((unused)),
+
+ #ifdef USE_POPEN
+ static int
+-com_shell(String *buffer __attribute__((unused)),
+- char *line __attribute__((unused)))
++com_shell(String *buffer MY_ATTRIBUTE((unused)),
++ char *line MY_ATTRIBUTE((unused)))
+ {
+ char *shell_cmd;
+
[email protected]@ -4330,7 +4330,7 @@ com_shell(String *buffer __attribute__((unused)),
+
+
+ static int
+-com_print(String *buffer,char *line __attribute__((unused)))
++com_print(String *buffer,char *line MY_ATTRIBUTE((unused)))
+ {
+ tee_puts("--------------", stdout);
+ (void) tee_fputs(buffer->c_ptr(), stdout);
[email protected]@ -4395,7 +4395,7 @@ com_connect(String *buffer, char *line)
+ }
+
+
+-static int com_source(String *buffer __attribute__((unused)),
++static int com_source(String *buffer MY_ATTRIBUTE((unused)),
+ char *line)
+ {
+ char source_name[FN_REFLEN], *end, *param;
[email protected]@ -4450,7 +4450,7 @@ static int com_source(String *buffer __attribute__((unused)),
+
+ /* ARGSUSED */
+ static int
+-com_delimiter(String *buffer __attribute__((unused)), char *line)
++com_delimiter(String *buffer MY_ATTRIBUTE((unused)), char *line)
+ {
+ char buff[256], *tmp;
+
[email protected]@ -4479,7 +4479,7 @@ com_delimiter(String *buffer __attribute__((unused)), char *line)
+
+ /* ARGSUSED */
+ static int
+-com_use(String *buffer __attribute__((unused)), char *line)
++com_use(String *buffer MY_ATTRIBUTE((unused)), char *line)
+ {
+ char *tmp, buff[FN_REFLEN + 1];
+ int select_db;
[email protected]@ -4624,8 +4624,8 @@ normalize_dbname(const char *line, char *buff, uint buff_size)
+ }
+
+ static int
+-com_warnings(String *buffer __attribute__((unused)),
+- char *line __attribute__((unused)))
++com_warnings(String *buffer MY_ATTRIBUTE((unused)),
++ char *line MY_ATTRIBUTE((unused)))
+ {
+ show_warnings = 1;
+ put_info("Show warnings enabled.",INFO_INFO);
[email protected]@ -4633,8 +4633,8 @@ com_warnings(String *buffer __attribute__((unused)),
+ }
+
+ static int
+-com_nowarnings(String *buffer __attribute__((unused)),
+- char *line __attribute__((unused)))
++com_nowarnings(String *buffer MY_ATTRIBUTE((unused)),
++ char *line MY_ATTRIBUTE((unused)))
+ {
+ show_warnings = 0;
+ put_info("Show warnings disabled.",INFO_INFO);
[email protected]@ -4914,8 +4914,8 @@ sql_connect(char *host,char *database,char *user,char *password,uint silent)
+
+
+ static int
+-com_status(String *buffer __attribute__((unused)),
+- char *line __attribute__((unused)))
++com_status(String *buffer MY_ATTRIBUTE((unused)),
++ char *line MY_ATTRIBUTE((unused)))
+ {
+ const char *status_str;
+ char buff[40];
[email protected]@ -5555,7 +5555,7 @@ static void init_username()
+ }
+ }
+
+-static int com_prompt(String *buffer __attribute__((unused)),
++static int com_prompt(String *buffer MY_ATTRIBUTE((unused)),
+ char *line)
+ {
+ char *ptr=strchr(line, ' ');
+--- a/client/mysql_config_editor.cc
++++ b/client/mysql_config_editor.cc
[email protected]@ -1,5 +1,5 @@
+ /*
+- Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
++ Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -209,7 +209,7 @@ static struct my_option my_help_command_options[]=
+
+ my_bool
+ my_program_get_one_option(int optid,
+- const struct my_option *opt __attribute__((unused)),
++ const struct my_option *opt MY_ATTRIBUTE((unused)),
+ char *argument)
+ {
+ switch(optid) {
[email protected]@ -230,7 +230,7 @@ my_program_get_one_option(int optid,
+
+ my_bool
+ my_set_command_get_one_option(int optid,
+- const struct my_option *opt __attribute__((unused)),
++ const struct my_option *opt MY_ATTRIBUTE((unused)),
+ char *argument)
+ {
+ switch(optid) {
[email protected]@ -257,7 +257,7 @@ my_set_command_get_one_option(int optid,
+
+ my_bool
+ my_remove_command_get_one_option(int optid,
+- const struct my_option *opt __attribute__((unused)),
++ const struct my_option *opt MY_ATTRIBUTE((unused)),
+ char *argument)
+ {
+ switch(optid) {
[email protected]@ -281,7 +281,7 @@ my_remove_command_get_one_option(int optid,
+
+ my_bool
+ my_print_command_get_one_option(int optid,
+- const struct my_option *opt __attribute__((unused)),
++ const struct my_option *opt MY_ATTRIBUTE((unused)),
+ char *argument)
+ {
+ switch(optid) {
[email protected]@ -305,7 +305,7 @@ my_print_command_get_one_option(int optid,
+
+ my_bool
+ my_reset_command_get_one_option(int optid,
+- const struct my_option *opt __attribute__((unused)),
++ const struct my_option *opt MY_ATTRIBUTE((unused)),
+ char *argument)
+ {
+ switch(optid) {
+--- a/client/mysql_plugin.c
++++ b/client/mysql_plugin.c
[email protected]@ -1,5 +1,5 @@
+ /*
+- Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
++ Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -406,7 +406,7 @@ exit:
+ static void usage(void)
+ {
+ PRINT_VERSION;
+- puts("Copyright (c) 2011, 2015, Oracle and/or its affiliates. "
++ puts("Copyright (c) 2011, 2016, Oracle and/or its affiliates. "
+ "All rights reserved.\n");
+ puts("Enable or disable plugins.");
+ printf("\nUsage: %s [options] <plugin> ENABLE|DISABLE\n\nOptions:\n",
[email protected]@ -471,7 +471,7 @@ static void print_default_values(void)
+
+ static my_bool
+ get_one_option(int optid,
+- const struct my_option *opt __attribute__((unused)),
++ const struct my_option *opt MY_ATTRIBUTE((unused)),
+ char *argument)
+ {
+ switch(optid) {
+--- a/client/mysqladmin.cc
++++ b/client/mysqladmin.cc
[email protected]@ -237,7 +237,7 @@ static struct my_option my_long_options[] =
+ static const char *load_default_groups[]= { "mysqladmin","client",0 };
+
+ my_bool
+-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
++get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)),
+ char *argument)
+ {
+ int error = 0;
[email protected]@ -528,7 +528,7 @@ int main(int argc,char *argv[])
+ }
+
+
+-sig_handler endprog(int signal_number __attribute__((unused)))
++sig_handler endprog(int signal_number MY_ATTRIBUTE((unused)))
+ {
+ interrupted=1;
+ }
[email protected]@ -1416,7 +1416,7 @@ static void print_top(MYSQL_RES *result)
+
+ /* 3.rd argument, uint row, is not in use. Don't remove! */
+ static void print_row(MYSQL_RES *result, MYSQL_ROW cur,
+- uint row __attribute__((unused)))
++ uint row MY_ATTRIBUTE((unused)))
+ {
+ uint i,length;
+ MYSQL_FIELD *field;
[email protected]@ -1451,9 +1451,9 @@ static void print_relative_row(MYSQL_RES *result, MYSQL_ROW cur, uint row)
+ }
+
+
+-static void print_relative_row_vert(MYSQL_RES *result __attribute__((unused)),
++static void print_relative_row_vert(MYSQL_RES *result MY_ATTRIBUTE((unused)),
+ MYSQL_ROW cur,
+- uint row __attribute__((unused)))
++ uint row MY_ATTRIBUTE((unused)))
+ {
+ uint length;
+ ulonglong tmp;
+--- a/client/mysqlbinlog.cc
++++ b/client/mysqlbinlog.cc
[email protected]@ -1,5 +1,5 @@
+ /*
+- Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
++ Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -1819,7 +1819,7 @@ static my_time_t convert_str_to_timestamp(const char* str)
+
+
+ extern "C" my_bool
+-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
++get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)),
+ char *argument)
+ {
+ bool tty_password=0;
+--- a/client/mysqlcheck.c
++++ b/client/mysqlcheck.c
[email protected]@ -270,7 +270,7 @@ static void usage(void)
+
+
+ static my_bool
+-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
++get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)),
+ char *argument)
+ {
+ int orig_what_to_do= what_to_do;
+--- a/client/mysqldump.c
++++ b/client/mysqldump.c
[email protected]@ -762,7 +762,7 @@ static void write_footer(FILE *sql_file)
+
+
+ uchar* get_table_key(const char *entry, size_t *length,
+- my_bool not_used __attribute__((unused)))
++ my_bool not_used MY_ATTRIBUTE((unused)))
+ {
+ *length= strlen(entry);
+ return (uchar*) entry;
[email protected]@ -770,7 +770,7 @@ uchar* get_table_key(const char *entry, size_t *length,
+
+
+ static my_bool
+-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
++get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)),
+ char *argument)
+ {
+ switch (optid) {
[email protected]@ -1921,7 +1921,7 @@ static void print_xml_row(FILE *xml_file, const char *row_name,
+ const char *str_create)
+ {
+ uint i;
+- my_bool body_found __attribute__((unused)) = 0;
++ my_bool body_found MY_ATTRIBUTE((unused)) = 0;
+ char *create_stmt_ptr= NULL;
+ ulong create_stmt_len= 0;
+ MYSQL_FIELD *field;
[email protected]@ -4281,7 +4281,7 @@ RETURN VALUES
+ 0 Success.
+ 1 Failure.
+ */
+-int init_dumping_views(char *qdatabase __attribute__((unused)))
++int init_dumping_views(char *qdatabase MY_ATTRIBUTE((unused)))
+ {
+ return 0;
+ } /* init_dumping_views */
+--- a/client/mysqlimport.c
++++ b/client/mysqlimport.c
[email protected]@ -222,7 +222,7 @@ file. The SQL command 'LOAD DATA INFILE' is used to import the rows.\n");
+
+
+ static my_bool
+-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
++get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)),
+ char *argument)
+ {
+ switch(optid) {
+--- a/client/mysqlshow.c
++++ b/client/mysqlshow.c
[email protected]@ -314,7 +314,7 @@ are shown.");
+
+
+ static my_bool
+-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
++get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)),
+ char *argument)
+ {
+ switch(optid) {
+--- a/client/mysqlslap.c
++++ b/client/mysqlslap.c
[email protected]@ -736,7 +736,7 @@ static void usage(void)
+
+
+ static my_bool
+-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
++get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)),
+ char *argument)
+ {
+ DBUG_ENTER("get_one_option");
+--- a/client/mysqltest.cc
++++ b/client/mysqltest.cc
[email protected]@ -547,12 +547,12 @@ struct st_replace *glob_replace= 0;
+ void replace_strings_append(struct st_replace *rep, DYNAMIC_STRING* ds,
+ const char *from, int len);
+
+-static void cleanup_and_exit(int exit_code) __attribute__((noreturn));
++static void cleanup_and_exit(int exit_code) MY_ATTRIBUTE((noreturn));
+
+ void die(const char *fmt, ...)
+- ATTRIBUTE_FORMAT(printf, 1, 2) __attribute__((noreturn));
++ ATTRIBUTE_FORMAT(printf, 1, 2) MY_ATTRIBUTE((noreturn));
+ void abort_not_supported_test(const char *fmt, ...)
+- ATTRIBUTE_FORMAT(printf, 1, 2) __attribute__((noreturn));
++ ATTRIBUTE_FORMAT(printf, 1, 2) MY_ATTRIBUTE((noreturn));
+ void verbose_msg(const char *fmt, ...)
+ ATTRIBUTE_FORMAT(printf, 1, 2);
+ void log_msg(const char *fmt, ...)
[email protected]@ -2121,7 +2121,7 @@ static void strip_parentheses(struct st_command *command)
+ C_MODE_START
+
+ static uchar *get_var_key(const uchar* var, size_t *len,
+- my_bool __attribute__((unused)) t)
++ my_bool MY_ATTRIBUTE((unused)) t)
+ {
+ register char* key;
+ key = ((VAR*)var)->name;
[email protected]@ -4320,7 +4320,7 @@ int do_echo(struct st_command *command)
+ }
+
+
+-void do_wait_for_slave_to_stop(struct st_command *c __attribute__((unused)))
++void do_wait_for_slave_to_stop(struct st_command *c MY_ATTRIBUTE((unused)))
+ {
+ static int SLAVE_POLL_INTERVAL= 300000;
+ MYSQL* mysql = &cur_con->mysql;
[email protected]@ -8418,7 +8418,7 @@ void update_expected_errors(struct st_command* command)
+
+ */
+
+-void mark_progress(struct st_command* command __attribute__((unused)),
++void mark_progress(struct st_command* command MY_ATTRIBUTE((unused)),
+ int line)
+ {
+ static ulonglong progress_start= 0; // < Beware
[email protected]@ -9465,7 +9465,7 @@ typedef struct st_replace_found {
+
+ void replace_strings_append(REPLACE *rep, DYNAMIC_STRING* ds,
+ const char *str,
+- int len __attribute__((unused)))
++ int len MY_ATTRIBUTE((unused)))
+ {
+ reg1 REPLACE *rep_pos;
+ reg2 REPLACE_STRING *rep_str;
+--- a/cmake/build_configurations/compiler_options.cmake
++++ b/cmake/build_configurations/compiler_options.cmake
[email protected]@ -1,4 +1,4 @@
+-# Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
++# Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
+ #
+ # This program is free software; you can redistribute it and/or modify
+ # it under the terms of the GNU General Public License as published by
[email protected]@ -66,11 +66,9 @@ IF(UNIX)
+ SET(SUNPRO_CXX_LIBRARY "stlport4" CACHE STRING
+ "What C++ library to use. The server needs stlport4. It is possible to build the client libraries with -DWITHOUT_SERVER=1 -DSUNPRO_CXX_LIBRARY=Cstd")
+
+- MESSAGE(STATUS "SUNPRO_CXX_LIBRARY ${SUNPRO_CXX_LIBRARY}")
+-
+ IF(CMAKE_SYSTEM_PROCESSOR MATCHES "i386")
+ SET(COMMON_C_FLAGS "-g -mt -fsimple=1 -ftrap=%none -nofstore -xbuiltin=%all -xlibmil -xlibmopt -xtarget=generic")
+- SET(COMMON_CXX_FLAGS "-g0 -mt -fsimple=1 -ftrap=%none -nofstore -xbuiltin=%all -xlibmil -xlibmopt -xtarget=generic -library=${SUNPRO_CXX_LIBRARY}")
++ SET(COMMON_CXX_FLAGS "-g0 -mt -fsimple=1 -ftrap=%none -nofstore -xbuiltin=%all -xlibmil -xlibmopt -xtarget=generic")
+ # We have to specify "-xO1" for DEBUG flags here,
+ # see http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6879978
+ SET(CMAKE_C_FLAGS_DEBUG "-xO1 ${COMMON_C_FLAGS}")
[email protected]@ -85,7 +83,7 @@ IF(UNIX)
+ ELSE()
+ # Assume !x86 is SPARC
+ SET(COMMON_C_FLAGS "-g -Xa -xstrconst -mt")
+- SET(COMMON_CXX_FLAGS "-g0 -mt -library=${SUNPRO_CXX_LIBRARY}")
++ SET(COMMON_CXX_FLAGS "-g0 -mt")
+ IF(32BIT)
+ SET(COMMON_C_FLAGS "${COMMON_C_FLAGS} -xarch=sparc")
+ SET(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} -xarch=sparc")
+
+--- a/dbug/tests.c
++++ b/dbug/tests.c
[email protected]@ -73,7 +73,7 @@ int main (int argc, char *argv[])
+ DBUG_EVALUATE_IF("evaluate_if", "ON", "OFF"));
+ DBUG_EXECUTE_IF("pop", DBUG_POP(); );
+ {
+- char s[1000] __attribute__((unused));
++ char s[1000] MY_ATTRIBUTE((unused));
+ DBUG_EXPLAIN(s, sizeof(s)-1);
+ DBUG_PRINT("explain", ("dbug explained: %s", s));
+ }
+--- a/extra/comp_err.c
++++ b/extra/comp_err.c
[email protected]@ -1,5 +1,5 @@
+ /*
+- Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
++ Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -1023,8 +1023,8 @@ static void print_version(void)
+
+
+ static my_bool
+-get_one_option(int optid, const struct my_option *opt __attribute__ ((unused)),
+- char *argument __attribute__ ((unused)))
++get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE ((unused)),
++ char *argument MY_ATTRIBUTE ((unused)))
+ {
+ DBUG_ENTER("get_one_option");
+ switch (optid) {
+--- a/extra/innochecksum.cc
++++ b/extra/innochecksum.cc
[email protected]@ -1,5 +1,5 @@
+ /*
+- Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
++ Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -235,8 +235,8 @@ extern "C" my_bool
+ innochecksum_get_one_option(
+ /*========================*/
+ int optid,
+- const struct my_option *opt __attribute__((unused)),
+- char *argument __attribute__((unused)))
++ const struct my_option *opt MY_ATTRIBUTE((unused)),
++ char *argument MY_ATTRIBUTE((unused)))
+ {
+ switch (optid) {
+ case 'd':
+--- a/extra/my_print_defaults.c
++++ b/extra/my_print_defaults.c
[email protected]@ -1,6 +1,6 @@
+
+ /*
+- Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
++ Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -118,8 +118,8 @@ static void usage(my_bool version)
+
+
+ static my_bool
+-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
+- char *argument __attribute__((unused)))
++get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)),
++ char *argument MY_ATTRIBUTE((unused)))
+ {
+ switch (optid) {
+ case 'c':
+--- a/extra/mysql_waitpid.c
++++ b/extra/mysql_waitpid.c
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -43,8 +43,8 @@ static struct my_option my_long_options[] =
+ };
+
+ static my_bool
+-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
+- char *argument __attribute__((unused)))
++get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)),
++ char *argument MY_ATTRIBUTE((unused)))
+ {
+ switch(optid) {
+ case 'V':
+--- a/extra/perror.c
++++ b/extra/perror.c
[email protected]@ -1,5 +1,5 @@
+ /*
+- Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
++ Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -94,8 +94,8 @@ static void usage(void)
+
+
+ static my_bool
+-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
+- char *argument __attribute__((unused)))
++get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)),
++ char *argument MY_ATTRIBUTE((unused)))
+ {
+ switch (optid) {
+ case 's':
+--- a/extra/resolve_stack_dump.cc
++++ b/extra/resolve_stack_dump.cc
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -51,7 +51,7 @@ static char* dump_fname = 0, *sym_fname = 0;
+ static std::vector<sym_entry> sym_table;
+ static FILE* fp_dump, *fp_sym = 0, *fp_out;
+ static void die(const char* fmt, ...)
+- __attribute__((noreturn)) __attribute__((format(printf, 1, 2)));
++ MY_ATTRIBUTE((noreturn)) MY_ATTRIBUTE((format(printf, 1, 2)));
+
+ static struct my_option my_long_options[] =
+ {
[email protected]@ -107,8 +107,8 @@ static void die(const char* fmt, ...)
+
+
+ static my_bool
+-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
+- char *argument __attribute__((unused)))
++get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)),
++ char *argument MY_ATTRIBUTE((unused)))
+ {
+ switch(optid) {
+ case 'V':
+--- a/extra/resolveip.c
++++ b/extra/resolveip.c
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -72,8 +72,8 @@ static void usage(void)
+
+
+ static my_bool
+-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
+- char *argument __attribute__((unused)))
++get_one_option(int optid, const struct my_option *opt MY_ATTRIBUTE((unused)),
++ char *argument MY_ATTRIBUTE((unused)))
+ {
+ switch (optid) {
+ case 'V': print_version(); exit(0);
+--- a/extra/yassl/taocrypt/CMakeLists.txt
++++ b/extra/yassl/taocrypt/CMakeLists.txt
[email protected]@ -1,4 +1,4 @@
+-# Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved.
++# Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.
+ #
+ # This program is free software; you can redistribute it and/or modify
+ # it under the terms of the GNU General Public License as published by
[email protected]@ -13,6 +13,8 @@
+ # along with this program; if not, write to the Free Software
+ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
++INCLUDE(${MYSQL_CMAKE_SCRIPT_DIR}/compile_flags.cmake)
++
+ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/extra/yassl/taocrypt/mySTL
+ ${CMAKE_SOURCE_DIR}/extra/yassl/taocrypt/include)
+
[email protected]@ -29,6 +31,14 @@ SET(TAOCRYPT_SOURCES src/aes.cpp src/aestables.cpp src/algebra.cpp src/arc4.cpp
+ include/random.hpp include/ripemd.hpp include/rsa.hpp include/sha.hpp
+ include/rabbit.hpp include/hc128.hpp)
+
++# Segfaults with SIGILL at high optimization levels in:
++# ModularArithmetic::SimultaneousExponentiate
++IF(CMAKE_CXX_COMPILER_ID MATCHES "SunPro")
++ IF(CMAKE_CXX_FLAGS MATCHES "-std=")
++ ADD_COMPILE_FLAGS(src/integer.cpp COMPILE_FLAGS "-xO1")
++ ENDIF()
++ENDIF()
++
+ IF(HAVE_EXPLICIT_TEMPLATE_INSTANTIATION)
+ SET(TAOCRYPT_SOURCES ${TAOCRYPT_SOURCES} src/template_instnt.cpp)
+ ENDIF()
+--- a/include/atomic/nolock.h
++++ b/include/atomic/nolock.h
[email protected]@ -1,7 +1,7 @@
+ #ifndef ATOMIC_NOLOCK_INCLUDED
+ #define ATOMIC_NOLOCK_INCLUDED
+
+-/* Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved. reserved.
++/* Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved. reserved.
+ reserved.
+
+ This program is free software; you can redistribute it and/or modify
[email protected]@ -44,7 +44,7 @@
+ Type not used so minimal size (emptry struct has different size between C
+ and C++, zero-length array is gcc-specific).
+ */
+-typedef char my_atomic_rwlock_t __attribute__ ((unused));
++typedef char my_atomic_rwlock_t MY_ATTRIBUTE ((unused));
+ #define my_atomic_rwlock_destroy(name)
+ #define my_atomic_rwlock_init(name)
+ #define my_atomic_rwlock_rdlock(name)
+--- a/include/lf.h
++++ b/include/lf.h
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -138,7 +138,7 @@ typedef struct {
+ #if defined(__GNUC__) && defined(MY_LF_EXTRA_DEBUG)
+ #define LF_REQUIRE_PINS(N) \
+ static const char require_pins[LF_PINBOX_PINS-N] \
+- __attribute__ ((unused)); \
++ MY_ATTRIBUTE ((unused)); \
+ static const int LF_NUM_PINS_IN_THIS_FILE= N;
+ #define _lf_pin(PINS, PIN, ADDR) \
+ ( \
+--- a/include/m_ctype.h
++++ b/include/m_ctype.h
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -658,10 +658,10 @@ int my_wildcmp_mb_bin(const CHARSET_INFO *cs,
+ const char *wildstr,const char *wildend,
+ int escape, int w_one, int w_many);
+
+-int my_strcasecmp_mb_bin(const CHARSET_INFO * cs __attribute__((unused)),
++int my_strcasecmp_mb_bin(const CHARSET_INFO * cs MY_ATTRIBUTE((unused)),
+ const char *s, const char *t);
+
+-void my_hash_sort_mb_bin(const CHARSET_INFO *cs __attribute__((unused)),
++void my_hash_sort_mb_bin(const CHARSET_INFO *cs MY_ATTRIBUTE((unused)),
+ const uchar *key, size_t len,ulong *nr1, ulong *nr2);
+
+ size_t my_strnxfrm_mb(const CHARSET_INFO *,
+--- a/include/my_atomic.h
++++ b/include/my_atomic.h
[email protected]@ -1,7 +1,7 @@
+ #ifndef MY_ATOMIC_INCLUDED
+ #define MY_ATOMIC_INCLUDED
+
+-/* Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -121,11 +121,11 @@
+ typedef union { \
+ int ## S i; \
+ uint ## S u; \
+- } U_ ## S __attribute__ ((transparent_union)); \
++ } U_ ## S MY_ATTRIBUTE ((transparent_union)); \
+ typedef union { \
+ int ## S volatile *i; \
+ uint ## S volatile *u; \
+- } Uv_ ## S __attribute__ ((transparent_union));
++ } Uv_ ## S MY_ATTRIBUTE ((transparent_union));
+ #define uintptr intptr
+ make_transparent_unions(8)
+ make_transparent_unions(16)
+--- a/include/my_attribute.h
++++ b/include/my_attribute.h
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -28,41 +28,30 @@
+ #endif
+
+ /*
+- Disable __attribute__() on gcc < 2.7, g++ < 3.4, and non-gcc compilers.
++ Disable MY_ATTRIBUTE() on g++ < 3.4, and non-gcc compilers.
+ Some forms of __attribute__ are actually supported in earlier versions of
+ g++, but we just disable them all because we only use them to generate
+ compilation warnings.
+ */
+-#ifndef __attribute__
+-# if !defined(__GNUC__)
+-# define __attribute__(A)
+-# elif GCC_VERSION < 2008
+-# define __attribute__(A)
+-# elif defined(__cplusplus) && GCC_VERSION < 3004
+-# define __attribute__(A)
+-# endif
++#ifndef MY_ATTRIBUTE
++#if defined(__GNUC__) && GCC_VERSION > 3003
++# define MY_ATTRIBUTE(A) __attribute__(A)
++#else
++# define MY_ATTRIBUTE(A)
++#endif
+ #endif
+
+ /*
+- __attribute__((format(...))) is only supported in gcc >= 2.8 and g++ >= 3.4
+- But that's already covered by the __attribute__ tests above, so this is
++ __attribute__((format(...))) is only supported in g++ >= 3.4
++ But that's already covered by the MY_ATTRIBUTE tests above, so this is
+ just a convenience macro.
+ */
+ #ifndef ATTRIBUTE_FORMAT
+-# define ATTRIBUTE_FORMAT(style, m, n) __attribute__((format(style, m, n)))
++# define ATTRIBUTE_FORMAT(style, m, n) MY_ATTRIBUTE((format(style, m, n)))
+ #endif
+
+-/*
+-
+- __attribute__((format(...))) on a function pointer is not supported
+- until gcc 3.1
+-*/
+ #ifndef ATTRIBUTE_FORMAT_FPTR
+-# if (GCC_VERSION >= 3001)
+ # define ATTRIBUTE_FORMAT_FPTR(style, m, n) ATTRIBUTE_FORMAT(style, m, n)
+-# else
+-# define ATTRIBUTE_FORMAT_FPTR(style, m, n)
+-# endif /* GNUC >= 3.1 */
+ #endif
+
+
+--- a/include/my_global.h
++++ b/include/my_global.h
[email protected]@ -1,5 +1,5 @@
+ /*
+- Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
++ Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -184,7 +184,7 @@
+ other reason to use them is for documentation
+ */
+
+-#if !defined(__GNUC__) || (__GNUC__ == 2 && __GNUC_MINOR__ < 96)
++#if !defined(__builtin_expect)
+ #define __builtin_expect(x, expected_value) (x)
+ #endif
+
[email protected]@ -374,7 +374,7 @@ C_MODE_END
+ #define compile_time_assert(X) \
+ do \
+ { \
+- typedef char compile_time_assert[(X) ? 1 : -1] __attribute__((unused)); \
++ typedef char compile_time_assert[(X) ? 1 : -1] MY_ATTRIBUTE((unused)); \
+ } while(0)
+ #endif
+
+--- a/include/my_pthread.h
++++ b/include/my_pthread.h
[email protected]@ -860,7 +860,7 @@ struct st_my_thread_var
+ #endif
+ };
+
+-extern struct st_my_thread_var *_my_thread_var(void) __attribute__ ((const));
++extern struct st_my_thread_var *_my_thread_var(void) MY_ATTRIBUTE ((const));
+ extern int set_mysys_var(struct st_my_thread_var *mysys_var);
+ extern void **my_thread_var_dbug();
+ extern uint my_thread_end_wait_time;
+--- a/include/mysql/psi/mysql_file.h
++++ b/include/mysql/psi/mysql_file.h
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -511,9 +511,9 @@ static inline void inline_mysql_file_register(
+ PSI_file_info *info,
+ int count
+ #else
+- const char *category __attribute__ ((unused)),
+- void *info __attribute__ ((unused)),
+- int count __attribute__ ((unused))
++ const char *category MY_ATTRIBUTE ((unused)),
++ void *info MY_ATTRIBUTE ((unused)),
++ int count MY_ATTRIBUTE ((unused))
+ #endif
+ )
+ {
+--- a/include/mysql/psi/mysql_socket.h
++++ b/include/mysql/psi/mysql_socket.h
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
[email protected]@ -114,9 +114,9 @@ mysql_socket_set_address(
+ const struct sockaddr *addr,
+ socklen_t addr_len
+ #else
+- MYSQL_SOCKET socket __attribute__ ((unused)),
+- const struct sockaddr *addr __attribute__ ((unused)),
+- socklen_t addr_len __attribute__ ((unused))
++ MYSQL_SOCKET socket MY_ATTRIBUTE ((unused)),
++ const struct sockaddr *addr MY_ATTRIBUTE ((unused)),
++ socklen_t addr_len MY_ATTRIBUTE ((unused))
+ #endif
+ )
+ {
[email protected]@ -136,7 +136,7 @@ mysql_socket_set_thread_owner(
+ #ifdef HAVE_PSI_SOCKET_INTERFACE
+ MYSQL_SOCKET socket
+ #else
+-MYSQL_SOCKET socket __attribute__ ((unused))
++MYSQL_SOCKET socket MY_ATTRIBUTE ((unused))
+ #endif
+ )
+ {
+--- a/include/mysql/psi/mysql_thread.h
++++ b/include/mysql/psi/mysql_thread.h
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -587,9 +587,9 @@ static inline void inline_mysql_mutex_register(
+ PSI_mutex_info *info,
+ int count
+ #else
+- const char *category __attribute__ ((unused)),
+- void *info __attribute__ ((unused)),
+- int count __attribute__ ((unused))
++ const char *category MY_ATTRIBUTE ((unused)),
++ void *info MY_ATTRIBUTE ((unused)),
++ int count MY_ATTRIBUTE ((unused))
+ #endif
+ )
+ {
[email protected]@ -771,9 +771,9 @@ static inline void inline_mysql_rwlock_register(
+ PSI_rwlock_info *info,
+ int count
+ #else
+- const char *category __attribute__ ((unused)),
+- void *info __attribute__ ((unused)),
+- int count __attribute__ ((unused))
++ const char *category MY_ATTRIBUTE ((unused)),
++ void *info MY_ATTRIBUTE ((unused)),
++ int count MY_ATTRIBUTE ((unused))
+ #endif
+ )
+ {
[email protected]@ -1089,9 +1089,9 @@ static inline void inline_mysql_cond_register(
+ PSI_cond_info *info,
+ int count
+ #else
+- const char *category __attribute__ ((unused)),
+- void *info __attribute__ ((unused)),
+- int count __attribute__ ((unused))
++ const char *category MY_ATTRIBUTE ((unused)),
++ void *info MY_ATTRIBUTE ((unused)),
++ int count MY_ATTRIBUTE ((unused))
+ #endif
+ )
+ {
[email protected]@ -1231,9 +1231,9 @@ static inline void inline_mysql_thread_register(
+ PSI_thread_info *info,
+ int count
+ #else
+- const char *category __attribute__ ((unused)),
+- void *info __attribute__ ((unused)),
+- int count __attribute__ ((unused))
++ const char *category MY_ATTRIBUTE ((unused)),
++ void *info MY_ATTRIBUTE ((unused)),
++ int count MY_ATTRIBUTE ((unused))
+ #endif
+ )
+ {
+--- a/libmysql/libmysql.c
++++ b/libmysql/libmysql.c
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -111,9 +111,9 @@ typedef struct st_mysql_stmt_extension
+ 1 could not initialize environment (out of memory or thread keys)
+ */
+
+-int STDCALL mysql_server_init(int argc __attribute__((unused)),
+- char **argv __attribute__((unused)),
+- char **groups __attribute__((unused)))
++int STDCALL mysql_server_init(int argc MY_ATTRIBUTE((unused)),
++ char **argv MY_ATTRIBUTE((unused)),
++ char **groups MY_ATTRIBUTE((unused)))
+ {
+ int result= 0;
+ if (!mysql_client_init)
[email protected]@ -128,7 +128,7 @@ int STDCALL mysql_server_init(int argc __attribute__((unused)),
+ if (!mysql_port)
+ {
+ char *env;
+- struct servent *serv_ptr __attribute__((unused));
++ struct servent *serv_ptr MY_ATTRIBUTE((unused));
+
+ mysql_port = MYSQL_PORT;
+
[email protected]@ -264,7 +264,7 @@ append_wild(char *to, char *end, const char *wild)
+ **************************************************************************/
+
+ void STDCALL
+-mysql_debug(const char *debug __attribute__((unused)))
++mysql_debug(const char *debug MY_ATTRIBUTE((unused)))
+ {
+ #ifndef DBUG_OFF
+ char *env;
[email protected]@ -299,7 +299,7 @@ mysql_debug(const char *debug __attribute__((unused)))
+ **************************************************************************/
+
+ sig_handler
+-my_pipe_sig_handler(int sig __attribute__((unused)))
++my_pipe_sig_handler(int sig MY_ATTRIBUTE((unused)))
+ {
+ DBUG_PRINT("info",("Hit by signal %d",sig));
+ #ifdef SIGNAL_HANDLER_RESET_ON_DELIVERY
[email protected]@ -559,7 +559,7 @@ typedef struct st_default_local_infile
+ */
+
+ static int default_local_infile_init(void **ptr, const char *filename,
+- void *userdata __attribute__ ((unused)))
++ void *userdata MY_ATTRIBUTE ((unused)))
+ {
+ default_local_infile_data *data;
+ char tmp_name[FN_REFLEN];
[email protected]@ -2341,15 +2341,15 @@ stmt_read_row_from_cursor(MYSQL_STMT *stmt, unsigned char **row)
+ */
+
+ static int
+-stmt_read_row_no_data(MYSQL_STMT *stmt __attribute__((unused)),
+- unsigned char **row __attribute__((unused)))
++stmt_read_row_no_data(MYSQL_STMT *stmt MY_ATTRIBUTE((unused)),
++ unsigned char **row MY_ATTRIBUTE((unused)))
+ {
+ return MYSQL_NO_DATA;
+ }
+
+ static int
+-stmt_read_row_no_result_set(MYSQL_STMT *stmt __attribute__((unused)),
+- unsigned char **row __attribute__((unused)))
++stmt_read_row_no_result_set(MYSQL_STMT *stmt MY_ATTRIBUTE((unused)),
++ unsigned char **row MY_ATTRIBUTE((unused)))
+ {
+ set_stmt_error(stmt, CR_NO_RESULT_SET, unknown_sqlstate, NULL);
+ return 1;
[email protected]@ -3708,7 +3708,7 @@ static void fetch_result_short(MYSQL_BIND *param, MYSQL_FIELD *field,
+ }
+
+ static void fetch_result_int32(MYSQL_BIND *param,
+- MYSQL_FIELD *field __attribute__((unused)),
++ MYSQL_FIELD *field MY_ATTRIBUTE((unused)),
+ uchar **row)
+ {
+ my_bool field_is_unsigned= MY_TEST(field->flags & UNSIGNED_FLAG);
[email protected]@ -3719,7 +3719,7 @@ static void fetch_result_int32(MYSQL_BIND *param,
+ }
+
+ static void fetch_result_int64(MYSQL_BIND *param,
+- MYSQL_FIELD *field __attribute__((unused)),
++ MYSQL_FIELD *field MY_ATTRIBUTE((unused)),
+ uchar **row)
+ {
+ my_bool field_is_unsigned= MY_TEST(field->flags & UNSIGNED_FLAG);
[email protected]@ -3730,7 +3730,7 @@ static void fetch_result_int64(MYSQL_BIND *param,
+ }
+
+ static void fetch_result_float(MYSQL_BIND *param,
+- MYSQL_FIELD *field __attribute__((unused)),
++ MYSQL_FIELD *field MY_ATTRIBUTE((unused)),
+ uchar **row)
+ {
+ float value;
[email protected]@ -3740,7 +3740,7 @@ static void fetch_result_float(MYSQL_BIND *param,
+ }
+
+ static void fetch_result_double(MYSQL_BIND *param,
+- MYSQL_FIELD *field __attribute__((unused)),
++ MYSQL_FIELD *field MY_ATTRIBUTE((unused)),
+ uchar **row)
+ {
+ double value;
[email protected]@ -3750,7 +3750,7 @@ static void fetch_result_double(MYSQL_BIND *param,
+ }
+
+ static void fetch_result_time(MYSQL_BIND *param,
+- MYSQL_FIELD *field __attribute__((unused)),
++ MYSQL_FIELD *field MY_ATTRIBUTE((unused)),
+ uchar **row)
+ {
+ MYSQL_TIME *tm= (MYSQL_TIME *)param->buffer;
[email protected]@ -3758,7 +3758,7 @@ static void fetch_result_time(MYSQL_BIND *param,
+ }
+
+ static void fetch_result_date(MYSQL_BIND *param,
+- MYSQL_FIELD *field __attribute__((unused)),
++ MYSQL_FIELD *field MY_ATTRIBUTE((unused)),
+ uchar **row)
+ {
+ MYSQL_TIME *tm= (MYSQL_TIME *)param->buffer;
[email protected]@ -3766,7 +3766,7 @@ static void fetch_result_date(MYSQL_BIND *param,
+ }
+
+ static void fetch_result_datetime(MYSQL_BIND *param,
+- MYSQL_FIELD *field __attribute__((unused)),
++ MYSQL_FIELD *field MY_ATTRIBUTE((unused)),
+ uchar **row)
+ {
+ MYSQL_TIME *tm= (MYSQL_TIME *)param->buffer;
[email protected]@ -3774,7 +3774,7 @@ static void fetch_result_datetime(MYSQL_BIND *param,
+ }
+
+ static void fetch_result_bin(MYSQL_BIND *param,
+- MYSQL_FIELD *field __attribute__((unused)),
++ MYSQL_FIELD *field MY_ATTRIBUTE((unused)),
+ uchar **row)
+ {
+ ulong length= net_field_length(row);
[email protected]@ -3786,7 +3786,7 @@ static void fetch_result_bin(MYSQL_BIND *param,
+ }
+
+ static void fetch_result_str(MYSQL_BIND *param,
+- MYSQL_FIELD *field __attribute__((unused)),
++ MYSQL_FIELD *field MY_ATTRIBUTE((unused)),
+ uchar **row)
+ {
+ ulong length= net_field_length(row);
[email protected]@ -3807,7 +3807,7 @@ static void fetch_result_str(MYSQL_BIND *param,
+ */
+
+ static void skip_result_fixed(MYSQL_BIND *param,
+- MYSQL_FIELD *field __attribute__((unused)),
++ MYSQL_FIELD *field MY_ATTRIBUTE((unused)),
+ uchar **row)
+
+ {
[email protected]@ -3815,8 +3815,8 @@ static void skip_result_fixed(MYSQL_BIND *param,
+ }
+
+
+-static void skip_result_with_length(MYSQL_BIND *param __attribute__((unused)),
+- MYSQL_FIELD *field __attribute__((unused)),
++static void skip_result_with_length(MYSQL_BIND *param MY_ATTRIBUTE((unused)),
++ MYSQL_FIELD *field MY_ATTRIBUTE((unused)),
+ uchar **row)
+
+ {
[email protected]@ -3825,7 +3825,7 @@ static void skip_result_with_length(MYSQL_BIND *param __attribute__((unused)),
+ }
+
+
+-static void skip_result_string(MYSQL_BIND *param __attribute__((unused)),
++static void skip_result_string(MYSQL_BIND *param MY_ATTRIBUTE((unused)),
+ MYSQL_FIELD *field,
+ uchar **row)
+
+--- a/libmysqld/lib_sql.cc
++++ b/libmysqld/lib_sql.cc
[email protected]@ -2,7 +2,7 @@
+ * Copyright (c) 2000
+ * SWsoft company
+ *
+- * Modifications copyright (c) 2001, 2015. Oracle and/or its affiliates.
++ * Modifications copyright (c) 2001, 2016. Oracle and/or its affiliates.
+ * All rights reserved.
+ *
+ * This material is provided "as is", with absolutely no warranty expressed
[email protected]@ -213,8 +213,8 @@ static void emb_flush_use_result(MYSQL *mysql, my_bool)
+ */
+
+ static MYSQL_DATA *
+-emb_read_rows(MYSQL *mysql, MYSQL_FIELD *mysql_fields __attribute__((unused)),
+- unsigned int fields __attribute__((unused)))
++emb_read_rows(MYSQL *mysql, MYSQL_FIELD *mysql_fields MY_ATTRIBUTE((unused)),
++ unsigned int fields MY_ATTRIBUTE((unused)))
+ {
+ MYSQL_DATA *result= ((THD*)mysql->thd)->cur_data;
+ ((THD*)mysql->thd)->cur_data= 0;
[email protected]@ -1426,7 +1426,7 @@ bool Protocol::net_store_data(const uchar *from, size_t length)
+ #define vsnprintf _vsnprintf
+ #endif
+
+-int vprint_msg_to_log(enum loglevel level __attribute__((unused)),
++int vprint_msg_to_log(enum loglevel level MY_ATTRIBUTE((unused)),
+ const char *format, va_list argsi)
+ {
+ my_vsnprintf(mysql_server_last_error, sizeof(mysql_server_last_error),
+--- a/mysql-test/r/mysql_plugin.result
++++ b/mysql-test/r/mysql_plugin.result
[email protected]@ -105,7 +105,7 @@ ERROR: Missing --plugin_dir option.
+ # Show the help.
+ #
+ mysql_plugin Ver V.V.VV Distrib XX.XX.XX
+-Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
++Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ Enable or disable plugins.
+
+--- a/mysys/charset-def.c
++++ b/mysys/charset-def.c
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -161,7 +161,7 @@ extern CHARSET_INFO my_charset_utf8mb4_vietnamese_ci;
+
+ #endif /* HAVE_UCA_COLLATIONS */
+
+-my_bool init_compiled_charsets(myf flags __attribute__((unused)))
++my_bool init_compiled_charsets(myf flags MY_ATTRIBUTE((unused)))
+ {
+ CHARSET_INFO *cs;
+
+--- a/mysys/charset.c
++++ b/mysys/charset.c
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -357,8 +357,8 @@ static int add_collation(CHARSET_INFO *cs)
+ Be silent by default: no warnings on the client side.
+ */
+ static void
+-default_reporter(enum loglevel level __attribute__ ((unused)),
+- const char *format __attribute__ ((unused)),
++default_reporter(enum loglevel level MY_ATTRIBUTE ((unused)),
++ const char *format MY_ATTRIBUTE ((unused)),
+ ...)
+ {
+ }
+--- a/mysys/mf_cache.c
++++ b/mysys/mf_cache.c
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -26,7 +26,7 @@
+ this, just remember the file name for later removal
+ */
+
+-static my_bool cache_remove_open_tmp(IO_CACHE *cache __attribute__((unused)),
++static my_bool cache_remove_open_tmp(IO_CACHE *cache MY_ATTRIBUTE((unused)),
+ const char *name)
+ {
+ #if O_TEMPORARY == 0
+--- a/mysys/mf_iocache.c
++++ b/mysys/mf_iocache.c
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -323,7 +323,7 @@ static void my_aiowait(my_aio_result *result)
+
+ my_bool reinit_io_cache(IO_CACHE *info, enum cache_type type,
+ my_off_t seek_offset,
+- pbool use_async_io __attribute__((unused)),
++ pbool use_async_io MY_ATTRIBUTE((unused)),
+ pbool clear_cache)
+ {
+ DBUG_ENTER("reinit_io_cache");
[email protected]@ -1129,7 +1129,7 @@ static void copy_to_read_buffer(IO_CACHE *write_cache,
+ while (write_length)
+ {
+ size_t copy_length= MY_MIN(write_length, write_cache->buffer_length);
+- int __attribute__((unused)) rc;
++ int MY_ATTRIBUTE((unused)) rc;
+
+ rc= lock_io_cache(write_cache, write_cache->pos_in_file);
+ /* The writing thread does always have the lock when it awakes. */
[email protected]@ -1732,7 +1732,7 @@ int my_block_write(register IO_CACHE *info, const uchar *Buffer, size_t Count,
+ unlock_append_buffer(info);
+
+ int my_b_flush_io_cache(IO_CACHE *info,
+- int need_append_buffer_lock __attribute__((unused)))
++ int need_append_buffer_lock MY_ATTRIBUTE((unused)))
+ {
+ size_t length;
+ my_off_t pos_in_file;
+--- a/mysys/mf_keycache.c
++++ b/mysys/mf_keycache.c
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -2498,8 +2498,8 @@ static void read_block(KEY_CACHE *keycache,
+ uchar *key_cache_read(KEY_CACHE *keycache,
+ File file, my_off_t filepos, int level,
+ uchar *buff, uint length,
+- uint block_length __attribute__((unused)),
+- int return_buffer __attribute__((unused)))
++ uint block_length MY_ATTRIBUTE((unused)),
++ int return_buffer MY_ATTRIBUTE((unused)))
+ {
+ my_bool locked_and_incremented= FALSE;
+ int error=0;
[email protected]@ -2979,7 +2979,7 @@ int key_cache_insert(KEY_CACHE *keycache,
+ int key_cache_write(KEY_CACHE *keycache,
+ File file, my_off_t filepos, int level,
+ uchar *buff, uint length,
+- uint block_length __attribute__((unused)),
++ uint block_length MY_ATTRIBUTE((unused)),
+ int dont_write)
+ {
+ my_bool locked_and_incremented= FALSE;
[email protected]@ -4206,7 +4206,7 @@ static int flush_all_key_blocks(KEY_CACHE *keycache)
+ 0 on success (always because it can't fail)
+ */
+
+-int reset_key_cache_counters(const char *name __attribute__((unused)),
++int reset_key_cache_counters(const char *name MY_ATTRIBUTE((unused)),
+ KEY_CACHE *key_cache)
+ {
+ DBUG_ENTER("reset_key_cache_counters");
[email protected]@ -4230,9 +4230,9 @@ int reset_key_cache_counters(const char *name __attribute__((unused)),
+ /*
+ Test if disk-cache is ok
+ */
+-static void test_key_cache(KEY_CACHE *keycache __attribute__((unused)),
+- const char *where __attribute__((unused)),
+- my_bool lock __attribute__((unused)))
++static void test_key_cache(KEY_CACHE *keycache MY_ATTRIBUTE((unused)),
++ const char *where MY_ATTRIBUTE((unused)),
++ my_bool lock MY_ATTRIBUTE((unused)))
+ {
+ /* TODO */
+ }
+--- a/mysys/mf_keycaches.c
++++ b/mysys/mf_keycaches.c
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -77,7 +77,7 @@ static void safe_hash_entry_free(SAFE_HASH_ENTRY *entry)
+ /* Get key and length for a SAFE_HASH_ENTRY */
+
+ static uchar *safe_hash_entry_get(SAFE_HASH_ENTRY *entry, size_t *length,
+- my_bool not_used __attribute__((unused)))
++ my_bool not_used MY_ATTRIBUTE((unused)))
+ {
+ *length=entry->length;
+ return (uchar*) entry->key;
+--- a/mysys/mf_tempfile.c
++++ b/mysys/mf_tempfile.c
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -55,8 +55,8 @@
+ */
+
+ File create_temp_file(char *to, const char *dir, const char *prefix,
+- int mode __attribute__((unused)),
+- myf MyFlags __attribute__((unused)))
++ int mode MY_ATTRIBUTE((unused)),
++ myf MyFlags MY_ATTRIBUTE((unused)))
+ {
+ File file= -1;
+ #ifdef __WIN__
+--- a/mysys/mf_unixpath.c
++++ b/mysys/mf_unixpath.c
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -24,7 +24,7 @@
+ @param to A pathname.
+ */
+
+-void to_unix_path(char *to __attribute__((unused)))
++void to_unix_path(char *to MY_ATTRIBUTE((unused)))
+ {
+ #if FN_LIBCHAR != '/'
+ {
+--- a/mysys/my_access.c
++++ b/mysys/my_access.c
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -187,9 +187,9 @@ static my_bool does_drive_exists(char drive_letter)
+
+ @return TRUE if the file name is allowed, FALSE otherwise.
+ */
+-my_bool is_filename_allowed(const char *name __attribute__((unused)),
+- size_t length __attribute__((unused)),
+- my_bool allow_current_dir __attribute__((unused)))
++my_bool is_filename_allowed(const char *name MY_ATTRIBUTE((unused)),
++ size_t length MY_ATTRIBUTE((unused)),
++ my_bool allow_current_dir MY_ATTRIBUTE((unused)))
+ {
+ /*
+ For Windows, check if the file name contains : character.
+--- a/mysys/my_alarm.c
++++ b/mysys/my_alarm.c
[email protected]@ -1,5 +1,4 @@
+-/* Copyright (C) 2000 MySQL AB
+- Use is subject to license terms
++/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -12,7 +11,7 @@
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
++ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+
+ /* Function to set a varible when we got a alarm */
+ /* Used by my_lock samt functions in m_alarm.h */
[email protected]@ -24,7 +23,7 @@
+ #ifdef HAVE_ALARM
+
+ /* ARGSUSED */
+-sig_handler my_set_alarm_variable(int signo __attribute__((unused)))
++sig_handler my_set_alarm_variable(int signo MY_ATTRIBUTE((unused)))
+ {
+ my_have_got_alarm=1; /* Tell program that time expired */
+ return;
+--- a/mysys/my_alloc.c
++++ b/mysys/my_alloc.c
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -44,7 +44,7 @@
+ */
+
+ void init_alloc_root(MEM_ROOT *mem_root, size_t block_size,
+- size_t pre_alloc_size __attribute__((unused)))
++ size_t pre_alloc_size MY_ATTRIBUTE((unused)))
+ {
+ DBUG_ENTER("init_alloc_root");
+ DBUG_PRINT("enter",("root: 0x%lx", (long) mem_root));
[email protected]@ -94,7 +94,7 @@ void init_alloc_root(MEM_ROOT *mem_root, size_t block_size,
+ */
+
+ void reset_root_defaults(MEM_ROOT *mem_root, size_t block_size,
+- size_t pre_alloc_size __attribute__((unused)))
++ size_t pre_alloc_size MY_ATTRIBUTE((unused)))
+ {
+ DBUG_ASSERT(alloc_root_inited(mem_root));
+
+--- a/mysys/my_bitmap.c
++++ b/mysys/my_bitmap.c
[email protected]@ -1,5 +1,5 @@
+ /*
+- Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
++ Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -81,14 +81,14 @@ void create_last_word_mask(MY_BITMAP *map)
+ }
+
+
+-static inline void bitmap_lock(MY_BITMAP *map __attribute__((unused)))
++static inline void bitmap_lock(MY_BITMAP *map MY_ATTRIBUTE((unused)))
+ {
+ if (map->mutex)
+ mysql_mutex_lock(map->mutex);
+ }
+
+
+-static inline void bitmap_unlock(MY_BITMAP *map __attribute__((unused)))
++static inline void bitmap_unlock(MY_BITMAP *map MY_ATTRIBUTE((unused)))
+ {
+ if (map->mutex)
+ mysql_mutex_unlock(map->mutex);
[email protected]@ -136,7 +136,7 @@ static inline uint get_first_not_set(uint32 value, uint word_pos)
+
+
+ my_bool bitmap_init(MY_BITMAP *map, my_bitmap_map *buf, uint n_bits,
+- my_bool thread_safe __attribute__((unused)))
++ my_bool thread_safe MY_ATTRIBUTE((unused)))
+ {
+ DBUG_ENTER("bitmap_init");
+ if (!buf)
+--- a/mysys/my_fopen.c
++++ b/mysys/my_fopen.c
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -147,7 +147,7 @@ static FILE *my_win_freopen(const char *path, const char *mode, FILE *stream)
+
+ /* No close operation hook. */
+
+-static int no_close(void *cookie __attribute__((unused)))
++static int no_close(void *cookie MY_ATTRIBUTE((unused)))
+ {
+ return 0;
+ }
+--- a/mysys/my_fstream.c
++++ b/mysys/my_fstream.c
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -171,7 +171,7 @@ size_t my_fwrite(FILE *stream, const uchar *Buffer, size_t Count, myf MyFlags)
+ /* Seek to position in file */
+
+ my_off_t my_fseek(FILE *stream, my_off_t pos, int whence,
+- myf MyFlags __attribute__((unused)))
++ myf MyFlags MY_ATTRIBUTE((unused)))
+ {
+ DBUG_ENTER("my_fseek");
+ DBUG_PRINT("my",("stream: 0x%lx pos: %lu whence: %d MyFlags: %d",
[email protected]@ -183,7 +183,7 @@ my_off_t my_fseek(FILE *stream, my_off_t pos, int whence,
+
+ /* Tell current position of file */
+
+-my_off_t my_ftell(FILE *stream, myf MyFlags __attribute__((unused)))
++my_off_t my_ftell(FILE *stream, myf MyFlags MY_ATTRIBUTE((unused)))
+ {
+ off_t pos;
+ DBUG_ENTER("my_ftell");
+--- a/mysys/my_gethwaddr.c
++++ b/mysys/my_gethwaddr.c
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -228,14 +228,14 @@ my_bool my_gethwaddr(uchar *to)
+
+ #else /* __FreeBSD__ || __linux__ || __WIN__ */
+ /* just fail */
+-my_bool my_gethwaddr(uchar *to __attribute__((unused)))
++my_bool my_gethwaddr(uchar *to MY_ATTRIBUTE((unused)))
+ {
+ return 1;
+ }
+ #endif
+
+ #else /* MAIN */
+-int main(int argc __attribute__((unused)),char **argv)
++int main(int argc MY_ATTRIBUTE((unused)),char **argv)
+ {
+ uchar mac[6];
+ uint i;
+--- a/mysys/my_getsystime.c
++++ b/mysys/my_getsystime.c
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -170,7 +170,7 @@ ulonglong my_micro_time_and_time(time_t *time_arg)
+ @retval current time.
+ */
+
+-time_t my_time_possible_from_micro(ulonglong microtime __attribute__((unused)))
++time_t my_time_possible_from_micro(ulonglong microtime MY_ATTRIBUTE((unused)))
+ {
+ #ifdef _WIN32
+ time_t t;
+--- a/mysys/my_lib.c
++++ b/mysys/my_lib.c
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -390,7 +390,7 @@ error:
+
+
+ int my_fstat(File Filedes, MY_STAT *stat_area,
+- myf MyFlags __attribute__((unused)))
++ myf MyFlags MY_ATTRIBUTE((unused)))
+ {
+ DBUG_ENTER("my_fstat");
+ DBUG_PRINT("my",("fd: %d MyFlags: %d", Filedes, MyFlags));
+--- a/mysys/my_mess.c
++++ b/mysys/my_mess.c
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -15,7 +15,7 @@
+
+ #include "mysys_priv.h"
+
+-void my_message_stderr(uint error __attribute__((unused)),
++void my_message_stderr(uint error MY_ATTRIBUTE((unused)),
+ const char *str, myf MyFlags)
+ {
+ DBUG_ENTER("my_message_stderr");
+--- a/mysys/my_static.c
++++ b/mysys/my_static.c
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -74,12 +74,12 @@ void (*error_handler_hook)(uint error, const char *str, myf MyFlags)=
+ void (*fatal_error_handler_hook)(uint error, const char *str, myf MyFlags)=
+ my_message_stderr;
+
+-static void proc_info_dummy(void *a __attribute__((unused)),
+- const PSI_stage_info *b __attribute__((unused)),
+- PSI_stage_info *c __attribute__((unused)),
+- const char *d __attribute__((unused)),
+- const char *e __attribute__((unused)),
+- const unsigned int f __attribute__((unused)))
++static void proc_info_dummy(void *a MY_ATTRIBUTE((unused)),
++ const PSI_stage_info *b MY_ATTRIBUTE((unused)),
++ PSI_stage_info *c MY_ATTRIBUTE((unused)),
++ const char *d MY_ATTRIBUTE((unused)),
++ const char *e MY_ATTRIBUTE((unused)),
++ const unsigned int f MY_ATTRIBUTE((unused)))
+ {
+ return;
+ }
+--- a/mysys/my_symlink.c
++++ b/mysys/my_symlink.c
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -107,7 +107,7 @@ int my_symlink(const char *content, const char *linkname, myf MyFlags)
+ #endif
+
+
+-int my_is_symlink(const char *filename __attribute__((unused)))
++int my_is_symlink(const char *filename MY_ATTRIBUTE((unused)))
+ {
+ #if defined (HAVE_LSTAT) && defined (S_ISLNK)
+ struct stat stat_buff;
+--- a/mysys/my_sync.c
++++ b/mysys/my_sync.c
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -159,8 +159,8 @@ int my_sync_dir(const char *dir_name, myf my_flags)
+
+ #else /* NEED_EXPLICIT_SYNC_DIR */
+
+-int my_sync_dir(const char *dir_name __attribute__((unused)),
+- myf my_flags __attribute__((unused)))
++int my_sync_dir(const char *dir_name MY_ATTRIBUTE((unused)),
++ myf my_flags MY_ATTRIBUTE((unused)))
+ {
+ return 0;
+ }
[email protected]@ -192,8 +192,8 @@ int my_sync_dir_by_file(const char *file_name, myf my_flags)
+
+ #else /* NEED_EXPLICIT_SYNC_DIR */
+
+-int my_sync_dir_by_file(const char *file_name __attribute__((unused)),
+- myf my_flags __attribute__((unused)))
++int my_sync_dir_by_file(const char *file_name MY_ATTRIBUTE((unused)),
++ myf my_flags MY_ATTRIBUTE((unused)))
+ {
+ return 0;
+ }
+--- a/mysys/psi_noop.c
++++ b/mysys/psi_noop.c
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -27,7 +27,7 @@
+
+ C_MODE_START
+
+-#define NNN __attribute__((unused))
++#define NNN MY_ATTRIBUTE((unused))
+
+ static void register_mutex_noop(const char *category NNN,
+ PSI_mutex_info *info NNN,
[email protected]@ -637,9 +637,9 @@ digest_end_noop(PSI_digest_locker *locker NNN,
+ }
+
+ static int
+-set_thread_connect_attrs_noop(const char *buffer __attribute__((unused)),
+- uint length __attribute__((unused)),
+- const void *from_cs __attribute__((unused)))
++set_thread_connect_attrs_noop(const char *buffer MY_ATTRIBUTE((unused)),
++ uint length MY_ATTRIBUTE((unused)),
++ const void *from_cs MY_ATTRIBUTE((unused)))
+ {
+ return 0;
+ }
+--- a/mysys/ptr_cmp.c
++++ b/mysys/ptr_cmp.c
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -45,9 +45,9 @@ static int native_compare(size_t *length, unsigned char **a, unsigned char **b)
+ Special case for ORDER BY / GROUP BY CHAR(0) NOT NULL
+ */
+ static
+-int ptr_compare_zero_length(size_t *compare_length __attribute__((unused)),
+- uchar **a __attribute__((unused)),
+- uchar **b __attribute__((unused)))
++int ptr_compare_zero_length(size_t *compare_length MY_ATTRIBUTE((unused)),
++ uchar **a MY_ATTRIBUTE((unused)),
++ uchar **b MY_ATTRIBUTE((unused)))
+ {
+ return 0;
+ }
[email protected]@ -61,7 +61,7 @@ static int ptr_compare_3(size_t *compare_length, uchar **a, uchar **b);
+ /* Get a pointer to a optimal byte-compare function for a given size */
+
+ #ifdef __sun
+-qsort2_cmp get_ptr_compare (size_t size __attribute__((unused)))
++qsort2_cmp get_ptr_compare (size_t size MY_ATTRIBUTE((unused)))
+ {
+ return (qsort2_cmp) native_compare;
+ }
+--- a/mysys/stacktrace.c
++++ b/mysys/stacktrace.c
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -159,8 +159,8 @@ void my_safe_print_str(const char* val, int max_len)
+ /* Use Solaris' symbolic stack trace routine. */
+ #include <ucontext.h>
+
+-void my_print_stacktrace(uchar* stack_bottom __attribute__((unused)),
+- ulong thread_stack __attribute__((unused)))
++void my_print_stacktrace(uchar* stack_bottom MY_ATTRIBUTE((unused)),
++ ulong thread_stack MY_ATTRIBUTE((unused)))
+ {
+ if (printstack(fileno(stderr)) == -1)
+ my_safe_printf_stderr("%s",
[email protected]@ -178,9 +178,9 @@ void my_print_stacktrace(uchar* stack_bottom __attribute__((unused)),
+
+ #if BACKTRACE_DEMANGLE
+
+-char __attribute__ ((weak)) *
+-my_demangle(const char *mangled_name __attribute__((unused)),
+- int *status __attribute__((unused)))
++char MY_ATTRIBUTE ((weak)) *
++my_demangle(const char *mangled_name MY_ATTRIBUTE((unused)),
++ int *status MY_ATTRIBUTE((unused)))
+ {
+ return NULL;
+ }
+--- a/mysys/testhash.c
++++ b/mysys/testhash.c
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -39,7 +39,7 @@ my_bool hash_check(HASH *hash);
+ void free_record(void *record);
+
+ static uchar *hash2_key(const uchar *rec,uint *length,
+- my_bool not_used __attribute__((unused)))
++ my_bool not_used MY_ATTRIBUTE((unused)))
+ {
+ *length=(uint) (uchar) rec[reclength-1];
+ return (uchar*) rec;
+--- a/mysys/thr_alarm.c
++++ b/mysys/thr_alarm.c
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -60,9 +60,9 @@ static void *alarm_handler(void *arg);
+ #define reschedule_alarms() pthread_kill(alarm_thread,THR_SERVER_ALARM)
+ #endif
+
+-static sig_handler thread_alarm(int sig __attribute__((unused)));
++static sig_handler thread_alarm(int sig MY_ATTRIBUTE((unused)));
+
+-static int compare_ulong(void *not_used __attribute__((unused)),
++static int compare_ulong(void *not_used MY_ATTRIBUTE((unused)),
+ uchar *a_ptr,uchar* b_ptr)
+ {
+ ulong a=*((ulong*) a_ptr),b= *((ulong*) b_ptr);
[email protected]@ -274,7 +274,7 @@ void thr_end_alarm(thr_alarm_t *alarmed)
+ every second.
+ */
+
+-sig_handler process_alarm(int sig __attribute__((unused)))
++sig_handler process_alarm(int sig MY_ATTRIBUTE((unused)))
+ {
+ sigset_t old_mask;
+ /*
[email protected]@ -304,7 +304,7 @@ sig_handler process_alarm(int sig __attribute__((unused)))
+ }
+
+
+-static sig_handler process_alarm_part2(int sig __attribute__((unused)))
++static sig_handler process_alarm_part2(int sig MY_ATTRIBUTE((unused)))
+ {
+ ALARM *alarm_data;
+ DBUG_ENTER("process_alarm");
[email protected]@ -492,7 +492,7 @@ void thr_alarm_info(ALARM_INFO *info)
+ */
+
+
+-static sig_handler thread_alarm(int sig __attribute__((unused)))
++static sig_handler thread_alarm(int sig MY_ATTRIBUTE((unused)))
+ {
+ #ifdef MAIN
+ printf("thread_alarm\n"); fflush(stdout);
[email protected]@ -511,7 +511,7 @@ static sig_handler thread_alarm(int sig __attribute__((unused)))
+ /* set up a alarm thread with uses 'sleep' to sleep between alarms */
+
+ #ifdef USE_ALARM_THREAD
+-static void *alarm_handler(void *arg __attribute__((unused)))
++static void *alarm_handler(void *arg MY_ATTRIBUTE((unused)))
+ {
+ int error;
+ struct timespec abstime;
[email protected]@ -580,7 +580,7 @@ void thr_alarm_kill(my_thread_id thread_id)
+ /* Can't do this yet */
+ }
+
+-sig_handler process_alarm(int sig __attribute__((unused)))
++sig_handler process_alarm(int sig MY_ATTRIBUTE((unused)))
+ {
+ /* Can't do this yet */
+ }
[email protected]@ -774,7 +774,7 @@ static sig_handler print_signal_warning(int sig)
+ #endif /* USE_ONE_SIGNAL_HAND */
+
+
+-static void *signal_hand(void *arg __attribute__((unused)))
++static void *signal_hand(void *arg MY_ATTRIBUTE((unused)))
+ {
+ sigset_t set;
+ int sig,error,err_count=0;;
[email protected]@ -842,7 +842,7 @@ static void *signal_hand(void *arg __attribute__((unused)))
+ }
+
+
+-int main(int argc __attribute__((unused)),char **argv __attribute__((unused)))
++int main(int argc MY_ATTRIBUTE((unused)),char **argv MY_ATTRIBUTE((unused)))
+ {
+ pthread_t tid;
+ pthread_attr_t thr_attr;
[email protected]@ -931,7 +931,7 @@ int main(int argc __attribute__((unused)),char **argv __attribute__((unused)))
+
+ #else /* !defined(DONT_USE_ALARM_THREAD) */
+
+-int main(int argc __attribute__((unused)),char **argv __attribute__((unused)))
++int main(int argc MY_ATTRIBUTE((unused)),char **argv MY_ATTRIBUTE((unused)))
+ {
+ printf("thr_alarm disabled with DONT_USE_THR_ALARM\n");
+ exit(1);
+--- a/mysys/thr_lock.c
++++ b/mysys/thr_lock.c
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -1512,21 +1512,21 @@ static ulong sum=0;
+
+ /* The following functions is for WRITE_CONCURRENT_INSERT */
+
+-static void test_get_status(void* param __attribute__((unused)),
+- int concurrent_insert __attribute__((unused)))
++static void test_get_status(void* param MY_ATTRIBUTE((unused)),
++ int concurrent_insert MY_ATTRIBUTE((unused)))
+ {
+ }
+
+-static void test_update_status(void* param __attribute__((unused)))
++static void test_update_status(void* param MY_ATTRIBUTE((unused)))
+ {
+ }
+
+-static void test_copy_status(void* to __attribute__((unused)) ,
+- void *from __attribute__((unused)))
++static void test_copy_status(void* to MY_ATTRIBUTE((unused)) ,
++ void *from MY_ATTRIBUTE((unused)))
+ {
+ }
+
+-static my_bool test_check_status(void* param __attribute__((unused)))
++static my_bool test_check_status(void* param MY_ATTRIBUTE((unused)))
+ {
+ return 0;
+ }
[email protected]@ -1583,7 +1583,7 @@ static void *test_thread(void *arg)
+ }
+
+
+-int main(int argc __attribute__((unused)),char **argv __attribute__((unused)))
++int main(int argc MY_ATTRIBUTE((unused)),char **argv MY_ATTRIBUTE((unused)))
+ {
+ pthread_t tid;
+ pthread_attr_t thr_attr;
+--- a/mysys/thr_mutex.c
++++ b/mysys/thr_mutex.c
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -53,7 +53,7 @@ void safe_mutex_global_init(void)
+
+
+ int safe_mutex_init(safe_mutex_t *mp,
+- const pthread_mutexattr_t *attr __attribute__((unused)),
++ const pthread_mutexattr_t *attr MY_ATTRIBUTE((unused)),
+ const char *file,
+ uint line)
+ {
[email protected]@ -370,7 +370,7 @@ int safe_mutex_destroy(safe_mutex_t *mp, const char *file, uint line)
+ This is ok, as this thread may not yet have been exited.
+ */
+
+-void safe_mutex_end(FILE *file __attribute__((unused)))
++void safe_mutex_end(FILE *file MY_ATTRIBUTE((unused)))
+ {
+ if (!safe_mutex_count) /* safetly */
+ pthread_mutex_destroy(&THR_LOCK_mutex);
+--- a/mysys/waiting_threads.c
++++ b/mysys/waiting_threads.c
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -295,9 +295,9 @@ uint32 wt_cycle_stats[2][WT_CYCLE_STATS+1];
+ uint32 wt_success_stats;
+
+ static my_atomic_rwlock_t
+- cycle_stats_lock __attribute__((unused)),
+- wait_stats_lock __attribute__((unused)),
+- success_stats_lock __attribute__((unused));
++ cycle_stats_lock MY_ATTRIBUTE((unused)),
++ wait_stats_lock MY_ATTRIBUTE((unused)),
++ success_stats_lock MY_ATTRIBUTE((unused));
+
+ #ifdef SAFE_STATISTICS
+ #define incr(VAR, LOCK) \
+--- a/mysys_ssl/my_default.cc
++++ b/mysys_ssl/my_default.cc
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -1279,7 +1279,7 @@ static int add_directory(MEM_ROOT *alloc, const char *dir, const char **dirs)
+ char buf[FN_REFLEN];
+ size_t len;
+ char *p;
+- my_bool err __attribute__((unused));
++ my_bool err MY_ATTRIBUTE((unused));
+
+ len= normalize_dirname(buf, dir);
+ if (!(p= strmake_root(alloc, buf, len)))
+--- a/mysys_ssl/my_getopt.cc
++++ b/mysys_ssl/my_getopt.cc
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -1370,7 +1370,7 @@ static void init_one_value(const struct my_option *option, void *variable,
+ */
+
+ static void fini_one_value(const struct my_option *option, void *variable,
+- longlong value __attribute__ ((unused)))
++ longlong value MY_ATTRIBUTE ((unused)))
+ {
+ DBUG_ENTER("fini_one_value");
+ switch ((option->var_type & GET_TYPE_MASK)) {
+--- a/plugin/audit_null/audit_null.c
++++ b/plugin/audit_null/audit_null.c
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
[email protected]@ -18,9 +18,7 @@
+ #include <mysql/plugin.h>
+ #include <mysql/plugin_audit.h>
+
+-#if !defined(__attribute__) && (defined(__cplusplus) || !defined(__GNUC__) || __GNUC__ == 2 && __GNUC_MINOR__ < 8)
+-#define __attribute__(A)
+-#endif
++#include "my_attribute.h"
+
+ static volatile int number_of_calls; /* for SHOW STATUS, see below */
+ /* Count MYSQL_AUDIT_GENERAL_CLASS event instances */
[email protected]@ -48,7 +46,7 @@ static volatile int number_of_calls_connection_change_user;
+ 1 failure (cannot happen)
+ */
+
+-static int audit_null_plugin_init(void *arg __attribute__((unused)))
++static int audit_null_plugin_init(void *arg MY_ATTRIBUTE((unused)))
+ {
+ number_of_calls= 0;
+ number_of_calls_general_log= 0;
[email protected]@ -75,7 +73,7 @@ static int audit_null_plugin_init(void *arg __attribute__((unused)))
+
+ */
+
+-static int audit_null_plugin_deinit(void *arg __attribute__((unused)))
++static int audit_null_plugin_deinit(void *arg MY_ATTRIBUTE((unused)))
+ {
+ return(0);
+ }
[email protected]@ -91,7 +89,7 @@ static int audit_null_plugin_deinit(void *arg __attribute__((unused)))
+ DESCRIPTION
+ */
+
+-static void audit_null_notify(MYSQL_THD thd __attribute__((unused)),
++static void audit_null_notify(MYSQL_THD thd MY_ATTRIBUTE((unused)),
+ unsigned int event_class,
+ const void *event)
+ {
+--- a/plugin/auth/dialog.c
++++ b/plugin/auth/dialog.c
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
[email protected]@ -207,8 +207,8 @@ typedef char *(*mysql_authentication_dialog_ask_t)(struct st_mysql *mysql,
+
+ static mysql_authentication_dialog_ask_t ask;
+
+-static char *builtin_ask(MYSQL *mysql __attribute__((unused)),
+- int type __attribute__((unused)),
++static char *builtin_ask(MYSQL *mysql MY_ATTRIBUTE((unused)),
++ int type MY_ATTRIBUTE((unused)),
+ const char *prompt,
+ char *buf, int buf_len)
+ {
[email protected]@ -309,10 +309,10 @@ static int perform_dialog(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql)
+ or fall back to the default implementation.
+ */
+
+-static int init_dialog(char *unused1 __attribute__((unused)),
+- size_t unused2 __attribute__((unused)),
+- int unused3 __attribute__((unused)),
+- va_list unused4 __attribute__((unused)))
++static int init_dialog(char *unused1 MY_ATTRIBUTE((unused)),
++ size_t unused2 MY_ATTRIBUTE((unused)),
++ int unused3 MY_ATTRIBUTE((unused)),
++ va_list unused4 MY_ATTRIBUTE((unused)))
+ {
+ void *sym= dlsym(RTLD_DEFAULT, "mysql_authentication_dialog_ask");
+ ask= sym ? (mysql_authentication_dialog_ask_t) sym : builtin_ask;
+--- a/plugin/auth/mysql_no_login.c
++++ b/plugin/auth/mysql_no_login.c
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2014, 2015 Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2014, 2016 Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
[email protected]@ -32,8 +32,8 @@
+ #include <stdlib.h>
+
+ static int mysql_no_login(
+- MYSQL_PLUGIN_VIO *vio __attribute__((unused)),
+- MYSQL_SERVER_AUTH_INFO *info __attribute__((unused)))
++ MYSQL_PLUGIN_VIO *vio MY_ATTRIBUTE((unused)),
++ MYSQL_SERVER_AUTH_INFO *info MY_ATTRIBUTE((unused)))
+ {
+ return CR_ERROR;
+ }
+--- a/plugin/daemon_example/daemon_example.cc
++++ b/plugin/daemon_example/daemon_example.cc
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -26,10 +26,10 @@
+ #include "sql_plugin.h" // st_plugin_int
+
+ /*
+- Disable __attribute__() on non-gcc compilers.
++ Disable MY_ATTRIBUTE() on non-gcc compilers.
+ */
+-#if !defined(__attribute__) && !defined(__GNUC__)
+-#define __attribute__(A)
++#if !defined(MY_ATTRIBUTE) && !defined(__GNUC__)
++#define MY_ATTRIBUTE(A)
+ #endif
+
+
+--- a/plugin/fulltext/plugin_example.c
++++ b/plugin/fulltext/plugin_example.c
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -17,9 +17,7 @@
+ #include <ctype.h>
+ #include <mysql/plugin.h>
+
+-#if !defined(__attribute__) && (defined(__cplusplus) || !defined(__GNUC__) || __GNUC__ == 2 && __GNUC_MINOR__ < 8)
+-#define __attribute__(A)
+-#endif
++#include "my_attribute.h"
+
+ static long number_of_calls= 0; /* for SHOW STATUS, see below */
+
[email protected]@ -62,7 +60,7 @@ static long number_of_calls= 0; /* for SHOW STATUS, see below */
+ 1 failure (cannot happen)
+ */
+
+-static int simple_parser_plugin_init(void *arg __attribute__((unused)))
++static int simple_parser_plugin_init(void *arg MY_ATTRIBUTE((unused)))
+ {
+ return(0);
+ }
[email protected]@ -81,7 +79,7 @@ static int simple_parser_plugin_init(void *arg __attribute__((unused)))
+
+ */
+
+-static int simple_parser_plugin_deinit(void *arg __attribute__((unused)))
++static int simple_parser_plugin_deinit(void *arg MY_ATTRIBUTE((unused)))
+ {
+ return(0);
+ }
[email protected]@ -102,7 +100,7 @@ static int simple_parser_plugin_deinit(void *arg __attribute__((unused)))
+ */
+
+ static int simple_parser_init(MYSQL_FTPARSER_PARAM *param
+- __attribute__((unused)))
++ MY_ATTRIBUTE((unused)))
+ {
+ return(0);
+ }
[email protected]@ -123,7 +121,7 @@ static int simple_parser_init(MYSQL_FTPARSER_PARAM *param
+ */
+
+ static int simple_parser_deinit(MYSQL_FTPARSER_PARAM *param
+- __attribute__((unused)))
++ MY_ATTRIBUTE((unused)))
+ {
+ return(0);
+ }
+--- a/plugin/password_validation/validate_password.cc
++++ b/plugin/password_validation/validate_password.cc
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -24,12 +24,12 @@
+
+
+ /*
+- __attribute__(A) needs to be defined for Windows else complier
++ MY_ATTRIBUTE(A) needs to be defined for Windows else complier
+ do not recognise it. Argument in plugin_init and plugin_deinit
+ Used in other plugins as well.
+ */
+-#if !defined(__attribute__) && (defined(__cplusplus) || !defined(__GNUC__) || __GNUC__ == 2 && __GNUC_MINOR__ < 8)
+-#define __attribute__(A)
++#if !defined(MY_ATTRIBUTE) && (defined(__cplusplus) || !defined(__GNUC__) || __GNUC__ == 2 && __GNUC_MINOR__ < 8)
++#define MY_ATTRIBUTE(A)
+ #endif
+
+ #define MAX_DICTIONARY_FILE_LENGTH 1024 * 1024
[email protected]@ -367,7 +367,7 @@ static int validate_password_init(MYSQL_PLUGIN plugin_info)
+ It empty the std::set and returns 0
+ */
+
+-static int validate_password_deinit(void *arg __attribute__((unused)))
++static int validate_password_deinit(void *arg MY_ATTRIBUTE((unused)))
+ {
+ free_dictionary_file();
+ mysql_rwlock_destroy(&LOCK_dict_file);
[email protected]@ -380,8 +380,8 @@ static int validate_password_deinit(void *arg __attribute__((unused)))
+ the cache and re-load the new dictionary file.
+ */
+ static void
+-dictionary_update(MYSQL_THD thd __attribute__((unused)),
+- struct st_mysql_sys_var *var __attribute__((unused)),
++dictionary_update(MYSQL_THD thd MY_ATTRIBUTE((unused)),
++ struct st_mysql_sys_var *var MY_ATTRIBUTE((unused)),
+ void *var_ptr, const void *save)
+ {
+ *(const char**)var_ptr= *(const char**)save;
[email protected]@ -396,8 +396,8 @@ dictionary_update(MYSQL_THD thd __attribute__((unused)),
+ 4. validate_password_special_char_count
+ */
+ static void
+-length_update(MYSQL_THD thd __attribute__((unused)),
+- struct st_mysql_sys_var *var __attribute__((unused)),
++length_update(MYSQL_THD thd MY_ATTRIBUTE((unused)),
++ struct st_mysql_sys_var *var MY_ATTRIBUTE((unused)),
+ void *var_ptr, const void *save)
+ {
+ int new_validate_password_length;
+--- a/regex/regcomp.c
++++ b/regex/regcomp.c
[email protected]@ -3,7 +3,7 @@
+
+ This file was modified by Oracle on 2015-05-18 for 32-bit compatibility.
+
+- Modifications copyright (c) 2015, Oracle and/or its affiliates. All rights
++ Modifications copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights
+ reserved. */
+
+ #include <my_global.h>
[email protected]@ -1258,8 +1258,8 @@ register char *cp;
+ */
+ static void
+ mcinvert(p, cs)
+- register struct parse *p __attribute__((unused));
+- register cset *cs __attribute__((unused));
++ register struct parse *p MY_ATTRIBUTE((unused));
++ register cset *cs MY_ATTRIBUTE((unused));
+ {
+ assert(cs->multis == NULL); /* xxx */
+ }
[email protected]@ -1273,8 +1273,8 @@ mcinvert(p, cs)
+ */
+ static void
+ mccase(p, cs)
+-register struct parse *p __attribute__((unused));
+-register cset *cs __attribute__((unused));
++register struct parse *p MY_ATTRIBUTE((unused));
++register cset *cs MY_ATTRIBUTE((unused));
+ {
+ assert(cs->multis == NULL); /* xxx */
+ }
+--- a/sql-common/client.c
++++ b/sql-common/client.c
[email protected]@ -1741,12 +1741,12 @@ mysql_init(MYSQL *mysql)
+ #define strdup_if_not_null(A) (A) == 0 ? 0 : my_strdup((A),MYF(MY_WME))
+
+ my_bool STDCALL
+-mysql_ssl_set(MYSQL *mysql __attribute__((unused)) ,
+- const char *key __attribute__((unused)),
+- const char *cert __attribute__((unused)),
+- const char *ca __attribute__((unused)),
+- const char *capath __attribute__((unused)),
+- const char *cipher __attribute__((unused)))
++mysql_ssl_set(MYSQL *mysql MY_ATTRIBUTE((unused)) ,
++ const char *key MY_ATTRIBUTE((unused)),
++ const char *cert MY_ATTRIBUTE((unused)),
++ const char *ca MY_ATTRIBUTE((unused)),
++ const char *capath MY_ATTRIBUTE((unused)),
++ const char *cipher MY_ATTRIBUTE((unused)))
+ {
+ my_bool result= 0;
+ DBUG_ENTER("mysql_ssl_set");
[email protected]@ -1771,7 +1771,7 @@ mysql_ssl_set(MYSQL *mysql __attribute__((unused)) ,
+ #if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
+
+ static void
+-mysql_ssl_free(MYSQL *mysql __attribute__((unused)))
++mysql_ssl_free(MYSQL *mysql MY_ATTRIBUTE((unused)))
+ {
+ struct st_VioSSLFd *ssl_fd= (struct st_VioSSLFd*) mysql->connector_fd;
+ DBUG_ENTER("mysql_ssl_free");
[email protected]@ -1817,7 +1817,7 @@ mysql_ssl_free(MYSQL *mysql __attribute__((unused)))
+ */
+
+ const char * STDCALL
+-mysql_get_ssl_cipher(MYSQL *mysql __attribute__((unused)))
++mysql_get_ssl_cipher(MYSQL *mysql MY_ATTRIBUTE((unused)))
+ {
+ DBUG_ENTER("mysql_get_ssl_cipher");
+ #if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
[email protected]@ -4085,8 +4085,8 @@ static void mysql_prune_stmt_list(MYSQL *mysql)
+ should also be reflected there.
+ */
+
+-void mysql_detach_stmt_list(LIST **stmt_list __attribute__((unused)),
+- const char *func_name __attribute__((unused)))
++void mysql_detach_stmt_list(LIST **stmt_list MY_ATTRIBUTE((unused)),
++ const char *func_name MY_ATTRIBUTE((unused)))
+ {
+ #ifdef MYSQL_CLIENT
+ /* Reset connection handle in all prepared statements. */
[email protected]@ -4598,7 +4598,7 @@ mysql_options(MYSQL *mysql,enum mysql_option option, const void *arg)
+ */
+ uchar *
+ get_attr_key(LEX_STRING *part, size_t *length,
+- my_bool not_used __attribute__((unused)))
++ my_bool not_used MY_ATTRIBUTE((unused)))
+ {
+ *length= part[0].length;
+ return (uchar *) part[0].str;
+--- a/sql/binlog.cc
++++ b/sql/binlog.cc
[email protected]@ -8613,7 +8613,7 @@ template <class RowsEventT> Rows_log_event*
+ THD::binlog_prepare_pending_rows_event(TABLE* table, uint32 serv_id,
+ size_t needed,
+ bool is_transactional,
+- RowsEventT *hint __attribute__((unused)),
++ RowsEventT *hint MY_ATTRIBUTE((unused)),
+ const uchar* extra_row_info)
+ {
+ DBUG_ENTER("binlog_prepare_pending_rows_event");
+--- a/sql/binlog.h
++++ b/sql/binlog.h
[email protected]@ -1,5 +1,5 @@
+ #ifndef BINLOG_H_INCLUDED
+-/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -86,7 +86,7 @@ public:
+
+ /** Lock for protecting the queue. */
+ mysql_mutex_t m_lock;
+- } __attribute__((aligned(CPU_LEVEL1_DCACHE_LINESIZE)));
++ } MY_ATTRIBUTE((aligned(CPU_LEVEL1_DCACHE_LINESIZE)));
+
+ public:
+ Stage_manager()
+--- a/sql/field.cc
++++ b/sql/field.cc
[email protected]@ -1,5 +1,5 @@
+ /*
+- Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
++ Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -1290,7 +1290,7 @@ out_of_range:
+ */
+ type_conversion_status
+ Field_num::store_time(MYSQL_TIME *ltime,
+- uint8 dec_arg __attribute__((unused)))
++ uint8 dec_arg MY_ATTRIBUTE((unused)))
+ {
+ longlong nr= TIME_to_ulonglong_round(ltime);
+ return store(ltime->neg ? -nr : nr, 0);
[email protected]@ -1444,8 +1444,8 @@ bool Field::send_binary(Protocol *protocol)
+ master's field size, @c false otherwise.
+ */
+ bool Field::compatible_field_size(uint field_metadata,
+- Relay_log_info *rli_arg __attribute__((unused)),
+- uint16 mflags __attribute__((unused)),
++ Relay_log_info *rli_arg MY_ATTRIBUTE((unused)),
++ uint16 mflags MY_ATTRIBUTE((unused)),
+ int *order_var)
+ {
+ uint const source_size= pack_length_from_metadata(field_metadata);
[email protected]@ -1508,7 +1508,7 @@ Field::store(const char *to, uint length, const CHARSET_INFO *cs,
+ */
+ uchar *
+ Field::pack(uchar *to, const uchar *from, uint max_length,
+- bool low_byte_first __attribute__((unused)))
++ bool low_byte_first MY_ATTRIBUTE((unused)))
+ {
+ uint32 length= pack_length();
+ set_if_smaller(length, max_length);
[email protected]@ -1548,7 +1548,7 @@ Field::pack(uchar *to, const uchar *from, uint max_length,
+ */
+ const uchar *
+ Field::unpack(uchar* to, const uchar *from, uint param_data,
+- bool low_byte_first __attribute__((unused)))
++ bool low_byte_first MY_ATTRIBUTE((unused)))
+ {
+ uint length=pack_length();
+ int from_type= 0;
[email protected]@ -1860,7 +1860,7 @@ bool Field::optimize_range(uint idx, uint part)
+
+
+ Field *Field::new_field(MEM_ROOT *root, TABLE *new_table,
+- bool keep_type __attribute__((unused)))
++ bool keep_type MY_ATTRIBUTE((unused)))
+ {
+ Field *tmp= clone(root);
+ if (tmp == NULL)
[email protected]@ -2435,7 +2435,7 @@ longlong Field_decimal::val_int(void)
+ }
+
+
+-String *Field_decimal::val_str(String *val_buffer __attribute__((unused)),
++String *Field_decimal::val_str(String *val_buffer MY_ATTRIBUTE((unused)),
+ String *val_ptr)
+ {
+ ASSERT_COLUMN_MARKED_FOR_READ;
[email protected]@ -2806,7 +2806,7 @@ Field_new_decimal::store_decimal(const my_decimal *decimal_value)
+
+ type_conversion_status
+ Field_new_decimal::store_time(MYSQL_TIME *ltime,
+- uint8 dec_arg __attribute__((unused)))
++ uint8 dec_arg MY_ATTRIBUTE((unused)))
+ {
+ my_decimal decimal_value;
+ return store_value(date2my_decimal(ltime, &decimal_value));
[email protected]@ -2847,7 +2847,7 @@ my_decimal* Field_new_decimal::val_decimal(my_decimal *decimal_value)
+
+
+ String *Field_new_decimal::val_str(String *val_buffer,
+- String *val_ptr __attribute__((unused)))
++ String *val_ptr MY_ATTRIBUTE((unused)))
+ {
+ ASSERT_COLUMN_MARKED_FOR_READ;
+ my_decimal decimal_value;
[email protected]@ -2960,8 +2960,8 @@ uint Field_new_decimal::pack_length_from_metadata(uint field_metadata)
+ @return @c true
+ */
+ bool Field_new_decimal::compatible_field_size(uint field_metadata,
+- Relay_log_info * __attribute__((unused)),
+- uint16 mflags __attribute__((unused)),
++ Relay_log_info * MY_ATTRIBUTE((unused)),
++ uint16 mflags MY_ATTRIBUTE((unused)),
+ int *order_var)
+ {
+ uint const source_precision= (field_metadata >> 8U) & 0x00ff;
[email protected]@ -3161,7 +3161,7 @@ longlong Field_tiny::val_int(void)
+
+
+ String *Field_tiny::val_str(String *val_buffer,
+- String *val_ptr __attribute__((unused)))
++ String *val_ptr MY_ATTRIBUTE((unused)))
+ {
+ ASSERT_COLUMN_MARKED_FOR_READ;
+ const CHARSET_INFO *cs= &my_charset_numeric;
[email protected]@ -3376,7 +3376,7 @@ longlong Field_short::val_int(void)
+
+
+ String *Field_short::val_str(String *val_buffer,
+- String *val_ptr __attribute__((unused)))
++ String *val_ptr MY_ATTRIBUTE((unused)))
+ {
+ ASSERT_COLUMN_MARKED_FOR_READ;
+ const CHARSET_INFO *cs= &my_charset_numeric;
[email protected]@ -3596,7 +3596,7 @@ longlong Field_medium::val_int(void)
+
+
+ String *Field_medium::val_str(String *val_buffer,
+- String *val_ptr __attribute__((unused)))
++ String *val_ptr MY_ATTRIBUTE((unused)))
+ {
+ ASSERT_COLUMN_MARKED_FOR_READ;
+ const CHARSET_INFO *cs= &my_charset_numeric;
[email protected]@ -3830,7 +3830,7 @@ longlong Field_long::val_int(void)
+ }
+
+ String *Field_long::val_str(String *val_buffer,
+- String *val_ptr __attribute__((unused)))
++ String *val_ptr MY_ATTRIBUTE((unused)))
+ {
+ ASSERT_COLUMN_MARKED_FOR_READ;
+ const CHARSET_INFO *cs= &my_charset_numeric;
[email protected]@ -4079,7 +4079,7 @@ longlong Field_longlong::val_int(void)
+
+
+ String *Field_longlong::val_str(String *val_buffer,
+- String *val_ptr __attribute__((unused)))
++ String *val_ptr MY_ATTRIBUTE((unused)))
+ {
+ const CHARSET_INFO *cs= &my_charset_numeric;
+ uint length;
[email protected]@ -4199,7 +4199,7 @@ Field_real::unpack(uchar *to, const uchar *from,
+
+ type_conversion_status
+ Field_real::store_time(MYSQL_TIME *ltime,
+- uint8 dec_arg __attribute__((unused)))
++ uint8 dec_arg MY_ATTRIBUTE((unused)))
+ {
+ double nr= TIME_to_double(ltime);
+ return store(ltime->neg ? -nr : nr);
[email protected]@ -4289,7 +4289,7 @@ longlong Field_float::val_int(void)
+
+
+ String *Field_float::val_str(String *val_buffer,
+- String *val_ptr __attribute__((unused)))
++ String *val_ptr MY_ATTRIBUTE((unused)))
+ {
+ ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(!zerofill || field_length <= MAX_FIELD_CHARLENGTH);
[email protected]@ -4625,7 +4625,7 @@ bool Field_real::get_time(MYSQL_TIME *ltime)
+
+
+ String *Field_double::val_str(String *val_buffer,
+- String *val_ptr __attribute__((unused)))
++ String *val_ptr MY_ATTRIBUTE((unused)))
+ {
+ ASSERT_COLUMN_MARKED_FOR_READ;
+ DBUG_ASSERT(!zerofill || field_length <= MAX_FIELD_CHARLENGTH);
[email protected]@ -5089,7 +5089,7 @@ Field_temporal_with_date::convert_number_to_TIME(longlong nr,
+
+ type_conversion_status
+ Field_temporal_with_date::store_time(MYSQL_TIME *ltime,
+- uint8 dec_arg __attribute__((unused)))
++ uint8 dec_arg MY_ATTRIBUTE((unused)))
+ {
+ ASSERT_COLUMN_MARKED_FOR_WRITE;
+ type_conversion_status error;
[email protected]@ -5480,7 +5480,7 @@ int Field_timestamp::cmp(const uchar *a_ptr, const uchar *b_ptr)
+ }
+
+
+-void Field_timestamp::make_sort_key(uchar *to,uint length __attribute__((unused)))
++void Field_timestamp::make_sort_key(uchar *to,uint length MY_ATTRIBUTE((unused)))
+ {
+ #ifdef WORDS_BIGENDIAN
+ if (!table || !table->s->db_low_byte_first)
[email protected]@ -5699,7 +5699,7 @@ Field_time_common::convert_number_to_TIME(longlong nr, bool unsigned_val,
+
+ type_conversion_status
+ Field_time_common::store_time(MYSQL_TIME *ltime,
+- uint8 dec_arg __attribute__((unused)))
++ uint8 dec_arg MY_ATTRIBUTE((unused)))
+ {
+ /* Check if seconds or minutes are out of range */
+ if (ltime->second >= 60 || ltime->minute >= 60)
[email protected]@ -5725,7 +5725,7 @@ Field_time_common::store_internal_with_round(MYSQL_TIME *ltime, int *warnings)
+
+
+ String *Field_time_common::val_str(String *val_buffer,
+- String *val_ptr __attribute__((unused)))
++ String *val_ptr MY_ATTRIBUTE((unused)))
+ {
+ ASSERT_COLUMN_MARKED_FOR_READ;
+ MYSQL_TIME ltime;
+@@ -6039,7 +6039,7 @@ type_conversion_status Field_year::store(double nr)
+
+ type_conversion_status
+ Field_year::store_time(MYSQL_TIME *ltime,
+- uint8 dec_arg __attribute__((unused)))
++ uint8 dec_arg MY_ATTRIBUTE((unused)))
+ {
+ if (ltime->time_type != MYSQL_TIMESTAMP_DATETIME &&
+ ltime->time_type != MYSQL_TIMESTAMP_DATE)
[email protected]@ -6103,7 +6103,7 @@ longlong Field_year::val_int(void)
+
+
+ String *Field_year::val_str(String *val_buffer,
+- String *val_ptr __attribute__((unused)))
++ String *val_ptr MY_ATTRIBUTE((unused)))
+ {
+ DBUG_ASSERT(field_length < 5);
+ val_buffer->alloc(5);
[email protected]@ -6203,7 +6203,7 @@ longlong Field_newdate::val_time_temporal()
+
+
+ String *Field_newdate::val_str(String *val_buffer,
+- String *val_ptr __attribute__((unused)))
++ String *val_ptr MY_ATTRIBUTE((unused)))
+ {
+ ASSERT_COLUMN_MARKED_FOR_READ;
+ val_buffer->alloc(field_length);
[email protected]@ -6393,7 +6393,7 @@ longlong Field_datetime::val_int()
+ Using my_datetime_number_to_str() instead of my_datetime_to_str().
+ */
+ String *Field_datetime::val_str(String *val_buffer,
+- String *val_ptr __attribute__((unused)))
++ String *val_ptr MY_ATTRIBUTE((unused)))
+ {
+ ASSERT_COLUMN_MARKED_FOR_READ;
+ val_buffer->alloc(field_length + 1);
[email protected]@ -6787,7 +6787,7 @@ longlong Field_string::val_int(void)
+ }
+
+
+-String *Field_string::val_str(String *val_buffer __attribute__((unused)),
++String *Field_string::val_str(String *val_buffer MY_ATTRIBUTE((unused)),
+ String *val_ptr)
+ {
+ ASSERT_COLUMN_MARKED_FOR_READ;
[email protected]@ -6845,7 +6845,7 @@ check_field_for_37426(const void *param_arg)
+ bool
+ Field_string::compatible_field_size(uint field_metadata,
+ Relay_log_info *rli_arg,
+- uint16 mflags __attribute__((unused)),
++ uint16 mflags MY_ATTRIBUTE((unused)),
+ int *order_var)
+ {
+ #ifdef HAVE_REPLICATION
[email protected]@ -6883,7 +6883,7 @@ int Field_string::cmp(const uchar *a_ptr, const uchar *b_ptr)
+
+ void Field_string::make_sort_key(uchar *to, uint length)
+ {
+- uint tmp __attribute__((unused))=
++ uint tmp MY_ATTRIBUTE((unused))=
+ field_charset->coll->strnxfrm(field_charset,
+ to, length, char_length(),
+ ptr, field_length,
[email protected]@ -6915,7 +6915,7 @@ void Field_string::sql_type(String &res) const
+
+ uchar *Field_string::pack(uchar *to, const uchar *from,
+ uint max_length,
+- bool low_byte_first __attribute__((unused)))
++ bool low_byte_first MY_ATTRIBUTE((unused)))
+ {
+ uint length= min(field_length,max_length);
+ uint local_char_length= max_length/field_charset->mbmaxlen;
[email protected]@ -6974,7 +6974,7 @@ const uchar *
+ Field_string::unpack(uchar *to,
+ const uchar *from,
+ uint param_data,
+- bool low_byte_first __attribute__((unused)))
++ bool low_byte_first MY_ATTRIBUTE((unused)))
+ {
+ uint from_length, length;
+
[email protected]@ -7229,7 +7229,7 @@ longlong Field_varstring::val_int(void)
+ return result;
+ }
+
+-String *Field_varstring::val_str(String *val_buffer __attribute__((unused)),
++String *Field_varstring::val_str(String *val_buffer MY_ATTRIBUTE((unused)),
+ String *val_ptr)
+ {
+ ASSERT_COLUMN_MARKED_FOR_READ;
[email protected]@ -7391,7 +7391,7 @@ uint32 Field_varstring::data_length()
+
+ uchar *Field_varstring::pack(uchar *to, const uchar *from,
+ uint max_length,
+- bool low_byte_first __attribute__((unused)))
++ bool low_byte_first MY_ATTRIBUTE((unused)))
+ {
+ uint length= length_bytes == 1 ? (uint) *from : uint2korr(from);
+ set_if_smaller(max_length, field_length);
[email protected]@ -7428,7 +7428,7 @@ uchar *Field_varstring::pack(uchar *to, const uchar *from,
+ const uchar *
+ Field_varstring::unpack(uchar *to, const uchar *from,
+ uint param_data,
+- bool low_byte_first __attribute__((unused)))
++ bool low_byte_first MY_ATTRIBUTE((unused)))
+ {
+ uint length;
+ uint l_bytes= (param_data && (param_data < field_length)) ?
[email protected]@ -7887,7 +7887,7 @@ longlong Field_blob::val_int(void)
+ return my_strntoll(charset(),blob,length,10,NULL,¬_used);
+ }
+
+-String *Field_blob::val_str(String *val_buffer __attribute__((unused)),
++String *Field_blob::val_str(String *val_buffer MY_ATTRIBUTE((unused)),
+ String *val_ptr)
+ {
+ ASSERT_COLUMN_MARKED_FOR_READ;
[email protected]@ -8539,7 +8539,7 @@ int Field_enum::do_save_field_metadata(uchar *metadata_ptr)
+ }
+
+
+-String *Field_enum::val_str(String *val_buffer __attribute__((unused)),
++String *Field_enum::val_str(String *val_buffer MY_ATTRIBUTE((unused)),
+ String *val_ptr)
+ {
+ uint tmp=(uint) Field_enum::val_int();
[email protected]@ -8683,7 +8683,7 @@ type_conversion_status Field_set::store(longlong nr, bool unsigned_val)
+
+
+ String *Field_set::val_str(String *val_buffer,
+- String *val_ptr __attribute__((unused)))
++ String *val_ptr MY_ATTRIBUTE((unused)))
+ {
+ ulonglong tmp=(ulonglong) Field_enum::val_int();
+ uint bitnr=0;
[email protected]@ -9148,7 +9148,7 @@ longlong Field_bit::val_int(void)
+
+
+ String *Field_bit::val_str(String *val_buffer,
+- String *val_ptr __attribute__((unused)))
++ String *val_ptr MY_ATTRIBUTE((unused)))
+ {
+ ASSERT_COLUMN_MARKED_FOR_READ;
+ char buff[sizeof(longlong)];
[email protected]@ -9308,7 +9308,7 @@ uint Field_bit::pack_length_from_metadata(uint field_metadata)
+ */
+ bool
+ Field_bit::compatible_field_size(uint field_metadata,
+- Relay_log_info * __attribute__((unused)),
++ Relay_log_info * MY_ATTRIBUTE((unused)),
+ uint16 mflags,
+ int *order_var)
+ {
[email protected]@ -9348,7 +9348,7 @@ void Field_bit::sql_type(String &res) const
+
+ uchar *
+ Field_bit::pack(uchar *to, const uchar *from, uint max_length,
+- bool low_byte_first __attribute__((unused)))
++ bool low_byte_first MY_ATTRIBUTE((unused)))
+ {
+ DBUG_ASSERT(max_length > 0);
+ uint length;
[email protected]@ -9396,7 +9396,7 @@ Field_bit::pack(uchar *to, const uchar *from, uint max_length,
+ */
+ const uchar *
+ Field_bit::unpack(uchar *to, const uchar *from, uint param_data,
+- bool low_byte_first __attribute__((unused)))
++ bool low_byte_first MY_ATTRIBUTE((unused)))
+ {
+ DBUG_ENTER("Field_bit::unpack");
+ DBUG_PRINT("enter", ("to: %p, from: %p, param_data: 0x%x",
+--- a/sql/field.h
++++ b/sql/field.h
[email protected]@ -1,7 +1,7 @@
+ #ifndef FIELD_INCLUDED
+ #define FIELD_INCLUDED
+
+-/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -1889,13 +1889,13 @@ public:
+ return new Field_long(*this);
+ }
+ virtual uchar *pack(uchar* to, const uchar *from,
+- uint max_length __attribute__((unused)),
++ uint max_length MY_ATTRIBUTE((unused)),
+ bool low_byte_first)
+ {
+ return pack_int32(to, from, low_byte_first);
+ }
+ virtual const uchar *unpack(uchar* to, const uchar *from,
+- uint param_data __attribute__((unused)),
++ uint param_data MY_ATTRIBUTE((unused)),
+ bool low_byte_first)
+ {
+ return unpack_int32(to, from, low_byte_first);
[email protected]@ -1954,13 +1954,13 @@ public:
+ return new Field_longlong(*this);
+ }
+ virtual uchar *pack(uchar* to, const uchar *from,
+- uint max_length __attribute__((unused)),
++ uint max_length MY_ATTRIBUTE((unused)),
+ bool low_byte_first)
+ {
+ return pack_int64(to, from, low_byte_first);
+ }
+ virtual const uchar *unpack(uchar* to, const uchar *from,
+- uint param_data __attribute__((unused)),
++ uint param_data MY_ATTRIBUTE((unused)),
+ bool low_byte_first)
+ {
+ return unpack_int64(to, from, low_byte_first);
[email protected]@ -2560,12 +2560,12 @@ public:
+ return new Field_timestamp(*this);
+ }
+ uchar *pack(uchar *to, const uchar *from,
+- uint max_length __attribute__((unused)), bool low_byte_first)
++ uint max_length MY_ATTRIBUTE((unused)), bool low_byte_first)
+ {
+ return pack_int32(to, from, low_byte_first);
+ }
+ const uchar *unpack(uchar* to, const uchar *from,
+- uint param_data __attribute__((unused)),
++ uint param_data MY_ATTRIBUTE((unused)),
+ bool low_byte_first)
+ {
+ return unpack_int32(to, from, low_byte_first);
[email protected]@ -2998,12 +2998,12 @@ public:
+ return new Field_datetime(*this);
+ }
+ uchar *pack(uchar* to, const uchar *from,
+- uint max_length __attribute__((unused)), bool low_byte_first)
++ uint max_length MY_ATTRIBUTE((unused)), bool low_byte_first)
+ {
+ return pack_int64(to, from, low_byte_first);
+ }
+ const uchar *unpack(uchar* to, const uchar *from,
+- uint param_data __attribute__((unused)),
++ uint param_data MY_ATTRIBUTE((unused)),
+ bool low_byte_first)
+ {
+ return unpack_int64(to, from, low_byte_first);
+--- a/sql/field_conv.cc
++++ b/sql/field_conv.cc
[email protected]@ -195,7 +195,7 @@ set_field_to_null_with_conversions(Field *field, bool no_conversions)
+ }
+
+
+-static void do_skip(Copy_field *copy __attribute__((unused)))
++static void do_skip(Copy_field *copy MY_ATTRIBUTE((unused)))
+ {
+ }
+
+--- a/sql/filesort.cc
++++ b/sql/filesort.cc
[email protected]@ -1,5 +1,5 @@
+ /*
+- Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
++ Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -1040,7 +1040,7 @@ void make_sortkey(Sort_param *param, uchar *to, uchar *ref_pos)
+ if (sort_field->need_strxnfrm)
+ {
+ char *from=(char*) res->ptr();
+- uint tmp_length __attribute__((unused));
++ uint tmp_length MY_ATTRIBUTE((unused));
+ if ((uchar*) from == to)
+ {
+ DBUG_ASSERT(sort_field->length >= length);
+--- a/sql/ha_ndb_index_stat.cc
++++ b/sql/ha_ndb_index_stat.cc
[email protected]@ -1,5 +1,5 @@
+ /*
+- Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
++ Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -1727,7 +1727,7 @@ ndb_index_stat_stop_listener(Ndb_index_stat_proc &pr)
+ }
+
+ pthread_handler_t
+-ndb_index_stat_thread_func(void *arg __attribute__((unused)))
++ndb_index_stat_thread_func(void *arg MY_ATTRIBUTE((unused)))
+ {
+ THD *thd; /* needs to be first for thread_stack */
+ struct timespec abstime;
+--- a/sql/ha_ndbcluster.cc
++++ b/sql/ha_ndbcluster.cc
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -417,7 +417,7 @@ pthread_mutex_t ndbcluster_mutex;
+ HASH ndbcluster_open_tables;
+
+ static uchar *ndbcluster_get_key(NDB_SHARE *share, size_t *length,
+- my_bool not_used __attribute__((unused)));
++ my_bool not_used MY_ATTRIBUTE((unused)));
+
+ static void modify_shared_stats(NDB_SHARE *share,
+ Ndb_local_table_statistics *local_stat);
[email protected]@ -1293,7 +1293,7 @@ typedef struct st_thd_ndb_share {
+ } THD_NDB_SHARE;
+ static
+ uchar *thd_ndb_share_get_key(THD_NDB_SHARE *thd_ndb_share, size_t *length,
+- my_bool not_used __attribute__((unused)))
++ my_bool not_used MY_ATTRIBUTE((unused)))
+ {
+ *length= sizeof(thd_ndb_share->key);
+ return (uchar*) &thd_ndb_share->key;
[email protected]@ -11106,7 +11106,7 @@ int ndbcluster_table_exists_in_engine(handlerton *hton, THD* thd,
+
+
+ extern "C" uchar* tables_get_key(const char *entry, size_t *length,
+- my_bool not_used __attribute__((unused)))
++ my_bool not_used MY_ATTRIBUTE((unused)))
+ {
+ *length= strlen(entry);
+ return (uchar*) entry;
[email protected]@ -12657,7 +12657,7 @@ ha_ndbcluster::register_query_cache_table(THD *thd,
+ */
+
+ static uchar *ndbcluster_get_key(NDB_SHARE *share, size_t *length,
+- my_bool not_used __attribute__((unused)))
++ my_bool not_used MY_ATTRIBUTE((unused)))
+ {
+ *length= share->key_length;
+ return (uchar*) share->key;
[email protected]@ -14539,7 +14539,7 @@ ha_ndbcluster::update_table_comment(
+ /**
+ Utility thread main loop.
+ */
+-pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused)))
++pthread_handler_t ndb_util_thread_func(void *arg MY_ATTRIBUTE((unused)))
+ {
+ THD *thd; /* needs to be first for thread_stack */
+ struct timespec abstime;
+--- a/sql/ha_ndbcluster_binlog.cc
++++ b/sql/ha_ndbcluster_binlog.cc
[email protected]@ -1,5 +1,5 @@
+ /*
+- Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved.
++ Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -6252,7 +6252,7 @@ private:
+ static uchar *
+ ndb_schema_objects_get_key(NDB_SCHEMA_OBJECT *schema_object,
+ size_t *length,
+- my_bool not_used __attribute__((unused)))
++ my_bool not_used MY_ATTRIBUTE((unused)))
+ {
+ *length= schema_object->key_length;
+ return (uchar*) schema_object->key;
+--- a/sql/ha_partition.cc
++++ b/sql/ha_partition.cc
[email protected]@ -1,5 +1,5 @@
+ /*
+- Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
++ Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -222,7 +222,7 @@ static uint partition_flags()
+ return HA_CAN_PARTITION;
+ }
+
+-static uint alter_table_flags(uint flags __attribute__((unused)))
++static uint alter_table_flags(uint flags MY_ATTRIBUTE((unused)))
+ {
+ return (HA_PARTITION_FUNCTION_SUPPORTED |
+ HA_FAST_CHANGE_PARTITION);
[email protected]@ -1670,9 +1670,9 @@ int ha_partition::change_partitions(HA_CREATE_INFO *create_info,
+ ulonglong * const copied,
+ ulonglong * const deleted,
+ const uchar *pack_frm_data
+- __attribute__((unused)),
++ MY_ATTRIBUTE((unused)),
+ size_t pack_frm_len
+- __attribute__((unused)))
++ MY_ATTRIBUTE((unused)))
+ {
+ List_iterator<partition_element> part_it(m_part_info->partitions);
+ List_iterator <partition_element> t_it(m_part_info->temp_partitions);
[email protected]@ -2956,7 +2956,7 @@ bool ha_partition::get_from_handler_file(const char *name, MEM_ROOT *mem_root,
+ */
+
+ static uchar *get_part_name(PART_NAME_DEF *part, size_t *length,
+- my_bool not_used __attribute__((unused)))
++ my_bool not_used MY_ATTRIBUTE((unused)))
+ {
+ *length= part->length;
+ return part->partition_name;
+--- a/sql/handler.cc
++++ b/sql/handler.cc
[email protected]@ -6278,7 +6278,7 @@ end:
+ ha_rows DsMrr_impl::dsmrr_info(uint keyno, uint n_ranges, uint rows,
+ uint *bufsz, uint *flags, Cost_estimate *cost)
+ {
+- ha_rows res __attribute__((unused));
++ ha_rows res MY_ATTRIBUTE((unused));
+ uint def_flags= *flags;
+ uint def_bufsz= *bufsz;
+
+--- a/sql/handler.h
++++ b/sql/handler.h
[email protected]@ -3067,7 +3067,7 @@ private:
+ */
+ virtual int rnd_init(bool scan)= 0;
+ virtual int rnd_end() { return 0; }
+- virtual int write_row(uchar *buf __attribute__((unused)))
++ virtual int write_row(uchar *buf MY_ATTRIBUTE((unused)))
+ {
+ return HA_ERR_WRONG_COMMAND;
+ }
[email protected]@ -3080,13 +3080,13 @@ private:
+ the columns required for the error message are not read, the error
+ message will contain garbage.
+ */
+- virtual int update_row(const uchar *old_data __attribute__((unused)),
+- uchar *new_data __attribute__((unused)))
++ virtual int update_row(const uchar *old_data MY_ATTRIBUTE((unused)),
++ uchar *new_data MY_ATTRIBUTE((unused)))
+ {
+ return HA_ERR_WRONG_COMMAND;
+ }
+
+- virtual int delete_row(const uchar *buf __attribute__((unused)))
++ virtual int delete_row(const uchar *buf MY_ATTRIBUTE((unused)))
+ {
+ return HA_ERR_WRONG_COMMAND;
+ }
[email protected]@ -3119,8 +3119,8 @@ private:
+ @return non-0 in case of failure, 0 in case of success.
+ When lock_type is F_UNLCK, the return value is ignored.
+ */
+- virtual int external_lock(THD *thd __attribute__((unused)),
+- int lock_type __attribute__((unused)))
++ virtual int external_lock(THD *thd MY_ATTRIBUTE((unused)),
++ int lock_type MY_ATTRIBUTE((unused)))
+ {
+ return 0;
+ }
+--- a/sql/hostname.cc
++++ b/sql/hostname.cc
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -413,7 +413,7 @@ int ip_to_hostname(struct sockaddr_storage *ip_storage,
+ {
+ const struct sockaddr *ip= (const sockaddr *) ip_storage;
+ int err_code;
+- bool err_status __attribute__((unused));
++ bool err_status MY_ATTRIBUTE((unused));
+ Host_errors errors;
+
+ DBUG_ENTER("ip_to_hostname");
+--- a/sql/init.h
++++ b/sql/init.h
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -19,6 +19,6 @@
+ #include "my_global.h" /* ulong */
+
+ void unireg_init(ulong options);
+-void unireg_end(void) __attribute__((noreturn));
++void unireg_end(void) MY_ATTRIBUTE((noreturn));
+
+ #endif /* INIT_INCLUDED */
+--- a/sql/item.cc
++++ b/sql/item.cc
[email protected]@ -3413,8 +3413,8 @@ Item *Item_null::safe_charset_converter(const CHARSET_INFO *tocs)
+
+ static void
+ default_set_param_func(Item_param *param,
+- uchar **pos __attribute__((unused)),
+- ulong len __attribute__((unused)))
++ uchar **pos MY_ATTRIBUTE((unused)),
++ ulong len MY_ATTRIBUTE((unused)))
+ {
+ param->set_null();
+ }
+--- a/sql/item_func.cc
++++ b/sql/item_func.cc
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -3985,7 +3985,7 @@ public:
+ };
+
+ uchar *ull_get_key(const User_level_lock *ull, size_t *length,
+- my_bool not_used __attribute__((unused)))
++ my_bool not_used MY_ATTRIBUTE((unused)))
+ {
+ *length= ull->key_length;
+ return ull->key;
+--- a/sql/item_sum.cc
++++ b/sql/item_sum.cc
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+ rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
[email protected]@ -3070,7 +3070,7 @@ int group_concat_key_cmp_with_order(const void* arg, const void* key1,
+ */
+
+ extern "C"
+-int dump_leaf_key(void* key_arg, element_count count __attribute__((unused)),
++int dump_leaf_key(void* key_arg, element_count count MY_ATTRIBUTE((unused)),
+ void* item_arg)
+ {
+ Item_func_group_concat *item= (Item_func_group_concat *) item_arg;
+--- a/sql/item_sum.h
++++ b/sql/item_sum.h
[email protected]@ -1,7 +1,7 @@
+ #ifndef ITEM_SUM_INCLUDED
+ #define ITEM_SUM_INCLUDED
+
+-/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. reserved.
++/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. reserved.
+ reserved.
+
+ This program is free software; you can redistribute it and/or modify
[email protected]@ -1417,7 +1417,7 @@ int group_concat_key_cmp_with_distinct(const void* arg, const void* key1,
+ int group_concat_key_cmp_with_order(const void* arg, const void* key1,
+ const void* key2);
+ int dump_leaf_key(void* key_arg,
+- element_count count __attribute__((unused)),
++ element_count count MY_ATTRIBUTE((unused)),
+ void* item_arg);
+ C_MODE_END
+
[email protected]@ -1463,7 +1463,7 @@ class Item_func_group_concat : public Item_sum
+ const void* key1,
+ const void* key2);
+ friend int dump_leaf_key(void* key_arg,
+- element_count count __attribute__((unused)),
++ element_count count MY_ATTRIBUTE((unused)),
+ void* item_arg);
+
+ public:
+--- a/sql/item_timefunc.cc
++++ b/sql/item_timefunc.cc
[email protected]@ -1,5 +1,5 @@
+ /*
+- Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
++ Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -1902,7 +1902,7 @@ Item_func_now::save_in_field(Field *to, bool no_conversions)
+ time zone. Defines time zone (local) used for whole SYSDATE function.
+ */
+ bool Item_func_sysdate_local::get_date(MYSQL_TIME *now_time,
+- uint fuzzy_date __attribute__((unused)))
++ uint fuzzy_date MY_ATTRIBUTE((unused)))
+ {
+ THD *thd= current_thd;
+ ulonglong tmp= my_micro_time();
[email protected]@ -2138,7 +2138,7 @@ void Item_func_from_unixtime::fix_length_and_dec()
+
+
+ bool Item_func_from_unixtime::get_date(MYSQL_TIME *ltime,
+- uint fuzzy_date __attribute__((unused)))
++ uint fuzzy_date MY_ATTRIBUTE((unused)))
+ {
+ lldiv_t lld;
+ if (decimals)
[email protected]@ -2177,7 +2177,7 @@ void Item_func_convert_tz::fix_length_and_dec()
+
+
+ bool Item_func_convert_tz::get_date(MYSQL_TIME *ltime,
+- uint fuzzy_date __attribute__((unused)))
++ uint fuzzy_date MY_ATTRIBUTE((unused)))
+ {
+ my_time_t my_time_tmp;
+ String str;
+--- a/sql/log_event.cc
++++ b/sql/log_event.cc
[email protected]@ -1740,7 +1740,7 @@ Log_event* Log_event::read_log_event(const char* buf, uint event_len,
+
+ void Log_event::print_header(IO_CACHE* file,
+ PRINT_EVENT_INFO* print_event_info,
+- bool is_more __attribute__((unused)))
++ bool is_more MY_ATTRIBUTE((unused)))
+ {
+ char llbuff[22];
+ my_off_t hexdump_from= print_event_info->hexdump_from;
[email protected]@ -2724,7 +2724,7 @@ Slave_worker *Log_event::get_slave_worker(Relay_log_info *rli)
+ {
+ if (!rli->curr_group_seen_gtid && !rli->curr_group_seen_begin)
+ {
+- ulong gaq_idx __attribute__((unused));
++ ulong gaq_idx MY_ATTRIBUTE((unused));
+ rli->mts_groups_assigned++;
+
+ rli->curr_group_isolated= FALSE;
+--- a/sql/log_event.h
++++ b/sql/log_event.h
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -1311,7 +1311,7 @@ public:
+ }
+ virtual bool write_data_header(IO_CACHE* file)
+ { return 0; }
+- virtual bool write_data_body(IO_CACHE* file __attribute__((unused)))
++ virtual bool write_data_body(IO_CACHE* file MY_ATTRIBUTE((unused)))
+ { return 0; }
+ inline time_t get_time()
+ {
[email protected]@ -4520,7 +4520,7 @@ public:
+ static bool binlog_row_logging_function(THD *thd, TABLE *table,
+ bool is_transactional,
+ const uchar *before_record
+- __attribute__((unused)),
++ MY_ATTRIBUTE((unused)),
+ const uchar *after_record)
+ {
+ return thd->binlog_write_row(table, is_transactional,
[email protected]@ -4660,7 +4660,7 @@ public:
+ bool is_transactional,
+ const uchar *before_record,
+ const uchar *after_record
+- __attribute__((unused)))
++ MY_ATTRIBUTE((unused)))
+ {
+ return thd->binlog_delete_row(table, is_transactional,
+ before_record, NULL);
+--- a/sql/log_event_old.h
++++ b/sql/log_event_old.h
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -369,7 +369,7 @@ public:
+ static bool binlog_row_logging_function(THD *thd, TABLE *table,
+ bool is_transactional,
+ const uchar *before_record
+- __attribute__((unused)),
++ MY_ATTRIBUTE((unused)),
+ const uchar *after_record)
+ {
+ return thd->binlog_write_row(table, is_transactional,
[email protected]@ -518,7 +518,7 @@ public:
+ bool is_transactional,
+ const uchar *before_record,
+ const uchar *after_record
+- __attribute__((unused)))
++ MY_ATTRIBUTE((unused)))
+ {
+ return thd->binlog_delete_row(table, is_transactional,
+ before_record, NULL);
+--- a/sql/mdl.cc
++++ b/sql/mdl.cc
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -94,7 +94,7 @@ void MDL_key::init_psi_keys()
+ {
+ int i;
+ int count;
+- PSI_stage_info *info __attribute__((unused));
++ PSI_stage_info *info MY_ATTRIBUTE((unused));
+
+ count= array_elements(MDL_key::m_namespace_to_wait_state_name);
+ for (i= 0; i<count; i++)
[email protected]@ -651,7 +651,7 @@ extern "C"
+ {
+ static uchar *
+ mdl_locks_key(const uchar *record, size_t *length,
+- my_bool not_used __attribute__((unused)))
++ my_bool not_used MY_ATTRIBUTE((unused)))
+ {
+ MDL_lock *lock=(MDL_lock*) record;
+ *length= lock->key.length();
+--- a/sql/mf_iocache.cc
++++ b/sql/mf_iocache.cc
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -49,7 +49,7 @@ extern "C" {
+
+
+ int _my_b_net_read(register IO_CACHE *info, uchar *Buffer,
+- size_t Count __attribute__((unused)))
++ size_t Count MY_ATTRIBUTE((unused)))
+ {
+ ulong read_length;
+ NET *net= &(current_thd)->net;
+--- a/sql/mysqld.cc
++++ b/sql/mysqld.cc
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights
++/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights
+ reserved.
+
+ This program is free software; you can redistribute it and/or modify
[email protected]@ -1303,7 +1303,7 @@ static void close_server_sock();
+ static void clean_up_mutexes(void);
+ static void wait_for_signal_thread_to_end(void);
+ static void create_pid_file();
+-static void mysqld_exit(int exit_code) __attribute__((noreturn));
++static void mysqld_exit(int exit_code) MY_ATTRIBUTE((noreturn));
+ #endif
+ static void delete_pid_file(myf flags);
+ static void end_ssl();
[email protected]@ -1715,7 +1715,7 @@ static void __cdecl kill_server(int sig_ptr)
+
+
+ #if defined(USE_ONE_SIGNAL_HAND)
+-pthread_handler_t kill_server_thread(void *arg __attribute__((unused)))
++pthread_handler_t kill_server_thread(void *arg MY_ATTRIBUTE((unused)))
+ {
+ my_thread_init(); // Initialize new thread
+ kill_server(0);
[email protected]@ -2619,7 +2619,7 @@ void close_connection(THD *thd, uint sql_errno)
+
+ /** Called when a thread is aborted. */
+ /* ARGSUSED */
+-extern "C" sig_handler end_thread_signal(int sig __attribute__((unused)))
++extern "C" sig_handler end_thread_signal(int sig MY_ATTRIBUTE((unused)))
+ {
+ THD *thd=current_thd;
+ my_safe_printf_stderr("end_thread_signal %p", thd);
[email protected]@ -2824,7 +2824,7 @@ void kill_blocked_pthreads()
+ @todo
+ One should have to fix that thr_alarm know about this thread too.
+ */
+-extern "C" sig_handler abort_thread(int sig __attribute__((unused)))
++extern "C" sig_handler abort_thread(int sig MY_ATTRIBUTE((unused)))
+ {
+ THD *thd=current_thd;
+ DBUG_ENTER("abort_thread");
[email protected]@ -3135,7 +3135,7 @@ static void start_signal_handler(void)
+
+ /** This threads handles all signals and alarms. */
+ /* ARGSUSED */
+-pthread_handler_t signal_hand(void *arg __attribute__((unused)))
++pthread_handler_t signal_hand(void *arg MY_ATTRIBUTE((unused)))
+ {
+ sigset_t set;
+ int sig;
[email protected]@ -8384,7 +8384,7 @@ static int mysql_init_variables(void)
+
+ my_bool
+ mysqld_get_one_option(int optid,
+- const struct my_option *opt __attribute__((unused)),
++ const struct my_option *opt MY_ATTRIBUTE((unused)),
+ char *argument)
+ {
+ switch(optid) {
+--- a/sql/mysqld.h
++++ b/sql/mysqld.h
[email protected]@ -710,10 +710,10 @@ typedef int64 query_id_t;
+ extern query_id_t global_query_id;
+ extern my_atomic_rwlock_t global_query_id_lock;
+
+-void unireg_end(void) __attribute__((noreturn));
++void unireg_end(void) MY_ATTRIBUTE((noreturn));
+
+ /* increment query_id and return it. */
+-inline __attribute__((warn_unused_result)) query_id_t next_query_id()
++inline MY_ATTRIBUTE((warn_unused_result)) query_id_t next_query_id()
+ {
+ query_id_t id;
+ my_atomic_rwlock_wrlock(&global_query_id_lock);
[email protected]@ -726,7 +726,7 @@ inline __attribute__((warn_unused_result)) query_id_t next_query_id()
+ TODO: Replace this with an inline function.
+ */
+ #ifndef EMBEDDED_LIBRARY
+-extern "C" void unireg_abort(int exit_code) __attribute__((noreturn));
++extern "C" void unireg_abort(int exit_code) MY_ATTRIBUTE((noreturn));
+ #else
+ extern "C" void unireg_clear(int exit_code);
+ #define unireg_abort(exit_code) do { unireg_clear(exit_code); DBUG_RETURN(exit_code); } while(0)
+--- a/sql/net_serv.cc
++++ b/sql/net_serv.cc
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -191,7 +191,7 @@ my_bool net_realloc(NET *net, size_t length)
+ */
+
+ void net_clear(NET *net,
+- my_bool check_buffer __attribute__((unused)))
++ my_bool check_buffer MY_ATTRIBUTE((unused)))
+ {
+ DBUG_ENTER("net_clear");
+
[email protected]@ -238,7 +238,7 @@ my_bool net_flush(NET *net)
+ */
+
+ static my_bool
+-net_should_retry(NET *net, uint *retry_count __attribute__((unused)))
++net_should_retry(NET *net, uint *retry_count MY_ATTRIBUTE((unused)))
+ {
+ my_bool retry;
+
+--- a/sql/partition_info.cc
++++ b/sql/partition_info.cc
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -945,7 +945,7 @@ partition_element *partition_info::get_part_elem(const char *partition_name,
+ */
+
+ static const char *get_part_name_from_elem(const char *name, size_t *length,
+- my_bool not_used __attribute__((unused)))
++ my_bool not_used MY_ATTRIBUTE((unused)))
+ {
+ *length= strlen(name);
+ return name;
+--- a/sql/rpl_filter.cc
++++ b/sql/rpl_filter.cc
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -508,7 +508,7 @@ extern "C" uchar *get_table_key(const uchar *, size_t *, my_bool);
+ extern "C" void free_table_ent(void* a);
+
+ uchar *get_table_key(const uchar* a, size_t *len,
+- my_bool __attribute__((unused)))
++ my_bool MY_ATTRIBUTE((unused)))
+ {
+ TABLE_RULE_ENT *e= (TABLE_RULE_ENT *) a;
+
+--- a/sql/rpl_info_dummy.cc
++++ b/sql/rpl_info_dummy.cc
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -21,7 +21,7 @@ Rpl_info_dummy::Rpl_info_dummy(const int nparam)
+ {
+ }
+
+-int Rpl_info_dummy::do_init_info(uint instance __attribute__((unused)))
++int Rpl_info_dummy::do_init_info(uint instance MY_ATTRIBUTE((unused)))
+ {
+ return 0;
+ }
[email protected]@ -51,13 +51,13 @@ enum_return_check Rpl_info_dummy::do_check_info()
+ return REPOSITORY_DOES_NOT_EXIST;
+ }
+
+-enum_return_check Rpl_info_dummy::do_check_info(uint instance __attribute__((unused)))
++enum_return_check Rpl_info_dummy::do_check_info(uint instance MY_ATTRIBUTE((unused)))
+ {
+ DBUG_ASSERT(!abort);
+ return REPOSITORY_DOES_NOT_EXIST;
+ }
+
+-int Rpl_info_dummy::do_flush_info(const bool force __attribute__((unused)))
++int Rpl_info_dummy::do_flush_info(const bool force MY_ATTRIBUTE((unused)))
+ {
+ DBUG_ASSERT(!abort);
+ return 0;
[email protected]@ -85,105 +85,105 @@ uint Rpl_info_dummy::do_get_rpl_info_type()
+ return INFO_REPOSITORY_DUMMY;
+ }
+
+-bool Rpl_info_dummy::do_set_info(const int pos __attribute__((unused)),
+- const char *value __attribute__((unused)))
++bool Rpl_info_dummy::do_set_info(const int pos MY_ATTRIBUTE((unused)),
++ const char *value MY_ATTRIBUTE((unused)))
+ {
+ DBUG_ASSERT(!abort);
+
+ return FALSE;
+ }
+
+-bool Rpl_info_dummy::do_set_info(const int pos __attribute__((unused)),
+- const uchar *value __attribute__((unused)),
+- const size_t size __attribute__((unused)))
++bool Rpl_info_dummy::do_set_info(const int pos MY_ATTRIBUTE((unused)),
++ const uchar *value MY_ATTRIBUTE((unused)),
++ const size_t size MY_ATTRIBUTE((unused)))
+ {
+ DBUG_ASSERT(!abort);
+
+ return FALSE;
+ }
+
+-bool Rpl_info_dummy::do_set_info(const int pos __attribute__((unused)),
+- const ulong value __attribute__((unused)))
++bool Rpl_info_dummy::do_set_info(const int pos MY_ATTRIBUTE((unused)),
++ const ulong value MY_ATTRIBUTE((unused)))
+ {
+ DBUG_ASSERT(!abort);
+
+ return FALSE;
+ }
+
+-bool Rpl_info_dummy::do_set_info(const int pos __attribute__((unused)),
+- const int value __attribute__((unused)))
++bool Rpl_info_dummy::do_set_info(const int pos MY_ATTRIBUTE((unused)),
++ const int value MY_ATTRIBUTE((unused)))
+ {
+ DBUG_ASSERT(!abort);
+
+ return FALSE;
+ }
+
+-bool Rpl_info_dummy::do_set_info(const int pos __attribute__((unused)),
+- const float value __attribute__((unused)))
++bool Rpl_info_dummy::do_set_info(const int pos MY_ATTRIBUTE((unused)),
++ const float value MY_ATTRIBUTE((unused)))
+ {
+ DBUG_ASSERT(!abort);
+
+ return FALSE;
+ }
+
+-bool Rpl_info_dummy::do_set_info(const int pos __attribute__((unused)),
+- const Dynamic_ids *value __attribute__((unused)))
++bool Rpl_info_dummy::do_set_info(const int pos MY_ATTRIBUTE((unused)),
++ const Dynamic_ids *value MY_ATTRIBUTE((unused)))
+ {
+ DBUG_ASSERT(!abort);
+
+ return FALSE;
+ }
+
+-bool Rpl_info_dummy::do_get_info(const int pos __attribute__((unused)),
+- char *value __attribute__((unused)),
+- const size_t size __attribute__((unused)),
+- const char *default_value __attribute__((unused)))
++bool Rpl_info_dummy::do_get_info(const int pos MY_ATTRIBUTE((unused)),
++ char *value MY_ATTRIBUTE((unused)),
++ const size_t size MY_ATTRIBUTE((unused)),
++ const char *default_value MY_ATTRIBUTE((unused)))
+ {
+ DBUG_ASSERT(!abort);
+
+ return FALSE;
+ }
+
+-bool Rpl_info_dummy::do_get_info(const int pos __attribute__((unused)),
+- uchar *value __attribute__((unused)),
+- const size_t size __attribute__((unused)),
+- const uchar *default_value __attribute__((unused)))
++bool Rpl_info_dummy::do_get_info(const int pos MY_ATTRIBUTE((unused)),
++ uchar *value MY_ATTRIBUTE((unused)),
++ const size_t size MY_ATTRIBUTE((unused)),
++ const uchar *default_value MY_ATTRIBUTE((unused)))
+ {
+ DBUG_ASSERT(!abort);
+
+ return FALSE;
+ }
+
+-bool Rpl_info_dummy::do_get_info(const int pos __attribute__((unused)),
+- ulong *value __attribute__((unused)),
+- const ulong default_value __attribute__((unused)))
++bool Rpl_info_dummy::do_get_info(const int pos MY_ATTRIBUTE((unused)),
++ ulong *value MY_ATTRIBUTE((unused)),
++ const ulong default_value MY_ATTRIBUTE((unused)))
+ {
+ DBUG_ASSERT(!abort);
+
+ return FALSE;
+ }
+
+-bool Rpl_info_dummy::do_get_info(const int pos __attribute__((unused)),
+- int *value __attribute__((unused)),
+- const int default_value __attribute__((unused)))
++bool Rpl_info_dummy::do_get_info(const int pos MY_ATTRIBUTE((unused)),
++ int *value MY_ATTRIBUTE((unused)),
++ const int default_value MY_ATTRIBUTE((unused)))
+ {
+ DBUG_ASSERT(!abort);
+
+ return FALSE;
+ }
+
+-bool Rpl_info_dummy::do_get_info(const int pos __attribute__((unused)),
+- float *value __attribute__((unused)),
+- const float default_value __attribute__((unused)))
++bool Rpl_info_dummy::do_get_info(const int pos MY_ATTRIBUTE((unused)),
++ float *value MY_ATTRIBUTE((unused)),
++ const float default_value MY_ATTRIBUTE((unused)))
+ {
+ DBUG_ASSERT(!abort);
+
+ return FALSE;
+ }
+
+-bool Rpl_info_dummy::do_get_info(const int pos __attribute__((unused)),
+- Dynamic_ids *value __attribute__((unused)),
+- const Dynamic_ids *default_value __attribute__((unused)))
++bool Rpl_info_dummy::do_get_info(const int pos MY_ATTRIBUTE((unused)),
++ Dynamic_ids *value MY_ATTRIBUTE((unused)),
++ const Dynamic_ids *default_value MY_ATTRIBUTE((unused)))
+ {
+ DBUG_ASSERT(!abort);
+
+--- a/sql/rpl_info_file.cc
++++ b/sql/rpl_info_file.cc
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -438,7 +438,7 @@ bool Rpl_info_file::do_get_info(const int pos, float *value,
+ }
+
+ bool Rpl_info_file::do_get_info(const int pos, Dynamic_ids *value,
+- const Dynamic_ids *default_value __attribute__((unused)))
++ const Dynamic_ids *default_value MY_ATTRIBUTE((unused)))
+ {
+ /*
+ Static buffer to use most of the times. However, if it is not big
+--- a/sql/rpl_info_table.cc
++++ b/sql/rpl_info_table.cc
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -600,7 +600,7 @@ bool Rpl_info_table::do_get_info(const int pos, char *value, const size_t size,
+ }
+
+ bool Rpl_info_table::do_get_info(const int pos, uchar *value, const size_t size,
+- const uchar *default_value __attribute__((unused)))
++ const uchar *default_value MY_ATTRIBUTE((unused)))
+ {
+ if (field_values->value[pos].length() == size)
+ return (!memcpy((char *) value, (char *)
[email protected]@ -661,7 +661,7 @@ bool Rpl_info_table::do_get_info(const int pos, float *value,
+ }
+
+ bool Rpl_info_table::do_get_info(const int pos, Dynamic_ids *value,
+- const Dynamic_ids *default_value __attribute__((unused)))
++ const Dynamic_ids *default_value MY_ATTRIBUTE((unused)))
+ {
+ if (value->unpack_dynamic_ids(field_values->value[pos].c_ptr_safe()))
+ return TRUE;
+--- a/sql/rpl_master.cc
++++ b/sql/rpl_master.cc
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -62,7 +62,7 @@ extern TYPELIB binlog_checksum_typelib;
+
+ extern "C" uint32
+ *slave_list_key(SLAVE_INFO* si, size_t *len,
+- my_bool not_used __attribute__((unused)))
++ my_bool not_used MY_ATTRIBUTE((unused)))
+ {
+ *len = 4;
+ return &si->server_id;
+--- a/sql/rpl_mi.cc
++++ b/sql/rpl_mi.cc
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -542,7 +542,7 @@ bool Master_info::write_info(Rpl_info_handler *to)
+ }
+
+ bool Master_info::set_password(const char* password_arg,
+- int password_arg_size __attribute__((unused)))
++ int password_arg_size MY_ATTRIBUTE((unused)))
+ {
+ bool ret= true;
+ DBUG_ENTER("Master_info::set_password");
+--- a/sql/rpl_rli_pdb.cc
++++ b/sql/rpl_rli_pdb.cc
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -629,7 +629,7 @@ static mysql_cond_t slave_worker_hash_cond;
+
+
+ extern "C" uchar *get_key(const uchar *record, size_t *length,
+- my_bool not_used __attribute__((unused)))
++ my_bool not_used MY_ATTRIBUTE((unused)))
+ {
+ DBUG_ENTER("get_key");
+
[email protected]@ -1490,7 +1490,7 @@ ulong Slave_committed_queue::move_queue_head(DYNAMIC_ARRAY *ws)
+ Slave_worker *w_i;
+ Slave_job_group *ptr_g, g;
+ char grl_name[FN_REFLEN];
+- ulong ind __attribute__((unused));
++ ulong ind MY_ATTRIBUTE((unused));
+
+ #ifndef DBUG_OFF
+ if (DBUG_EVALUATE_IF("check_slave_debug_group", 1, 0) &&
+--- a/sql/rpl_slave.cc
++++ b/sql/rpl_slave.cc
[email protected]@ -1384,7 +1384,7 @@ terminate_slave_thread(THD *thd,
+
+ while (*slave_running) // Should always be true
+ {
+- int error __attribute__((unused));
++ int error MY_ATTRIBUTE((unused));
+ DBUG_PRINT("loop", ("killing slave thread"));
+
+ mysql_mutex_lock(&thd->LOCK_thd_data);
[email protected]@ -1394,7 +1394,7 @@ terminate_slave_thread(THD *thd,
+ EINVAL: invalid signal number (can't happen)
+ ESRCH: thread already killed (can happen, should be ignored)
+ */
+- int err __attribute__((unused))= pthread_kill(thd->real_id, thr_client_alarm);
++ int err MY_ATTRIBUTE((unused))= pthread_kill(thd->real_id, thr_client_alarm);
+ DBUG_ASSERT(err != EINVAL);
+ #endif
+ thd->awake(THD::NOT_KILLED);
+--- a/sql/rpl_utility.cc
++++ b/sql/rpl_utility.cc
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -1243,7 +1243,7 @@ bool event_checksum_test(uchar *event_buf, ulong event_len, uint8 alg)
+ static uchar*
+ hash_slave_rows_get_key(const uchar *record,
+ size_t *length,
+- my_bool not_used __attribute__((unused)))
++ my_bool not_used MY_ATTRIBUTE((unused)))
+ {
+ DBUG_ENTER("get_key");
+
+--- a/sql/sql_acl.cc
++++ b/sql/sql_acl.cc
[email protected]@ -625,7 +625,7 @@ public:
+
+
+ static uchar* acl_entry_get_key(acl_entry *entry, size_t *length,
+- my_bool not_used __attribute__((unused)))
++ my_bool not_used MY_ATTRIBUTE((unused)))
+ {
+ *length=(uint) entry->length;
+ return (uchar*) entry->key;
[email protected]@ -1673,7 +1673,7 @@ bool acl_getroot(Security_context *sctx, char *user, char *host,
+ }
+
+ static uchar* check_get_key(ACL_USER *buff, size_t *length,
+- my_bool not_used __attribute__((unused)))
++ my_bool not_used MY_ATTRIBUTE((unused)))
+ {
+ *length=buff->host.get_host_len();
+ return (uchar*) buff->host.get_host();
[email protected]@ -3607,7 +3607,7 @@ public:
+
+
+ static uchar* get_key_column(GRANT_COLUMN *buff, size_t *length,
+- my_bool not_used __attribute__((unused)))
++ my_bool not_used MY_ATTRIBUTE((unused)))
+ {
+ *length=buff->key_length;
+ return (uchar*) buff->column;
[email protected]@ -3800,7 +3800,7 @@ GRANT_TABLE::~GRANT_TABLE()
+
+
+ static uchar* get_grant_table(GRANT_NAME *buff, size_t *length,
+- my_bool not_used __attribute__((unused)))
++ my_bool not_used MY_ATTRIBUTE((unused)))
+ {
+ *length=buff->key_length;
+ return (uchar*) buff->hash_key;
+--- a/sql/sql_analyse.cc
++++ b/sql/sql_analyse.cc
[email protected]@ -1,5 +1,5 @@
+ /*
+- Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
++ Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -34,25 +34,25 @@
+ using std::min;
+ using std::max;
+
+-int sortcmp2(void* cmp_arg __attribute__((unused)),
++int sortcmp2(void* cmp_arg MY_ATTRIBUTE((unused)),
+ const String *a,const String *b)
+ {
+ return sortcmp(a,b,a->charset());
+ }
+
+-int compare_double2(void* cmp_arg __attribute__((unused)),
++int compare_double2(void* cmp_arg MY_ATTRIBUTE((unused)),
+ const double *s, const double *t)
+ {
+ return compare_double(s,t);
+ }
+
+-int compare_longlong2(void* cmp_arg __attribute__((unused)),
++int compare_longlong2(void* cmp_arg MY_ATTRIBUTE((unused)),
+ const longlong *s, const longlong *t)
+ {
+ return compare_longlong(s,t);
+ }
+
+-int compare_ulonglong2(void* cmp_arg __attribute__((unused)),
++int compare_ulonglong2(void* cmp_arg MY_ATTRIBUTE((unused)),
+ const ulonglong *s, const ulonglong *t)
+ {
+ return compare_ulonglong(s,t);
[email protected]@ -835,7 +835,7 @@ void field_str::get_opt_type(String *answer, ha_rows total_rows)
+
+
+ void field_real::get_opt_type(String *answer,
+- ha_rows total_rows __attribute__((unused)))
++ ha_rows total_rows MY_ATTRIBUTE((unused)))
+ {
+ char buff[MAX_FIELD_WIDTH];
+
[email protected]@ -888,7 +888,7 @@ void field_real::get_opt_type(String *answer,
+
+
+ void field_longlong::get_opt_type(String *answer,
+- ha_rows total_rows __attribute__((unused)))
++ ha_rows total_rows MY_ATTRIBUTE((unused)))
+ {
+ char buff[MAX_FIELD_WIDTH];
+
[email protected]@ -919,7 +919,7 @@ void field_longlong::get_opt_type(String *answer,
+
+
+ void field_ulonglong::get_opt_type(String *answer,
+- ha_rows total_rows __attribute__((unused)))
++ ha_rows total_rows MY_ATTRIBUTE((unused)))
+ {
+ char buff[MAX_FIELD_WIDTH];
+
[email protected]@ -944,7 +944,7 @@ void field_ulonglong::get_opt_type(String *answer,
+
+
+ void field_decimal::get_opt_type(String *answer,
+- ha_rows total_rows __attribute__((unused)))
++ ha_rows total_rows MY_ATTRIBUTE((unused)))
+ {
+ my_decimal zero;
+ char buff[MAX_FIELD_WIDTH];
[email protected]@ -1022,7 +1022,7 @@ String *field_decimal::std(String *s, ha_rows rows)
+
+
+ int collect_string(String *element,
+- element_count count __attribute__((unused)),
++ element_count count MY_ATTRIBUTE((unused)),
+ TREE_INFO *info)
+ {
+ if (info->found)
[email protected]@ -1037,7 +1037,7 @@ int collect_string(String *element,
+ } // collect_string
+
+
+-int collect_real(double *element, element_count count __attribute__((unused)),
++int collect_real(double *element, element_count count MY_ATTRIBUTE((unused)),
+ TREE_INFO *info)
+ {
+ char buff[MAX_FIELD_WIDTH];
[email protected]@ -1078,7 +1078,7 @@ int collect_decimal(uchar *element, element_count count,
+
+
+ int collect_longlong(longlong *element,
+- element_count count __attribute__((unused)),
++ element_count count MY_ATTRIBUTE((unused)),
+ TREE_INFO *info)
+ {
+ char buff[MAX_FIELD_WIDTH];
[email protected]@ -1097,7 +1097,7 @@ int collect_longlong(longlong *element,
+
+
+ int collect_ulonglong(ulonglong *element,
+- element_count count __attribute__((unused)),
++ element_count count MY_ATTRIBUTE((unused)),
+ TREE_INFO *info)
+ {
+ char buff[MAX_FIELD_WIDTH];
+--- a/sql/sql_analyse.h
++++ b/sql/sql_analyse.h
[email protected]@ -1,7 +1,7 @@
+ #ifndef SQL_ANALYSE_INCLUDED
+ #define SQL_ANALYSE_INCLUDED
+
+-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -53,13 +53,13 @@ uint check_ulonglong(const char *str, uint length);
+ bool get_ev_num_info(EV_NUM_INFO *ev_info, NUM_INFO *info, const char *num);
+ bool test_if_number(NUM_INFO *info, const char *str, uint str_len);
+ int compare_double(const double *s, const double *t);
+-int compare_double2(void* cmp_arg __attribute__((unused)),
++int compare_double2(void* cmp_arg MY_ATTRIBUTE((unused)),
+ const double *s, const double *t);
+ int compare_longlong(const longlong *s, const longlong *t);
+-int compare_longlong2(void* cmp_arg __attribute__((unused)),
++int compare_longlong2(void* cmp_arg MY_ATTRIBUTE((unused)),
+ const longlong *s, const longlong *t);
+ int compare_ulonglong(const ulonglong *s, const ulonglong *t);
+-int compare_ulonglong2(void* cmp_arg __attribute__((unused)),
++int compare_ulonglong2(void* cmp_arg MY_ATTRIBUTE((unused)),
+ const ulonglong *s, const ulonglong *t);
+ int compare_decimal2(int* len, const char *s, const char *t);
+ void free_string(String*);
[email protected]@ -97,7 +97,7 @@ public:
+ int collect_string(String *element, element_count count,
+ TREE_INFO *info);
+
+-int sortcmp2(void* cmp_arg __attribute__((unused)),
++int sortcmp2(void* cmp_arg MY_ATTRIBUTE((unused)),
+ const String *a,const String *b);
+
+ class field_str :public field_info
[email protected]@ -120,9 +120,9 @@ public:
+
+ void add();
+ void get_opt_type(String*, ha_rows);
+- String *get_min_arg(String *not_used __attribute__((unused)))
++ String *get_min_arg(String *not_used MY_ATTRIBUTE((unused)))
+ { return &min_arg; }
+- String *get_max_arg(String *not_used __attribute__((unused)))
++ String *get_max_arg(String *not_used MY_ATTRIBUTE((unused)))
+ { return &max_arg; }
+ String *avg(String *s, ha_rows rows)
+ {
[email protected]@ -137,8 +137,8 @@ public:
+ TREE_INFO *info);
+ tree_walk_action collect_enum()
+ { return (tree_walk_action) collect_string; }
+- String *std(String *s __attribute__((unused)),
+- ha_rows rows __attribute__((unused)))
++ String *std(String *s MY_ATTRIBUTE((unused)),
++ ha_rows rows MY_ATTRIBUTE((unused)))
+ { return (String*) 0; }
+ };
+
+--- a/sql/sql_audit.cc
++++ b/sql/sql_audit.cc
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -494,7 +494,7 @@ static void event_class_dispatch(THD *thd, unsigned int event_class,
+
+
+ /** There's at least one active audit plugin tracking the general events */
+-bool is_any_audit_plugin_active(THD *thd __attribute__((unused)))
++bool is_any_audit_plugin_active(THD *thd MY_ATTRIBUTE((unused)))
+ {
+ return (mysql_global_audit_mask[0] & MYSQL_AUDIT_GENERAL_CLASSMASK);
+ }
+--- a/sql/sql_audit.h
++++ b/sql/sql_audit.h
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -37,7 +37,7 @@ extern void mysql_audit_acquire_plugins(THD *thd, uint event_class);
+ #ifndef EMBEDDED_LIBRARY
+ extern void mysql_audit_notify(THD *thd, uint event_class,
+ uint event_subtype, ...);
+-bool is_any_audit_plugin_active(THD *thd __attribute__((unused)));
++bool is_any_audit_plugin_active(THD *thd MY_ATTRIBUTE((unused)));
+ #else
+ #define mysql_audit_notify(...)
+ #endif
+--- a/sql/sql_base.cc
++++ b/sql/sql_base.cc
[email protected]@ -330,7 +330,7 @@ uint get_table_def_key(const TABLE_LIST *table_list, const char **key)
+ *****************************************************************************/
+
+ extern "C" uchar *table_def_key(const uchar *record, size_t *length,
+- my_bool not_used __attribute__((unused)))
++ my_bool not_used MY_ATTRIBUTE((unused)))
+ {
+ TABLE_SHARE *entry=(TABLE_SHARE*) record;
+ *length= entry->table_cache_key.length;
[email protected]@ -4865,7 +4865,7 @@ end:
+ }
+
+ extern "C" uchar *schema_set_get_key(const uchar *record, size_t *length,
+- my_bool not_used __attribute__((unused)))
++ my_bool not_used MY_ATTRIBUTE((unused)))
+ {
+ TABLE_LIST *table=(TABLE_LIST*) record;
+ *length= table->db_length;
+--- a/sql/sql_cache.cc
++++ b/sql/sql_cache.cc
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2000, 2013, 2015, Oracle and/or its affiliates. All rights
++/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights
+ reserved.
+
+ This program is free software; you can redistribute it and/or modify
[email protected]@ -729,7 +729,7 @@ inline Query_cache_block_table * Query_cache_block::table(TABLE_COUNTER_TYPE n)
+ extern "C"
+ {
+ uchar *query_cache_table_get_key(const uchar *record, size_t *length,
+- my_bool not_used __attribute__((unused)))
++ my_bool not_used MY_ATTRIBUTE((unused)))
+ {
+ Query_cache_block* table_block = (Query_cache_block*) record;
+ *length = (table_block->used - table_block->headers_len() -
+--- a/sql/sql_class.cc
++++ b/sql/sql_class.cc
[email protected]@ -83,7 +83,7 @@ const char * const THD::DEFAULT_WHERE= "field list";
+ ****************************************************************************/
+
+ extern "C" uchar *get_var_key(user_var_entry *entry, size_t *length,
+- my_bool not_used __attribute__((unused)))
++ my_bool not_used MY_ATTRIBUTE((unused)))
+ {
+ *length= entry->entry_name.length();
+ return (uchar*) entry->entry_name.ptr();
[email protected]@ -3053,7 +3053,7 @@ err:
+
+
+ int
+-select_dump::prepare(List<Item> &list __attribute__((unused)),
++select_dump::prepare(List<Item> &list MY_ATTRIBUTE((unused)),
+ SELECT_LEX_UNIT *u)
+ {
+ unit= u;
[email protected]@ -3465,7 +3465,7 @@ C_MODE_START
+
+ static uchar *
+ get_statement_id_as_hash_key(const uchar *record, size_t *key_length,
+- my_bool not_used __attribute__((unused)))
++ my_bool not_used MY_ATTRIBUTE((unused)))
+ {
+ const Statement *statement= (const Statement *) record;
+ *key_length= sizeof(statement->id);
[email protected]@ -3478,7 +3478,7 @@ static void delete_statement_as_hash_key(void *key)
+ }
+
+ static uchar *get_stmt_name_hash_key(Statement *entry, size_t *length,
+- my_bool not_used __attribute__((unused)))
++ my_bool not_used MY_ATTRIBUTE((unused)))
+ {
+ *length= entry->name.length;
+ return (uchar*) entry->name.str;
[email protected]@ -4779,7 +4779,7 @@ extern "C" uchar *xid_get_hash_key(const uchar *, size_t *, my_bool);
+ extern "C" void xid_free_hash(void *);
+
+ uchar *xid_get_hash_key(const uchar *ptr, size_t *length,
+- my_bool not_used __attribute__((unused)))
++ my_bool not_used MY_ATTRIBUTE((unused)))
+ {
+ *length=((XID_STATE*)ptr)->xid.key_length();
+ return ((XID_STATE*)ptr)->xid.key();
+--- a/sql/sql_connect.cc
++++ b/sql/sql_connect.cc
[email protected]@ -1,5 +1,5 @@
+ /*
+- Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.
++ Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -337,7 +337,7 @@ void release_user_connection(THD *thd)
+ */
+
+ extern "C" uchar *get_key_conn(user_conn *buff, size_t *length,
+- my_bool not_used __attribute__((unused)))
++ my_bool not_used MY_ATTRIBUTE((unused)))
+ {
+ *length= buff->len;
+ return (uchar*) buff->user;
+--- a/sql/sql_cursor.cc
++++ b/sql/sql_cursor.cc
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -47,7 +47,7 @@ public:
+
+ int send_result_set_metadata(THD *thd, List<Item> &send_result_set_metadata);
+ virtual bool is_open() const { return table != 0; }
+- virtual int open(JOIN *join __attribute__((unused)));
++ virtual int open(JOIN *join MY_ATTRIBUTE((unused)));
+ virtual void fetch(ulong num_rows);
+ virtual void close();
+ virtual ~Materialized_cursor();
[email protected]@ -277,7 +277,7 @@ end:
+ }
+
+
+-int Materialized_cursor::open(JOIN *join __attribute__((unused)))
++int Materialized_cursor::open(JOIN *join MY_ATTRIBUTE((unused)))
+ {
+ THD *thd= fake_unit.thd;
+ int rc;
+--- a/sql/sql_db.cc
++++ b/sql/sql_db.cc
[email protected]@ -1,5 +1,5 @@
+ /*
+- Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
++ Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -86,7 +86,7 @@ extern "C" uchar* dboptions_get_key(my_dbopt_t *opt, size_t *length,
+ my_bool not_used);
+
+ uchar* dboptions_get_key(my_dbopt_t *opt, size_t *length,
+- my_bool not_used __attribute__((unused)))
++ my_bool not_used MY_ATTRIBUTE((unused)))
+ {
+ *length= opt->name_length;
+ return (uchar*) opt->name;
+--- a/sql/sql_executor.cc
++++ b/sql/sql_executor.cc
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -484,7 +484,7 @@ init_tmptable_sum_functions(Item_sum **func_ptr)
+
+ static void
+ update_tmptable_sum_func(Item_sum **func_ptr,
+- TABLE *tmp_table __attribute__((unused)))
++ TABLE *tmp_table MY_ATTRIBUTE((unused)))
+ {
+ Item_sum *func;
+ while ((func= *(func_ptr++)))
[email protected]@ -2256,7 +2256,7 @@ join_read_last_key(JOIN_TAB *tab)
+
+ /* ARGSUSED */
+ static int
+-join_no_more_records(READ_RECORD *info __attribute__((unused)))
++join_no_more_records(READ_RECORD *info MY_ATTRIBUTE((unused)))
+ {
+ return -1;
+ }
[email protected]@ -2858,7 +2858,7 @@ end_send(JOIN *join, JOIN_TAB *join_tab, bool end_of_records)
+
+ /* ARGSUSED */
+ enum_nested_loop_state
+-end_send_group(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)),
++end_send_group(JOIN *join, JOIN_TAB *join_tab MY_ATTRIBUTE((unused)),
+ bool end_of_records)
+ {
+ int idx= -1;
[email protected]@ -3856,7 +3856,7 @@ setup_copy_fields(THD *thd, TMP_TABLE_PARAM *param,
+ Item *pos;
+ List_iterator_fast<Item> li(all_fields);
+ Copy_field *copy= NULL;
+- Copy_field *copy_start __attribute__((unused));
++ Copy_field *copy_start MY_ATTRIBUTE((unused));
+ res_selected_fields.empty();
+ res_all_fields.empty();
+ List_iterator_fast<Item> itr(res_all_fields);
+--- a/sql/sql_executor.h
++++ b/sql/sql_executor.h
[email protected]@ -1,7 +1,7 @@
+ #ifndef SQL_EXECUTOR_INCLUDED
+ #define SQL_EXECUTOR_INCLUDED
+
+-/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights
++/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights
+ reserved.
+
+ This program is free software; you can redistribute it and/or modify
[email protected]@ -258,7 +258,7 @@ private:
+ /** Write function that would be used for saving records in tmp table. */
+ Next_select_func write_func;
+ enum_nested_loop_state put_record(bool end_of_records);
+- __attribute__((warn_unused_result))
++ MY_ATTRIBUTE((warn_unused_result))
+ bool prepare_tmp_table();
+ };
+
+--- a/sql/sql_handler.cc
++++ b/sql/sql_handler.cc
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -89,7 +89,7 @@ static bool mysql_ha_open_table(THD *thd, TABLE_LIST *table);
+ */
+
+ static char *mysql_ha_hash_get_key(TABLE_LIST *tables, size_t *key_len_p,
+- my_bool first __attribute__((unused)))
++ my_bool first MY_ATTRIBUTE((unused)))
+ {
+ *key_len_p= strlen(tables->alias) + 1 ; /* include '\0' in comparisons */
+ return tables->alias;
+--- a/sql/sql_load.cc
++++ b/sql/sql_load.cc
[email protected]@ -209,7 +209,7 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
+ */
+ char *tdb= thd->db ? thd->db : db; // Result is never null
+ ulong skip_lines= ex->skip_lines;
+- bool transactional_table __attribute__((unused));
++ bool transactional_table MY_ATTRIBUTE((unused));
+ DBUG_ENTER("mysql_load");
+
+ /*
+--- a/sql/sql_manager.cc
++++ b/sql/sql_manager.cc
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -63,7 +63,7 @@ bool mysql_manager_submit(void (*action)())
+ return result;
+ }
+
+-pthread_handler_t handle_manager(void *arg __attribute__((unused)))
++pthread_handler_t handle_manager(void *arg MY_ATTRIBUTE((unused)))
+ {
+ int error = 0;
+ struct timespec abstime;
+--- a/sql/sql_optimizer.cc
++++ b/sql/sql_optimizer.cc
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -1121,8 +1121,8 @@ public:
+ {
+ return (void*) sql_alloc((uint) size);
+ }
+- static void operator delete(void *ptr __attribute__((unused)),
+- size_t size __attribute__((unused)))
++ static void operator delete(void *ptr MY_ATTRIBUTE((unused)),
++ size_t size MY_ATTRIBUTE((unused)))
+ { TRASH(ptr, size); }
+
+ Item *and_level;
+--- a/sql/sql_parse.cc
++++ b/sql/sql_parse.cc
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -1645,7 +1645,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
+ {
+ STATUS_VAR current_global_status_var;
+ ulong uptime;
+- uint length __attribute__((unused));
++ uint length MY_ATTRIBUTE((unused));
+ ulonglong queries_per_second1000;
+ char buff[250];
+ uint buff_len= sizeof(buff);
[email protected]@ -1791,7 +1791,7 @@ done:
+ /* DTRACE instrumentation, end */
+ if (MYSQL_QUERY_DONE_ENABLED() || MYSQL_COMMAND_DONE_ENABLED())
+ {
+- int res __attribute__((unused));
++ int res MY_ATTRIBUTE((unused));
+ res= (int) thd->is_error();
+ if (command == COM_QUERY)
+ {
[email protected]@ -5919,7 +5919,7 @@ long max_stack_used;
+ - Passing to check_stack_overrun() prevents the compiler from removing it.
+ */
+ bool check_stack_overrun(THD *thd, long margin,
+- uchar *buf __attribute__((unused)))
++ uchar *buf MY_ATTRIBUTE((unused)))
+ {
+ long stack_used;
+ DBUG_ASSERT(thd == current_thd);
[email protected]@ -6260,7 +6260,7 @@ void mysql_init_multi_delete(LEX *lex)
+ void mysql_parse(THD *thd, char *rawbuf, uint length,
+ Parser_state *parser_state)
+ {
+- int error __attribute__((unused));
++ int error MY_ATTRIBUTE((unused));
+ DBUG_ENTER("mysql_parse");
+
+ DBUG_EXECUTE_IF("parser_debug", turn_parser_debug_on(););
+--- a/sql/sql_planner.cc
++++ b/sql/sql_planner.cc
[email protected]@ -1516,7 +1516,7 @@ bool Optimize_table_order::greedy_search(table_map remaining_tables)
+ join state will not be reverted back to its initial state because we
+ don't "pop" tables already present in the partial plan.
+ */
+- bool is_interleave_error __attribute__((unused))=
++ bool is_interleave_error MY_ATTRIBUTE((unused))=
+ check_interleaving_with_nj (best_table);
+ /* This has been already checked by best_extension_by_limited_search */
+ DBUG_ASSERT(!is_interleave_error);
+--- a/sql/sql_plugin.cc
++++ b/sql/sql_plugin.cc
[email protected]@ -1216,7 +1216,7 @@ extern "C" uchar *get_bookmark_hash_key(const uchar *, size_t *, my_bool);
+
+
+ uchar *get_plugin_hash_key(const uchar *buff, size_t *length,
+- my_bool not_used __attribute__((unused)))
++ my_bool not_used MY_ATTRIBUTE((unused)))
+ {
+ struct st_plugin_int *plugin= (st_plugin_int *)buff;
+ *length= (uint)plugin->name.length;
[email protected]@ -1225,7 +1225,7 @@ uchar *get_plugin_hash_key(const uchar *buff, size_t *length,
+
+
+ uchar *get_bookmark_hash_key(const uchar *buff, size_t *length,
+- my_bool not_used __attribute__((unused)))
++ my_bool not_used MY_ATTRIBUTE((unused)))
+ {
+ struct st_bookmark *var= (st_bookmark *)buff;
+ *length= var->name_len + 1;
[email protected]@ -3396,7 +3396,7 @@ static void plugin_opt_set_limits(struct my_option *options,
+ extern "C" my_bool get_one_plugin_option(int optid, const struct my_option *,
+ char *);
+
+-my_bool get_one_plugin_option(int optid __attribute__((unused)),
++my_bool get_one_plugin_option(int optid MY_ATTRIBUTE((unused)),
+ const struct my_option *opt,
+ char *argument)
+ {
[email protected]@ -3717,7 +3717,7 @@ static my_option *construct_help_options(MEM_ROOT *mem_root,
+
+ static my_bool check_if_option_is_deprecated(int optid,
+ const struct my_option *opt,
+- char *argument __attribute__((unused)))
++ char *argument MY_ATTRIBUTE((unused)))
+ {
+ if (optid == -1)
+ {
[email protected]@ -3767,7 +3767,7 @@ static int test_plugin_options(MEM_ROOT *tmp_root, struct st_plugin_int *tmp,
+ LEX_STRING plugin_name;
+ char *varname;
+ int error;
+- sys_var *v __attribute__((unused));
++ sys_var *v MY_ATTRIBUTE((unused));
+ struct st_bookmark *var;
+ uint len, count= EXTRA_OPTIONS;
+ DBUG_ENTER("test_plugin_options");
+--- a/sql/sql_prepare.cc
++++ b/sql/sql_prepare.cc
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -399,7 +399,7 @@ static bool send_prep_stmt(Prepared_statement *stmt, uint columns)
+ }
+ #else
+ static bool send_prep_stmt(Prepared_statement *stmt,
+- uint columns __attribute__((unused)))
++ uint columns MY_ATTRIBUTE((unused)))
+ {
+ THD *thd= stmt->thd;
+
[email protected]@ -1183,7 +1183,7 @@ swap_parameter_array(Item_param **param_array_dst,
+
+ static bool insert_params_from_vars(Prepared_statement *stmt,
+ List<LEX_STRING>& varnames,
+- String *query __attribute__((unused)))
++ String *query MY_ATTRIBUTE((unused)))
+ {
+ Item_param **begin= stmt->param_array;
+ Item_param **end= begin + stmt->param_count;
[email protected]@ -4529,7 +4529,7 @@ bool Protocol_local::store(const char *str, size_t length,
+ /* Store MYSQL_TIME (in binary format) */
+
+ bool Protocol_local::store(MYSQL_TIME *time,
+- uint precision __attribute__((unused)))
++ uint precision MY_ATTRIBUTE((unused)))
+ {
+ return store_column(time, sizeof(MYSQL_TIME));
+ }
[email protected]@ -4546,7 +4546,7 @@ bool Protocol_local::store_date(MYSQL_TIME *time)
+ /** Store MYSQL_TIME (in binary format) */
+
+ bool Protocol_local::store_time(MYSQL_TIME *time,
+- uint precision __attribute__((unused)))
++ uint precision MY_ATTRIBUTE((unused)))
+ {
+ return store_column(time, sizeof(MYSQL_TIME));
+ }
+--- a/sql/sql_select.cc
++++ b/sql/sql_select.cc
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -3075,7 +3075,7 @@ bool JOIN_TAB::and_with_jt_and_sel_condition(Item *add_cond, uint line)
+ */
+ bool JOIN_TAB::and_with_condition(Item *add_cond, uint line)
+ {
+- Item *old_cond __attribute__((unused))= m_condition;
++ Item *old_cond MY_ATTRIBUTE((unused))= m_condition;
+ if (and_conditions(&m_condition, add_cond))
+ return true;
+ DBUG_PRINT("info", ("JOIN_TAB::m_condition extended. Change %p -> %p "
+--- a/sql/sql_servers.cc
++++ b/sql/sql_servers.cc
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -86,7 +86,7 @@ static void merge_server_struct(FOREIGN_SERVER *from, FOREIGN_SERVER *to);
+
+
+ static uchar *servers_cache_get_key(FOREIGN_SERVER *server, size_t *length,
+- my_bool not_used __attribute__((unused)))
++ my_bool not_used MY_ATTRIBUTE((unused)))
+ {
+ DBUG_ENTER("servers_cache_get_key");
+ DBUG_PRINT("info", ("server_name_length %d server_name %s",
+--- a/sql/sql_show.cc
++++ b/sql/sql_show.cc
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -369,7 +369,7 @@ ignore_db_dirs_init()
+
+ static uchar *
+ db_dirs_hash_get_key(const uchar *data, size_t *len_ret,
+- my_bool __attribute__((unused)))
++ my_bool MY_ATTRIBUTE((unused)))
+ {
+ LEX_STRING *e= (LEX_STRING *) data;
+
[email protected]@ -2032,8 +2032,8 @@ public:
+ {
+ return (void*) sql_alloc((uint) size);
+ }
+- static void operator delete(void *ptr __attribute__((unused)),
+- size_t size __attribute__((unused)))
++ static void operator delete(void *ptr MY_ATTRIBUTE((unused)),
++ size_t size MY_ATTRIBUTE((unused)))
+ { TRASH(ptr, size); }
+
+ ulong thread_id;
+--- a/sql/sql_table.cc
++++ b/sql/sql_table.cc
[email protected]@ -5513,7 +5513,7 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table, TABLE_LIST* src_table,
+ */
+ create_info->used_fields|= HA_CREATE_USED_ENGINE;
+
+- int result __attribute__((unused))=
++ int result MY_ATTRIBUTE((unused))=
+ store_create_info(thd, table, &query,
+ create_info, TRUE /* show_database */);
+
+--- a/sql/sql_time.cc
++++ b/sql/sql_time.cc
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -1187,7 +1187,7 @@ const char *get_date_time_format_str(KNOWN_DATE_TIME_FORMAT *format,
+ @param OUT str String to conver to
+ @param dec Number of fractional digits.
+ */
+-void make_time(const DATE_TIME_FORMAT *format __attribute__((unused)),
++void make_time(const DATE_TIME_FORMAT *format MY_ATTRIBUTE((unused)),
+ const MYSQL_TIME *l_time, String *str, uint dec)
+ {
+ uint length= (uint) my_time_to_str(l_time, (char*) str->ptr(), dec);
[email protected]@ -1202,7 +1202,7 @@ void make_time(const DATE_TIME_FORMAT *format __attribute__((unused)),
+ @param l_time DATE value
+ @param OUT str String to conver to
+ */
+-void make_date(const DATE_TIME_FORMAT *format __attribute__((unused)),
++void make_date(const DATE_TIME_FORMAT *format MY_ATTRIBUTE((unused)),
+ const MYSQL_TIME *l_time, String *str)
+ {
+ uint length= (uint) my_date_to_str(l_time, (char*) str->ptr());
[email protected]@ -1218,7 +1218,7 @@ void make_date(const DATE_TIME_FORMAT *format __attribute__((unused)),
+ @param OUT str String to conver to
+ @param dec Number of fractional digits.
+ */
+-void make_datetime(const DATE_TIME_FORMAT *format __attribute__((unused)),
++void make_datetime(const DATE_TIME_FORMAT *format MY_ATTRIBUTE((unused)),
+ const MYSQL_TIME *l_time, String *str, uint dec)
+ {
+ uint length= (uint) my_datetime_to_str(l_time, (char*) str->ptr(), dec);
+--- a/sql/sql_udf.cc
++++ b/sql/sql_udf.cc
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -94,7 +94,7 @@ static char *init_syms(udf_func *tmp, char *nm)
+
+
+ extern "C" uchar* get_hash_key(const uchar *buff, size_t *length,
+- my_bool not_used __attribute__((unused)))
++ my_bool not_used MY_ATTRIBUTE((unused)))
+ {
+ udf_func *udf=(udf_func*) buff;
+ *length=(uint) udf->name.length;
+--- a/sql/sql_yacc.yy
++++ b/sql/sql_yacc.yy
[email protected]@ -113,18 +113,18 @@ int yylex(void *yylval, void *yythd);
+ <pre>
+ yyerrlab1:
+ #if defined (__GNUC_MINOR__) && 2093 <= (__GNUC__ * 1000 + __GNUC_MINOR__)
+- __attribute__ ((__unused__))
++ MY_ATTRIBUTE ((__unused__))
+ #endif
+ </pre>
+- This usage of __attribute__ is illegal, so we remove it.
++ This usage of MY_ATTRIBUTE is illegal, so we remove it.
+ See the following references for details:
+ http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00014.html
+ http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14273
+ */
+
+ #if defined (__GNUC_MINOR__) && 2093 <= (__GNUC__ * 1000 + __GNUC_MINOR__)
+-#undef __attribute__
+-#define __attribute__(X)
++#undef MY_ATTRIBUTE
++#define MY_ATTRIBUTE(X)
+ #endif
+
+
+--- a/sql/table.cc
++++ b/sql/table.cc
[email protected]@ -1,5 +1,5 @@
+ /*
+- Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
++ Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -210,7 +210,7 @@ View_creation_ctx * View_creation_ctx::create(THD *thd,
+ /* Get column name from column hash */
+
+ static uchar *get_field_name(Field **buff, size_t *length,
+- my_bool not_used __attribute__((unused)))
++ my_bool not_used MY_ATTRIBUTE((unused)))
+ {
+ *length= (uint) strlen((*buff)->field_name);
+ return (uchar*) (*buff)->field_name;
+--- a/sql/table_cache.cc
++++ b/sql/table_cache.cc
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -33,7 +33,7 @@ PSI_mutex_info Table_cache::m_mutex_keys[]= {
+
+ extern "C" uchar *table_cache_key(const uchar *record,
+ size_t *length,
+- my_bool not_used __attribute__((unused)))
++ my_bool not_used MY_ATTRIBUTE((unused)))
+ {
+ TABLE_SHARE *share= ((Table_cache_element*)record)->get_share();
+ *length= share->table_cache_key.length;
+--- a/sql/tztime.cc
++++ b/sql/tztime.cc
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -1490,7 +1490,7 @@ public:
+
+ extern "C" uchar *
+ my_tz_names_get_key(Tz_names_entry *entry, size_t *length,
+- my_bool not_used __attribute__((unused)))
++ my_bool not_used MY_ATTRIBUTE((unused)))
+ {
+ *length= entry->name.length();
+ return (uchar*) entry->name.ptr();
[email protected]@ -1499,7 +1499,7 @@ my_tz_names_get_key(Tz_names_entry *entry, size_t *length,
+ extern "C" uchar *
+ my_offset_tzs_get_key(Time_zone_offset *entry,
+ size_t *length,
+- my_bool not_used __attribute__((unused)))
++ my_bool not_used MY_ATTRIBUTE((unused)))
+ {
+ *length= sizeof(long);
+ return (uchar*) &entry->offset;
+--- a/sql/udf_example.cc
++++ b/sql/udf_example.cc
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -227,7 +227,7 @@ my_bool metaphon_init(UDF_INIT *initid, UDF_ARGS *args, char *message)
+ ****************************************************************************/
+
+
+-void metaphon_deinit(UDF_INIT *initid __attribute__((unused)))
++void metaphon_deinit(UDF_INIT *initid MY_ATTRIBUTE((unused)))
+ {
+ }
+
[email protected]@ -273,9 +273,9 @@ static char codes[26] = {
+ #define NOGHTOF(x) (codes[(x) - 'A'] & 16) /* BDH */
+
+
+-char *metaphon(UDF_INIT *initid __attribute__((unused)),
++char *metaphon(UDF_INIT *initid MY_ATTRIBUTE((unused)),
+ UDF_ARGS *args, char *result, unsigned long *length,
+- char *is_null, char *error __attribute__((unused)))
++ char *is_null, char *error MY_ATTRIBUTE((unused)))
+ {
+ const char *word=args->args[0];
+ const char *w_end;
[email protected]@ -550,8 +550,8 @@ my_bool myfunc_double_init(UDF_INIT *initid, UDF_ARGS *args, char *message)
+ }
+
+
+-double myfunc_double(UDF_INIT *initid __attribute__((unused)), UDF_ARGS *args,
+- char *is_null, char *error __attribute__((unused)))
++double myfunc_double(UDF_INIT *initid MY_ATTRIBUTE((unused)), UDF_ARGS *args,
++ char *is_null, char *error MY_ATTRIBUTE((unused)))
+ {
+ unsigned long val = 0;
+ unsigned long v = 0;
[email protected]@ -589,9 +589,9 @@ double myfunc_double(UDF_INIT *initid __attribute__((unused)), UDF_ARGS *args,
+
+ /* This function returns the sum of all arguments */
+
+-longlong myfunc_int(UDF_INIT *initid __attribute__((unused)), UDF_ARGS *args,
+- char *is_null __attribute__((unused)),
+- char *error __attribute__((unused)))
++longlong myfunc_int(UDF_INIT *initid MY_ATTRIBUTE((unused)), UDF_ARGS *args,
++ char *is_null MY_ATTRIBUTE((unused)),
++ char *error MY_ATTRIBUTE((unused)))
+ {
+ longlong val = 0;
+ uint i;
[email protected]@ -621,9 +621,9 @@ longlong myfunc_int(UDF_INIT *initid __attribute__((unused)), UDF_ARGS *args,
+ At least one of _init/_deinit is needed unless the server is started
+ with --allow_suspicious_udfs.
+ */
+-my_bool myfunc_int_init(UDF_INIT *initid __attribute__((unused)),
+- UDF_ARGS *args __attribute__((unused)),
+- char *message __attribute__((unused)))
++my_bool myfunc_int_init(UDF_INIT *initid MY_ATTRIBUTE((unused)),
++ UDF_ARGS *args MY_ATTRIBUTE((unused)),
++ char *message MY_ATTRIBUTE((unused)))
+ {
+ return 0;
+ }
[email protected]@ -663,9 +663,9 @@ void sequence_deinit(UDF_INIT *initid)
+ free(initid->ptr);
+ }
+
+-longlong sequence(UDF_INIT *initid __attribute__((unused)), UDF_ARGS *args,
+- char *is_null __attribute__((unused)),
+- char *error __attribute__((unused)))
++longlong sequence(UDF_INIT *initid MY_ATTRIBUTE((unused)), UDF_ARGS *args,
++ char *is_null MY_ATTRIBUTE((unused)),
++ char *error MY_ATTRIBUTE((unused)))
+ {
+ ulonglong val=0;
+ if (args->arg_count)
[email protected]@ -727,16 +727,16 @@ my_bool lookup_init(UDF_INIT *initid, UDF_ARGS *args, char *message)
+ return 0;
+ }
+
+-void lookup_deinit(UDF_INIT *initid __attribute__((unused)))
++void lookup_deinit(UDF_INIT *initid MY_ATTRIBUTE((unused)))
+ {
+ #if !defined(HAVE_GETHOSTBYADDR_R) || !defined(HAVE_SOLARIS_STYLE_GETHOST)
+ (void) pthread_mutex_destroy(&LOCK_hostname);
+ #endif
+ }
+
+-char *lookup(UDF_INIT *initid __attribute__((unused)), UDF_ARGS *args,
++char *lookup(UDF_INIT *initid MY_ATTRIBUTE((unused)), UDF_ARGS *args,
+ char *result, unsigned long *res_length, char *null_value,
+- char *error __attribute__((unused)))
++ char *error MY_ATTRIBUTE((unused)))
+ {
+ uint length;
+ char name_buff[256];
[email protected]@ -807,16 +807,16 @@ my_bool reverse_lookup_init(UDF_INIT *initid, UDF_ARGS *args, char *message)
+ return 0;
+ }
+
+-void reverse_lookup_deinit(UDF_INIT *initid __attribute__((unused)))
++void reverse_lookup_deinit(UDF_INIT *initid MY_ATTRIBUTE((unused)))
+ {
+ #if !defined(HAVE_GETHOSTBYADDR_R) || !defined(HAVE_SOLARIS_STYLE_GETHOST)
+ (void) pthread_mutex_destroy(&LOCK_hostname);
+ #endif
+ }
+
+-char *reverse_lookup(UDF_INIT *initid __attribute__((unused)), UDF_ARGS *args,
++char *reverse_lookup(UDF_INIT *initid MY_ATTRIBUTE((unused)), UDF_ARGS *args,
+ char *result, unsigned long *res_length,
+- char *null_value, char *error __attribute__((unused)))
++ char *null_value, char *error MY_ATTRIBUTE((unused)))
+ {
+ #if defined(HAVE_GETHOSTBYADDR_R) && defined(HAVE_SOLARIS_STYLE_GETHOST)
+ char name_buff[256];
[email protected]@ -970,8 +970,8 @@ avgcost_reset(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* message)
+ /* This is needed to get things to work in MySQL 4.1.1 and above */
+
+ void
+-avgcost_clear(UDF_INIT* initid, char* is_null __attribute__((unused)),
+- char* message __attribute__((unused)))
++avgcost_clear(UDF_INIT* initid, char* is_null MY_ATTRIBUTE((unused)),
++ char* message MY_ATTRIBUTE((unused)))
+ {
+ struct avgcost_data* data = (struct avgcost_data*)initid->ptr;
+ data->totalprice= 0.0;
[email protected]@ -982,8 +982,8 @@ avgcost_clear(UDF_INIT* initid, char* is_null __attribute__((unused)),
+
+ void
+ avgcost_add(UDF_INIT* initid, UDF_ARGS* args,
+- char* is_null __attribute__((unused)),
+- char* message __attribute__((unused)))
++ char* is_null MY_ATTRIBUTE((unused)),
++ char* message MY_ATTRIBUTE((unused)))
+ {
+ if (args->args[0] && args->args[1])
+ {
[email protected]@ -1029,8 +1029,8 @@ avgcost_add(UDF_INIT* initid, UDF_ARGS* args,
+
+
+ double
+-avgcost( UDF_INIT* initid, UDF_ARGS* args __attribute__((unused)),
+- char* is_null, char* error __attribute__((unused)))
++avgcost( UDF_INIT* initid, UDF_ARGS* args MY_ATTRIBUTE((unused)),
++ char* is_null, char* error MY_ATTRIBUTE((unused)))
+ {
+ struct avgcost_data* data = (struct avgcost_data*)initid->ptr;
+ if (!data->count || !data->totalquantity)
[email protected]@ -1063,10 +1063,10 @@ my_bool myfunc_argument_name_init(UDF_INIT *initid, UDF_ARGS *args,
+ return 0;
+ }
+
+-char *myfunc_argument_name(UDF_INIT *initid __attribute__((unused)),
++char *myfunc_argument_name(UDF_INIT *initid MY_ATTRIBUTE((unused)),
+ UDF_ARGS *args, char *result,
+ unsigned long *length, char *null_value,
+- char *error __attribute__((unused)))
++ char *error MY_ATTRIBUTE((unused)))
+ {
+ if (!args->attributes[0])
+ {
[email protected]@ -1094,9 +1094,9 @@ my_bool is_const_init(UDF_INIT *initid, UDF_ARGS *args, char *message)
+ return 0;
+ }
+
+-char * is_const(UDF_INIT *initid, UDF_ARGS *args __attribute__((unused)),
++char * is_const(UDF_INIT *initid, UDF_ARGS *args MY_ATTRIBUTE((unused)),
+ char *result, unsigned long *length,
+- char *is_null, char *error __attribute__((unused)))
++ char *is_null, char *error MY_ATTRIBUTE((unused)))
+ {
+ if (initid->ptr != 0) {
+ sprintf(result, "const");
[email protected]@ -1135,9 +1135,9 @@ my_bool check_const_len_init(UDF_INIT *initid, UDF_ARGS *args, char *message)
+ }
+
+ extern "C"
+-char * check_const_len(UDF_INIT *initid, UDF_ARGS *args __attribute__((unused)),
++char * check_const_len(UDF_INIT *initid, UDF_ARGS *args MY_ATTRIBUTE((unused)),
+ char *result, unsigned long *length,
+- char *is_null, char *error __attribute__((unused)))
++ char *is_null, char *error MY_ATTRIBUTE((unused)))
+ {
+ strmov(result, initid->ptr);
+ *length= (uint) strlen(result);
[email protected]@ -1183,8 +1183,8 @@ void my_median_deinit(UDF_INIT* initid)
+ }
+
+ void my_median_add(UDF_INIT* initid, UDF_ARGS* args,
+- char* is_null __attribute__((unused)),
+- char* message __attribute__((unused)))
++ char* is_null MY_ATTRIBUTE((unused)),
++ char* message MY_ATTRIBUTE((unused)))
+ {
+ My_median_data *data=
+ static_cast<My_median_data*>(static_cast<void*>(initid->ptr));
[email protected]@ -1197,8 +1197,8 @@ void my_median_add(UDF_INIT* initid, UDF_ARGS* args,
+ }
+
+ void my_median_clear(UDF_INIT* initid, UDF_ARGS* args,
+- char* is_null __attribute__((unused)),
+- char* message __attribute__((unused)))
++ char* is_null MY_ATTRIBUTE((unused)),
++ char* message MY_ATTRIBUTE((unused)))
+ {
+ My_median_data *data=
+ static_cast<My_median_data*>(static_cast<void*>(initid->ptr));
[email protected]@ -1207,7 +1207,7 @@ void my_median_clear(UDF_INIT* initid, UDF_ARGS* args,
+
+ longlong my_median(UDF_INIT* initid, UDF_ARGS* args,
+ char* is_null,
+- char* message __attribute__((unused)))
++ char* message MY_ATTRIBUTE((unused)))
+ {
+ My_median_data *data=
+ static_cast<My_median_data*>(static_cast<void*>(initid->ptr));
+--- a/storage/archive/archive_reader.c
++++ b/storage/archive/archive_reader.c
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -22,6 +22,7 @@
+ #include <m_string.h>
+ #include <my_getopt.h>
+ #include <mysql_version.h>
++#include <welcome_copyright_notice.h> // ORACLE_WELCOME_COPYRIGHT_NOTICE
+
+ #define BUFFER_LEN 1024
+ #define ARCHIVE_ROW_HEADER_SIZE 4
[email protected]@ -292,7 +293,7 @@ end:
+
+ static my_bool
+ get_one_option(int optid,
+- const struct my_option *opt __attribute__((unused)),
++ const struct my_option *opt MY_ATTRIBUTE((unused)),
+ char *argument)
+ {
+ switch (optid) {
[email protected]@ -388,8 +389,8 @@ static struct my_option my_long_options[] =
+ static void usage(void)
+ {
+ print_version();
+- puts("Copyright 2007-2008 MySQL AB, 2008 Sun Microsystems, Inc.");
+- puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license\n");
++ puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2007"));
++
+ puts("Read and modify Archive files directly\n");
+ printf("Usage: %s [OPTIONS] file_to_be_looked_at [file_for_backup]\n", my_progname);
+ print_defaults("my", load_default_groups);
+--- a/storage/blackhole/ha_blackhole.cc
++++ b/storage/blackhole/ha_blackhole.cc
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -383,7 +383,7 @@ static void blackhole_free_key(st_blackhole_share *share)
+ }
+
+ static uchar* blackhole_get_key(st_blackhole_share *share, size_t *length,
+- my_bool not_used __attribute__((unused)))
++ my_bool not_used MY_ATTRIBUTE((unused)))
+ {
+ *length= share->table_name_length;
+ return (uchar*) share->table_name;
+--- a/storage/csv/ha_tina.cc
++++ b/storage/csv/ha_tina.cc
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -102,7 +102,7 @@ int sort_set (tina_set *a, tina_set *b)
+ }
+
+ static uchar* tina_get_key(TINA_SHARE *share, size_t *length,
+- my_bool not_used __attribute__((unused)))
++ my_bool not_used MY_ATTRIBUTE((unused)))
+ {
+ *length=share->table_name_length;
+ return (uchar*) share->table_name;
+--- a/storage/example/ha_example.cc
++++ b/storage/example/ha_example.cc
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -436,9 +436,9 @@ int ha_example::delete_row(const uchar *buf)
+ */
+
+ int ha_example::index_read_map(uchar *buf, const uchar *key,
+- key_part_map keypart_map __attribute__((unused)),
++ key_part_map keypart_map MY_ATTRIBUTE((unused)),
+ enum ha_rkey_function find_flag
+- __attribute__((unused)))
++ MY_ATTRIBUTE((unused)))
+ {
+ int rc;
+ DBUG_ENTER("ha_example::index_read");
+--- a/storage/federated/ha_federated.cc
++++ b/storage/federated/ha_federated.cc
[email protected]@ -425,7 +425,7 @@ static handler *federated_create_handler(handlerton *hton,
+ /* Function we use in the creation of our hash to get key */
+
+ static uchar *federated_get_key(FEDERATED_SHARE *share, size_t *length,
+- my_bool not_used __attribute__ ((unused)))
++ my_bool not_used MY_ATTRIBUTE ((unused)))
+ {
+ *length= share->share_key_length;
+ return (uchar*) share->share_key;
[email protected]@ -2743,7 +2743,7 @@ int ha_federated::read_next(uchar *buf, MYSQL_RES *result)
+ @param[in] record record data (unused)
+ */
+
+-void ha_federated::position(const uchar *record __attribute__ ((unused)))
++void ha_federated::position(const uchar *record MY_ATTRIBUTE ((unused)))
+ {
+ DBUG_ENTER("ha_federated::position");
+
+--- a/storage/heap/hp_hash.c
++++ b/storage/heap/hp_hash.c
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
[email protected]@ -867,7 +867,7 @@ uint hp_rb_pack_key(HP_KEYDEF *keydef, uchar *key, const uchar *old,
+
+
+ uint hp_rb_key_length(HP_KEYDEF *keydef,
+- const uchar *key __attribute__((unused)))
++ const uchar *key MY_ATTRIBUTE((unused)))
+ {
+ return keydef->length;
+ }
+--- a/storage/heap/hp_test2.c
++++ b/storage/heap/hp_test2.c
[email protected]@ -1,4 +1,4 @@
+-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
++/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
+ reserved
+
+ This program is free software; you can redistribute it and/or modify
[email protected]@ -660,7 +660,7 @@ static int rnd(int max_value)
+ } /* rnd */
+
+
+-static sig_handler endprog(int sig_number __attribute__((unused)))
++static sig_handler endprog(int sig_number MY_ATTRIBUTE((unused)))
+ {
+ {
+ hp_panic(HA_PANIC_CLOSE);
+--- a/storage/innobase/btr/btr0btr.cc
++++ b/storage/innobase/btr/btr0btr.cc
[email protected]@ -1,6 +1,6 @@
+ /*****************************************************************************
+
+-Copyright (c) 1994, 2015, Oracle and/or its affiliates. All Rights Reserved.
++Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved.
+ Copyright (c) 2012, Facebook Inc.
+
+ This program is free software; you can redistribute it and/or modify it under
[email protected]@ -1102,7 +1102,7 @@ that the caller has made the reservation for free extents!
+ @retval block, rw_lock_x_lock_count(&block->lock) == 1 if allocation succeeded
+ (init_mtr == mtr, or the page was not previously freed in mtr)
+ @retval block (not allocated or initialized) otherwise */
+-static __attribute__((nonnull, warn_unused_result))
++static MY_ATTRIBUTE((nonnull, warn_unused_result))
+ buf_block_t*
+ btr_page_alloc_low(
+ /*===============*/
[email protected]@ -1971,7 +1971,7 @@ IBUF_BITMAP_FREE is unaffected by reorganization.
+
+ @retval true if the operation was successful
+ @retval false if it is a compressed page, and recompression failed */
+-static __attribute__((nonnull))
++static MY_ATTRIBUTE((nonnull))
+ bool
+ btr_page_reorganize_block(
+ /*======================*/
[email protected]@ -2500,7 +2500,7 @@ func_exit:
+ Returns TRUE if the insert fits on the appropriate half-page with the
+ chosen split_rec.
+ @return true if fits */
+-static __attribute__((nonnull(1,3,4,6), warn_unused_result))
++static MY_ATTRIBUTE((nonnull(1,3,4,6), warn_unused_result))
+ bool
+ btr_page_insert_fits(
+ /*=================*/
[email protected]@ -2643,7 +2643,7 @@ btr_insert_on_non_leaf_level_func(
+ /**************************************************************//**
+ Attaches the halves of an index page on the appropriate level in an
+ index tree. */
+-static __attribute__((nonnull))
++static MY_ATTRIBUTE((nonnull))
+ void
+ btr_attach_half_pages(
+ /*==================*/
[email protected]@ -2779,7 +2779,7 @@ btr_attach_half_pages(
+ /*************************************************************//**
+ Determine if a tuple is smaller than any record on the page.
+ @return TRUE if smaller */
+-static __attribute__((nonnull, warn_unused_result))
++static MY_ATTRIBUTE((nonnull, warn_unused_result))
+ bool
+ btr_page_tuple_smaller(
+ /*===================*/
[email protected]@ -3355,7 +3355,7 @@ Removes a page from the level list of pages.
+
+ /*************************************************************//**
+ Removes a page from the level list of pages. */
+-static __attribute__((nonnull))
++static MY_ATTRIBUTE((nonnull))
+ void
+ btr_level_list_remove_func(
+ /*=======================*/
+--- a/storage/innobase/btr/btr0cur.cc
++++ b/storage/innobase/btr/btr0cur.cc
[email protected]@ -1,6 +1,6 @@
+ /*****************************************************************************
+
+-Copyright (c) 1994, 2015, Oracle and/or its affiliates. All Rights Reserved.
++Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved.
+ Copyright (c) 2008, Google Inc.
+ Copyright (c) 2012, Facebook Inc.
+
[email protected]@ -1084,7 +1084,7 @@ This has to be done either within the same mini-transaction,
+ or by invoking ibuf_reset_free_bits() before mtr_commit().
+
+ @return pointer to inserted record if succeed, else NULL */
+-static __attribute__((nonnull, warn_unused_result))
++static MY_ATTRIBUTE((nonnull, warn_unused_result))
+ rec_t*
+ btr_cur_insert_if_possible(
+ /*=======================*/
[email protected]@ -1127,7 +1127,7 @@ btr_cur_insert_if_possible(
+ /*************************************************************//**
+ For an insert, checks the locks and does the undo logging if desired.
+ @return DB_SUCCESS, DB_WAIT_LOCK, DB_FAIL, or error number */
+-UNIV_INLINE __attribute__((warn_unused_result, nonnull(2,3,5,6)))
++UNIV_INLINE MY_ATTRIBUTE((warn_unused_result, nonnull(2,3,5,6)))
+ dberr_t
+ btr_cur_ins_lock_and_undo(
+ /*======================*/
[email protected]@ -1653,7 +1653,7 @@ btr_cur_pessimistic_insert(
+ /*************************************************************//**
+ For an update, checks the locks and does the undo logging.
+ @return DB_SUCCESS, DB_WAIT_LOCK, or error number */
+-UNIV_INLINE __attribute__((warn_unused_result, nonnull(2,3,6,7)))
++UNIV_INLINE MY_ATTRIBUTE((warn_unused_result, nonnull(2,3,6,7)))
+ dberr_t
+ btr_cur_upd_lock_and_undo(
+ /*======================*/
[email protected]@ -4992,7 +4992,7 @@ btr_free_externally_stored_field(
+ ulint i, /*!< in: field number of field_ref;
+ ignored if rec == NULL */
+ enum trx_rb_ctx rb_ctx, /*!< in: rollback context */
+- mtr_t* local_mtr __attribute__((unused))) /*!< in: mtr
++ mtr_t* local_mtr MY_ATTRIBUTE((unused))) /*!< in: mtr
+ containing the latch to data an an
+ X-latch to the index tree */
+ {
+--- a/storage/innobase/btr/btr0sea.cc
++++ b/storage/innobase/btr/btr0sea.cc
[email protected]@ -1,6 +1,6 @@
+ /*****************************************************************************
+
+-Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved.
++Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
+ Copyright (c) 2008, Google Inc.
+
+ Portions of this file contain modifications contributed and copyrighted by
[email protected]@ -473,7 +473,7 @@ btr_search_update_block_hash_info(
+ /*==============================*/
+ btr_search_t* info, /*!< in: search info */
+ buf_block_t* block, /*!< in: buffer block */
+- btr_cur_t* cursor __attribute__((unused)))
++ btr_cur_t* cursor MY_ATTRIBUTE((unused)))
+ /*!< in: cursor */
+ {
+ #ifdef UNIV_SYNC_DEBUG
+--- a/storage/innobase/buf/buf0buddy.cc
++++ b/storage/innobase/buf/buf0buddy.cc
[email protected]@ -1,6 +1,6 @@
+ /*****************************************************************************
+
+-Copyright (c) 2006, 2013, Oracle and/or its affiliates. All Rights Reserved.
++Copyright (c) 2006, 2016, Oracle and/or its affiliates. All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free Software
[email protected]@ -112,7 +112,7 @@ buf_buddy_mem_invalid(
+ /**********************************************************************//**
+ Check if a buddy is stamped free.
+ @return whether the buddy is free */
+-UNIV_INLINE __attribute__((warn_unused_result))
++UNIV_INLINE MY_ATTRIBUTE((warn_unused_result))
+ bool
+ buf_buddy_stamp_is_free(
+ /*====================*/
[email protected]@ -225,7 +225,7 @@ Checks if a buf is free i.e.: in the zip_free[].
+ @retval BUF_BUDDY_STATE_FREE if fully free
+ @retval BUF_BUDDY_STATE_USED if currently in use
+ @retval BUF_BUDDY_STATE_PARTIALLY_USED if partially in use. */
+-static __attribute__((warn_unused_result))
++static MY_ATTRIBUTE((warn_unused_result))
+ buf_buddy_state_t
+ buf_buddy_is_free(
+ /*==============*/
+--- a/storage/innobase/buf/buf0buf.cc
++++ b/storage/innobase/buf/buf0buf.cc
[email protected]@ -1,6 +1,6 @@
+ /*****************************************************************************
+
+-Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved.
++Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
+ Copyright (c) 2008, Google Inc.
+
+ Portions of this file contain modifications contributed and copyrighted by
[email protected]@ -3470,7 +3470,7 @@ buf_page_init_low(
+
+ /********************************************************************//**
+ Inits a page to the buffer buf_pool. */
+-static __attribute__((nonnull))
++static MY_ATTRIBUTE((nonnull))
+ void
+ buf_page_init(
+ /*==========*/
+--- a/storage/innobase/buf/buf0dump.cc
++++ b/storage/innobase/buf/buf0dump.cc
[email protected]@ -1,6 +1,6 @@
+ /*****************************************************************************
+
+-Copyright (c) 2011, 2015, Oracle and/or its affiliates. All Rights Reserved.
++Copyright (c) 2011, 2016, Oracle and/or its affiliates. All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free Software
[email protected]@ -105,7 +105,7 @@ SELECT variable_value FROM information_schema.global_status WHERE
+ variable_name = 'INNODB_BUFFER_POOL_DUMP_STATUS';
+ or by:
+ SHOW STATUS LIKE 'innodb_buffer_pool_dump_status'; */
+-static __attribute__((nonnull, format(printf, 2, 3)))
++static MY_ATTRIBUTE((nonnull, format(printf, 2, 3)))
+ void
+ buf_dump_status(
+ /*============*/
[email protected]@ -141,7 +141,7 @@ SELECT variable_value FROM information_schema.global_status WHERE
+ variable_name = 'INNODB_BUFFER_POOL_LOAD_STATUS';
+ or by:
+ SHOW STATUS LIKE 'innodb_buffer_pool_load_status'; */
+-static __attribute__((nonnull, format(printf, 2, 3)))
++static MY_ATTRIBUTE((nonnull, format(printf, 2, 3)))
+ void
+ buf_load_status(
+ /*============*/
[email protected]@ -594,7 +594,7 @@ extern "C" UNIV_INTERN
+ os_thread_ret_t
+ DECLARE_THREAD(buf_dump_thread)(
+ /*============================*/
+- void* arg __attribute__((unused))) /*!< in: a dummy parameter
++ void* arg MY_ATTRIBUTE((unused))) /*!< in: a dummy parameter
+ required by os_thread_create */
+ {
+ ut_ad(!srv_read_only_mode);
+--- a/storage/innobase/buf/buf0flu.cc
++++ b/storage/innobase/buf/buf0flu.cc
[email protected]@ -1,6 +1,6 @@
+ /*****************************************************************************
+
+-Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved.
++Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free Software
[email protected]@ -2384,7 +2384,7 @@ extern "C" UNIV_INTERN
+ os_thread_ret_t
+ DECLARE_THREAD(buf_flush_page_cleaner_thread)(
+ /*==========================================*/
+- void* arg __attribute__((unused)))
++ void* arg MY_ATTRIBUTE((unused)))
+ /*!< in: a dummy parameter required by
+ os_thread_create */
+ {
+--- a/storage/innobase/buf/buf0lru.cc
++++ b/storage/innobase/buf/buf0lru.cc
[email protected]@ -1,6 +1,6 @@
+ /*****************************************************************************
+
+-Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved.
++Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free Software
[email protected]@ -142,7 +142,7 @@ If a compressed page is freed other compressed pages may be relocated.
+ caller needs to free the page to the free list
+ @retval false if BUF_BLOCK_ZIP_PAGE was removed from page_hash. In
+ this case the block is already returned to the buddy allocator. */
+-static __attribute__((nonnull, warn_unused_result))
++static MY_ATTRIBUTE((nonnull, warn_unused_result))
+ bool
+ buf_LRU_block_remove_hashed(
+ /*========================*/
[email protected]@ -366,7 +366,7 @@ want to hog the CPU and resources. Release the buffer pool and block
+ mutex and try to force a context switch. Then reacquire the same mutexes.
+ The current page is "fixed" before the release of the mutexes and then
+ "unfixed" again once we have reacquired the mutexes. */
+-static __attribute__((nonnull))
++static MY_ATTRIBUTE((nonnull))
+ void
+ buf_flush_yield(
+ /*============*/
[email protected]@ -407,7 +407,7 @@ If we have hogged the resources for too long then release the buffer
+ pool and flush list mutex and do a thread yield. Set the current page
+ to "sticky" so that it is not relocated during the yield.
+ @return true if yielded */
+-static __attribute__((nonnull(1), warn_unused_result))
++static MY_ATTRIBUTE((nonnull(1), warn_unused_result))
+ bool
+ buf_flush_try_yield(
+ /*================*/
[email protected]@ -450,7 +450,7 @@ buf_flush_try_yield(
+ Removes a single page from a given tablespace inside a specific
+ buffer pool instance.
+ @return true if page was removed. */
+-static __attribute__((nonnull, warn_unused_result))
++static MY_ATTRIBUTE((nonnull, warn_unused_result))
+ bool
+ buf_flush_or_remove_page(
+ /*=====================*/
[email protected]@ -531,7 +531,7 @@ the list as they age towards the tail of the LRU.
+ @retval DB_SUCCESS if all freed
+ @retval DB_FAIL if not all freed
+ @retval DB_INTERRUPTED if the transaction was interrupted */
+-static __attribute__((nonnull(1), warn_unused_result))
++static MY_ATTRIBUTE((nonnull(1), warn_unused_result))
+ dberr_t
+ buf_flush_or_remove_pages(
+ /*======================*/
[email protected]@ -637,7 +637,7 @@ Remove or flush all the dirty pages that belong to a given tablespace
+ inside a specific buffer pool instance. The pages will remain in the LRU
+ list and will be evicted from the LRU list as they age and move towards
+ the tail of the LRU list. */
+-static __attribute__((nonnull(1)))
++static MY_ATTRIBUTE((nonnull(1)))
+ void
+ buf_flush_dirty_pages(
+ /*==================*/
[email protected]@ -677,7 +677,7 @@ buf_flush_dirty_pages(
+ /******************************************************************//**
+ Remove all pages that belong to a given tablespace inside a specific
+ buffer pool instance when we are DISCARDing the tablespace. */
+-static __attribute__((nonnull))
++static MY_ATTRIBUTE((nonnull))
+ void
+ buf_LRU_remove_all_pages(
+ /*=====================*/
[email protected]@ -825,7 +825,7 @@ buffer pool instance when we are deleting the data file(s) of that
+ tablespace. The pages still remain a part of LRU and are evicted from
+ the list as they age towards the tail of the LRU only if buf_remove
+ is BUF_REMOVE_FLUSH_NO_WRITE. */
+-static __attribute__((nonnull(1)))
++static MY_ATTRIBUTE((nonnull(1)))
+ void
+ buf_LRU_remove_pages(
+ /*=================*/
+--- a/storage/innobase/data/data0data.cc
++++ b/storage/innobase/data/data0data.cc
[email protected]@ -1,6 +1,6 @@
+ /*****************************************************************************
+
+-Copyright (c) 1994, 2012, Oracle and/or its affiliates. All Rights Reserved.
++Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free Software
[email protected]@ -715,7 +715,7 @@ UNIV_INTERN
+ void
+ dtuple_convert_back_big_rec(
+ /*========================*/
+- dict_index_t* index __attribute__((unused)), /*!< in: index */
++ dict_index_t* index MY_ATTRIBUTE((unused)), /*!< in: index */
+ dtuple_t* entry, /*!< in: entry whose data was put to vector */
+ big_rec_t* vector) /*!< in, own: big rec vector; it is
+ freed in this function */
+--- a/storage/innobase/dict/dict0crea.cc
++++ b/storage/innobase/dict/dict0crea.cc
[email protected]@ -1,6 +1,6 @@
+ /*****************************************************************************
+
+-Copyright (c) 1996, 2014, Oracle and/or its affiliates. All Rights Reserved.
++Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free Software
[email protected]@ -246,7 +246,7 @@ dict_create_sys_columns_tuple(
+ /***************************************************************//**
+ Builds a table definition to insert.
+ @return DB_SUCCESS or error code */
+-static __attribute__((nonnull, warn_unused_result))
++static MY_ATTRIBUTE((nonnull, warn_unused_result))
+ dberr_t
+ dict_build_table_def_step(
+ /*======================*/
[email protected]@ -573,7 +573,7 @@ dict_create_search_tuple(
+ /***************************************************************//**
+ Builds an index definition row to insert.
+ @return DB_SUCCESS or error code */
+-static __attribute__((nonnull, warn_unused_result))
++static MY_ATTRIBUTE((nonnull, warn_unused_result))
+ dberr_t
+ dict_build_index_def_step(
+ /*======================*/
[email protected]@ -648,7 +648,7 @@ dict_build_field_def_step(
+ /***************************************************************//**
+ Creates an index tree for the index if it is not a member of a cluster.
+ @return DB_SUCCESS or DB_OUT_OF_FILE_SPACE */
+-static __attribute__((nonnull, warn_unused_result))
++static MY_ATTRIBUTE((nonnull, warn_unused_result))
+ dberr_t
+ dict_create_index_tree_step(
+ /*========================*/
[email protected]@ -1464,7 +1464,7 @@ dict_create_or_check_foreign_constraint_tables(void)
+ /****************************************************************//**
+ Evaluate the given foreign key SQL statement.
+ @return error code or DB_SUCCESS */
+-static __attribute__((nonnull, warn_unused_result))
++static MY_ATTRIBUTE((nonnull, warn_unused_result))
+ dberr_t
+ dict_foreign_eval_sql(
+ /*==================*/
[email protected]@ -1530,7 +1530,7 @@ dict_foreign_eval_sql(
+ Add a single foreign key field definition to the data dictionary tables in
+ the database.
+ @return error code or DB_SUCCESS */
+-static __attribute__((nonnull, warn_unused_result))
++static MY_ATTRIBUTE((nonnull, warn_unused_result))
+ dberr_t
+ dict_create_add_foreign_field_to_dictionary(
+ /*========================================*/
+--- a/storage/innobase/dict/dict0load.cc
++++ b/storage/innobase/dict/dict0load.cc
[email protected]@ -1783,7 +1783,7 @@ Loads definitions for table indexes. Adds them to the data dictionary
+ cache.
+ @return DB_SUCCESS if ok, DB_CORRUPTION if corruption of dictionary
+ table or DB_UNSUPPORTED if table has unknown index type */
+-static __attribute__((nonnull))
++static MY_ATTRIBUTE((nonnull))
+ dberr_t
+ dict_load_indexes(
+ /*==============*/
[email protected]@ -2789,7 +2789,7 @@ dict_load_foreign_cols(
+ /***********************************************************************//**
+ Loads a foreign key constraint to the dictionary cache.
+ @return DB_SUCCESS or error code */
+-static __attribute__((nonnull(1), warn_unused_result))
++static MY_ATTRIBUTE((nonnull(1), warn_unused_result))
+ dberr_t
+ dict_load_foreign(
+ /*==============*/
+--- a/storage/innobase/dict/dict0mem.cc
++++ b/storage/innobase/dict/dict0mem.cc
[email protected]@ -1,6 +1,6 @@
+ /*****************************************************************************
+
+-Copyright (c) 1996, 2015, Oracle and/or its affiliates. All Rights Reserved.
++Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
+ Copyright (c) 2012, Facebook Inc.
+
+ This program is free software; you can redistribute it and/or modify it under
[email protected]@ -264,7 +264,7 @@ dict_mem_table_add_col(
+
+ /**********************************************************************//**
+ Renames a column of a table in the data dictionary cache. */
+-static __attribute__((nonnull))
++static MY_ATTRIBUTE((nonnull))
+ void
+ dict_mem_table_col_rename_low(
+ /*==========================*/
+--- a/storage/innobase/dict/dict0stats_bg.cc
++++ b/storage/innobase/dict/dict0stats_bg.cc
[email protected]@ -1,6 +1,6 @@
+ /*****************************************************************************
+
+-Copyright (c) 2012, 2013, Oracle and/or its affiliates. All Rights Reserved.
++Copyright (c) 2012, 2016, Oracle and/or its affiliates. All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free Software
[email protected]@ -331,7 +331,7 @@ extern "C" UNIV_INTERN
+ os_thread_ret_t
+ DECLARE_THREAD(dict_stats_thread)(
+ /*==============================*/
+- void* arg __attribute__((unused))) /*!< in: a dummy parameter
++ void* arg MY_ATTRIBUTE((unused))) /*!< in: a dummy parameter
+ required by os_thread_create */
+ {
+ ut_a(!srv_read_only_mode);
+--- a/storage/innobase/fil/fil0fil.cc
++++ b/storage/innobase/fil/fil0fil.cc
[email protected]@ -1875,7 +1875,7 @@ fil_set_max_space_id_if_bigger(
+ Writes the flushed lsn and the latest archived log number to the page header
+ of the first page of a data file of the system tablespace (space 0),
+ which is uncompressed. */
+-static __attribute__((warn_unused_result))
++static MY_ATTRIBUTE((warn_unused_result))
+ dberr_t
+ fil_write_lsn_and_arch_no_to_file(
+ /*==============================*/
[email protected]@ -1883,7 +1883,7 @@ fil_write_lsn_and_arch_no_to_file(
+ ulint sum_of_sizes, /*!< in: combined size of previous files
+ in space, in database pages */
+ lsn_t lsn, /*!< in: lsn to write */
+- ulint arch_log_no __attribute__((unused)))
++ ulint arch_log_no MY_ATTRIBUTE((unused)))
+ /*!< in: archived log number to write */
+ {
+ byte* buf1;
[email protected]@ -1970,7 +1970,7 @@ Checks the consistency of the first data page of a tablespace
+ at database startup.
+ @retval NULL on success, or if innodb_force_recovery is set
+ @return pointer to an error message string */
+-static __attribute__((warn_unused_result))
++static MY_ATTRIBUTE((warn_unused_result))
+ const char*
+ fil_check_first_page(
+ /*=================*/
+--- a/storage/innobase/fsp/fsp0fsp.cc
++++ b/storage/innobase/fsp/fsp0fsp.cc
[email protected]@ -1,6 +1,6 @@
+ /*****************************************************************************
+
+-Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved.
++Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free Software
[email protected]@ -93,7 +93,7 @@ fseg_n_reserved_pages_low(
+ /********************************************************************//**
+ Marks a page used. The page must reside within the extents of the given
+ segment. */
+-static __attribute__((nonnull))
++static MY_ATTRIBUTE((nonnull))
+ void
+ fseg_mark_page_used(
+ /*================*/
[email protected]@ -132,7 +132,7 @@ fsp_fill_free_list(
+ ulint space, /*!< in: space */
+ fsp_header_t* header, /*!< in/out: space header */
+ mtr_t* mtr) /*!< in/out: mini-transaction */
+- UNIV_COLD __attribute__((nonnull));
++ UNIV_COLD MY_ATTRIBUTE((nonnull));
+ /**********************************************************************//**
+ Allocates a single free page from a segment. This function implements
+ the intelligent allocation strategy which tries to minimize file space
[email protected]@ -161,7 +161,7 @@ fseg_alloc_free_page_low(
+ in which the page should be initialized.
+ If init_mtr!=mtr, but the page is already
+ latched in mtr, do not initialize the page. */
+- __attribute__((warn_unused_result, nonnull));
++ MY_ATTRIBUTE((warn_unused_result, nonnull));
+ #endif /* !UNIV_HOTBACKUP */
+
+ /**********************************************************************//**
[email protected]@ -425,7 +425,7 @@ descriptor resides is x-locked. This function no longer extends the data
+ file.
+ @return pointer to the extent descriptor, NULL if the page does not
+ exist in the space or if the offset is >= the free limit */
+-UNIV_INLINE __attribute__((nonnull, warn_unused_result))
++UNIV_INLINE MY_ATTRIBUTE((nonnull, warn_unused_result))
+ xdes_t*
+ xdes_get_descriptor_with_space_hdr(
+ /*===============================*/
[email protected]@ -487,7 +487,7 @@ is necessary to make the descriptor defined, as they are uninitialized
+ above the free limit.
+ @return pointer to the extent descriptor, NULL if the page does not
+ exist in the space or if the offset exceeds the free limit */
+-static __attribute__((nonnull, warn_unused_result))
++static MY_ATTRIBUTE((nonnull, warn_unused_result))
+ xdes_t*
+ xdes_get_descriptor(
+ /*================*/
[email protected]@ -614,7 +614,7 @@ byte*
+ fsp_parse_init_file_page(
+ /*=====================*/
+ byte* ptr, /*!< in: buffer */
+- byte* end_ptr __attribute__((unused)), /*!< in: buffer end */
++ byte* end_ptr MY_ATTRIBUTE((unused)), /*!< in: buffer end */
+ buf_block_t* block) /*!< in: block or NULL */
+ {
+ ut_ad(ptr && end_ptr);
[email protected]@ -850,7 +850,7 @@ fsp_header_get_tablespace_size(void)
+ Tries to extend a single-table tablespace so that a page would fit in the
+ data file.
+ @return TRUE if success */
+-static UNIV_COLD __attribute__((nonnull, warn_unused_result))
++static UNIV_COLD MY_ATTRIBUTE((nonnull, warn_unused_result))
+ ibool
+ fsp_try_extend_data_file_with_pages(
+ /*================================*/
[email protected]@ -882,7 +882,7 @@ fsp_try_extend_data_file_with_pages(
+ /***********************************************************************//**
+ Tries to extend the last data file of a tablespace if it is auto-extending.
+ @return FALSE if not auto-extending */
+-static UNIV_COLD __attribute__((nonnull))
++static UNIV_COLD MY_ATTRIBUTE((nonnull))
+ ibool
+ fsp_try_extend_data_file(
+ /*=====================*/
[email protected]@ -1236,7 +1236,7 @@ fsp_alloc_free_extent(
+
+ /**********************************************************************//**
+ Allocates a single free page from a space. */
+-static __attribute__((nonnull))
++static MY_ATTRIBUTE((nonnull))
+ void
+ fsp_alloc_from_free_frag(
+ /*=====================*/
[email protected]@ -1327,7 +1327,7 @@ Allocates a single free page from a space. The page is marked as used.
+ @retval block, rw_lock_x_lock_count(&block->lock) == 1 if allocation succeeded
+ (init_mtr == mtr, or the page was not previously freed in mtr)
+ @retval block (not allocated or initialized) otherwise */
+-static __attribute__((nonnull, warn_unused_result))
++static MY_ATTRIBUTE((nonnull, warn_unused_result))
+ buf_block_t*
+ fsp_alloc_free_page(
+ /*================*/
[email protected]@ -1576,9 +1576,9 @@ fsp_seg_inode_page_get_nth_inode(
+ /*=============================*/
+ page_t* page, /*!< in: segment inode page */
+ ulint i, /*!< in: inode index on page */
+- ulint zip_size __attribute__((unused)),
++ ulint zip_size MY_ATTRIBUTE((unused)),
+ /*!< in: compressed page size, or 0 */
+- mtr_t* mtr __attribute__((unused)))
++ mtr_t* mtr MY_ATTRIBUTE((unused)))
+ /*!< in/out: mini-transaction */
+ {
+ ut_ad(i < FSP_SEG_INODES_PER_PAGE(zip_size));
[email protected]@ -1877,7 +1877,7 @@ fseg_get_nth_frag_page_no(
+ /*======================*/
+ fseg_inode_t* inode, /*!< in: segment inode */
+ ulint n, /*!< in: slot index */
+- mtr_t* mtr __attribute__((unused)))
++ mtr_t* mtr MY_ATTRIBUTE((unused)))
+ /*!< in/out: mini-transaction */
+ {
+ ut_ad(inode && mtr);
[email protected]@ -2958,7 +2958,7 @@ fsp_get_available_space_in_free_extents(
+ /********************************************************************//**
+ Marks a page used. The page must reside within the extents of the given
+ segment. */
+-static __attribute__((nonnull))
++static MY_ATTRIBUTE((nonnull))
+ void
+ fseg_mark_page_used(
+ /*================*/
+--- a/storage/innobase/fts/fts0blex.cc
++++ b/storage/innobase/fts/fts0blex.cc
[email protected]@ -305,9 +305,9 @@ YY_BUFFER_STATE fts0b_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner
+ YY_BUFFER_STATE fts0b_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
+ YY_BUFFER_STATE fts0b_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
+
+-void *fts0balloc (yy_size_t , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) );
+-void *fts0brealloc (void *,yy_size_t , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) );
+-void fts0bfree (void * , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) );
++void *fts0balloc (yy_size_t , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) );
++void *fts0brealloc (void *,yy_size_t , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) );
++void fts0bfree (void * , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) );
+
+ #define yy_new_buffer fts0b_create_buffer
+
[email protected]@ -347,7 +347,7 @@ typedef int yy_state_type;
+ static yy_state_type yy_get_previous_state (yyscan_t yyscanner );
+ static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner);
+ static int yy_get_next_buffer (yyscan_t yyscanner );
+-static void yy_fatal_error (yyconst char msg[] , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) );
++static void yy_fatal_error (yyconst char msg[] , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) );
+
+ /* Done after the current pattern has been matched and before the
+ * corresponding action - sets up yytext.
[email protected]@ -451,7 +451,7 @@ static yyconst flex_int16_t yy_chk[32] =
+ #line 1 "fts0blex.l"
+ /*****************************************************************************
+
+-Copyright (c) 2007, 2014, Oracle and/or its affiliates. All Rights Reserved.
++Copyright (c) 2007, 2016, Oracle and/or its affiliates. All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free Software
[email protected]@ -579,11 +579,11 @@ extern int fts0bwrap (yyscan_t yyscanner );
+ #endif
+
+ #ifndef yytext_ptr
+-static void yy_flex_strncpy (char *,yyconst char *,int , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)));
++static void yy_flex_strncpy (char *,yyconst char *,int , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)));
+ #endif
+
+ #ifdef YY_NEED_STRLEN
+-static int yy_flex_strlen (yyconst char * , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)));
++static int yy_flex_strlen (yyconst char * , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)));
+ #endif
+
+ #ifndef YY_NO_INPUT
[email protected]@ -1609,7 +1609,7 @@ YY_BUFFER_STATE fts0b_scan_bytes (yyconst char * yybytes, int _yybytes_len , y
+ #define YY_EXIT_FAILURE 2
+ #endif
+
+-static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)))
++static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)))
+ {
+ (void) fprintf( stderr, "%s\n", msg );
+ exit( YY_EXIT_FAILURE );
[email protected]@ -1910,7 +1910,7 @@ int fts0blex_destroy (yyscan_t yyscanner)
+ */
+
+ #ifndef yytext_ptr
+-static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)))
++static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)))
+ {
+ register int i;
+ for ( i = 0; i < n; ++i )
[email protected]@ -1919,7 +1919,7 @@ static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yys
+ #endif
+
+ #ifdef YY_NEED_STRLEN
+-static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)))
++static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)))
+ {
+ register int n;
+ for ( n = 0; s[n]; ++n )
[email protected]@ -1929,12 +1929,12 @@ static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner __at
+ }
+ #endif
+
+-void *fts0balloc (yy_size_t size , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)))
++void *fts0balloc (yy_size_t size , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)))
+ {
+ return (void *) malloc( size );
+ }
+
+-void *fts0brealloc (void * ptr, yy_size_t size , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)))
++void *fts0brealloc (void * ptr, yy_size_t size , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)))
+ {
+ /* The cast to (char *) in the following accommodates both
+ * implementations that use char* generic pointers, and those
[email protected]@ -1946,7 +1946,7 @@ void *fts0brealloc (void * ptr, yy_size_t size , yyscan_t yyscanner
+ return (void *) realloc( (char *) ptr, size );
+ }
+
+-void fts0bfree (void * ptr , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)))
++void fts0bfree (void * ptr , yyscan_t yyscanner MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)) MY_ATTRIBUTE((unused)))
+ {
+ free( (char *) ptr ); /* see fts0brealloc() for (char *) cast */
+ }
+--- a/storage/innobase/fts/fts0fts.cc
++++ b/storage/innobase/fts/fts0fts.cc
[email protected]@ -280,7 +280,7 @@ void
+ fts_words_free(
+ /*===========*/
+ ib_rbt_t* words) /*!< in: rb tree of words */
+- __attribute__((nonnull));
++ MY_ATTRIBUTE((nonnull));
+ #ifdef FTS_CACHE_SIZE_DEBUG
+ /****************************************************************//**
+ Read the max cache size parameter from the config table. */
[email protected]@ -302,7 +302,7 @@ fts_add_doc_by_id(
+ /*==============*/
+ fts_trx_table_t*ftt, /*!< in: FTS trx table */
+ doc_id_t doc_id, /*!< in: doc id */
+- ib_vector_t* fts_indexes __attribute__((unused)));
++ ib_vector_t* fts_indexes MY_ATTRIBUTE((unused)));
+ /*!< in: affected fts indexes */
+ #ifdef FTS_DOC_STATS_DEBUG
+ /****************************************************************//**
[email protected]@ -317,7 +317,7 @@ fts_is_word_in_index(
+ fts_table_t* fts_table, /*!< in: table instance */
+ const fts_string_t* word, /*!< in: the word to check */
+ ibool* found) /*!< out: TRUE if exists */
+- __attribute__((nonnull, warn_unused_result));
++ MY_ATTRIBUTE((nonnull, warn_unused_result));
+ #endif /* FTS_DOC_STATS_DEBUG */
+
+ /******************************************************************//**
[email protected]@ -332,7 +332,7 @@ fts_update_sync_doc_id(
+ const char* table_name, /*!< in: table name, or NULL */
+ doc_id_t doc_id, /*!< in: last document id */
+ trx_t* trx) /*!< in: update trx, or NULL */
+- __attribute__((nonnull(1)));
++ MY_ATTRIBUTE((nonnull(1)));
+
+ /****************************************************************//**
+ This function loads the default InnoDB stopword list */
[email protected]@ -1477,7 +1477,7 @@ fts_cache_add_doc(
+ /****************************************************************//**
+ Drops a table. If the table can't be found we return a SUCCESS code.
+ @return DB_SUCCESS or error code */
+-static __attribute__((nonnull, warn_unused_result))
++static MY_ATTRIBUTE((nonnull, warn_unused_result))
+ dberr_t
+ fts_drop_table(
+ /*===========*/
[email protected]@ -1519,7 +1519,7 @@ fts_drop_table(
+ /****************************************************************//**
+ Rename a single auxiliary table due to database name change.
+ @return DB_SUCCESS or error code */
+-static __attribute__((nonnull, warn_unused_result))
++static MY_ATTRIBUTE((nonnull, warn_unused_result))
+ dberr_t
+ fts_rename_one_aux_table(
+ /*=====================*/
[email protected]@ -1628,7 +1628,7 @@ Drops the common ancillary tables needed for supporting an FTS index
+ on the given table. row_mysql_lock_data_dictionary must have been called
+ before this.
+ @return DB_SUCCESS or error code */
+-static __attribute__((nonnull, warn_unused_result))
++static MY_ATTRIBUTE((nonnull, warn_unused_result))
+ dberr_t
+ fts_drop_common_tables(
+ /*===================*/
[email protected]@ -1755,7 +1755,7 @@ Drops FTS ancillary tables needed for supporting an FTS index
+ on the given table. row_mysql_lock_data_dictionary must have been called
+ before this.
+ @return DB_SUCCESS or error code */
+-static __attribute__((nonnull, warn_unused_result))
++static MY_ATTRIBUTE((nonnull, warn_unused_result))
+ dberr_t
+ fts_drop_all_index_tables(
+ /*======================*/
[email protected]@ -2663,7 +2663,7 @@ fts_get_next_doc_id(
+ This function fetch the Doc ID from CONFIG table, and compare with
+ the Doc ID supplied. And store the larger one to the CONFIG table.
+ @return DB_SUCCESS if OK */
+-static __attribute__((nonnull))
++static MY_ATTRIBUTE((nonnull))
+ dberr_t
+ fts_cmp_set_sync_doc_id(
+ /*====================*/
[email protected]@ -2917,7 +2917,7 @@ fts_add(
+ /*********************************************************************//**
+ Do commit-phase steps necessary for the deletion of a row.
+ @return DB_SUCCESS or error code */
+-static __attribute__((nonnull, warn_unused_result))
++static MY_ATTRIBUTE((nonnull, warn_unused_result))
+ dberr_t
+ fts_delete(
+ /*=======*/
[email protected]@ -3008,7 +3008,7 @@ fts_delete(
+ /*********************************************************************//**
+ Do commit-phase steps necessary for the modification of a row.
+ @return DB_SUCCESS or error code */
+-static __attribute__((nonnull, warn_unused_result))
++static MY_ATTRIBUTE((nonnull, warn_unused_result))
+ dberr_t
+ fts_modify(
+ /*=======*/
[email protected]@ -3079,7 +3079,7 @@ fts_create_doc_id(
+ The given transaction is about to be committed; do whatever is necessary
+ from the FTS system's POV.
+ @return DB_SUCCESS or error code */
+-static __attribute__((nonnull, warn_unused_result))
++static MY_ATTRIBUTE((nonnull, warn_unused_result))
+ dberr_t
+ fts_commit_table(
+ /*=============*/
[email protected]@ -3412,7 +3412,7 @@ fts_add_doc_by_id(
+ /*==============*/
+ fts_trx_table_t*ftt, /*!< in: FTS trx table */
+ doc_id_t doc_id, /*!< in: doc id */
+- ib_vector_t* fts_indexes __attribute__((unused)))
++ ib_vector_t* fts_indexes MY_ATTRIBUTE((unused)))
+ /*!< in: affected fts indexes */
+ {
+ mtr_t mtr;
[email protected]@ -3532,7 +3532,7 @@ fts_add_doc_by_id(
+ get_doc, clust_index, doc_pcur, offsets, &doc);
+
+ if (doc.found) {
+- ibool success __attribute__((unused));
++ ibool success MY_ATTRIBUTE((unused));
+
+ btr_pcur_store_position(doc_pcur, &mtr);
+ mtr_commit(&mtr);
[email protected]@ -3641,7 +3641,7 @@ fts_get_max_doc_id(
+ dict_table_t* table) /*!< in: user table */
+ {
+ dict_index_t* index;
+- dict_field_t* dfield __attribute__((unused)) = NULL;
++ dict_field_t* dfield MY_ATTRIBUTE((unused)) = NULL;
+ doc_id_t doc_id = 0;
+ mtr_t mtr;
+ btr_pcur_t pcur;
[email protected]@ -3899,7 +3899,7 @@ fts_write_node(
+ /*********************************************************************//**
+ Add rows to the DELETED_CACHE table.
+ @return DB_SUCCESS if all went well else error code*/
+-static __attribute__((nonnull, warn_unused_result))
++static MY_ATTRIBUTE((nonnull, warn_unused_result))
+ dberr_t
+ fts_sync_add_deleted_cache(
+ /*=======================*/
[email protected]@ -3953,7 +3953,7 @@ fts_sync_add_deleted_cache(
+ @param[in] index_cache index cache
+ @param[in] unlock_cache whether unlock cache when write node
+ @return DB_SUCCESS if all went well else error code */
+-static __attribute__((nonnull, warn_unused_result))
++static MY_ATTRIBUTE((nonnull, warn_unused_result))
+ dberr_t
+ fts_sync_write_words(
+ trx_t* trx,
[email protected]@ -4089,7 +4089,7 @@ fts_sync_write_words(
+ /*********************************************************************//**
+ Write a single documents statistics to disk.
+ @return DB_SUCCESS if all went well else error code */
+-static __attribute__((nonnull, warn_unused_result))
++static MY_ATTRIBUTE((nonnull, warn_unused_result))
+ dberr_t
+ fts_sync_write_doc_stat(
+ /*====================*/
[email protected]@ -4343,7 +4343,7 @@ fts_sync_begin(
+ Run SYNC on the table, i.e., write out data from the index specific
+ cache to the FTS aux INDEX table and FTS aux doc id stats table.
+ @return DB_SUCCESS if all OK */
+-static __attribute__((nonnull, warn_unused_result))
++static MY_ATTRIBUTE((nonnull, warn_unused_result))
+ dberr_t
+ fts_sync_index(
+ /*===========*/
[email protected]@ -4411,7 +4411,7 @@ fts_sync_index_check(
+ /*********************************************************************//**
+ Commit the SYNC, change state of processed doc ids etc.
+ @return DB_SUCCESS if all OK */
+-static __attribute__((nonnull, warn_unused_result))
++static MY_ATTRIBUTE((nonnull, warn_unused_result))
+ dberr_t
+ fts_sync_commit(
+ /*============*/
[email protected]@ -6169,7 +6169,7 @@ fts_update_hex_format_flag(
+ /*********************************************************************//**
+ Rename an aux table to HEX format. It's called when "%016llu" is used
+ to format an object id in table name, which only happens in Windows. */
+-static __attribute__((nonnull, warn_unused_result))
++static MY_ATTRIBUTE((nonnull, warn_unused_result))
+ dberr_t
+ fts_rename_one_aux_table_to_hex_format(
+ /*===================================*/
[email protected]@ -6260,7 +6260,7 @@ Note the ids in tables are correct but the names are old ambiguous ones.
+
+ This function should make sure that either all the parent table and aux tables
+ are set DICT_TF2_FTS_AUX_HEX_NAME with flags2 or none of them are set */
+-static __attribute__((nonnull, warn_unused_result))
++static MY_ATTRIBUTE((nonnull, warn_unused_result))
+ dberr_t
+ fts_rename_aux_tables_to_hex_format_low(
+ /*====================================*/
[email protected]@ -6414,7 +6414,7 @@ fts_fake_hex_to_dec(
+ {
+ ib_id_t dec_id = 0;
+ char tmp_id[FTS_AUX_MIN_TABLE_ID_LENGTH];
+- int ret __attribute__((unused));
++ int ret MY_ATTRIBUTE((unused));
+
+ ret = sprintf(tmp_id, UINT64PFx, id);
+ ut_ad(ret == 16);
[email protected]@ -6736,7 +6736,7 @@ fts_drop_aux_table_from_vector(
+ Check and drop all orphaned FTS auxiliary tables, those that don't have
+ a parent table or FTS index defined on them.
+ @return DB_SUCCESS or error code */
+-static __attribute__((nonnull))
++static MY_ATTRIBUTE((nonnull))
+ void
+ fts_check_and_drop_orphaned_tables(
+ /*===============================*/
+--- a/storage/innobase/fts/fts0opt.cc
++++ b/storage/innobase/fts/fts0opt.cc
[email protected]@ -797,7 +797,7 @@ fts_zip_deflate_end(
+ Read the words from the FTS INDEX.
+ @return DB_SUCCESS if all OK, DB_TABLE_NOT_FOUND if no more indexes
+ to search else error code */
+-static __attribute__((nonnull, warn_unused_result))
++static MY_ATTRIBUTE((nonnull, warn_unused_result))
+ dberr_t
+ fts_index_fetch_words(
+ /*==================*/
[email protected]@ -1131,7 +1131,7 @@ fts_optimize_lookup(
+ /**********************************************************************//**
+ Encode the word pos list into the node
+ @return DB_SUCCESS or error code*/
+-static __attribute__((nonnull))
++static MY_ATTRIBUTE((nonnull))
+ dberr_t
+ fts_optimize_encode_node(
+ /*=====================*/
[email protected]@ -1220,7 +1220,7 @@ fts_optimize_encode_node(
+ /**********************************************************************//**
+ Optimize the data contained in a node.
+ @return DB_SUCCESS or error code*/
+-static __attribute__((nonnull))
++static MY_ATTRIBUTE((nonnull))
+ dberr_t
+ fts_optimize_node(
+ /*==============*/
[email protected]@ -1318,7 +1318,7 @@ test_again:
+ /**********************************************************************//**
+ Determine the starting pos within the deleted doc id vector for a word.
+ @return delete position */
+-static __attribute__((nonnull, warn_unused_result))
++static MY_ATTRIBUTE((nonnull, warn_unused_result))
+ int
+ fts_optimize_deleted_pos(
+ /*=====================*/
[email protected]@ -1447,7 +1447,7 @@ fts_optimize_word(
+ /**********************************************************************//**
+ Update the FTS index table. This is a delete followed by an insert.
+ @return DB_SUCCESS or error code */
+-static __attribute__((nonnull, warn_unused_result))
++static MY_ATTRIBUTE((nonnull, warn_unused_result))
+ dberr_t
+ fts_optimize_write_word(
+ /*====================*/
[email protected]@ -1550,7 +1550,7 @@ fts_word_free(
+ /**********************************************************************//**
+ Optimize the word ilist and rewrite data to the FTS index.
+ @return status one of RESTART, EXIT, ERROR */
+-static __attribute__((nonnull, warn_unused_result))
++static MY_ATTRIBUTE((nonnull, warn_unused_result))
+ dberr_t
+ fts_optimize_compact(
+ /*=================*/
[email protected]@ -1645,7 +1645,7 @@ fts_optimize_create(
+ /**********************************************************************//**
+ Get optimize start time of an FTS index.
+ @return DB_SUCCESS if all OK else error code */
+-static __attribute__((nonnull, warn_unused_result))
++static MY_ATTRIBUTE((nonnull, warn_unused_result))
+ dberr_t
+ fts_optimize_get_index_start_time(
+ /*==============================*/
[email protected]@ -1661,7 +1661,7 @@ fts_optimize_get_index_start_time(
+ /**********************************************************************//**
+ Set the optimize start time of an FTS index.
+ @return DB_SUCCESS if all OK else error code */
+-static __attribute__((nonnull, warn_unused_result))
++static MY_ATTRIBUTE((nonnull, warn_unused_result))
+ dberr_t
+ fts_optimize_set_index_start_time(
+ /*==============================*/
[email protected]@ -1677,7 +1677,7 @@ fts_optimize_set_index_start_time(
+ /**********************************************************************//**
+ Get optimize end time of an FTS index.
+ @return DB_SUCCESS if all OK else error code */
+-static __attribute__((nonnull, warn_unused_result))
++static MY_ATTRIBUTE((nonnull, warn_unused_result))
+ dberr_t
+ fts_optimize_get_index_end_time(
+ /*============================*/
[email protected]@ -1692,7 +1692,7 @@ fts_optimize_get_index_end_time(
+ /**********************************************************************//**
+ Set the optimize end time of an FTS index.
+ @return DB_SUCCESS if all OK else error code */
+-static __attribute__((nonnull, warn_unused_result))
++static MY_ATTRIBUTE((nonnull, warn_unused_result))
+ dberr_t
+ fts_optimize_set_index_end_time(
+ /*============================*/
[email protected]@ -1912,7 +1912,7 @@ fts_optimize_set_next_word(
+ Optimize is complete. Set the completion time, and reset the optimize
+ start string for this FTS index to "".
+ @return DB_SUCCESS if all OK */
+-static __attribute__((nonnull, warn_unused_result))
++static MY_ATTRIBUTE((nonnull, warn_unused_result))
+ dberr_t
+ fts_optimize_index_completed(
+ /*=========================*/
[email protected]@ -1952,7 +1952,7 @@ fts_optimize_index_completed(
+ Read the list of words from the FTS auxiliary index that will be
+ optimized in this pass.
+ @return DB_SUCCESS if all OK */
+-static __attribute__((nonnull, warn_unused_result))
++static MY_ATTRIBUTE((nonnull, warn_unused_result))
+ dberr_t
+ fts_optimize_index_read_words(
+ /*==========================*/
[email protected]@ -2009,7 +2009,7 @@ fts_optimize_index_read_words(
+ Run OPTIMIZE on the given FTS index. Note: this can take a very long
+ time (hours).
+ @return DB_SUCCESS if all OK */
+-static __attribute__((nonnull, warn_unused_result))
++static MY_ATTRIBUTE((nonnull, warn_unused_result))
+ dberr_t
+ fts_optimize_index(
+ /*===============*/
[email protected]@ -2080,7 +2080,7 @@ fts_optimize_index(
+ /**********************************************************************//**
+ Delete the document ids in the delete, and delete cache tables.
+ @return DB_SUCCESS if all OK */
+-static __attribute__((nonnull, warn_unused_result))
++static MY_ATTRIBUTE((nonnull, warn_unused_result))
+ dberr_t
+ fts_optimize_purge_deleted_doc_ids(
+ /*===============================*/
[email protected]@ -2149,7 +2149,7 @@ fts_optimize_purge_deleted_doc_ids(
+ /**********************************************************************//**
+ Delete the document ids in the pending delete, and delete tables.
+ @return DB_SUCCESS if all OK */
+-static __attribute__((nonnull, warn_unused_result))
++static MY_ATTRIBUTE((nonnull, warn_unused_result))
+ dberr_t
+ fts_optimize_purge_deleted_doc_id_snapshot(
+ /*=======================================*/
[email protected]@ -2199,7 +2199,7 @@ Copy the deleted doc ids that will be purged during this optimize run
+ to the being deleted FTS auxiliary tables. The transaction is committed
+ upon successfull copy and rolled back on DB_DUPLICATE_KEY error.
+ @return DB_SUCCESS if all OK */
+-static __attribute__((nonnull, warn_unused_result))
++static MY_ATTRIBUTE((nonnull, warn_unused_result))
+ dberr_t
+ fts_optimize_create_deleted_doc_id_snapshot(
+ /*========================================*/
[email protected]@ -2237,7 +2237,7 @@ fts_optimize_create_deleted_doc_id_snapshot(
+ Read in the document ids that are to be purged during optimize. The
+ transaction is committed upon successfully read.
+ @return DB_SUCCESS if all OK */
+-static __attribute__((nonnull, warn_unused_result))
++static MY_ATTRIBUTE((nonnull, warn_unused_result))
+ dberr_t
+ fts_optimize_read_deleted_doc_id_snapshot(
+ /*======================================*/
[email protected]@ -2274,7 +2274,7 @@ Optimze all the FTS indexes, skipping those that have already been
+ optimized, since the FTS auxiliary indexes are not guaranteed to be
+ of the same cardinality.
+ @return DB_SUCCESS if all OK */
+-static __attribute__((nonnull, warn_unused_result))
++static MY_ATTRIBUTE((nonnull, warn_unused_result))
+ dberr_t
+ fts_optimize_indexes(
+ /*=================*/
[email protected]@ -2344,7 +2344,7 @@ fts_optimize_indexes(
+ /*********************************************************************//**
+ Cleanup the snapshot tables and the master deleted table.
+ @return DB_SUCCESS if all OK */
+-static __attribute__((nonnull, warn_unused_result))
++static MY_ATTRIBUTE((nonnull, warn_unused_result))
+ dberr_t
+ fts_optimize_purge_snapshot(
+ /*========================*/
[email protected]@ -2373,7 +2373,7 @@ fts_optimize_purge_snapshot(
+ /*********************************************************************//**
+ Reset the start time to 0 so that a new optimize can be started.
+ @return DB_SUCCESS if all OK */
+-static __attribute__((nonnull, warn_unused_result))
++static MY_ATTRIBUTE((nonnull, warn_unused_result))
+ dberr_t
+ fts_optimize_reset_start_time(
+ /*==========================*/
[email protected]@ -2412,7 +2412,7 @@ fts_optimize_reset_start_time(
+ /*********************************************************************//**
+ Run OPTIMIZE on the given table by a background thread.
+ @return DB_SUCCESS if all OK */
+-static __attribute__((nonnull))
++static MY_ATTRIBUTE((nonnull))
+ dberr_t
+ fts_optimize_table_bk(
+ /*==================*/
+--- a/storage/innobase/fts/fts0que.cc
++++ b/storage/innobase/fts/fts0que.cc
[email protected]@ -1,6 +1,6 @@
+ /*****************************************************************************
+
+-Copyright (c) 2007, 2015, Oracle and/or its affiliates. All Rights Reserved.
++Copyright (c) 2007, 2016, Oracle and/or its affiliates. All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free Software
[email protected]@ -287,7 +287,7 @@ fts_expand_query(
+ dict_index_t* index, /*!< in: FTS index to search */
+ fts_query_t* query) /*!< in: query result, to be freed
+ by the client */
+- __attribute__((nonnull, warn_unused_result));
++ MY_ATTRIBUTE((nonnull, warn_unused_result));
+ /*************************************************************//**
+ This function finds documents that contain all words in a
+ phrase or proximity search. And if proximity search, verify
[email protected]@ -1128,7 +1128,7 @@ cont_search:
+ /*****************************************************************//**
+ Set difference.
+ @return DB_SUCCESS if all go well */
+-static __attribute__((nonnull, warn_unused_result))
++static MY_ATTRIBUTE((nonnull, warn_unused_result))
+ dberr_t
+ fts_query_difference(
+ /*=================*/
[email protected]@ -1220,7 +1220,7 @@ fts_query_difference(
+ /*****************************************************************//**
+ Intersect the token doc ids with the current set.
+ @return DB_SUCCESS if all go well */
+-static __attribute__((nonnull, warn_unused_result))
++static MY_ATTRIBUTE((nonnull, warn_unused_result))
+ dberr_t
+ fts_query_intersect(
+ /*================*/
[email protected]@ -1398,7 +1398,7 @@ fts_query_cache(
+ /*****************************************************************//**
+ Set union.
+ @return DB_SUCCESS if all go well */
+-static __attribute__((nonnull, warn_unused_result))
++static MY_ATTRIBUTE((nonnull, warn_unused_result))
+ dberr_t
+ fts_query_union(
+ /*============*/
[email protected]@ -2014,7 +2014,7 @@ fts_query_select(
+ Read the rows from the FTS index, that match word and where the
+ doc id is between first and last doc id.
+ @return DB_SUCCESS if all go well else error code */
+-static __attribute__((nonnull, warn_unused_result))
++static MY_ATTRIBUTE((nonnull, warn_unused_result))
+ dberr_t
+ fts_query_find_term(
+ /*================*/
[email protected]@ -2154,7 +2154,7 @@ fts_query_sum(
+ /********************************************************************
+ Calculate the total documents that contain a particular word (term).
+ @return DB_SUCCESS if all go well else error code */
+-static __attribute__((nonnull, warn_unused_result))
++static MY_ATTRIBUTE((nonnull, warn_unused_result))
+ dberr_t
+ fts_query_total_docs_containing_term(
+ /*=================================*/
[email protected]@ -2233,7 +2233,7 @@ fts_query_total_docs_containing_term(
+ /********************************************************************
+ Get the total number of words in a documents.
+ @return DB_SUCCESS if all go well else error code */
+-static __attribute__((nonnull, warn_unused_result))
++static MY_ATTRIBUTE((nonnull, warn_unused_result))
+ dberr_t
+ fts_query_terms_in_document(
+ /*========================*/
[email protected]@ -2314,7 +2314,7 @@ fts_query_terms_in_document(
+ /*****************************************************************//**
+ Retrieve the document and match the phrase tokens.
+ @return DB_SUCCESS or error code */
+-static __attribute__((nonnull, warn_unused_result))
++static MY_ATTRIBUTE((nonnull, warn_unused_result))
+ dberr_t
+ fts_query_match_document(
+ /*=====================*/
[email protected]@ -2360,7 +2360,7 @@ fts_query_match_document(
+ This function fetches the original documents and count the
+ words in between matching words to see that is in specified distance
+ @return DB_SUCCESS if all OK */
+-static __attribute__((nonnull, warn_unused_result))
++static MY_ATTRIBUTE((nonnull, warn_unused_result))
+ bool
+ fts_query_is_in_proximity_range(
+ /*============================*/
[email protected]@ -2415,7 +2415,7 @@ fts_query_is_in_proximity_range(
+ Iterate over the matched document ids and search the for the
+ actual phrase in the text.
+ @return DB_SUCCESS if all OK */
+-static __attribute__((nonnull, warn_unused_result))
++static MY_ATTRIBUTE((nonnull, warn_unused_result))
+ dberr_t
+ fts_query_search_phrase(
+ /*====================*/
[email protected]@ -2503,7 +2503,7 @@ func_exit:
+ /*****************************************************************//**
+ Text/Phrase search.
+ @return DB_SUCCESS or error code */
+-static __attribute__((nonnull, warn_unused_result))
++static MY_ATTRIBUTE((nonnull, warn_unused_result))
+ dberr_t
+ fts_query_phrase_search(
+ /*====================*/
[email protected]@ -2754,7 +2754,7 @@ func_exit:
+ /*****************************************************************//**
+ Find the word and evaluate.
+ @return DB_SUCCESS if all go well */
+-static __attribute__((nonnull, warn_unused_result))
++static MY_ATTRIBUTE((nonnull, warn_unused_result))
+ dberr_t
+ fts_query_execute(
+ /*==============*/
[email protected]@ -4123,7 +4123,7 @@ words in documents found in the first search pass will be used as
+ search arguments to search the document again, thus "expand"
+ the search result set.
+ @return DB_SUCCESS if success, otherwise the error code */
+-static __attribute__((nonnull, warn_unused_result))
++static MY_ATTRIBUTE((nonnull, warn_unused_result))
+ dberr_t
+ fts_expand_query(
+ /*=============*/
+--- a/storage/innobase/fts/fts0tlex.cc
++++ b/storage/innobase/fts/fts0tlex.cc
[email protected]@ -305,9 +305,9 @@ YY_BUFFER_STATE fts0t_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner
+ YY_BUFFER_STATE fts0t_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
+ YY_BUFFER_STATE fts0t_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
+
+-void *fts0talloc (yy_size_t , yyscan_t yyscanner __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) __attribute__((unused)) _