Bug 271413 - textproc/xmlstarlet: fix build with clang 16
Summary: textproc/xmlstarlet: fix build with clang 16
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Hiroki Sato
URL:
Keywords:
Depends on:
Blocks: 271047
  Show dependency treegraph
 
Reported: 2023-05-14 13:51 UTC by Dimitry Andric
Modified: 2023-05-18 11:44 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (hrs)


Attachments
textproc/xmlstarlet: fix build with clang 16 (1.63 KB, patch)
2023-05-14 13:52 UTC, Dimitry Andric
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitry Andric freebsd_committer freebsd_triage 2023-05-14 13:51:56 UTC
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.
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2023-05-14 13:52:16 UTC
Created attachment 242167 [details]
textproc/xmlstarlet: fix build with clang 16
Comment 2 commit-hook freebsd_committer freebsd_triage 2023-05-18 11:41:58 UTC
A commit in branch main references this bug:

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 (new) | 11 +++++++++++
 2 files changed, 12 insertions(+), 1 deletion(-)