New SHA module won't compile blead under C++

Commit d3013bbfc3b14e06bdc794c44d15e95024343369
Upgrade Digest::SHA from version 5.88 to 5.91

breaks blead when compiling in C++.  The reason is that it uses a C++ 
reserved-word 'class' as a formal parameter name
0
public
5/28/2014 10:54:11 PM
perl.perl5.porters 48293 articles. 1 followers. Follow

2 Replies
194 Views

Similar Articles

[PageSpeed] 0

--------------030509040406060201000007
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

On 05/28/2014 04:54 PM, Karl Williamson wrote:
> Commit d3013bbfc3b14e06bdc794c44d15e95024343369
> Upgrade Digest::SHA from version 5.88 to 5.91
>
> breaks blead when compiling in C++.  The reason is that it uses a C++
> reserved-word 'class' as a formal parameter name
>

Reverted by c2de4d02ec9abcb746fff0e08aa79b17a217dbfa.  Attached is a 
patch that fixes the original problem.

--------------030509040406060201000007
Content-Type: text/x-diff;
 name="0053-Digest-SHA-SHA-Fix-C-compile-problem.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="0053-Digest-SHA-SHA-Fix-C-compile-problem.patch"

From 9f281db9a230ea74fa453d91e4e2a02d937f6a46 Mon Sep 17 00:00:00 2001
From: Karl Williamson <khw@cpan.org>
Date: Wed, 28 May 2014 19:34:45 -0600
Subject: [PATCH 53/53] Digest-SHA::SHA:  Fix C++ compile problem

by not using a C++ reserved-word as a formal parameter name
---
 cpan/Digest-SHA/SHA.xs | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/cpan/Digest-SHA/SHA.xs b/cpan/Digest-SHA/SHA.xs
index 7200a62..ce2d11a 100644
--- a/cpan/Digest-SHA/SHA.xs
+++ b/cpan/Digest-SHA/SHA.xs
@@ -66,8 +66,8 @@ shawrite(bitstr, bitcnt, s)
 	SHA *	s
 
 SV *
-newSHA(class, alg)
-	char *	class
+newSHA(type, alg)
+	char *	type
 	int 	alg
 PREINIT:
 	SHA *state;
@@ -78,7 +78,7 @@ CODE:
 		XSRETURN_UNDEF;
 	}
 	RETVAL = newSV(0);
-	sv_setref_pv(RETVAL, class, (void *) state);
+	sv_setref_pv(RETVAL, type, (void *) state);
 	SvREADONLY_on(SvRV(RETVAL));
 OUTPUT:
 	RETVAL
-- 
1.9.1


--------------030509040406060201000007--
0
public
5/29/2014 1:35:58 AM
On Wednesday-201405-28, 21:35, Karl Williamson wrote:
> On 05/28/2014 04:54 PM, Karl Williamson wrote:
>> Commit d3013bbfc3b14e06bdc794c44d15e95024343369
>> Upgrade Digest::SHA from version 5.88 to 5.91
>>
>> breaks blead when compiling in C++.  The reason is that it uses a C++
>> reserved-word 'class' as a formal parameter name
>>
>
> Reverted by c2de4d02ec9abcb746fff0e08aa79b17a217dbfa.  Attached is a
> patch that fixes the original problem.

Reported to Digest::SHA, though without your suggested patch because I 
had forgotten that you had suggested one...

https://rt.cpan.org/Public/Bug/Display.html?id=96090


0
jhi
5/31/2014 2:00:51 AM
Reply: