Skip to content
Browse files

Fix invalid cast in wxMSW AutoHANDLE::InvalidHandle()

Somehow this compiled with the previous gcc versions (as well as MSVS),
but a static_cast from an integer wxUIntPtr type to a pointer HANDLE
type is obviously invalid and a reinterpret_cast is needed here.

This fixes compilation with g++ 8.
  • Loading branch information...
vadz committed May 27, 2018
1 parent 81750e5 commit 424f64f27d94f83ed946ebfcf9b9543c828f9f25
Showing with 1 addition and 1 deletion.
  1. +1 −1 include/wx/msw/private.h
@@ -145,7 +145,7 @@ class AutoHANDLE
// implicitly convertible to HANDLE, which is a pointer.
static HANDLE InvalidHandle()
return static_cast<HANDLE>(INVALID_VALUE);
return reinterpret_cast<HANDLE>(INVALID_VALUE);

void DoClose()

0 comments on commit 424f64f

Please sign in to comment.
You can’t perform that action at this time.