On Tue, Mar 27, 2012 at 7:20 AM, Stefan Behnel <stefan...@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?

IIRC, this was to avoid warnings about unused functions when importing
the numpy headers without manually invoking these functions.

Perhaps taking their address rather than "calling" them would be
better (though this may involve creating yet more unused
variables...).

- Robert
_______________________________________________
cython-devel mailing list
cython-devel@python.org
http://mail.python.org/mailman/listinfo/cython-devel

Reply via email to