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

accelerate: Fix C type errors for GCC 14/Clang compatibility #112

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

fweimer-rh
Copy link

This fixes type errors that cause build failures with current compilers:

src/numpy_formathandler.c: In function ‘__pyx_f_17OpenGL_accelerate_19numpy_form
athandler_12NumpyHandler_c_asArray’:
src/numpy_formathandler.c:6412:43: error: passing argument 1 of ‘(int (*)(PyArrayObject *, PyObject *))*(PyArray_API + 832)’ from incompatible pointer type
 6412 |     __pyx_v_res = PyArray_FillWithScalar(((PyObject *)__pyx_v_working), __pyx_v_instance);
      |                                          ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                           |
      |                                           PyObject * {aka struct _object *}
src/numpy_formathandler.c:6412:43: note: expected ‘PyArrayObject *’ {aka ‘struct tagPyArrayObject_fields *’} but argument is of type ‘PyObject *’ {aka ‘struct _object *’}
src/numpy_formathandler.c: In function ‘__pyx_pymod_exec_numpy_formathandler’:
src/numpy_formathandler.c:9799:3: error: returning ‘void *’ from a function with return type ‘int’ makes integer from pointer without a cast
 9799 |   import_array();
      |   ^~~~~~~~~~~~

Related to:

@seanjensengrey
Copy link

Using this PR, I was able to get https://github.com/p5py/p5 installed from head on an M1 Mac.

% sw_vers
ProductName:		macOS
ProductVersion:		14.4
BuildVersion:		23E214
% clang --version
Apple clang version 15.0.0 (clang-1500.3.9.4)
Target: arm64-apple-darwin23.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

@seanjensengrey
Copy link

@mcfletch the failures are in py27 on windows/vc++. Do you have an env to debug or can we turn those builds off?

gulagkulak pushed a commit to gulagkulak/pyopengl that referenced this pull request Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants