assert: check format arguments for correctness

This instructs the compiler to check that arguments to
__ASSERT/__ASSERT_NO_MSG are valid for printf.

Signed-off-by: Armin Brauns <armin.brauns@embedded-solutions.at>
This commit is contained in:
Armin Brauns 2023-07-19 08:15:04 +00:00 committed by Carles Cufí
commit d7846de548

View file

@ -26,7 +26,7 @@ extern "C" {
#endif
/* Wrapper around printk to avoid including printk.h in assert.h */
void assert_print(const char *fmt, ...);
void __printf_like(1, 2) assert_print(const char *fmt, ...);
#ifdef __cplusplus
}