summarylogtreecommitdiffstats
path: root/0001-xsdconvert-xmlGetLastError-fix-invalid-pointer-conv.patch
blob: 4e17eda79dee8688d60b26f2fb3523f97f471d7e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
From 9d0675181ffce9f938bf77a53ab4186415011e41 Mon Sep 17 00:00:00 2001
From: Vadim Yanitskiy <vyanitskiy@sysmocom.de>
Date: Wed, 8 May 2024 15:44:21 +0200
Subject: [PATCH] xsdconvert: xmlGetLastError(): fix invalid pointer conversion
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This patch fixes the following errors observed with libxml2 v2.12.6:

XMLParser.cc: In static member function ‘static void XMLParser::warningHandler(void*, const char*, ...)’:
XMLParser.cc:193:38: error: invalid conversion from ‘const xmlError*’ {aka ‘const _xmlError*’} to ‘xmlErrorPtr’ {aka ‘_xmlError*’} [-fpermissive]
  193 |   xmlErrorPtr error = xmlGetLastError();
      |                       ~~~~~~~~~~~~~~~^~
      |                                      |
      |                                      const xmlError* {aka const _xmlError*}
XMLParser.cc: In static member function ‘static void XMLParser::errorHandler(void*, const char*, ...)’:
XMLParser.cc:213:38: error: invalid conversion from ‘const xmlError*’ {aka ‘const _xmlError*’} to ‘xmlErrorPtr’ {aka ‘_xmlError*’} [-fpermissive]
  213 |   xmlErrorPtr error = xmlGetLastError();
      |                       ~~~~~~~~~~~~~~~^~
      |                                      |
      |                                      const xmlError* {aka const _xmlError*}
---
 xsdconvert/XMLParser.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xsdconvert/XMLParser.cc b/xsdconvert/XMLParser.cc
index 567a8027f..6d1c416cb 100644
--- a/xsdconvert/XMLParser.cc
+++ b/xsdconvert/XMLParser.cc
@@ -190,7 +190,7 @@ void XMLParser::warningHandler(void *, const char *, ...) {
     return;
   }
 
-  xmlErrorPtr error = xmlGetLastError();
+  const xmlError *error = xmlGetLastError();
 
   if (error->file == NULL) {
     fprintf(stderr,
@@ -210,7 +210,7 @@ void XMLParser::warningHandler(void *, const char *, ...) {
 }
 
 void XMLParser::errorHandler(void *, const char *, ...) {
-  xmlErrorPtr error = xmlGetLastError();
+  const xmlError *error = xmlGetLastError();
 
   if (error->code == XML_SCHEMAP_SRC_RESOLVE) {
     return;
-- 
2.45.0