[Cython] Cython code fails to compile with gcc 2.95

Stefan Behnel stefan_ml at behnel.de
Fri Feb 1 14:32:59 CET 2008


Hi,

Sven Berkvens-Matthijsse wrote:
> The problem is that GCC 2.95 does not follow C99 semantics, and the C
> version that it adheres to does not allow variables to be declared in
> the middle of a block. All variables must be declared at the top of a
> block. In the above case:
> 
> 110164         PyObject* tmp = PyNumber_Int(x); if (!tmp) return (PY_LONG_LONG)-1;
> 110165         PY_LONG_LONG val = __pyx_PyInt_AsLongLong(tmp);
> 
> the 'if' statement on line 110164 terminates the end of the variable
> declarations in the block. Line 110165 tries to declare one in the
> middle of some statements, which was not allowed before C99.

Ah, sure, that makes sense. So here's the obvious fix.

Thanks a lot,
Stefan

-------------- next part --------------
A non-text attachment was scrubbed...
Name: upstream.bundle
Type: application/octet-stream
Size: 568 bytes
Desc: not available
Url : http://codespeak.net/pipermail/cython-dev/attachments/20080201/fc83b24c/attachment.obj 


More information about the Cython-dev mailing list