]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix warning in TBB 5923/head
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Sun, 18 Feb 2018 09:24:54 +0000 (10:24 +0100)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Sun, 18 Feb 2018 12:01:25 +0000 (13:01 +0100)
bundled/tbb41_20130401oss/src/tbb/tools_api/ittnotify_static.c

index 462cc6f911195f5bc0817a995b540cb6cce394c2..096794022ed7129e7324d0eb2fea2bfd711b23e6 100644 (file)
@@ -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 */

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.