Add format checking to mbed_error_printf

pull/8601/head
Kevin Bracey 2018-09-11 11:19:18 +03:00
parent 8976709c9c
commit 1f56fbe397
2 changed files with 4 additions and 4 deletions

View File

@ -871,7 +871,7 @@ typedef struct _mbed_error_ctx {
* *
*/ */
MBED_NORETURN void error(const char *format, ...); MBED_NORETURN void error(const char *format, ...) MBED_PRINTF(1, 2);
/** /**
* Call this Macro to generate a mbed_error_status_t value for a System error * Call this Macro to generate a mbed_error_status_t value for a System error

View File

@ -139,7 +139,7 @@ MBED_NORETURN void mbed_die(void);
* @endcode * @endcode
* *
*/ */
void mbed_error_printf(const char *format, ...); void mbed_error_printf(const char *format, ...) MBED_PRINTF(1, 2);
/** Print out an error message. Similar to mbed_error_printf /** Print out an error message. Similar to mbed_error_printf
* but uses a va_list. * but uses a va_list.
@ -150,7 +150,7 @@ void mbed_error_printf(const char *format, ...);
* @param arg Variable arguments list * @param arg Variable arguments list
* *
*/ */
void mbed_error_vprintf(const char *format, va_list arg); void mbed_error_vprintf(const char *format, va_list arg) MBED_PRINTF(1, 0);
/** Print out an error message. This is typically called when /** Print out an error message. This is typically called when
* handling a crash. * handling a crash.
@ -169,7 +169,7 @@ void mbed_error_puts(const char *str);
/** @deprecated Renamed to mbed_error_vprintf to match functionality */ /** @deprecated Renamed to mbed_error_vprintf to match functionality */
MBED_DEPRECATED_SINCE("mbed-os-5.11", MBED_DEPRECATED_SINCE("mbed-os-5.11",
"Renamed to mbed_error_vprintf to match functionality.") "Renamed to mbed_error_vprintf to match functionality.")
void mbed_error_vfprintf(const char *format, va_list arg); void mbed_error_vfprintf(const char *format, va_list arg) MBED_PRINTF(1, 0);
/** @}*/ /** @}*/