From: Daniel Arndt Date: Sun, 18 Feb 2018 09:24:54 +0000 (+0100) Subject: Fix warning in TBB X-Git-Tag: v9.0.0-rc1~419^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ad513ca332d38bba8d70a537c5d791c13cce109f;p=dealii.git Fix warning in TBB --- diff --git a/bundled/tbb41_20130401oss/src/tbb/tools_api/ittnotify_static.c b/bundled/tbb41_20130401oss/src/tbb/tools_api/ittnotify_static.c index 462cc6f911..096794022e 100644 --- a/bundled/tbb41_20130401oss/src/tbb/tools_api/ittnotify_static.c +++ b/bundled/tbb41_20130401oss/src/tbb/tools_api/ittnotify_static.c @@ -277,14 +277,13 @@ ITT_EXTERN_C void _N_(error_handler)(__itt_error_code, va_list args); #pragma warning(disable: 4055) /* warning C4055: 'type cast' : from data pointer 'void *' to function pointer 'XXX' */ #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */ -static void __itt_report_error(__itt_error_code code, ...) -{ +static void __itt_report_error_impl(int code, ...) { va_list args; va_start(args, code); if (__itt_ittapi_global.error_handler != NULL) { - __itt_error_handler_t* handler = (__itt_error_handler_t*)__itt_ittapi_global.error_handler; - handler(code, args); + __itt_error_handler_t* handler = (__itt_error_handler_t*)(size_t)__itt_ittapi_global.error_handler; + handler((__itt_error_code)code, args); } #ifdef ITT_NOTIFY_EXT_REPORT _N_(error_handler)(code, args); @@ -292,6 +291,11 @@ static void __itt_report_error(__itt_error_code code, ...) va_end(args); } +//va_start cannot take enum (__itt_error_code) on clang, so it is necessary to transform it to int +#define __itt_report_error(code, ...) \ + __itt_report_error_impl((int)code,__VA_ARGS__) + + #if ITT_PLATFORM==ITT_PLATFORM_WIN #pragma warning(pop) #endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */