On Fri, Oct 3, 2008 at 8:04 PM, Greg Ewing <[EMAIL PROTECTED]> wrote: > Lisandro Dalcin wrote: > >> Long ago I discussed that case with Sfefan, and we agreed that there >> was not point on supporting 'int foo(void)', as that C declaration was >> in fact related to support ancient C and the different meaning of 'int >> foo()', hopefully fixed in C++. > > Yes, in C++, all function headers are prototypes, so > there's no need for f(void). It seems to be accepted > for backward compatibility with C, but Pyrex/Cython > doesn't have to be backward compatible with anything, > so there's no need to support it. > > As for (f)(), I'm not sure why you would ever have to > write that instead of f(). However, there's a degenerate > case of that when you have an empty declarator, e.g. > in a cast, where ()() means a function, whereas just > () on its own is regarded as a syntax error by C > compilers.
Greg, I´m not a C lawyer, but as reference, the MPI standard uses "typedef int (f)(args)" everywhere, for example: <http://www.mpi-forum.org/docs/mpi21-report-bw/node147.htm>. > > I suspect this isn't important, though, because casting > something to a function (as opposed to a function pointer) > isn't something I can think of a use for. > > Nevertheless, (f)() is valid C declaration syntax, and > Pyrex aims to allow any valid C declaration as far as > reasonably possible. So I'd recommend fixing this if > it won't be too difficult. > > -- > Greg > _______________________________________________ > 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
