[Pyrex] casting to a function pointer

Simon Burton simon at arrowtheory.com
Sun Oct 9 12:44:04 CEST 2005


Consider this:

cdef void *p
p = <void*>0
( < int (*)() >p )()

Pyrex doesn't seem to produce correct code.

$ gcc func.c -I/usr/local/include/python2.3
func.c: In function `initfunc':
func.c:61: error: cast specifies function type

the relevant line in func.c:
  ((int ((void)))__pyx_v_4func_p)();

ie. pyrex is casting to a function, not a pointer to a function.

Also mentioned in 2003:
http://lists.copyleft.no/pipermail/pyrex/2003-July/000232.html

Is this a bug?

Simon.

-- 
Simon Burton, B.Sc.
Licensed PO Box 8066
ANU Canberra 2601
Australia
Ph. 61 02 6249 6940
http://arrowtheory.com 



More information about the Pyrex mailing list