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.

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

Reply via email to