[xsd-users] Re: expat build fails with 4.0

Ovanes Markarian om_codesynthesis at keywallet.com
Wed Jul 23 21:36:01 EDT 2014


OK, after patching some files got it working :(

Here are the patches:

elements.hxx, line: 54

change typedef to:
       typedef std::unique_ptr<XML_ParserStruct, parser_deleter>
parser_auto_ptr;

There was no parser deleter specification

elements.txx:

Had in two places:
  begin_parse(parser, ...) calls and these must be:
  begin_parse(parser.get(), ...) calls.


Would be great if you could verify these proposals and release a new
version.


On Thu, Jul 24, 2014 at 3:01 AM, Ovanes Markarian <
om_codesynthesis at keywallet.com> wrote:

> I get even more errors :(
>
>
> Seems like the in the expat version which I have installed (2.1.0)
> XML_ParserStruct is an incomplete type. I can't find the definition of the
> struct in any of the header files. Therefore it is an incomplete type and
> unique_ptr implementation can't delete it. Luckily there was a
> static_assert :)
>
>
> In file included from /usr/local/include/xsd/cxx/xml/error-handler.hxx:8:
> In file included from
> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/string:439:
> In file included from
> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/algorithm:627:
> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/memory:2424:27:
> error: invalid application of 'sizeof' to an incomplete type
> 'XML_ParserStruct'
>             static_assert(sizeof(_Tp) > 0, "default_delete can not delete
> incomplete type");
>                           ^~~~~~~~~~~
> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/memory:2625:13:
> note: in instantiation of member function
> 'std::__1::default_delete<XML_ParserStruct>::operator()' requested here
>             __ptr_.second()(__tmp);
>             ^
> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/memory:2593:46:
> note: in instantiation of member function
> 'std::__1::unique_ptr<XML_ParserStruct,
> std::__1::default_delete<XML_ParserStruct> >::reset' requested here
>     _LIBCPP_INLINE_VISIBILITY ~unique_ptr() {reset();}
>                                              ^
> /usr/local/include/xsd/cxx/parser/expat/elements.hxx:102:16: note: in
> instantiation of member function 'std::__1::unique_ptr<XML_ParserStruct,
> std::__1::default_delete<XML_ParserStruct> >::~unique_ptr' requested here
>         struct document: cxx::parser::document<C> // VC likes it qualified
>                ^
> /usr/local/include/expat.h:24:8: note: forward declaration of
> 'XML_ParserStruct'
> struct XML_ParserStruct;
>        ^
>
>
> On Thu, Jul 24, 2014 at 2:29 AM, Ovanes Markarian <
> om_codesynthesis at keywallet.com> wrote:
>
>> Hello *,
>>
>> there seems to be a minor misconception with expat interface. Clang 3.4
>> on Mac OS X gives me the error:
>>
>> /usr/local/include/xsd/cxx/parser/expat/elements.txx:313:17: error: no
>> matching function for call to 'XML_Parse'
>>             if (XML_Parse (
>>                 ^~~~~~~~~
>> /usr/local/include/expat.h:778:1: note: candidate function not viable: no
>> known conversion from 'parser_auto_ptr' (aka
>> 'unique_ptr<XML_ParserStruct>') to 'XML_Parser' (aka 'XML_ParserStruct *')
>> for 1st argument
>> XML_Parse(XML_Parser parser, const char *s, int len, int isFinal);
>> ^
>>
>> std::unique_ptr does not implicitly converts to the pointer to the value
>> contained there...
>>
>> IMO there must be:
>>
>>             if (XML_Parse (
>>                   parser.get(), buf, is.gcount (), is.eof ()) ==
>> XML_STATUS_ERROR)
>>                            ^^^^^
>>            {
>>               r = false;
>>               break;
>>             }
>>
>> which fixes the problem. But I'am not sure weather I'am correct about
>> passing a bare pointer. I think yes, as expat is a C based parser.
>>
>>
>> Thanks for the new release,
>> Ovanes
>>
>
>


More information about the xsd-users mailing list