Add format checks for printf-style functions
Added format checks to functions that expect printf style arguments and fixed any broken calls to these functions.
This commit is contained in:
@ -79,6 +79,17 @@
|
||||
*/
|
||||
#define MXS_MAX(a,b) ((a)>(b) ? (a) : (b))
|
||||
|
||||
/**
|
||||
* Define function attributes
|
||||
*
|
||||
* The function attributes are compiler specific.
|
||||
*/
|
||||
#ifdef __GNUC__
|
||||
#define mxs_attribute(a) __attribute__(a)
|
||||
#else
|
||||
#define mxs_attribute(a)
|
||||
#endif
|
||||
|
||||
/**
|
||||
* COMMON INCLUDE FILES
|
||||
*/
|
||||
|
@ -119,7 +119,7 @@ static inline bool mxs_log_priority_is_enabled(int priority)
|
||||
int mxs_log_message(int priority,
|
||||
const char* modname,
|
||||
const char* file, int line, const char* function,
|
||||
const char* format, ...) __attribute__((format(printf, 6, 7)));
|
||||
const char* format, ...) mxs_attribute((format(printf, 6, 7)));
|
||||
/**
|
||||
* Log an error, warning, notice, info, or debug message.
|
||||
*
|
||||
|
@ -256,7 +256,7 @@ bool modulecmd_call_command(const MODULECMD *cmd, const MODULECMD_ARG *args, jso
|
||||
* @param format Format string
|
||||
* @param ... Format string arguments
|
||||
*/
|
||||
void modulecmd_set_error(const char *format, ...);
|
||||
void modulecmd_set_error(const char *format, ...) mxs_attribute((format (printf, 1, 2)));
|
||||
|
||||
/**
|
||||
* @brief Get the latest error generated by the modulecmd system
|
||||
|
Reference in New Issue
Block a user