Skip to content

Commit 202c2fb

Browse files
ParadoxV5vuvova
authored andcommitted
make abi_update
Commits for MDEV-21978 changes ABIs with their introduction of `__attribute__((format(printf, …))` tags.
1 parent c878375 commit 202c2fb

File tree

7 files changed

+196
-84
lines changed

7 files changed

+196
-84
lines changed

include/mysql/plugin_audit.h.pp

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,10 @@
130130
unsigned long long size_limit,
131131
unsigned int rotations);
132132
int (*close)(LOGGER_HANDLE *log);
133-
int (*vprintf)(LOGGER_HANDLE *log, const char *fmt, va_list argptr);
134-
int (*printf)(LOGGER_HANDLE *log, const char *fmt, ...);
133+
int (*vprintf)(LOGGER_HANDLE *log, const char *fmt, va_list argptr)
134+
__attribute__((format(printf, 2, 0)));
135+
int (*printf)(LOGGER_HANDLE *log, const char *fmt, ...)
136+
__attribute__((format(printf, 2, 3)));
135137
int (*write)(LOGGER_HANDLE *log, const char *buffer, size_t size);
136138
int (*rotate)(LOGGER_HANDLE *log);
137139
} *logger_service;
@@ -140,8 +142,10 @@
140142
unsigned long long size_limit,
141143
unsigned int rotations);
142144
int logger_close(LOGGER_HANDLE *log);
143-
int logger_vprintf(LOGGER_HANDLE *log, const char *fmt, va_list argptr);
144-
int logger_printf(LOGGER_HANDLE *log, const char *fmt, ...);
145+
int logger_vprintf(LOGGER_HANDLE *log, const char *fmt, va_list argptr)
146+
__attribute__((format(printf, 2, 0)));
147+
int logger_printf(LOGGER_HANDLE *log, const char *fmt, ...)
148+
__attribute__((format(printf, 2, 3)));
145149
int logger_write(LOGGER_HANDLE *log, const char *buffer, size_t size);
146150
int logger_rotate(LOGGER_HANDLE *log);
147151
}
@@ -195,20 +199,32 @@
195199
extern "C" {
196200
extern struct my_print_error_service_st {
197201
void (*my_error_func)(unsigned int nr, unsigned long MyFlags, ...);
198-
void (*my_printf_error_func)(unsigned int nr, const char *fmt, unsigned long MyFlags,...);
199-
void (*my_printv_error_func)(unsigned int error, const char *format, unsigned long MyFlags, va_list ap);
202+
void (*my_printf_error_func)(unsigned int nr, const char *fmt,
203+
unsigned long MyFlags, ...)
204+
__attribute__((format(printf, 2, 4)));
205+
void (*my_printv_error_func)(unsigned int error, const char *format,
206+
unsigned long MyFlags, va_list ap)
207+
__attribute__((format(printf, 2, 0)));
200208
} *my_print_error_service;
201209
extern void my_error(unsigned int nr, unsigned long MyFlags, ...);
202-
extern void my_printf_error(unsigned int my_err, const char *format, unsigned long MyFlags, ...);
203-
extern void my_printv_error(unsigned int error, const char *format, unsigned long MyFlags,va_list ap);
210+
extern void my_printf_error(unsigned int my_err, const char *format,
211+
unsigned long MyFlags, ...)
212+
__attribute__((format(printf, 2, 4)));
213+
extern void my_printv_error(unsigned int error, const char *format,
214+
unsigned long MyFlags,va_list ap)
215+
__attribute__((format(printf, 2, 0)));
204216
}
205217
extern "C" {
206218
extern struct my_snprintf_service_st {
207-
size_t (*my_snprintf_type)(char*, size_t, const char*, ...);
208-
size_t (*my_vsnprintf_type)(char *, size_t, const char*, va_list);
219+
size_t (*my_snprintf_type)(char*, size_t, const char*, ...)
220+
__attribute__((format(printf, 3, 4)));
221+
size_t (*my_vsnprintf_type)(char *, size_t, const char*, va_list)
222+
__attribute__((format(printf, 3, 0)));
209223
} *my_snprintf_service;
210-
size_t my_snprintf(char* to, size_t n, const char* fmt, ...);
211-
size_t my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap);
224+
size_t my_snprintf(char* to, size_t n, const char* fmt, ...)
225+
__attribute__((format(printf, 3, 4)));
226+
size_t my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap)
227+
__attribute__((format(printf, 3, 0)));
212228
}
213229
extern "C" {
214230
extern struct progress_report_service_st {

include/mysql/plugin_auth.h.pp

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,10 @@
130130
unsigned long long size_limit,
131131
unsigned int rotations);
132132
int (*close)(LOGGER_HANDLE *log);
133-
int (*vprintf)(LOGGER_HANDLE *log, const char *fmt, va_list argptr);
134-
int (*printf)(LOGGER_HANDLE *log, const char *fmt, ...);
133+
int (*vprintf)(LOGGER_HANDLE *log, const char *fmt, va_list argptr)
134+
__attribute__((format(printf, 2, 0)));
135+
int (*printf)(LOGGER_HANDLE *log, const char *fmt, ...)
136+
__attribute__((format(printf, 2, 3)));
135137
int (*write)(LOGGER_HANDLE *log, const char *buffer, size_t size);
136138
int (*rotate)(LOGGER_HANDLE *log);
137139
} *logger_service;
@@ -140,8 +142,10 @@
140142
unsigned long long size_limit,
141143
unsigned int rotations);
142144
int logger_close(LOGGER_HANDLE *log);
143-
int logger_vprintf(LOGGER_HANDLE *log, const char *fmt, va_list argptr);
144-
int logger_printf(LOGGER_HANDLE *log, const char *fmt, ...);
145+
int logger_vprintf(LOGGER_HANDLE *log, const char *fmt, va_list argptr)
146+
__attribute__((format(printf, 2, 0)));
147+
int logger_printf(LOGGER_HANDLE *log, const char *fmt, ...)
148+
__attribute__((format(printf, 2, 3)));
145149
int logger_write(LOGGER_HANDLE *log, const char *buffer, size_t size);
146150
int logger_rotate(LOGGER_HANDLE *log);
147151
}
@@ -195,20 +199,32 @@
195199
extern "C" {
196200
extern struct my_print_error_service_st {
197201
void (*my_error_func)(unsigned int nr, unsigned long MyFlags, ...);
198-
void (*my_printf_error_func)(unsigned int nr, const char *fmt, unsigned long MyFlags,...);
199-
void (*my_printv_error_func)(unsigned int error, const char *format, unsigned long MyFlags, va_list ap);
202+
void (*my_printf_error_func)(unsigned int nr, const char *fmt,
203+
unsigned long MyFlags, ...)
204+
__attribute__((format(printf, 2, 4)));
205+
void (*my_printv_error_func)(unsigned int error, const char *format,
206+
unsigned long MyFlags, va_list ap)
207+
__attribute__((format(printf, 2, 0)));
200208
} *my_print_error_service;
201209
extern void my_error(unsigned int nr, unsigned long MyFlags, ...);
202-
extern void my_printf_error(unsigned int my_err, const char *format, unsigned long MyFlags, ...);
203-
extern void my_printv_error(unsigned int error, const char *format, unsigned long MyFlags,va_list ap);
210+
extern void my_printf_error(unsigned int my_err, const char *format,
211+
unsigned long MyFlags, ...)
212+
__attribute__((format(printf, 2, 4)));
213+
extern void my_printv_error(unsigned int error, const char *format,
214+
unsigned long MyFlags,va_list ap)
215+
__attribute__((format(printf, 2, 0)));
204216
}
205217
extern "C" {
206218
extern struct my_snprintf_service_st {
207-
size_t (*my_snprintf_type)(char*, size_t, const char*, ...);
208-
size_t (*my_vsnprintf_type)(char *, size_t, const char*, va_list);
219+
size_t (*my_snprintf_type)(char*, size_t, const char*, ...)
220+
__attribute__((format(printf, 3, 4)));
221+
size_t (*my_vsnprintf_type)(char *, size_t, const char*, va_list)
222+
__attribute__((format(printf, 3, 0)));
209223
} *my_snprintf_service;
210-
size_t my_snprintf(char* to, size_t n, const char* fmt, ...);
211-
size_t my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap);
224+
size_t my_snprintf(char* to, size_t n, const char* fmt, ...)
225+
__attribute__((format(printf, 3, 4)));
226+
size_t my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap)
227+
__attribute__((format(printf, 3, 0)));
212228
}
213229
extern "C" {
214230
extern struct progress_report_service_st {

include/mysql/plugin_data_type.h.pp

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,10 @@
130130
unsigned long long size_limit,
131131
unsigned int rotations);
132132
int (*close)(LOGGER_HANDLE *log);
133-
int (*vprintf)(LOGGER_HANDLE *log, const char *fmt, va_list argptr);
134-
int (*printf)(LOGGER_HANDLE *log, const char *fmt, ...);
133+
int (*vprintf)(LOGGER_HANDLE *log, const char *fmt, va_list argptr)
134+
__attribute__((format(printf, 2, 0)));
135+
int (*printf)(LOGGER_HANDLE *log, const char *fmt, ...)
136+
__attribute__((format(printf, 2, 3)));
135137
int (*write)(LOGGER_HANDLE *log, const char *buffer, size_t size);
136138
int (*rotate)(LOGGER_HANDLE *log);
137139
} *logger_service;
@@ -140,8 +142,10 @@
140142
unsigned long long size_limit,
141143
unsigned int rotations);
142144
int logger_close(LOGGER_HANDLE *log);
143-
int logger_vprintf(LOGGER_HANDLE *log, const char *fmt, va_list argptr);
144-
int logger_printf(LOGGER_HANDLE *log, const char *fmt, ...);
145+
int logger_vprintf(LOGGER_HANDLE *log, const char *fmt, va_list argptr)
146+
__attribute__((format(printf, 2, 0)));
147+
int logger_printf(LOGGER_HANDLE *log, const char *fmt, ...)
148+
__attribute__((format(printf, 2, 3)));
145149
int logger_write(LOGGER_HANDLE *log, const char *buffer, size_t size);
146150
int logger_rotate(LOGGER_HANDLE *log);
147151
}
@@ -195,20 +199,32 @@
195199
extern "C" {
196200
extern struct my_print_error_service_st {
197201
void (*my_error_func)(unsigned int nr, unsigned long MyFlags, ...);
198-
void (*my_printf_error_func)(unsigned int nr, const char *fmt, unsigned long MyFlags,...);
199-
void (*my_printv_error_func)(unsigned int error, const char *format, unsigned long MyFlags, va_list ap);
202+
void (*my_printf_error_func)(unsigned int nr, const char *fmt,
203+
unsigned long MyFlags, ...)
204+
__attribute__((format(printf, 2, 4)));
205+
void (*my_printv_error_func)(unsigned int error, const char *format,
206+
unsigned long MyFlags, va_list ap)
207+
__attribute__((format(printf, 2, 0)));
200208
} *my_print_error_service;
201209
extern void my_error(unsigned int nr, unsigned long MyFlags, ...);
202-
extern void my_printf_error(unsigned int my_err, const char *format, unsigned long MyFlags, ...);
203-
extern void my_printv_error(unsigned int error, const char *format, unsigned long MyFlags,va_list ap);
210+
extern void my_printf_error(unsigned int my_err, const char *format,
211+
unsigned long MyFlags, ...)
212+
__attribute__((format(printf, 2, 4)));
213+
extern void my_printv_error(unsigned int error, const char *format,
214+
unsigned long MyFlags,va_list ap)
215+
__attribute__((format(printf, 2, 0)));
204216
}
205217
extern "C" {
206218
extern struct my_snprintf_service_st {
207-
size_t (*my_snprintf_type)(char*, size_t, const char*, ...);
208-
size_t (*my_vsnprintf_type)(char *, size_t, const char*, va_list);
219+
size_t (*my_snprintf_type)(char*, size_t, const char*, ...)
220+
__attribute__((format(printf, 3, 4)));
221+
size_t (*my_vsnprintf_type)(char *, size_t, const char*, va_list)
222+
__attribute__((format(printf, 3, 0)));
209223
} *my_snprintf_service;
210-
size_t my_snprintf(char* to, size_t n, const char* fmt, ...);
211-
size_t my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap);
224+
size_t my_snprintf(char* to, size_t n, const char* fmt, ...)
225+
__attribute__((format(printf, 3, 4)));
226+
size_t my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap)
227+
__attribute__((format(printf, 3, 0)));
212228
}
213229
extern "C" {
214230
extern struct progress_report_service_st {

include/mysql/plugin_encryption.h.pp

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,10 @@
130130
unsigned long long size_limit,
131131
unsigned int rotations);
132132
int (*close)(LOGGER_HANDLE *log);
133-
int (*vprintf)(LOGGER_HANDLE *log, const char *fmt, va_list argptr);
134-
int (*printf)(LOGGER_HANDLE *log, const char *fmt, ...);
133+
int (*vprintf)(LOGGER_HANDLE *log, const char *fmt, va_list argptr)
134+
__attribute__((format(printf, 2, 0)));
135+
int (*printf)(LOGGER_HANDLE *log, const char *fmt, ...)
136+
__attribute__((format(printf, 2, 3)));
135137
int (*write)(LOGGER_HANDLE *log, const char *buffer, size_t size);
136138
int (*rotate)(LOGGER_HANDLE *log);
137139
} *logger_service;
@@ -140,8 +142,10 @@
140142
unsigned long long size_limit,
141143
unsigned int rotations);
142144
int logger_close(LOGGER_HANDLE *log);
143-
int logger_vprintf(LOGGER_HANDLE *log, const char *fmt, va_list argptr);
144-
int logger_printf(LOGGER_HANDLE *log, const char *fmt, ...);
145+
int logger_vprintf(LOGGER_HANDLE *log, const char *fmt, va_list argptr)
146+
__attribute__((format(printf, 2, 0)));
147+
int logger_printf(LOGGER_HANDLE *log, const char *fmt, ...)
148+
__attribute__((format(printf, 2, 3)));
145149
int logger_write(LOGGER_HANDLE *log, const char *buffer, size_t size);
146150
int logger_rotate(LOGGER_HANDLE *log);
147151
}
@@ -195,20 +199,32 @@
195199
extern "C" {
196200
extern struct my_print_error_service_st {
197201
void (*my_error_func)(unsigned int nr, unsigned long MyFlags, ...);
198-
void (*my_printf_error_func)(unsigned int nr, const char *fmt, unsigned long MyFlags,...);
199-
void (*my_printv_error_func)(unsigned int error, const char *format, unsigned long MyFlags, va_list ap);
202+
void (*my_printf_error_func)(unsigned int nr, const char *fmt,
203+
unsigned long MyFlags, ...)
204+
__attribute__((format(printf, 2, 4)));
205+
void (*my_printv_error_func)(unsigned int error, const char *format,
206+
unsigned long MyFlags, va_list ap)
207+
__attribute__((format(printf, 2, 0)));
200208
} *my_print_error_service;
201209
extern void my_error(unsigned int nr, unsigned long MyFlags, ...);
202-
extern void my_printf_error(unsigned int my_err, const char *format, unsigned long MyFlags, ...);
203-
extern void my_printv_error(unsigned int error, const char *format, unsigned long MyFlags,va_list ap);
210+
extern void my_printf_error(unsigned int my_err, const char *format,
211+
unsigned long MyFlags, ...)
212+
__attribute__((format(printf, 2, 4)));
213+
extern void my_printv_error(unsigned int error, const char *format,
214+
unsigned long MyFlags,va_list ap)
215+
__attribute__((format(printf, 2, 0)));
204216
}
205217
extern "C" {
206218
extern struct my_snprintf_service_st {
207-
size_t (*my_snprintf_type)(char*, size_t, const char*, ...);
208-
size_t (*my_vsnprintf_type)(char *, size_t, const char*, va_list);
219+
size_t (*my_snprintf_type)(char*, size_t, const char*, ...)
220+
__attribute__((format(printf, 3, 4)));
221+
size_t (*my_vsnprintf_type)(char *, size_t, const char*, va_list)
222+
__attribute__((format(printf, 3, 0)));
209223
} *my_snprintf_service;
210-
size_t my_snprintf(char* to, size_t n, const char* fmt, ...);
211-
size_t my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap);
224+
size_t my_snprintf(char* to, size_t n, const char* fmt, ...)
225+
__attribute__((format(printf, 3, 4)));
226+
size_t my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap)
227+
__attribute__((format(printf, 3, 0)));
212228
}
213229
extern "C" {
214230
extern struct progress_report_service_st {

include/mysql/plugin_ftparser.h.pp

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,10 @@
130130
unsigned long long size_limit,
131131
unsigned int rotations);
132132
int (*close)(LOGGER_HANDLE *log);
133-
int (*vprintf)(LOGGER_HANDLE *log, const char *fmt, va_list argptr);
134-
int (*printf)(LOGGER_HANDLE *log, const char *fmt, ...);
133+
int (*vprintf)(LOGGER_HANDLE *log, const char *fmt, va_list argptr)
134+
__attribute__((format(printf, 2, 0)));
135+
int (*printf)(LOGGER_HANDLE *log, const char *fmt, ...)
136+
__attribute__((format(printf, 2, 3)));
135137
int (*write)(LOGGER_HANDLE *log, const char *buffer, size_t size);
136138
int (*rotate)(LOGGER_HANDLE *log);
137139
} *logger_service;
@@ -140,8 +142,10 @@
140142
unsigned long long size_limit,
141143
unsigned int rotations);
142144
int logger_close(LOGGER_HANDLE *log);
143-
int logger_vprintf(LOGGER_HANDLE *log, const char *fmt, va_list argptr);
144-
int logger_printf(LOGGER_HANDLE *log, const char *fmt, ...);
145+
int logger_vprintf(LOGGER_HANDLE *log, const char *fmt, va_list argptr)
146+
__attribute__((format(printf, 2, 0)));
147+
int logger_printf(LOGGER_HANDLE *log, const char *fmt, ...)
148+
__attribute__((format(printf, 2, 3)));
145149
int logger_write(LOGGER_HANDLE *log, const char *buffer, size_t size);
146150
int logger_rotate(LOGGER_HANDLE *log);
147151
}
@@ -195,20 +199,32 @@
195199
extern "C" {
196200
extern struct my_print_error_service_st {
197201
void (*my_error_func)(unsigned int nr, unsigned long MyFlags, ...);
198-
void (*my_printf_error_func)(unsigned int nr, const char *fmt, unsigned long MyFlags,...);
199-
void (*my_printv_error_func)(unsigned int error, const char *format, unsigned long MyFlags, va_list ap);
202+
void (*my_printf_error_func)(unsigned int nr, const char *fmt,
203+
unsigned long MyFlags, ...)
204+
__attribute__((format(printf, 2, 4)));
205+
void (*my_printv_error_func)(unsigned int error, const char *format,
206+
unsigned long MyFlags, va_list ap)
207+
__attribute__((format(printf, 2, 0)));
200208
} *my_print_error_service;
201209
extern void my_error(unsigned int nr, unsigned long MyFlags, ...);
202-
extern void my_printf_error(unsigned int my_err, const char *format, unsigned long MyFlags, ...);
203-
extern void my_printv_error(unsigned int error, const char *format, unsigned long MyFlags,va_list ap);
210+
extern void my_printf_error(unsigned int my_err, const char *format,
211+
unsigned long MyFlags, ...)
212+
__attribute__((format(printf, 2, 4)));
213+
extern void my_printv_error(unsigned int error, const char *format,
214+
unsigned long MyFlags,va_list ap)
215+
__attribute__((format(printf, 2, 0)));
204216
}
205217
extern "C" {
206218
extern struct my_snprintf_service_st {
207-
size_t (*my_snprintf_type)(char*, size_t, const char*, ...);
208-
size_t (*my_vsnprintf_type)(char *, size_t, const char*, va_list);
219+
size_t (*my_snprintf_type)(char*, size_t, const char*, ...)
220+
__attribute__((format(printf, 3, 4)));
221+
size_t (*my_vsnprintf_type)(char *, size_t, const char*, va_list)
222+
__attribute__((format(printf, 3, 0)));
209223
} *my_snprintf_service;
210-
size_t my_snprintf(char* to, size_t n, const char* fmt, ...);
211-
size_t my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap);
224+
size_t my_snprintf(char* to, size_t n, const char* fmt, ...)
225+
__attribute__((format(printf, 3, 4)));
226+
size_t my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap)
227+
__attribute__((format(printf, 3, 0)));
212228
}
213229
extern "C" {
214230
extern struct progress_report_service_st {

0 commit comments

Comments
 (0)