From ee21b5378ba87dafc6e4d84a19a94b53e71aeee2 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 3 Nov 2020 15:07:08 -0500 Subject: microprofile: Silence warning in headers Silences a truncation warning by making the truncation explicit and documenting the reason for it. --- externals/microprofile/microprofile.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'externals') diff --git a/externals/microprofile/microprofile.h b/externals/microprofile/microprofile.h index 5c381f002..a06f6457d 100644 --- a/externals/microprofile/microprofile.h +++ b/externals/microprofile/microprofile.h @@ -948,7 +948,11 @@ typedef HANDLE MicroProfileThread; DWORD _stdcall ThreadTrampoline(void* pFunc) { MicroProfileThreadFunc F = (MicroProfileThreadFunc)pFunc; - return (DWORD)F(0); + + // The return value of F will always return a void*, however, this is for + // compatibility with pthreads. The underlying "address" of the pointer + // is always a 32-bit value, so this cast is safe to perform. + return static_cast(reinterpret_cast(F(0))); } inline void MicroProfileThreadStart(MicroProfileThread* pThread, MicroProfileThreadFunc Func) -- cgit v1.2.3