Skip to content

Fix const correctness with libxml2 >= 2.12.0#625

Merged
mlschroe merged 1 commit into
openSUSE:masterfrom
ppisar:xml_const
Jun 12, 2026
Merged

Fix const correctness with libxml2 >= 2.12.0#625
mlschroe merged 1 commit into
openSUSE:masterfrom
ppisar:xml_const

Conversation

@ppisar

@ppisar ppisar commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

If configured with -DENABLE_RPMMD=ON -DWITH_LIBXML2=ON and building with libxml2-2.13.9, this warning was reported:

/home/test/libsolv/ext/solv_xmlparser.c:294:25: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  294 |       xmlErrorPtr err = xmlCtxtGetLastError(xmlp->parser);
  |                         ^~~~~~~~~~~~~~~~~~~

The cause was that libxml2 2.12.0 changed a prototype of xmlCtxtGetLastError(). This patch fixes it.

If configured with -DENABLE_RPMMD=ON -DWITH_LIBXML2=ON and building
with libxml2-2.13.9, this warning was reported:

    /home/test/libsolv/ext/solv_xmlparser.c:294:25: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
      294 |       xmlErrorPtr err = xmlCtxtGetLastError(xmlp->parser);
	  |                         ^~~~~~~~~~~~~~~~~~~

The cause was that libxml2 2.12.0 changed a prototype of
xmlCtxtGetLastError(). This patch fixes it.
@mlschroe mlschroe merged commit 0241c9a into openSUSE:master Jun 12, 2026
1 check passed
@mlschroe

Copy link
Copy Markdown
Member

Thanks!

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.

2 participants