Skip to content

[BUG] code emitted for Python 3.10 causes warning C4551 in MSVC #4445

@Zabolekar

Description

@Zabolekar

Environment
OS: Windows
Cython version: 3.0.0a9
Python version: 3.10 (the same setup with 3.9 doesn't have this problem)

To reproduce
setup.py:

from setuptools import setup, Extension
from Cython.Build import cythonize
extensions = [Extension("a", ["a.pyx"], language='c++', extra_compile_args=["/WX"])]
setup(ext_modules=cythonize(extensions, compiler_directives={'language_level': "3"}))

a.pyx

def f():
    cdef float[:] data

I execute the following: python setup.py build_ext --inplace

Expected behavior
A .pyd file is generated.

Actual behavior
The compiler fails with the following messages:

a.cpp(21102): error C2220: the following warning is treated as an error
a.cpp(21102): warning C4551: function call missing argument list

Line 21102 contains:

(void)__Pyx_PyObject_CallMethod0;

(details about the warning are here)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions