Skip to content

Commit 63b0ee2

Browse files
ParadoxV5vuvova
authored andcommitted
Tag ALL my_error_reporters with ATTRIBUTE_FORMAT
The function pointer typedef `my_error_reporter` is already tagged. This commit inherits this attribute to all `my_getopt_error_reporter`s and `my_charset_error_reporter`s for consistency. (It future-proofs for deliberate direct uses of those functions.)
1 parent 1c315b3 commit 63b0ee2

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

mysys/charset.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ static int add_collation(struct charset_info_st *cs)
477477
Report character set initialization errors and warnings.
478478
Be silent by default: no warnings on the client side.
479479
*/
480-
static void
480+
ATTRIBUTE_FORMAT(printf, 2, 3) static void
481481
default_reporter(enum loglevel level __attribute__ ((unused)),
482482
const char *format __attribute__ ((unused)),
483483
...)

mysys/my_getopt.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ my_bool my_handle_options_init_variables = 1;
8686

8787
my_getopt_value my_getopt_get_addr= 0;
8888

89+
ATTRIBUTE_FORMAT(printf, 2, 3)
8990
static void default_reporter(enum loglevel level, const char *format, ...)
9091
{
9192
va_list args;

sql/mysqld.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1435,6 +1435,7 @@ C_MODE_START
14351435
@param level log message level
14361436
@param format log message format string
14371437
*/
1438+
ATTRIBUTE_FORMAT(printf, 2, 3)
14381439
static void buffered_option_error_reporter(enum loglevel level,
14391440
const char *format, ...)
14401441
{
@@ -1465,6 +1466,7 @@ static void buffered_option_error_reporter(enum loglevel level,
14651466
to print general character set subsystem initialization errors,
14661467
such as Index.xml syntax problems, bad XML tag hierarchy, etc.
14671468
*/
1469+
ATTRIBUTE_FORMAT(printf, 2, 3)
14681470
static void charset_error_reporter(enum loglevel level,
14691471
const char *format, ...)
14701472
{
@@ -8720,7 +8722,7 @@ mysql_getopt_value(const char *name, uint length,
87208722
return option->value;
87218723
}
87228724

8723-
8725+
ATTRIBUTE_FORMAT(printf, 2, 3)
87248726
static void option_error_reporter(enum loglevel level, const char *format, ...)
87258727
{
87268728
va_list args;

0 commit comments

Comments
 (0)