[xsd-users] Compilation error with xsd:decimal mapped to long double

Felix Hoppe hoppef at hsu-hh.de
Fri Sep 9 10:40:58 EDT 2022


Hallo,

I have the following problem: I tried to re-map the decimal type to 
"long double", as it is described for example in this mail 
https://www.codesynthesis.com/pipermail/xsd-users/2008-June/001776.html

However, now when I try to compile my code I get three error messages. 
Some excerpts of the errors (for errors 2 and 3 I omitted text for the 
sake of brevity):

/home/felix/Programming/ls1-mardyn/dependencies-external/libxsd/xsd/cxx/tree/parsing.txx:307:19: 
error: no matching member function for call to 'push_back'
             this->push_back (
             ~~~~~~^~~~~~~~~
/home/felix/Programming/ls1-mardyn/dependencies-external/libxsd/xsd/cxx/tree/parsing.txx:263:9: 
note: in instantiation of member function 'xsd::cxx::tree::list<long 
double, char, xsd::cxx::tree::schema_type::decimal, true>::init' 
requested here
         init (tree::text_content<C> (e), &e);
         ^
/home/felix/Programming/ls1-mardyn/src/io/vtk/vtk-unstructured.cpp:480:3: 
note: in instantiation of member function 'xsd::cxx::tree::list<long 
double, char, xsd::cxx::tree::schema_type::decimal, true>::list' 
requested here
   ::xsd::cxx::tree::list< ::xml_schema::decimal, char, 
::xsd::cxx::tree::schema_type::decimal > (e, f, this)
   ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/stl_vector.h:1187:7: 
note: candidate function not viable: no known conversion from 
'std::unique_ptr<long double>' to 'const std::vector<long double, 
std::allocator<long double> >::value_type' (aka 'const long double') for 
1st argument
       push_back(const value_type& __x)
       ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/stl_vector.h:1203:7: 
note: candidate function not viable: no known conversion from 
'std::unique_ptr<long double>' to 'std::vector<long double, 
std::allocator<long double> >::value_type' (aka 'long double') for 1st 
argument
       push_back(value_type&& __x)


Warning 2:
/libxsd/xsd/cxx/tree/elements.hxx:1509:39: error: excess elements in 
scalar initializer
           return XSD_AUTO_PTR<T> (new T (s, e, f, c));
                                       ^   ~~~~~~~~~

Warning 3:
/libxsd/xsd/cxx/tree/serialization.txx:226:14: error: invalid operands 
to binary expression ('list_stream<char>' and 'as_decimal<long double>')
           ls << as_decimal<T> (*i);
           ~~ ^  ~~~~~~~~~~~~~~~~~~

The xsdcxx version is 4.0.0, libxerces-c is 3.2.3. Tried different 
compilers like clang 10 or gcc 8.5 or 9.

Hopefully someone can help. Thanks in advance,
Felix



More information about the xsd-users mailing list