Mmm, perhaps it is valid C99, bot not sure if it is valid C89 ...

IMHO, the way default arguments is implemented should be changed, but
the only way I can imagine will always work is by introducing a new
scope (I mean, { ... } )in the generated code, declare the struct for
optional aguments, and next fill its fields, and finally pass the
pointer to the function call.


On 6/19/08, Robert Bradshaw <[EMAIL PROTECTED]> wrote:
> On Jun 19, 2008, at 11:43 AM, Johannes Wienke wrote:
>
>  ...
>
>
>
> >
> > >
> > > >
> > > > Ok, then it didn't solve my problem. Jus tried that out and as both *
> > > > and ? are possible, I got the same error message:
> > > >
> > > > build/temp.linux-x86_64-2.4/pyrex/plugins.c: In
> function 'PyObject*
> > > >
> __pyx_pf_4ship_7icewing_7plugins_14PluginInstance_init(PyObject*,
> > > > PyObject*, PyObject*)':
> > > > build/temp.linux-x86_64-2.4/pyrex/plugins.c:1228:
> error: invalid lvalue
> > > > in unary '&'
> > > > error: command 'x86_64-pc-linux-gnu-g++' failed with exit status 1
> > > >
> > > > My pxd file looks like that:
> > > >
> > > > cpdef class PluginInstance(Plugin):
> > > >    #....
> > > >    cpdef getName(self)
> > > >    cpdef init(self, args=*)
> > > >    cpdef process(self, d)
> > > >
> > > > And the method body:
> > > >
> > > >    cpdef init(self, args = ""):
> > > >        argList = helpers.splitArgs(args)
> > > >        # ...
> > > >
> > > > The line in the C code that gcc does complain about is:
> > > >
> > > > __pyx_1 = (__pyx_skip_dispatch = 1, ((struct
> > > >
> __pyx_vtabstruct_4ship_7icewing_7plugins_PluginInstance
> *)((struct
> > > > __pyx_obj_4ship_7icewing_7plugins_PluginInstance
> > > > *)__pyx_v_self)->__pyx_vtab)->init(((struct
> > > > __pyx_obj_4ship_7icewing_7plugins_PluginInstance
> *)__pyx_v_self), ((void
> > > > *)&((struct
> > > >
> __pyx_opt_args_4ship_7icewing_7plugins_14PluginInstance_init){1,__pyx_v_args}))));
> > > >
> > > > if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno =
> 93;
> > > > goto __pyx_L1;}
> > > >
> > > > Is there something I am doing wrong?
> > > >
> > >
> > > Hmm... what version of gcc are you using?
> > >
> >
> > 4.1.2 on amd64
> >
>
>  Apparently this is valid C, but not valid C++.
> http://trac.cython.org/cython_trac/ticket/21
>
>  C++ gurus, any ideas?
>
>  - Robert
>
>
>
> _______________________________________________
>  Cython-dev mailing list
>  [email protected]
>  http://codespeak.net/mailman/listinfo/cython-dev
>
>
>


-- 
Lisandro Dalcín
---------------
Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
PTLC - Güemes 3450, (3000) Santa Fe, Argentina
Tel/Fax: +54-(0)342-451.1594
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to