[Cython] Question on "numpy_common.pxi" in NumPy tests
robertwb at gmail.com
Wed Mar 28 22:30:10 CEST 2012
On Tue, Mar 27, 2012 at 11:49 PM, Stefan Behnel <stefan_ml at behnel.de> wrote:
> Lisandro Dalcin, 27.03.2012 21:34:
>> On 27 March 2012 17:20, Stefan Behnel wrote:
>>> 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:
>>> 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.
> Ok - in that case, it should be enough to move the import calls into a cdef
> function body and "avoiding" to call that.
And then gcc helpfully spits out an "unused function" warning, which
is what we're trying to avoid in the first place...
> And a comment in the file would be helpful ...
More information about the cython-devel