Skip to content

fix error support clang #58

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

fix error support clang #58

wants to merge 1 commit into from

Conversation

sgzGary
Copy link

@sgzGary sgzGary commented Sep 25, 2024

I meet problems like this when I use clang:
[ 75s] src/dmidecodemodule.c:916:28: 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]
[ 75s] 916 | {(char *)"xmlapi", dmidecode_xmlapi, METH_VARARGS | METH_KEYWORDS,
[ 75s] | ^~~~~~~~~~~~~~~~
[ 75s] src/dmidecodemodule.c:997:9: warning: 'xmlXPathInit' is deprecated [-Wdeprecated-declarations]
[ 75s] 997 | xmlXPathInit();
[ 75s] | ^
[ 75s] /usr/include/libxml2/libxml/xpath.h:562:1: note: 'xmlXPathInit' has been explicitly marked deprecated here
[ 75s] 562 | XML_DEPRECATED
[ 75s] | ^
[ 75s] /usr/include/libxml2/libxml/xmlversion.h:447:43: note: expanded from macro 'XML_DEPRECATED'
[ 75s] 447 | # define XML_DEPRECATED attribute((deprecated))
[ 75s] | ^
[ 75s] src/dmidecodemodule.c:1027:72: error: incompatible function pointer types passing 'void (void )' to parameter of type 'PyCapsule_Destructor' (aka 'void ()(struct _object *)') [-Wincompatible-function-pointer-types]
[ 75s] 1027 | PyModule_AddObject(module, "options", PyCapsule_New(opt, NULL, destruct_options));
[ 75s] | ^~~~~~~~~~~~~~~~
[ 75s] /usr/include/python3.11/pycapsule.h:31:26: note: passing argument to parameter 'destructor' here
[ 75s] 31 | PyCapsule_Destructor destructor);
[ 75s] | ^
[ 75s] 5 warnings and 2 errors generated.
so i did some change

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.

1 participant