Cleanup: add printf function attributes, quiet GCC warnings

This commit is contained in:
Campbell Barton
2024-07-08 22:32:53 +10:00
parent 6471b715b2
commit 67bb5b25b1
2 changed files with 6 additions and 0 deletions

View File

@@ -212,6 +212,9 @@ static bool malloc_debug_memset = false;
/* implementation */
/* --------------------------------------------------------------------- */
#ifdef __GNUC__
__attribute__((format(printf, 1, 0)))
#endif
static void print_error(const char *message, va_list str_format_args)
{
char buf[512];

View File

@@ -74,6 +74,9 @@ enum {
#define MEMHEAD_IS_FROM_CPP_NEW(memhead) ((memhead)->len & size_t(MEMHEAD_FLAG_FROM_CPP_NEW))
#define MEMHEAD_LEN(memhead) ((memhead)->len & ~size_t(MEMHEAD_FLAG_MASK))
#ifdef __GNUC__
__attribute__((format(printf, 1, 0)))
#endif
static void print_error(const char *message, va_list str_format_args)
{
char buf[512];