[xsd-users] segmentation fault in the simplified library example(C++/Parser)

Wahid hamishagi at yahoo.com
Mon Mar 12 23:00:55 EDT 2012


Hi Boris,
thank you it worked as you suggested.
vahid


--- On Mon, 3/12/12, Boris Kolpackov <boris at codesynthesis.com> wrote:

From: Boris Kolpackov <boris at codesynthesis.com>
Subject: Re: [xsd-users] segmentation fault in the simplified library example(C++/Parser)
To: "Wahid" <hamishagi at yahoo.com>
Cc: xsd-users at codesynthesis.com
Date: Monday, March 12, 2012, 4:25 PM

Hi Wahid,

Wahid <hamishagi at yahoo.com> writes:

> Then let the following command creat the skeleton and implementation files
> for you:
> xsd cxx-parser --generate-noop-impl --type-map library.map library.xsd

When you use a type map, generated post_*() callbacks have non-void return
types. Take a look, for example, at the generated catalog_pimpl class. The
post_catalog() callback has the following signature:

virtual library::catalog
post_catalog ();

If you look at the generated implementation for this callback, you will
see:

library::catalog catalog_pimpl::
post_catalog ()
{
  // TODO
  //
  // return ... ;
}

As you can see, the comment even tells you that you must remember to
return the value from this function!

In more general terms, the generated implementations are just stubs
that you must fill with actual code. When type maps are not used, the
generated implementations will run as is (though won't do anything
useful). If, however, you are using type maps, then you will need to
fill in the implementations to at least return something.

Boris


More information about the xsd-users mailing list