This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Try making gcc happy about casting U32 to void*.
authorJarkko Hietaniemi <jhi@iki.fi>
Wed, 19 Nov 2014 01:20:54 +0000 (20:20 -0500)
committerJarkko Hietaniemi <jhi@iki.fi>
Wed, 19 Nov 2014 01:20:54 +0000 (20:20 -0500)
util.c: In function ‘I32 Perl_xs_handshake(U32, void*, const char*, ...)’:
util.c:5389:39: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]

util.c

diff --git a/util.c b/util.c
index 35ab087..d1a13a2 100644 (file)
--- a/util.c
+++ b/util.c
@@ -5386,9 +5386,9 @@ Perl_xs_handshake(const U32 key, void * v_my_perl, const char * file, ...)
     PERL_ARGS_ASSERT_XS_HANDSHAKE;
     va_start(args, file);
 
-    got = (void *)(key & HSm_KEY_MATCH);
+    got = INT2PTR(void*, (UV)(key & HSm_KEY_MATCH));
     need = (void *)(HS_KEY(FALSE, FALSE, "", "") & HSm_KEY_MATCH);
-    if(UNLIKELY(got != need))
+    if (UNLIKELY(got != need))
        goto bad_handshake;
 /* try to catch where a 2nd threaded perl interp DLL is loaded into a process
    by a XS DLL compiled against the wrong interl DLL b/c of bad @INC, and the