Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAINT: fix an incorrect pointer type usage in f2py #22216

Merged
merged 1 commit into from Sep 6, 2022

Commits on Sep 6, 2022

  1. MAINT: fix an incorrect pointer type usage in f2py

    This was giving many warnings like this one in the SciPy build:
    ```
    scipy/special/_specfunmodule.c: In function 'complex_double_from_pyobj':
    scipy/special/_specfunmodule.c:198:47: warning: passing argument 1 of 'PyArray_DATA' from incompatible pointer type [-Wincompatible-pointer-types]
      198 |         (*v).r = ((npy_cdouble *)PyArray_DATA(arr))->real;
          |                                               ^~~
          |                                               |
          |                                               PyObject * {aka struct _object *}
    In file included from /home/rgommers/code/numpy/numpy/core/include/numpy/ndarrayobject.h:12,
                     from /home/rgommers/code/numpy/numpy/core/include/numpy/arrayobject.h:5,
                     from /home/rgommers/code/numpy/numpy/f2py/src/fortranobject.h:16,
                     from scipy/special/_specfunmodule.c:22:
    /home/rgommers/code/numpy/numpy/core/include/numpy/ndarraytypes.h:1524:29: note: expected 'PyArrayObject *' {aka 'struct tagPyArrayObject *'} but argument is of type 'PyObject *' {aka 'struct _object *'}
     1524 | PyArray_DATA(PyArrayObject *arr)
          |              ~~~~~~~~~~~~~~~^~~
    ```
    
    Fixing pointer mismatches is important for Pyodide/Emscripten.
    rgommers authored and charris committed Sep 6, 2022
    Copy the full SHA
    5286e57 View commit details
    Browse the repository at this point in the history