Skip to content

Correct types in PyModuleDef / fix compilation with new clang+gcc#26

Open
hannob wants to merge 1 commit into
tgalal:masterfrom
hannob:fix_type
Open

Correct types in PyModuleDef / fix compilation with new clang+gcc#26
hannob wants to merge 1 commit into
tgalal:masterfrom
hannob:fix_type

Conversation

@hannob
Copy link
Copy Markdown

@hannob hannob commented Dec 2, 2022

The 4th variable of PyModuleDef is an int, not a pointer:
https://docs.python.org/3/c-api/module.html#c.PyModuleDef

Fixes compilation with clang.

@mimi89999
Copy link
Copy Markdown

@tgalal could you please review? Currently, it is not possible to build python-axolotl-curve25519 with Clang.

@byildiz
Copy link
Copy Markdown

byildiz commented Jul 24, 2023

I had the following error with Python 3.11 and this change solved the problem:

curve25519module.c:161:9: error: incompatible pointer to integer conversion initializing 'Py_ssize_t' (aka 'long') with an expression of type 'void *' [-Wint-conversion]

@coldfire-x
Copy link
Copy Markdown

@hannob @tgalal what's the progress right now? has it fixed?
we get this error in mac m1, python3.10, can not install python-axolotl-curve25519

@glaubitz
Copy link
Copy Markdown

This patch also fixes the build with GCC 14. Would be great if it could be merged.

@hannob hannob changed the title Correct types in PyModuleDef / fix compilation with clang Correct types in PyModuleDef / fix compilation with new clang+gcc Jun 26, 2024
setarcos added a commit to lcpu-club/loongarch-packages that referenced this pull request Sep 2, 2024
fix error: incompatible pointer to integer conversion
patch already available, but not merged:
tgalal/python-axolotl-curve25519#26
@gur111
Copy link
Copy Markdown

gur111 commented Oct 20, 2024

Any news?

@gur111
Copy link
Copy Markdown

gur111 commented Oct 20, 2024

Until this is merged, this is the workaround.

I installed the patch manually using:

pip install git+https://github.com/hannob/python-axolotl-curve25519.git@fix_type

Then using the following works fine:

pip install python-axolotl

And if the project have other requirements (ehm ehm yowsup):

pip install -r requirements.txt

Saved you 10 minutes of stackoverflowing, yw.

@deemru
Copy link
Copy Markdown

deemru commented May 6, 2025

Used this fix and published a package with pre-built wheels for the most platforms as a fork here:

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.

7 participants