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

Conversation

charris
Copy link
Member

@charris charris commented Sep 6, 2022

Backport of #22189.

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.

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.
@charris charris added this to the 1.23.3 release milestone Sep 6, 2022
@charris charris merged commit cb715c7 into numpy:maintenance/1.23.x Sep 6, 2022
@charris charris deleted the backport-22189 branch September 6, 2022 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants