Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 927838 - app-text/xmlstarlet: fails to build with -Werror=incompatible-pointer-types
Summary: app-text/xmlstarlet: fails to build with -Werror=incompatible-pointer-types
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Sebastian Pipping
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: c99-porting
  Show dependency tree
 
Reported: 2024-03-26 03:01 UTC by Eli Schwartz
Modified: 2024-03-27 22:51 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
build log (xmlstarlet-1.6.1-r1:20240326-025622.log,63.68 KB, text/x-log)
2024-03-26 03:01 UTC, Eli Schwartz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eli Schwartz 2024-03-26 03:01:59 UTC
Created attachment 888581 [details]
build log

$ ebuild xmlstarlet-1.6.1-r1.ebuild clean install


x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I.  -I//include -I//include/libxml2 -I/usr/include/libxml2 -Wall -pedantic -ansi -march=native -fstack-protector-all -O2 -pipe -fdiagnostics-color=always -frecord-gcc-switches -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-clash-protection -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing  -Wformat -Werror=format-security -Werror=implicit-function-declaration -Werror=implicit-int -Werror=int-conversion -Werror=incompatible-pointer-types -c -o src/xml.o src/xml.c
src/xml.c: In function ‘main’:
src/xml.c:300:43: error: passing argument 2 of ‘xmlSetStructuredErrorFunc’ from incompatible pointer type [-Werror=incompatible-pointer-types]
  300 |     xmlSetStructuredErrorFunc(&errorInfo, reportError);
      |                                           ^~~~~~~~~~~
      |                                           |
      |                                           void (*)(void *, xmlError *) {aka void (*)(void *, struct _xmlError *)}
In file included from /usr/include/libxml2/libxml/valid.h:15,
                 from /usr/include/libxml2/libxml/parser.h:19,
                 from /usr/include/libxml2/libxml/tree.h:17,
                 from /usr/include/libxslt/xslt.h:13,
                 from src/xml.c:37:
/usr/include/libxml2/libxml/xmlerror.h:898:57: note: expected ‘xmlStructuredErrorFunc’ {aka ‘void (*)(void *, const struct _xmlError *)’} but argument is of type ‘void (*)(void *, xmlError *)’ {aka ‘void (*)(void *, struct _xmlError *)’}
  898 |                                  xmlStructuredErrorFunc handler);
      |                                  ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
cc1: some warnings being treated as errors
make[1]: *** [Makefile:941: src/xml.o] Error 1
make[1]: Leaving directory '/var/tmp/portage/app-text/xmlstarlet-1.6.1-r1/work/xmlstarlet-1.6.1'
make[1]: Entering directory '/var/tmp/portage/app-text/xmlstarlet-1.6.1-r1/work/xmlstarlet-1.6.1'
x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I.  -I//include -I//include/libxml2 -I/usr/include/libxml2 -Wall -pedantic -ansi -march=native -fstack-protector-all -O2 -pipe -fdiagnostics-color=always -frecord-gcc-switches -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-clash-protection -flto=4 -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing  -Wformat -Werror=format-security -Werror=implicit-function-declaration -Werror=implicit-int -Werror=int-conversion -Werror=incompatible-pointer-types -c -o src/xml_validate.o src/xml_validate.c
src/xml_validate.c: In function ‘valMain’:
src/xml_validate.c:300:43: error: passing argument 2 of ‘xmlSetStructuredErrorFunc’ from incompatible pointer type [-Werror=incompatible-pointer-types]
  300 |     xmlSetStructuredErrorFunc(&errorInfo, reportError);
      |                                           ^~~~~~~~~~~
      |                                           |
      |                                           void (*)(void *, xmlError *) {aka void (*)(void *, struct _xmlError *)}
In file included from /usr/include/libxml2/libxml/xpath.h:26,
                 from src/xmlstar.h:15,
                 from src/xml_validate.c:35:
/usr/include/libxml2/libxml/xmlerror.h:898:57: note: expected ‘xmlStructuredErrorFunc’ {aka ‘void (*)(void *, const struct _xmlError *)’} but argument is of type ‘void (*)(void *, xmlError *)’ {aka ‘void (*)(void *, struct _xmlError *)’}
  898 |                                  xmlStructuredErrorFunc handler);
      |                                  ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
Comment 1 Larry the Git Cow gentoo-dev 2024-03-27 22:51:23 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=56085500739ab65b687013d8bd8e7725a8edd413

commit 56085500739ab65b687013d8bd8e7725a8edd413
Author:     Sebastian Pipping <sping@gentoo.org>
AuthorDate: 2024-03-27 22:45:51 +0000
Commit:     Sebastian Pipping <sping@gentoo.org>
CommitDate: 2024-03-27 22:45:51 +0000

    app-text/xmlstarlet: Fix compilation for Clang >=17
    
    Closes: https://bugs.gentoo.org/927838
    Signed-off-by: Sebastian Pipping <sping@gentoo.org>

 .../files/xmlstarlet-1.6.1-clang17.patch           | 59 +++++++++++++++++++++
 app-text/xmlstarlet/xmlstarlet-1.6.1-r2.ebuild     | 60 ++++++++++++++++++++++
 2 files changed, 119 insertions(+)