summaryrefslogtreecommitdiffstats
path: root/lang/perl/perl-authen-sasl-xs/patches/105-gcc-14.patch
blob: 1642e271e58b45bc651da06dae0956237b05d8b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
Description: fix multiple build issues with gcc 14.
 Multiple callbacks are cast due to otherwise incompatible pointer
 types.  The target pointer cb->proc cannot really see its type adjusted
 for two reasons.  First, it is declared in the libsasl2, and changing
 it might cause an ABI/API breakage.  Second, the different callbacks
 also have different function signatures anyway.
 .
 Another issue seems to be a casting error while trying to set an IV:
 .
 	XS.xs:1886:40: error:
	        initialization of ‘IV’ {aka ‘long int’} from ‘int *’
                makes integer from pointer without a cast [-Wint-conversion]
 	 1886 |                                 XPUSHi((int *)value);
 	      |                                        ^
 	/usr/lib/x86_64-linux-gnu/perl/5.38/CORE/pp.h:428:23: note: in definition of macro ‘TARGi’
 	  428 |         IV TARGi_iv = i;                                                \
 	      |                       ^
 	XS.xs:1886:33: note: in expansion of macro ‘XPUSHi’
 	 1886 |                                 XPUSHi((int *)value);
 	      |                                 ^~~~~~
 .
 It is unclear to me what was the motivation for the initial wrong type.

Author: Étienne Mollier <emollier@debian.org>
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1075146
Forwarded: no
Last-Update: 2024-07-26
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/XS.xs
+++ b/XS.xs
@@ -892,39 +892,39 @@ void AddCallback(SV *action, struct _per
 		case SASL_CB_USER:
 		case SASL_CB_AUTHNAME:
 		case SASL_CB_LANGUAGE:
-				 cb->proc = PerlCallback;
+				 cb->proc = (int (*)(void))PerlCallback;
 			break;
 
 		case SASL_CB_PASS:
-				cb->proc = PerlCallbackSecret;
+				cb->proc = (int (*)(void))PerlCallbackSecret;
 			break;
 
 		case SASL_CB_GETREALM:
-				cb->proc = PerlCallbackRealm;
+				cb->proc = (int (*)(void))PerlCallbackRealm;
 			break;
 
 		case SASL_CB_ECHOPROMPT:
 		case SASL_CB_NOECHOPROMPT:
 			break;
 		case SASL_CB_PROXY_POLICY:
-				cb->proc = PerlCallbackAuthorize;
+				cb->proc = (int (*)(void))PerlCallbackAuthorize;
 			break;
 
 		case SASL_CB_CANON_USER:
-				cb->proc = PerlCallbackCanonUser;
+				cb->proc = (int (*)(void))PerlCallbackCanonUser;
 			break;
 #ifdef SASL2
 		case SASL_CB_SERVER_USERDB_CHECKPASS:
-				cb->proc = PerlCallbackServerCheckPass;
+				cb->proc = (int (*)(void))PerlCallbackServerCheckPass;
 			break;
 
 		case SASL_CB_SERVER_USERDB_SETPASS:
-				cb->proc = PerlCallbackServerSetPass;
+				cb->proc = (int (*)(void))PerlCallbackServerSetPass;
 			break;
 #else
 		// SASL 1 Servercallbacks:
 		case SASL_CB_SERVER_GETSECRET:
-				cb->proc = PerlCallbackGetSecret;
+				cb->proc = (int (*)(void))PerlCallbackGetSecret;
 			break;
 		case SASL_CB_SERVER_PUTSECRET:
 				// Not implemented yet maybe TODO, if ever needed
@@ -1883,7 +1883,7 @@ PPCODE:
 			break;
 			case SASL_SSF:
 			case SASL_MAXOUTBUF:
-				XPUSHi((int *)value);
+				XPUSHi((long int)value);
 			break;
 #ifdef SASL2
 			case SASL_IPLOCALPORT: