OK, your are right, that code should be definitely safe, even if GCC generares a spurious warnings.
On 6/13/08, Carl Witty <[EMAIL PROTECTED]> wrote: > On Thu, Jun 12, 2008 at 4:14 PM, Lisandro Dalcin <[EMAIL PROTECTED]> wrote: > > On 6/12/08, Carl Witty <[EMAIL PROTECTED]> wrote: > >> I don't think the solution is nearly so complicated. Can't you just > >> cast the function to the correct type? > >> > >> vtable_Parrot.describe = (void (*)(struct Parrot *))Norwegian_describe; > > > > Well, the type of 'Norwegian_describe' is acctually 'void (*)(struct > > *Norwegian)'. If those types aren't aliasables, then that will break > > strict aliasing rules. What I do not know if in this case the funtions > > types can alias each other (I guess they cannot). > > > No; you only break aliasing rules if you read or write a value through > a pointer of the wrong type. The above code doesn't do that. > > > Carl > _______________________________________________ > 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
