BUG: Use Windows intsafe only for MSVC#65708
Open
dragon-archer wants to merge 2 commits into
Open
Conversation
When compiling with MSYS2, `intsafe.h` will indirectly include `wingdi.h`, in which `#define ERROR 0`, causing compiling error for `typedef enum { ERROR, WARN, SKIP } BadLineHandleMethod;`
Also, all MSYS2 compilers (GCC/Clang) supports __builtin_add_overflow, so it's safe to use these builtins.
Detailed error:
```
FAILED: [code=1] pandas/_libs/tslibs/parsing.cp314-mingw_x86_64_ucrt_gnu.pyd.p/meson-generated_pandas__libs_tslibs_parsing.pyx.c.obj
"gcc" "-Ipandas/_libs/tslibs/parsing.cp314-mingw_x86_64_ucrt_gnu.pyd.p" "-Ipandas/_libs/tslibs" "-I../pandas/_libs/tslibs" "-I../../../../../../../../ucrt64/lib/python3.14/site-packages/numpy/_core/include" "-I../pandas/_libs/include" "-ID:/msys64/ucrt64/include/python3.14" "-fvisibility=hidden" "-fdiagnostics-color=always" "-DNDEBUG" "-D_FILE_OFFSET_BITS=64" "-Wall" "-Winvalid-pch" "-Wextra" "-std=c11" "-O3" "-DNPY_NO_DEPRECATED_API=0" "-DCYTHON_USE_TYPE_SPECS=1" "-DNPY_TARGET_VERSION=NPY_1_21_API_VERSION" "-march=nocona" "-msahf" "-mtune=generic" "-O2" "-pipe" "-Wp,-D_FORTIFY_SOURCE=2" "-fstack-protector-strong" "-Wp,-D__USE_MINGW_ANSI_STDIO=1" -MD -MQ pandas/_libs/tslibs/parsing.cp314-mingw_x86_64_ucrt_gnu.pyd.p/meson-generated_pandas__libs_tslibs_parsing.pyx.c.obj -MF "pandas/_libs/tslibs/parsing.cp314-mingw_x86_64_ucrt_gnu.pyd.p/meson-generated_pandas__libs_tslibs_parsing.pyx.c.obj.d" -o pandas/_libs/tslibs/parsing.cp314-mingw_x86_64_ucrt_gnu.pyd.p/meson-generated_pandas__libs_tslibs_parsing.pyx.c.obj "-c" pandas/_libs/tslibs/parsing.cp314-mingw_x86_64_ucrt_gnu.pyd.p/pandas/_libs/tslibs/parsing.pyx.c
In file included from D:/msys64/ucrt64/include/windows.h:71,
from D:/msys64/ucrt64/include/rpc.h:16,
from D:/msys64/ucrt64/include/wtypesbase.h:7,
from D:/msys64/ucrt64/include/intsafe.h:15,
from ../pandas/_libs/include/pandas/portable.h:43,
from pandas/_libs/tslibs/parsing.cp314-mingw_x86_64_ucrt_gnu.pyd.p/pandas/_libs/tslibs/parsing.pyx.c:1159:
../pandas/_libs/include/pandas/parser/tokenizer.h:81:16: error: expected identifier before numeric constant
81 | typedef enum { ERROR, WARN, SKIP } BadLineHandleMethod;
| ^~~~~
```
Member
This error should've been fixed by #64849. |
Author
Oops, I didn't find that before. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When compiling with MSYS2,
intsafe.hwill indirectly includewingdi.h, in which#define ERROR 0, causing compiling error fortypedef enum { ERROR, WARN, SKIP } BadLineHandleMethod;Also, all MSYS2 compilers (GCC/Clang) supports __builtin_add_overflow, so it's safe to use these builtins.
Detailed error:
doc/source/whatsnew/vX.X.X.rstfile if fixing a bug or adding a new feature.AGENTS.md.