Skip to content

BUG: C code generated by f2py is not C23 compliant #30167

@sergiocallegari

Description

@sergiocallegari

Describe the issue:

Looks like the C code generated by f2py is not C23 compliant and fails to compile with gcc 15.

For instance, this can be seen trying to build scikits.odes-daepack on rolling linux distros that are already at gcc 15. Editing the meson.build file to include a 'c_std=c17' seems to fix the issue.

The problem seems to be triggered when generating functions that take a function as a parameter. The latter gets in the signature as f2py_func() that is a function taking an arbitrary number of parameters in C<23 but is not the same in C23 that wants a full signature.

Reproduce the code example:

`uv add scikits.odes` on a system with gcc 15.

Error message:

N/A

Python and NumPy Versions:

python 3.13.9
numpy 2.3.4

Runtime Environment:

N/A

Context for the issue:

Not necessarily a problem, if properly documented.

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