diff --git a/intern/guardedalloc/intern/mallocn_guarded_impl.cc b/intern/guardedalloc/intern/mallocn_guarded_impl.cc index b8a21319de8..ef7bcd22735 100644 --- a/intern/guardedalloc/intern/mallocn_guarded_impl.cc +++ b/intern/guardedalloc/intern/mallocn_guarded_impl.cc @@ -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]; diff --git a/intern/guardedalloc/intern/mallocn_lockfree_impl.cc b/intern/guardedalloc/intern/mallocn_lockfree_impl.cc index 694404d8ca1..bda9a52ddde 100644 --- a/intern/guardedalloc/intern/mallocn_lockfree_impl.cc +++ b/intern/guardedalloc/intern/mallocn_lockfree_impl.cc @@ -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];