[Cython] GCC warnings about uninitialized variables
Greg Ewing
greg.ewing at canterbury.ac.nz
Sun Jun 8 06:20:13 CEST 2008
Lisandro Dalcin wrote:
> GCC complains about uninitialized variables when compiling the
> generated C sources in some cases like the below:
>
> cdef int obj2int(object ob) except *:
> return ob
As an aside, it's probably more efficient to declare
a function like that as something like
cdef int obj2int(object ob) except? -1:
or some other unlikely value in place of -1. Then
callers will only call PyError_Occurred if that
particular value is returned, rather than every time.
The only time you should really have to use except *
is with a function returning void.
--
Greg
More information about the Cython-dev
mailing list