[xsd-users] FreeBSD compilation error

Maxim Maslennikov maxim.maslennikov at gmail.com
Tue Feb 24 18:32:04 EST 2015


Hi Boris,

I managed to do this.

First I change in file xsd-4.0.0+dep/libxsd-frontend/xsd-frontend/semantic-graph/elements.cxx
return os << path.string ().c_str ();
to
return os << wasting( path.string().begin(), path.string().end());

Second I change in file xsd-4.0.0+dep/build-0.3/git/gitignore
#! /usr/bin env bash
to
#! /usr/bin env sh
because of FreeBSD doesn’t use bash by default.

But I get a few Assertion failed messages during testing in file xsd-4.0.0+dep/xsd/tests/cxx/parser/validation/built-in/float/driver.cxx
I had to comment a few line to do all tests.

The part of the file is below:

  // Bad                                                                                                                                   
  //                                                                                                                                       
                                                                                                                                            
  // float                                                                                                                                 
  //                                                                                                                                       
  {                                                                                                                                        
    float_pimpl<char> p;                                                                                                                   
    p.pre ();                                                                                                                              
    p._pre ();                                                                                                                             
    p._characters ("+INF");                                                                                                                
    //assert (test_post_fail (p));                                                                                                         
  }                                                                                                                                        
                                                                                                                                            
  {                                                                                                                                        
    float_pimpl<char> p;                                                                                                                   
    p.pre ();                                                                                                                              
    p._pre ();                                                                                                                             
    p._characters ("1.45 E2");                                                                                                             
    assert (test_post_fail (p));                                                                                                           
  }                                                                                                                                        
                                                                                                                                            
  // double                                                                                                                                
  //                                                                                                                                       
  {                                                                                                                                        
    double_pimpl<char> p;                                                                                                                  
    p.pre ();                                                                                                                              
    p._pre ();                                                                                                                             
    p._characters ("+INF");                                                                                                                
    //assert (test_post_fail (p));                                                                                                         
  }                                                                                                                                        
                                                                                                                                            
  {                                                                                                                                        
    double_pimpl<char> p;                                                                                                                  
    p.pre ();                                                                                                                              
    p._pre ();                                                                                                                             
    p._characters ("1.45 E2");                                                                                                             
    assert (test_post_fail (p));                                                                                                           
  }                                                                                                                                        
                                                                                                                                            
  // decimal                                                                                                                               
  //                                                                                                                                       
  {                                                                                                                                        
    decimal_pimpl<char> p;                                                                                                                 
    p.pre ();                                                                                                                              
    p._pre ();                                                                                                                             
    p._characters ("INF");                                                                                                                 
    //assert (test_post_fail (p));                                                                                                         
  }                                                                                                                                        
                                                                                                                                            
  {                                                                                                                                        
    decimal_pimpl<char> p;                                                                                                                 
    p.pre ();                                                                                                                              
    p._pre ();                                                                                                                             
    p._characters ("+INF");                                                                                                                
    //assert (test_post_fail (p));                                                                                                         
  }                                                                                                                                        
                                                                                                                                            
  {                                                                                                                                        
    decimal_pimpl<char> p;                                                                                                                 
    p.pre ();                                                                                                                              
    p._pre ();                                                                                                                             
    p._characters ("-INF");                                                                                                                
    //assert (test_post_fail (p));                                                                                                         
  }
                                                                                                                                            
  {                                                                                                                                        
    decimal_pimpl<char> p;                                                                                                                 
    p.pre ();                                                                                                                              
    p._pre ();                                                                                                                             
    p._characters ("NaN");                                                                                                                 
    //assert (test_post_fail (p));                                                                                                         
  }  


Why I got these assertion messages? How to correct this?

Best Regards,
Maxim Maslennikov
Moscow Russia
+7 985 274-05-70

> On Feb 24, 2015, at 11:02 PM, Maxim Maslennikov <maxim.maslennikov at gmail.com> wrote:
> 
> Hi Boris,
> 
> Result is the same …
> 
> root at dev:~/dev # cat main.cpp 
> #include <iostream>
> 
> int main ()
> {
>  std::wcerr << "Hello, World!" << std::endl;
> }
> 
> root at dev:~/dev # clang++ -std=c++98 main.cpp -o test                                                              
> root at dev:~/dev # ./test                                                              
> Hello, World!
> root at dev:~/dev # 
> 
> Also tried compiling xsd with -std=c++98 and got the same error :(
> 
> /root/dev/xsd-4.0.0+dep/libxsd-frontend/xsd-frontend/semantic-graph/elements.cxx:298:13: error: invalid operands
>       to binary expression ('std::wostream' (aka 'basic_ostream<wchar_t>') and 'const value_type *'
>       (aka 'const char *'))
>   return os << path.string ().c_str ();
>          ~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~
> /root/dev/xsd-4.0.0+dep/libxsd-frontend/xsd-frontend/semantic-graph/elements.cxx:296:1: note: candidate function
>       not viable: no known conversion from 'const value_type *' (aka 'const char *') to 'const
>       XSDFrontend::SemanticGraph::Path' (aka 'const basic_path<char>') for 2nd argument
> operator<< (std::wostream& os, XSDFrontend::SemanticGraph::Path const& path)
> ^
> /usr/include/c++/v1/memory:5263:1: note: candidate template ignored: could not match
>       'shared_ptr<type-parameter-0-2>' against 'const char *'
> operator<<(basic_ostream<_CharT, _Traits>& __os, shared_ptr<_Yp> const& __p);
> ^
> /usr/include/c++/v1/string:4088:1: note: candidate template ignored: could not match
>       'basic_string<type-parameter-0-0, type-parameter-0-1, type-parameter-0-2>' against 'const char *'
> operator<<(basic_ostream<_CharT, _Traits>& __os,
> ^
> 1 error generated.
> 
> Best Regards,
> Maxim Maslennikov
> Moscow Russia
> +7 985 274-05-70
> 
>> On Feb 24, 2015, at 11:37 AM, Boris Kolpackov <boris at codesynthesis.com <mailto:boris at codesynthesis.com>> wrote:
>> 
>> Hi Maxim,
>> 
>> Maxim Maslennikov <maxim.maslennikov at gmail.com <mailto:maxim.maslennikov at gmail.com>> writes:
>> 
>>> root at dev:~/dev # clang++ -std=c++11 main.cpp -o test                                                                                               
>> 
>> Try in the c++98 mode since that's how you compile XSD. Clang is
>> known to be anal enough not to implement common sense stuff just
>> because the standard doesn't mandate it.
>> 
>> Boris
> 



More information about the xsd-users mailing list