[Pyrex] incomplete type

Greg Ewing greg at cosc.canterbury.ac.nz
Thu Oct 23 06:15:04 CEST 2003


> cdef extern from "c_header.h":
>     ctypedef void foo_t
>     foo_t * get_foo()
> 
> is declaring foo_t to be of type void the right thing to do?

You might get away with it, but you'd be throwing away potentially
valuable type checking. Better to use

  cdef extern from "c_header.h":
    ctypedef struct foo_t:
      pass

Then Pyrex can check that you're using the type foo_t consistently,
instead of leaving it to the C compiler.

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg at cosc.canterbury.ac.nz	   +--------------------------------------+




More information about the Pyrex mailing list