[issue35037] PYLONG_BITS_IN_DIGIT differs between MinGW and MSVC

2021-12-22 Thread Mark Dickinson
Mark Dickinson added the comment: > This should probably be a separate issue, Specifically, issue 45569. -- ___ Python tracker ___ ___

[issue35037] PYLONG_BITS_IN_DIGIT differs between MinGW and MSVC

2021-12-11 Thread Irit Katriel
Change by Irit Katriel : -- versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.5, Python 3.6, Python 3.7, Python 3.8 ___ Python tracker ___

[issue35037] PYLONG_BITS_IN_DIGIT differs between MinGW and MSVC

2021-10-22 Thread Mark Dickinson
Mark Dickinson added the comment: This should probably be a separate issue, but I wonder whether the 15-bit digit option has value any more. Should we just drop that option and always use 30-bit digits? 30-bit digits were introduced at a time when we couldn't rely on a 64-bit integer type

[issue35037] PYLONG_BITS_IN_DIGIT differs between MinGW and MSVC

2021-10-20 Thread Beier Liu
Change by Beier Liu : -- keywords: +patch nosy: +Beier Liu nosy_count: 7.0 -> 8.0 pull_requests: +27362 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19326 ___ Python tracker __

[issue35037] PYLONG_BITS_IN_DIGIT differs between MinGW and MSVC

2018-10-23 Thread Stefan Behnel
Stefan Behnel added the comment: The relevant macro seems to be "__MINGW64__". I have neither a Windows environment nor MinGW-64 for testing, but the logic should be the same as for the "_WIN64" macro, i.e. #if defined(_WIN64) || defined(__MINGW64__) #define MS_WIN64 #endif And then there's

[issue35037] PYLONG_BITS_IN_DIGIT differs between MinGW and MSVC

2018-10-21 Thread Steve Dower
Steve Dower added the comment: That variable should be inferred somewhere, either in PC/pyconfig.h or pyport.h. If there's a way to also infer it on 64-bit MinGW then we would consider a patch for that. -- ___ Python tracker

[issue35037] PYLONG_BITS_IN_DIGIT differs between MinGW and MSVC

2018-10-21 Thread Stefan Behnel
Stefan Behnel added the comment: > There's PyLong_GetInfo ... Thanks, I understand that this information can be found at runtime. However, in order to correctly compile C code against a given CPython runtime, there needs to be a guarantee that extension module builds use the same configurati

[issue35037] PYLONG_BITS_IN_DIGIT differs between MinGW and MSVC

2018-10-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: At runtime this information is available as sys.int_info.bits_per_digit. > In MinGW, "SIZEOF_VOID_P" is 4, whereas "sizeof(void*)" resolves to 8. Looks like a misconfiguration. I suppose this will cause more issues than just wrong PYLONG_BITS_IN_DIGIT. --

[issue35037] PYLONG_BITS_IN_DIGIT differs between MinGW and MSVC

2018-10-21 Thread Mark Dickinson
Mark Dickinson added the comment: > Is there a reason why CPython cannot store its compile time value for the > PYLONG_BITS_IN_DIGIT setting somewhere? There's PyLong_GetInfo [1], and at Python level, the corresponding sys.long_info (Python 2) / sys.int_info (Python 3). Does that help?

[issue35037] PYLONG_BITS_IN_DIGIT differs between MinGW and MSVC

2018-10-21 Thread Mark Dickinson
Change by Mark Dickinson : -- nosy: +mark.dickinson ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[issue35037] PYLONG_BITS_IN_DIGIT differs between MinGW and MSVC

2018-10-21 Thread Stefan Behnel
Stefan Behnel added the comment: Some more information. CPython uses this code snippet to decide on the PyLong digit size: #ifndef PYLONG_BITS_IN_DIGIT #if SIZEOF_VOID_P >= 8 #define PYLONG_BITS_IN_DIGIT 30 #else #define PYLONG_BITS_IN_DIGIT 15 #endif #endif In MinGW, "SIZEOF_VOID_P" is 4, w

[issue35037] PYLONG_BITS_IN_DIGIT differs between MinGW and MSVC

2018-10-21 Thread Stefan Behnel
New submission from Stefan Behnel : I see reports from Cython users on Windows-64 that extension modules that use "longintrepr.h" get miscompiled by MinGW. A failing setup looks as follows: Stock 64 bit CPython on Windows, e.g. Python 3.6.3 (v3.6.3:2c5fed8, Oct 3 2017, 18:11:49) [MSC v.1900 6