Message: xmlparse.cc: error: cannot convert 'XML_Status' to 'XML_Error' in assignment Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Warning xmlparse.cc: error: cannot convert 'XML_Status' to 'XML_Error' in assignment 

Forum: Installation and Configuration
Date: 27 Jun, 2013
From: Mojca Miklavec <Mojca Miklavec>

During compilation of Geant4.9.5.p02 on Windows XP (MinGW) one of the compilation errors was the following:

  [ 26%] Building CXX object source/externals/expat/CMakeFiles/_G4expat-archive.dir/src/xmlparse.cc.obj
  C:\Programs\geant4\geant4.9.5.p02-src\source\externals\expat\src\xmlparse.cc:1151:1: warning: unused parameter 'parser' [-Wunused-parameter]
  C:\Programs\geant4\geant4.9.5.p02-src\source\externals\expat\src\xmlparse.cc:1151:1: warning: unused parameter 'useDTD' [-Wunused-parameter]
  C:\Programs\geant4\geant4.9.5.p02-src\source\externals\expat\src\xmlparse.cc: In function 'XML_Status XML_Parse(XML_Parser, const char*, int, int)':
  C:\Programs\geant4\geant4.9.5.p02-src\source\externals\expat\src\xmlparse.cc:1494:18: error: cannot convert 'XML_Status' to 'XML_Error' in assignment
  C:\Programs\geant4\geant4.9.5.p02-src\source\externals\expat\src\xmlparse.cc:1498:18: error: cannot convert 'XML_Status' to 'XML_Error' in assignment
  C:\Programs\geant4\geant4.9.5.p02-src\source\externals\expat\src\xmlparse.cc:1501:18: error: cannot convert 'XML_Error' to 'XML_Status' in return
  C:\Programs\geant4\geant4.9.5.p02-src\source\externals\expat\src\xmlparse.cc:1492:14: warning: enumeration value 'XML_FINISHED' not handled in switch [-W
  switch]
  C:\Programs\geant4\geant4.9.5.p02-src\source\externals\expat\src\xmlparse.cc:1536:12: error: cannot convert 'XML_Error' to 'XML_Status' in return
  C:\Programs\geant4\geant4.9.5.p02-src\source\externals\expat\src\xmlparse.cc: At global scope:
  C:\Programs\geant4\geant4.9.5.p02-src\source\externals\expat\src\xmlparse.cc:1778:1: warning: unused parameter 'parser' [-Wunused-parameter]
  C:\Programs\geant4\geant4.9.5.p02-src\source\externals\expat\src\xmlparse.cc:1778:1: warning: unused parameter 'offset' [-Wunused-parameter]
  C:\Programs\geant4\geant4.9.5.p02-src\source\externals\expat\src\xmlparse.cc:1778:1: warning: unused parameter 'size' [-Wunused-parameter]
  C:\Programs\geant4\geant4.9.5.p02-src\source\externals\expat\src\xmlparse.cc:4802:1: warning: unused parameter 's' [-Wunused-parameter]
  C:\Programs\geant4\geant4.9.5.p02-src\source\externals\expat\src\xmlparse.cc:4802:1: warning: unused parameter 'end' [-Wunused-parameter]
  C:\Programs\geant4\geant4.9.5.p02-src\source\externals\expat\src\xmlparse.cc:4802:1: warning: unused parameter 'nextPtr' [-Wunused-parameter]
  C:\Programs\geant4\geant4.9.5.p02-src\source\externals\expat\src\xmlparse.cc: In function 'XML_Status XML_Parse(XML_Parser, const char*, int, int)':
  C:\Programs\geant4\geant4.9.5.p02-src\source\externals\expat\src\xmlparse.cc:1548:1: warning: control reaches end of non-void function [-Wreturn-type]
  source\externals\expat\CMakeFiles\_G4expat-archive.dir\build.make:57: recipe for target 'source/externals/expat/CMakeFiles/_G4expat-archive.dir/src/xmlparse.cc.
  obj' failed
  mingw32-make[2]: *** [source/externals/expat/CMakeFiles/_G4expat-archive.dir/src/xmlparse.cc.obj] Error 1
  CMakeFiles\Makefile2:1029: recipe for target 'source/externals/expat/CMakeFiles/_G4expat-archive.dir/all' failed
  mingw32-make[1]: *** [source/externals/expat/CMakeFiles/_G4expat-archive.dir/all] Error 2
  Makefile:135: recipe for target 'all' failed
  mingw32-make: *** [all] Error 2

and this seems to be the cure:

  --- a/source/externals/expat/src/xmlparse.cc
  +++ b/source/externals/expat/src/xmlparse.cc
  @@ -1475,7 +1475,7 @@ XML_Parse(XML_Parser parser, const char *s, int len, int i
     else if (bufferPtr == bufferEnd) {
       const char *end;
       int nLeftOver;
  -    enum XML_Error result;
  +    enum XML_Status result;
       parseEndByteIndex += len;
       positionPtr = s;
       ps_finalBuffer = (XML_Bool)isFinal;

(at least for the error; I didn't try to address the warnings yet)

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 Warning: Re: xmlparse.cc: error: cannot convert 'XML_Status' to 'XML_Error' in assignment   (Gabriele Cosmo - 28 Jun, 2013)
 Add Message Add Message
to: "xmlparse.cc: error: cannot convert 'XML_Status' to 'XML_Error' in assignment"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]