SWDEV-431399 - add const cast to pointer before casting it to function type.

C++ does not allow const qualifier on function type, even if we add it it will get ignored and clang will fail with failed cast from const void* to func*. const_cast here is necessary to make it work.

Change-Id: I72cec8d9e715bdf9e163cb9b08393dd733dafaf2


[ROCm/clr commit: 5b5213adf5]
This commit is contained in:
Jatin Chaudhary authored and Jatin Jaikishan Chaudhary committed 2023-12-04 04:34:57 -05:00
1 förälder ab411c8f34
incheckning c9b5c5c657
1 file changed
+1 -1
+1 -1
Visa fil
@@ -48,7 +48,7 @@ const char* hipKernelNameRefByPtr(const void* host_function, hipStream_t stream)
void hipRegisterTracerCallback(const void* function) {
typedef int (*fptr)(activity_domain_t domain, uint32_t operation_id, void* data);
fptr my_fptr = reinterpret_cast<fptr>(function);
fptr my_fptr = reinterpret_cast<fptr>(const_cast<void*>(function));
activity_prof::report_activity.store(my_fptr, std::memory_order_relaxed);
}