Stefan Behnel | 1 Feb 14:32

Re: [Cython] Cython code fails to compile with gcc 2.95

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

Attachment (upstream.bundle): application/octet-stream, 568 bytes
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


Gmane