Skip to content

Commit bf60478

Browse files
committed
MDEV-34388/MDEV-36701: mysql status_info_cb disable varargs warnings
Clang complains that the callback is using a variadic based on an enum. client/mysql.cc:3207:16: error: passing an object that undergoes default argument promotion to 'va_start' has undefined behavior [-Werror,-Wvarargs] 3207 | va_start(ap, type); This is part of the C/C API this has been referred as bug: * CONC-789 MARIADB_OPT_STATUS_CALLBACK Variadic around enums is undefined behaviour In the mean time, we are just disabling the warning. Reviewer: Jimmy Hu <jimmy.hu@mariadb.com>
1 parent 4b058a3 commit bf60478

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

client/mysql.cc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3199,6 +3199,12 @@ static int reconnect(void)
31993199
}
32003200

32013201
#ifndef EMBEDDED_LIBRARY
3202+
#ifdef __clang__
3203+
#pragma clang diagnostic push
3204+
#pragma clang diagnostic ignored "-Wvarargs"
3205+
/* CONC-789 */
3206+
#endif
3207+
32023208
static void status_info_cb(void *data, enum enum_mariadb_status_info type, ...)
32033209
{
32043210
va_list ap;
@@ -3214,6 +3220,10 @@ static void status_info_cb(void *data, enum enum_mariadb_status_info type, ...)
32143220
}
32153221
va_end(ap);
32163222
}
3223+
3224+
#ifdef __clang__
3225+
#pragma clang diagnostic pop
3226+
#endif
32173227
#else
32183228
#define mysql_optionsv(A,B,C,D) do { } while(0)
32193229
#endif

0 commit comments

Comments
 (0)