Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 May 2023 11:41:07 GMT
From:      Dimitry Andric <dim@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: ba3df3c788d0 - main - textproc/xmlstarlet: fix build with clang 16
Message-ID:  <202305181141.34IBf7Yw086800@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by dim:

URL: https://cgit.FreeBSD.org/ports/commit/?id=ba3df3c788d068ca6cbad5e6c6735a2111194de3

commit ba3df3c788d068ca6cbad5e6c6735a2111194de3
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2023-05-14 13:48:31 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2023-05-18 11:37:47 +0000

    textproc/xmlstarlet: fix build with clang 16
    
    Clang 16 has a new error about incompatible function types, which shows
    up when building textproc/xmlstarlet:
    
      src/xml_elem.c:271:27: 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(uniq, hash_key_put, &lines);
                                ^~~~~~~~~~~~
      /usr/local/include/libxml2/libxml/hash.h:213:22: note: passing argument to parameter 'f' here
                                               xmlHashScanner f,
                                                              ^
    
    In this case, the libxml2 callback function requires a const xmlChar
    pointer, so fix the parameter in the definition.
    
    PR:             271413
    Approved by:    portmgr (build fix blanket)
    MFH:            2023Q2
---
 textproc/xmlstarlet/Makefile                    |  2 +-
 textproc/xmlstarlet/files/patch-src_xml__elem.c | 11 +++++++++++
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/textproc/xmlstarlet/Makefile b/textproc/xmlstarlet/Makefile
index 4c5610500277..320d60ebade2 100644
--- a/textproc/xmlstarlet/Makefile
+++ b/textproc/xmlstarlet/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	xmlstarlet
 PORTVERSION=	1.6.1
-PORTREVISION=	2
+PORTREVISION=	3
 CATEGORIES=	textproc
 MASTER_SITES=	SF/xmlstar/${PORTNAME}/${PORTVERSION}
 
diff --git a/textproc/xmlstarlet/files/patch-src_xml__elem.c b/textproc/xmlstarlet/files/patch-src_xml__elem.c
new file mode 100644
index 000000000000..cad7b77b790d
--- /dev/null
+++ b/textproc/xmlstarlet/files/patch-src_xml__elem.c
@@ -0,0 +1,11 @@
+--- src/xml_elem.c.orig	2012-08-12 15:18:59 UTC
++++ src/xml_elem.c
+@@ -186,7 +186,7 @@ static void
+  * put @name into @data->array[@data->offset]
+  */
+ static void
+-hash_key_put(void *payload, void *data, xmlChar *name)
++hash_key_put(void *payload, void *data, const xmlChar *name)
+ {
+     ArrayDest *dest = data;
+     dest->array[dest->offset++] = name;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202305181141.34IBf7Yw086800>