From b6384d5da57f3d8088cf0174f60745dfc9ee3e00 Mon Sep 17 00:00:00 2001 From: CTCaer Date: Thu, 12 May 2022 16:40:34 +0300 Subject: [PATCH] bdk: utils: Set format attribute for s_printf This allows the custom sprintf to be recognized as printf by gcc and effectively doing format checking. NOTE: 64bit formatting is not supported for now, even if gcc asks to be set. --- bdk/utils/sprintf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bdk/utils/sprintf.h b/bdk/utils/sprintf.h index 2fb863b..c523267 100644 --- a/bdk/utils/sprintf.h +++ b/bdk/utils/sprintf.h @@ -21,7 +21,7 @@ #include -void s_printf(char *out_buf, const char *fmt, ...); +void s_printf(char *out_buf, const char *fmt, ...) __attribute__((format(printf, 2, 3))); void s_vprintf(char *out_buf, const char *fmt, va_list ap); #endif \ No newline at end of file