Commit a6e215f2 authored by Sergei Golubchik's avatar Sergei Golubchik

Fix compilation warnings in plugins

* update cracklib_password_check to match the new prototype
* cannot use __attribute__((format)) for my_snprintf, because
  we support format extensions that the compiler doesn't know about.
parent d5a6bae7
......@@ -19,8 +19,6 @@
/* By Jani Tolonen, 2001-04-20, MySQL Development Team */
#define CHECK_VERSION "2.7.4-MariaDB"
/* Avoid warnings from %'s format */
#define USING_MARIADB_SNPRINTF_EXTENSIONS
#include "client_priv.h"
#include <m_ctype.h>
......
......@@ -167,9 +167,9 @@ int my_random_bytes(unsigned char* buf, int num);
unsigned int my_aes_get_size(enum my_aes_mode mode, unsigned int source_length);
unsigned int my_aes_ctx_size(enum my_aes_mode mode);
extern struct my_print_error_service_st {
void(*my_error_func)(unsigned int nr, unsigned long MyFlags, ...);
void(*my_printf_error_func)(unsigned int nr, const char *fmt, unsigned long MyFlags,...);
void(*my_printv_error_func)(unsigned int error, const char *format, unsigned long MyFlags, va_list ap);
void (*my_error_func)(unsigned int nr, unsigned long MyFlags, ...);
void (*my_printf_error_func)(unsigned int nr, const char *fmt, unsigned long MyFlags,...);
void (*my_printv_error_func)(unsigned int error, const char *format, unsigned long MyFlags, va_list ap);
} *my_print_error_service;
extern void my_error(unsigned int nr, unsigned long MyFlags, ...);
extern void my_printf_error(unsigned int my_err, const char *format, unsigned long MyFlags, ...);
......@@ -178,8 +178,7 @@ extern struct my_snprintf_service_st {
size_t (*my_snprintf_type)(char*, size_t, const char*, ...);
size_t (*my_vsnprintf_type)(char *, size_t, const char*, va_list);
} *my_snprintf_service;
size_t my_snprintf(char* to, size_t n, const char* fmt, ...)
;
size_t my_snprintf(char* to, size_t n, const char* fmt, ...);
size_t my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap);
extern struct progress_report_service_st {
void (*thd_progress_init_func)(void* thd, unsigned int max_stage);
......
......@@ -167,9 +167,9 @@ int my_random_bytes(unsigned char* buf, int num);
unsigned int my_aes_get_size(enum my_aes_mode mode, unsigned int source_length);
unsigned int my_aes_ctx_size(enum my_aes_mode mode);
extern struct my_print_error_service_st {
void(*my_error_func)(unsigned int nr, unsigned long MyFlags, ...);
void(*my_printf_error_func)(unsigned int nr, const char *fmt, unsigned long MyFlags,...);
void(*my_printv_error_func)(unsigned int error, const char *format, unsigned long MyFlags, va_list ap);
void (*my_error_func)(unsigned int nr, unsigned long MyFlags, ...);
void (*my_printf_error_func)(unsigned int nr, const char *fmt, unsigned long MyFlags,...);
void (*my_printv_error_func)(unsigned int error, const char *format, unsigned long MyFlags, va_list ap);
} *my_print_error_service;
extern void my_error(unsigned int nr, unsigned long MyFlags, ...);
extern void my_printf_error(unsigned int my_err, const char *format, unsigned long MyFlags, ...);
......@@ -178,8 +178,7 @@ extern struct my_snprintf_service_st {
size_t (*my_snprintf_type)(char*, size_t, const char*, ...);
size_t (*my_vsnprintf_type)(char *, size_t, const char*, va_list);
} *my_snprintf_service;
size_t my_snprintf(char* to, size_t n, const char* fmt, ...)
;
size_t my_snprintf(char* to, size_t n, const char* fmt, ...);
size_t my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap);
extern struct progress_report_service_st {
void (*thd_progress_init_func)(void* thd, unsigned int max_stage);
......
......@@ -167,9 +167,9 @@ int my_random_bytes(unsigned char* buf, int num);
unsigned int my_aes_get_size(enum my_aes_mode mode, unsigned int source_length);
unsigned int my_aes_ctx_size(enum my_aes_mode mode);
extern struct my_print_error_service_st {
void(*my_error_func)(unsigned int nr, unsigned long MyFlags, ...);
void(*my_printf_error_func)(unsigned int nr, const char *fmt, unsigned long MyFlags,...);
void(*my_printv_error_func)(unsigned int error, const char *format, unsigned long MyFlags, va_list ap);
void (*my_error_func)(unsigned int nr, unsigned long MyFlags, ...);
void (*my_printf_error_func)(unsigned int nr, const char *fmt, unsigned long MyFlags,...);
void (*my_printv_error_func)(unsigned int error, const char *format, unsigned long MyFlags, va_list ap);
} *my_print_error_service;
extern void my_error(unsigned int nr, unsigned long MyFlags, ...);
extern void my_printf_error(unsigned int my_err, const char *format, unsigned long MyFlags, ...);
......@@ -178,8 +178,7 @@ extern struct my_snprintf_service_st {
size_t (*my_snprintf_type)(char*, size_t, const char*, ...);
size_t (*my_vsnprintf_type)(char *, size_t, const char*, va_list);
} *my_snprintf_service;
size_t my_snprintf(char* to, size_t n, const char* fmt, ...)
;
size_t my_snprintf(char* to, size_t n, const char* fmt, ...);
size_t my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap);
extern struct progress_report_service_st {
void (*thd_progress_init_func)(void* thd, unsigned int max_stage);
......
......@@ -167,9 +167,9 @@ int my_random_bytes(unsigned char* buf, int num);
unsigned int my_aes_get_size(enum my_aes_mode mode, unsigned int source_length);
unsigned int my_aes_ctx_size(enum my_aes_mode mode);
extern struct my_print_error_service_st {
void(*my_error_func)(unsigned int nr, unsigned long MyFlags, ...);
void(*my_printf_error_func)(unsigned int nr, const char *fmt, unsigned long MyFlags,...);
void(*my_printv_error_func)(unsigned int error, const char *format, unsigned long MyFlags, va_list ap);
void (*my_error_func)(unsigned int nr, unsigned long MyFlags, ...);
void (*my_printf_error_func)(unsigned int nr, const char *fmt, unsigned long MyFlags,...);
void (*my_printv_error_func)(unsigned int error, const char *format, unsigned long MyFlags, va_list ap);
} *my_print_error_service;
extern void my_error(unsigned int nr, unsigned long MyFlags, ...);
extern void my_printf_error(unsigned int my_err, const char *format, unsigned long MyFlags, ...);
......@@ -178,8 +178,7 @@ extern struct my_snprintf_service_st {
size_t (*my_snprintf_type)(char*, size_t, const char*, ...);
size_t (*my_vsnprintf_type)(char *, size_t, const char*, va_list);
} *my_snprintf_service;
size_t my_snprintf(char* to, size_t n, const char* fmt, ...)
;
size_t my_snprintf(char* to, size_t n, const char* fmt, ...);
size_t my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap);
extern struct progress_report_service_st {
void (*thd_progress_init_func)(void* thd, unsigned int max_stage);
......
......@@ -167,9 +167,9 @@ int my_random_bytes(unsigned char* buf, int num);
unsigned int my_aes_get_size(enum my_aes_mode mode, unsigned int source_length);
unsigned int my_aes_ctx_size(enum my_aes_mode mode);
extern struct my_print_error_service_st {
void(*my_error_func)(unsigned int nr, unsigned long MyFlags, ...);
void(*my_printf_error_func)(unsigned int nr, const char *fmt, unsigned long MyFlags,...);
void(*my_printv_error_func)(unsigned int error, const char *format, unsigned long MyFlags, va_list ap);
void (*my_error_func)(unsigned int nr, unsigned long MyFlags, ...);
void (*my_printf_error_func)(unsigned int nr, const char *fmt, unsigned long MyFlags,...);
void (*my_printv_error_func)(unsigned int error, const char *format, unsigned long MyFlags, va_list ap);
} *my_print_error_service;
extern void my_error(unsigned int nr, unsigned long MyFlags, ...);
extern void my_printf_error(unsigned int my_err, const char *format, unsigned long MyFlags, ...);
......@@ -178,8 +178,7 @@ extern struct my_snprintf_service_st {
size_t (*my_snprintf_type)(char*, size_t, const char*, ...);
size_t (*my_vsnprintf_type)(char *, size_t, const char*, va_list);
} *my_snprintf_service;
size_t my_snprintf(char* to, size_t n, const char* fmt, ...)
;
size_t my_snprintf(char* to, size_t n, const char* fmt, ...);
size_t my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap);
extern struct progress_report_service_st {
void (*thd_progress_init_func)(void* thd, unsigned int max_stage);
......
......@@ -92,22 +92,9 @@ extern struct my_snprintf_service_st {
#else
#ifndef ATTRIBUTE_FORMAT
#define ATTRIBUTE_FORMAT_DEFINED
#define ATTRIBUTE_FORMAT(A,B,C)
#endif
#if defined(MYSQL_ABI_CHECK) || defined(USING_MARIADB_SNPRINTF_EXTENSIONS)
#undef ATTRIBUTE_FORMAT
#define ATTRIBUTE_FORMAT(A,B,C)
#endif
size_t my_snprintf(char* to, size_t n, const char* fmt, ...)
ATTRIBUTE_FORMAT(printf, 3, 4);
size_t my_snprintf(char* to, size_t n, const char* fmt, ...);
size_t my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap);
#ifdef ATTRIBUTE_FORMAT_DEFINED
#undef ATTRIBUTE_FORMAT_DEFINED
#undef ATTRIBUTE_FORMAT
#endif
#endif
#ifdef __cplusplus
......
......@@ -23,7 +23,7 @@
static char *dictionary;
static int crackme(MYSQL_LEX_STRING *username, MYSQL_LEX_STRING *password)
static int crackme(MYSQL_CONST_LEX_STRING *username, MYSQL_CONST_LEX_STRING *password)
{
char *user= alloca(username->length + 1);
char *host;
......
......@@ -51,7 +51,7 @@
*****************************************************************************/
static const char *zero_timestamp="0000-00-00 00:00:00.000000";
LEX_CSTRING temp_lex_str= {"temp", 4};
LEX_CSTRING temp_lex_str= {STRING_WITH_LEN("temp")};
uchar Field_null::null[1]={1};
const char field_separator=',';
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment