Skip to content

fix for incompatible function pointer types initializing 'PyCFunction' in edgeDB.c#1572

Merged
David-Baddeley merged 1 commit intopython-microscopy:masterfrom
csoeller:edgedb-compile-fix
Feb 27, 2025
Merged

fix for incompatible function pointer types initializing 'PyCFunction' in edgeDB.c#1572
David-Baddeley merged 1 commit intopython-microscopy:masterfrom
csoeller:edgedb-compile-fix

Conversation

@csoeller
Copy link
Contributor

Addresses issue where compiling on mac (14.7.x) raises errors in edgeDB.c:

PYME/Analysis/points/EdgeDB/edgeDB.c:710:19: error: incompatible function pointer types initializing 'PyCFunction' (aka 'struct _object *(*)(struct _object *, struct _object *)') with an expression of type 'PyObject *(PyObject *, PyObject *, PyObject *)' (aka 'struct _object *(struct _object *, struct _object *, struct _object *)') [-Wincompatible-function-pointer-types]
  710 |     {"addEdges",  addEdges, METH_VARARGS | METH_KEYWORDS,
      |                   ^~~~~~~~
PYME/Analysis/points/EdgeDB/edgeDB.c:712:18: error: incompatible function pointer types initializing 'PyCFunction' (aka 'struct _object *(*)(struct _object *, struct _object *)') with an expression of type 'PyObject *(PyObject *, PyObject *, PyObject *)' (aka 'struct _object *(struct _object *, struct _object *, struct _object *)') [-Wincompatible-function-pointer-types]
  712 |     {"segment",  segment, METH_VARARGS | METH_KEYWORDS,
      |                  ^~~~~~~
...

Is this a bugfix or an enhancement?

backwordscompatible bugfix

Proposed changes:

Typecast explicitly to PyCFunction:

    {"addEdges",  (PyCFunction) addEdges, METH_VARARGS | METH_KEYWORDS, 
...

Compiles fine on mac and PC with these tweaks.

Checklist:

Tested with latest sources from git.

@David-Baddeley
Copy link
Contributor

Thanks!

@David-Baddeley David-Baddeley merged commit 3b40c20 into python-microscopy:master Feb 27, 2025
5 checks passed
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