summaryrefslogtreecommitdiff
path: root/textproc/p5-XML-LibXML/files/patch-perl-libxml-mm.c
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2023-05-10 21:19:33 +0200
committerDimitry Andric <dim@FreeBSD.org>2023-05-18 13:36:36 +0200
commitea9006c8e8ff30532f8ebd66d850cc6b2b8701b7 (patch)
tree7fbd47f2aaba2a5e0e6e095ada55a647472b82ab /textproc/p5-XML-LibXML/files/patch-perl-libxml-mm.c
parentmultimedia/smpeg: fix build with clang 16 (diff)
textproc/p5-XML-LibXML: fix build with clang 16
Clang 16 has a new error about incompatible function types, which shows up when building textproc/p5-XML-LibXML: perl-libxml-mm.c:142:18: error: incompatible function pointer types passing 'void (void *, void *, xmlChar *)' (aka 'void (void *, void *, unsigned char *)') to parameter of type 'xmlHashScanner' (aka 'void (*)(void *, void *, const unsigned char *)') [-Wincompatible-function-pointer-types] xmlHashScan(r, PmmRegistryDumpHashScanner, NULL); ^~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/local/include/libxml2/libxml/hash.h:213:22: note: passing argument to parameter 'f' here xmlHashScanner f, ^ perl-libxml-mm.c:234:44: error: incompatible function pointer types passing 'void (void *, xmlChar *)' (aka 'void (void *, unsigned char *)') to parameter of type 'xmlHashDeallocator' (aka 'void (*)(void *, const unsigned char *)') [-Wincompatible-function-pointer-types] if( xmlHashRemoveEntry(PmmREGISTRY, name, PmmRegistryHashDeallocator) ) ^~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/local/include/libxml2/libxml/hash.h:160:47: note: passing argument to parameter 'f' here xmlHashDeallocator f); ^ perl-libxml-mm.c:301:38: error: incompatible function pointer types passing 'void *(void *, xmlChar *)' (aka 'void *(void *, unsigned char *)') to parameter of type 'xmlHashCopier' (aka 'void *(*)(void *, const unsigned char *)') [-Wincompatible-function-pointer-types] reg_copy = xmlHashCopy(PmmREGISTRY, PmmRegistryHashCopier); ^~~~~~~~~~~~~~~~~~~~~ /usr/local/include/libxml2/libxml/hash.h:208:21: note: passing argument to parameter 'f' here xmlHashCopier f); ^ In all three cases, the libxml2 callback functions require const xmlChar pointers, so fix the parameters in their definitions. PR: 271355 Approved by: portmgr (build fix blanket) MFH: 2023Q2
Diffstat (limited to 'textproc/p5-XML-LibXML/files/patch-perl-libxml-mm.c')
-rw-r--r--textproc/p5-XML-LibXML/files/patch-perl-libxml-mm.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/textproc/p5-XML-LibXML/files/patch-perl-libxml-mm.c b/textproc/p5-XML-LibXML/files/patch-perl-libxml-mm.c
new file mode 100644
index 000000000000..ad6f7f1d6489
--- /dev/null
+++ b/textproc/p5-XML-LibXML/files/patch-perl-libxml-mm.c
@@ -0,0 +1,29 @@
+--- perl-libxml-mm.c.orig 2022-09-21 16:57:45 UTC
++++ perl-libxml-mm.c
+@@ -121,7 +121,7 @@ extern SV* PROXY_NODE_REGISTRY_MUTEX;
+ extern SV* PROXY_NODE_REGISTRY_MUTEX;
+
+ /* Utility method used by PmmDumpRegistry */
+-void PmmRegistryDumpHashScanner(void * payload, void * data, xmlChar * name)
++void PmmRegistryDumpHashScanner(void * payload, void * data, const xmlChar * name)
+ {
+ LocalProxyNodePtr lp = (LocalProxyNodePtr) payload;
+ ProxyNodePtr node = (ProxyNodePtr) lp->proxy;
+@@ -215,7 +215,7 @@ static void
+ /* PP: originally this was static inline void, but on AIX the compiler
+ did not chew it, so I'm removing the inline */
+ static void
+-PmmRegistryHashDeallocator(void *payload, xmlChar *name)
++PmmRegistryHashDeallocator(void *payload, const xmlChar *name)
+ {
+ Safefree((LocalProxyNodePtr) payload);
+ }
+@@ -279,7 +279,7 @@ void *
+ * internal, used by PmmCloneProxyNodes
+ */
+ void *
+-PmmRegistryHashCopier(void *payload, xmlChar *name)
++PmmRegistryHashCopier(void *payload, const xmlChar *name)
+ {
+ ProxyNodePtr proxy = ((LocalProxyNodePtr) payload)->proxy;
+ LocalProxyNodePtr lp;