Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compilation with libxml2 2.12.0 #417

Merged
merged 7 commits into from
Nov 30, 2023
Merged

Fix compilation with libxml2 2.12.0 #417

merged 7 commits into from
Nov 30, 2023

Conversation

KNnut
Copy link
Contributor

@KNnut KNnut commented Nov 20, 2023

Tested with GCC 13.2.1 and libxml2 2.12.0.
Closes #418.

xml2_init.cpp: In function ‘SEXPREC* init_libxml2()’:
xml2_init.cpp:46:35: error: invalid conversion from ‘void (*)(void*, xmlError*)’ {aka ‘void (*)(void*, _xmlError*)’} to ‘xmlStructuredErrorFunc’ {aka ‘void (*)(void*, const _xmlError*)’} [-fpermissive]
   46 |   xmlSetStructuredErrorFunc(NULL, handleStructuredError);
      |                                   ^~~~~~~~~~~~~~~~~~~~~
      |                                   |
      |                                   void (*)(void*, xmlError*) {aka void (*)(void*, _xmlError*)}
In file included from xml2_init.cpp:8:
/usr/include/libxml2/libxml/xmlerror.h:898:57: note:   initializing argument 2 of ‘void xmlSetStructuredErrorFunc(void*, xmlStructuredErrorFunc)’
  898 |                                  xmlStructuredErrorFunc handler);
      |                                  ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
make: *** [/usr/lib64/R/etc/Makeconf:200: xml2_init.o] Error 1
ERROR: compilation failed for package ‘xml2’
xml2_schema.cpp: In function ‘SEXPREC* doc_validate(SEXP, SEXP)’:
xml2_schema.cpp:25:3: error: ‘xmlLineNumbersDefault’ was not declared in this scope
   25 |   xmlLineNumbersDefault(1);
      |   ^~~~~~~~~~~~~~~~~~~~~
xml2_schema.cpp:33:44: error: invalid conversion from ‘void (*)(void*, xmlError*)’ {aka ‘void (*)(void*, _xmlError*)’} to ‘xmlStructuredErrorFunc’ {aka ‘void (*)(void*, const _xmlError*)’} [-fpermissive]
   33 |   xmlSchemaSetParserStructuredErrors(cptr, handleSchemaError, &vec);
      |                                            ^~~~~~~~~~~~~~~~~
      |                                            |
      |                                            void (*)(void*, xmlError*) {aka void (*)(void*, _xmlError*)}
In file included from xml2_schema.cpp:5:
/usr/include/libxml2/libxml/xmlschemas.h:156:65: note:   initializing argument 2 of ‘void xmlSchemaSetParserStructuredErrors(xmlSchemaParserCtxtPtr, xmlStructuredErrorFunc, void*)’
  156 |                                          xmlStructuredErrorFunc serror,
      |                                          ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
xml2_schema.cpp:39:43: error: invalid conversion from ‘void (*)(void*, xmlError*)’ {aka ‘void (*)(void*, _xmlError*)’} to ‘xmlStructuredErrorFunc’ {aka ‘void (*)(void*, const _xmlError*)’} [-fpermissive]
   39 |   xmlSchemaSetValidStructuredErrors(vptr, handleSchemaError, &vec);
      |                                           ^~~~~~~~~~~~~~~~~
      |                                           |
      |                                           void (*)(void*, xmlError*) {aka void (*)(void*, _xmlError*)}
/usr/include/libxml2/libxml/xmlschemas.h:185:65: note:   initializing argument 2 of ‘void xmlSchemaSetValidStructuredErrors(xmlSchemaValidCtxtPtr, xmlStructuredErrorFunc, void*)’
  185 |                                          xmlStructuredErrorFunc serror,
      |                                          ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
make: *** [/usr/lib64/R/etc/Makeconf:200: xml2_schema.o] Error 1
xml2_schema.cpp: In function ‘SEXPREC* doc_validate(SEXP, SEXP)’:
xml2_schema.cpp:25:3: error: ‘xmlLineNumbersDefault’ was not declared in this scope
   25 |   xmlLineNumbersDefault(1);
      |   ^~~~~~~~~~~~~~~~~~~~~
make: *** [/usr/lib64/R/etc/Makeconf:200: xml2_schema.o] Error 1
@KNnut KNnut changed the title Fix compilation with GCC 13 Fix compilation with libxml2 2.12.0 Nov 20, 2023
@hadley hadley merged commit e4a54ae into r-lib:main Nov 30, 2023
12 checks passed
@hadley
Copy link
Member

hadley commented Nov 30, 2023

Thanks for figuring this out!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error during installation of xml2
2 participants