Hi all,

x10c++ from trunk has trouble compiling this code:

class bw_bzero extends BandwidthTest
{
    private def this( val bytes : ULong ) {
        super( bytes );
    }

    // Entry point 
        public static def main( args : Array[String]( 1 ) ) {
        val niter = UInt.parse( args( 0 ) );
        val bytes = parseBytes( args( 1 ) );
        new bw_bzero( bytes ).main( niter );
        }
}

The error:

x10c++: x10/hbench/bw_bzero.cc: In static member function ?static void 
x10::hbench::bw_bzero::main(x10aux::ref<x10::array::Array<x10aux::ref<x10::lang::String>
 
> >)?: 
     x10/hbench/bw_bzero.cc:45: error: invalid conversion from ?x10_int? 
to ?x10::array::Array<x10aux::ref<x10::lang::String> >*? 
     x10/hbench/bw_bzero.cc:45: error: initializing argument 1 of 
?x10aux::ref<T>::ref(T*) [with T = 
x10::array::Array<x10aux::ref<x10::lang::String> >]? 
x10c++: Non-zero return code: 1

The generated .cc:

void 
x10::hbench::bw_bzero::main(x10aux::ref<x10::array::Array<x10aux::ref<x10::lang::String>
 
> > args) {

    //#line 19 
"/Users/minorg/projects/x10apps/HBench/trunk/x10/src/x10/hbench/bw_bzero.x10": 
x10.ast.X10LocalDecl_c
    x10_uint niter = ((x10_uint) 
x10aux::int_utils::parseInt(x10aux::nullCheck(args)->x10::array::Array<x10aux::ref<x10::lang::String>
 
>::apply(
 ((x10_int)0))));

    //#line 20 
"/Users/minorg/projects/x10apps/HBench/trunk/x10/src/x10/hbench/bw_bzero.x10": 
x10.ast.X10LocalDecl_c
    x10_ulong bytes = 
x10::hbench::Test::parseBytes(x10aux::nullCheck(args)->x10::array::Array<x10aux::ref<x10::lang::String>
 
>::apply(
                                                      ((x10_int)1)));

    //#line 21 
"/Users/minorg/projects/x10apps/HBench/trunk/x10/src/x10/hbench/bw_bzero.x10": 
polyglot.ast.Eval_c
    (x10::hbench::bw_bzero::_make(bytes))->main(((x10_int) (niter)));
}

parseBytes is:
    protected static def parseBytes( sBytes : String ) : ULong {

The code compiles and runs fine in Java.

This is superficially similar to XTENLANG-1156, but probably unrelated.

Suggestions?

Minor

------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly 
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
_______________________________________________
X10-users mailing list
X10-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/x10-users

Reply via email to