Subject: | Digest-MD5 2.50 fails to build under g++ |
Digest-MD5 2.50 was recently merged into blead perl, and is causing a
compilation when building with g++.
The culprit is the cast on line 483 of MD5.xs:
sv_magicext(sv, NULL, PERL_MAGIC_ext, &vtbl_md5, (void *)context, 0);
The context parameter is a char *, and unlike C, C++ doesn't implicitly
cast void * to other pointer types.
Changing the code to:
sv_magicext(sv, NULL, PERL_MAGIC_ext, &vtbl_md5, (char *)context, 0);
and updating the hash in t/files.t fixes the compilation error and
allows tests to pass.
I've attached the diff to blead that I tested with.
Tony
Subject: | md5-cast.diff |
diff --git a/cpan/Digest-MD5/MD5.xs b/cpan/Digest-MD5/MD5.xs
index ac36b05..0fc9944 100644
--- a/cpan/Digest-MD5/MD5.xs
+++ b/cpan/Digest-MD5/MD5.xs
@@ -480,7 +480,7 @@ static SV * new_md5_ctx(pTHX_ MD5_CTX *context, const char *klass)
#ifdef USE_ITHREADS
mg =
#endif
- sv_magicext(sv, NULL, PERL_MAGIC_ext, &vtbl_md5, (void *)context, 0);
+ sv_magicext(sv, NULL, PERL_MAGIC_ext, &vtbl_md5, (char *)context, 0);
#ifdef USE_ITHREADS
mg->mg_flags |= MGf_DUP;
diff --git a/cpan/Digest-MD5/t/files.t b/cpan/Digest-MD5/t/files.t
index 854e76f..8a6fe86 100644
--- a/cpan/Digest-MD5/t/files.t
+++ b/cpan/Digest-MD5/t/files.t
@@ -21,7 +21,7 @@ EOT
# This is the output of: 'md5sum README MD5.xs rfc1321.txt'
$EXPECT = <<EOT;
c8d3f8457a2d6983253d771ffddb9f4c README
-dab5596ff82930da5cdf75afcd255f9c MD5.xs
+5cf175e9864466e08a07c8ecfa14b37c MD5.xs
754b9db19f79dbc4992f7166eb0f37ce rfc1321.txt
EOT
}