From 915bdfbea873dd064edc28905945f2f098bb83e2 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 17 Aug 2006 12:25:40 -0700 Subject: Bug #2717: include/my_global.h mis-defines __attribute__ Fix when __attribute__() is stubbed out, add ATTRIBUTE_FORMAT() for specifying __attribute__((format(...))) safely, make more use of the format attribute, and fix some of the warnings that this turns up (plus a bonus unrelated one). include/m_ctype.h: Add ATTRIBUTE_FORMAT to printf-like functions. include/m_string.h: Add ATTRIBUTE_FORMAT to my_snprintf() declaration. include/my_global.h: Fix neutering of __attribute__() on old versions of GCC and non-GCC compilers. Add ATTRIBUTE_FORMAT() macro for setting __attribute_((format(...)), since it is available from different versions of gcc and g++. include/my_sys.h: Add ATTRIBUTE_FORMAT() to my_printf_error declaration sql/item_subselect.cc: Silence warning about members being initialized out-of-order sql/item_timefunc.cc: Fix format specifier in snprintf() calls with milliseconds sql/mysql_priv.h: Add ATTRIBUTE_FORMAT to printf-like functions. sql/mysqld.cc: Fix various format specifiers Make sure that method_conv is always set by myisam_stats_method sql/opt_range.cc: Cast pointers to correct type for %lx sql/set_var.cc: Fix __attribute__((unused)) (missing inner set of parens) sql/slave.cc: Fix format specifier sql/slave.h: Add ATTRIBUTE_FORMAT to slave_print_error() declaration. sql/sql_acl.cc: Fix number of arguments passed for formatting, and fix acl_host_or_ip being passed instead of just the hostname. sql/sql_class.h: Add ATTRIBUTE_FORMAT to MYSQL_LOG::write(). --- sql/opt_range.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'sql/opt_range.cc') diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 57903ffe7b9..f5e8a799c4c 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -2513,8 +2513,9 @@ void SEL_ARG::test_use_count(SEL_ARG *root) ulong count=count_key_part_usage(root,pos->next_key_part); if (count > pos->next_key_part->use_count) { - sql_print_information("Use_count: Wrong count for key at %lx, %lu should be %lu", - pos,pos->next_key_part->use_count,count); + sql_print_information("Use_count: Wrong count for key at %lx, %lu " + "should be %lu", (long unsigned int)pos, + pos->next_key_part->use_count, count); return; } pos->next_key_part->test_use_count(root); @@ -2522,7 +2523,7 @@ void SEL_ARG::test_use_count(SEL_ARG *root) } if (e_count != elements) sql_print_warning("Wrong use count: %u (should be %u) for tree at %lx", - e_count, elements, (gptr) this); + e_count, elements, (long unsigned int) this); } #endif -- cgit v1.2.1