From 95b0718a4a2911080ef2d88708b518ddf4f96e90 Mon Sep 17 00:00:00 2001 From: Gautier Pelloux-Prayer Date: Wed, 23 Apr 2014 10:07:12 +0200 Subject: [PATCH] cast size_t to unsigned long when using printf since some compilers complain about bad format conversion --- coreapi/quality_reporting.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/coreapi/quality_reporting.c b/coreapi/quality_reporting.c index 595db24d2..c9aaf331c 100644 --- a/coreapi/quality_reporting.c +++ b/coreapi/quality_reporting.c @@ -73,7 +73,9 @@ static void append_to_buffer_valist(char **buff, size_t *buff_size, size_t *offs // if we are out of memory, we add some size to buffer if (ret == BELLE_SIP_BUFFER_OVERFLOW) { - ms_warning("Buffer was too small to contain the whole report - doubling its size from %lu to %lu", *buff_size, 2 * *buff_size); + // some compilers complain that size_t cannot be formatted as unsigned long, hence forcing cast + ms_warning("Buffer was too small to contain the whole report - doubling its size from %lu to %lu", + (unsigned long)*buff_size, (unsigned long)2 * *buff_size); *buff_size += 2048; *buff = (char *) ms_realloc(*buff, *buff_size);