Skip to content

[BUG]: Regression in Cython 3.0.3 - static declaration follows non-static declaration #5747

@lithomas1

Description

@lithomas1

Describe the bug

We have a cdef inline function is_timedelta64_object defined in a util.pxd file.

In another file, nattype.pxd, we cimport util and use is_timedelta64_object, however we get a compile error saying

  pandas/_libs/tslibs/nattype.cpython-310-aarch64-linux-gnu.so.p/pandas/_libs/tslibs/nattype.pyx.c:8729:26: error: static declaration of ‘__pyx_f_6pandas_5_libs_6tslibs_4util_is_timedelta64_object’ follows non-static declaration
   8729 | static CYTHON_INLINE int __pyx_f_6pandas_5_libs_6tslibs_4util_is_timedelta64_object(PyObject *__pyx_v_obj) {
        |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  pandas/_libs/tslibs/nattype.cpython-310-aarch64-linux-gnu.so.p/pandas/_libs/tslibs/nattype.pyx.c:8492:17: note: previous implicit declaration of ‘__pyx_f_6pandas_5_libs_6tslibs_4util_is_timedelta64_object’ was here
   8492 |   __pyx_t_2 = (!__pyx_f_6pandas_5_libs_6tslibs_4util_is_timedelta64_object(__pyx_v_obj));

Code to reproduce the behaviour:

# example code

Expected behaviour

No response

OS

Linux aarch64

Python version

3.10.10

Cython version

3.0.3

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions