[Cython] Question on "numpy_common.pxi" in NumPy tests

Lisandro Dalcin dalcinl at gmail.com
Tue Mar 27 21:34:13 CEST 2012

On 27 March 2012 17:20, Stefan Behnel <stefan_ml at behnel.de> wrote:
> Hi,
> the NumPy related tests use a file "numpy_common.pxi" that contains this
> useless code:
> """
> cdef extern from *:
>   bint FALSE "0"
>   void import_array()
>   void import_umath()
> if FALSE:
>    import_array()
>    import_umath()
> """
> Does this serve any purpose? It currently leads to build failures of the
> tests in C++ mode because the "import_umath()" call seems to inline code
> with a bare "return" statement, which is not allowed in the module init
> function (which returns a reference to the module).
> Is there any reason why this can't just die?

Oh! long long ago Cython testsuite was able to run without a single C
compiler warning... That numpy common file was a hack to silent
"defined but not used" warnings about the import array/umath functions
defined in  NumPy headers.

I think you can safely remove that file, it serves no useful purpose IMHO...

Lisandro Dalcin
Predio CONICET-Santa Fe
Colectora RN 168 Km 472, Paraje El Pozo
3000 Santa Fe, Argentina
Tel: +54-342-4511594 (ext 1011)
Tel/Fax: +54-342-4511169

More information about the cython-devel mailing list