Add printf attribute to all variadic functions

The test methods that take printf style input now have the printf
attribute. This enables format checks making oversights less likely.

Also fixed any existing errors in the code. Only the one in
test_binlog_fnc.cpp would've had an actual effect.
This commit is contained in:
Markus Mäkelä
2018-06-21 15:33:22 +03:00
parent a59c0c61ce
commit 9737962add
9 changed files with 20 additions and 14 deletions

View File

@ -26,6 +26,8 @@
#include <string>
#include <vector>
#include <maxbase/ccdefs.hh>
typedef std::vector<std::string> Row;
typedef std::vector<Row> Result;
@ -119,7 +121,7 @@ static MYSQL* open_conn_no_db(int port, std::string ip, std::string user, std::s
* @param ... Parameters for @c format
* @return 0 in case of success
*/
int execute_query(MYSQL* conn, const char* format, ...);
int execute_query(MYSQL* conn, const char* format, ...) mxb_attribute((format(printf, 2, 3)));
/**
* @brief execute_query_from_file Read a line from a file, trim leading and trailing whitespace and execute it.