From 4f45240bc84a9aa648c8f7243be7b79e9f9323a5 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 29 Apr 2016 15:46:40 +0200 Subject: lib: include curl_printf.h as one of the last headers curl_printf.h defines printf to curl_mprintf, etc. This can cause problems with external headers which may use __attribute__((format(printf, ...))) markers etc. To avoid that they cause problems with system includes, we include curl_printf.h after any system headers. That makes the three last headers to always be, and we keep them in this order: curl_printf.h curl_memory.h memdebug.h None of them include system headers, they all do funny #defines. Reported-by: David Benjamin Fixes #743 --- lib/memdebug.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/memdebug.c') diff --git a/lib/memdebug.c b/lib/memdebug.c index 804b5fa34..1618bbaf3 100644 --- a/lib/memdebug.c +++ b/lib/memdebug.c @@ -26,10 +26,12 @@ #include -#include "curl_printf.h" #include "urldata.h" #define MEMDEBUG_NODEFINES /* don't redefine the standard functions */ + +/* The last 3 #include files should be in this order */ +#include "curl_printf.h" #include "curl_memory.h" #include "memdebug.h" -- cgit v1.2.3