Repository navigation
New GitHub warning: 'ERROR': macro redefinition #100213
Copy link
Copy link
Closed
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Activity
- addedtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or errorinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)
on Dec 13, 2022 OOI, do we know where
ERRORis previously defined?It is not in sources:
» ag '#define ERROR' Python/compile.c 59:#define ERROR -1 Python/bytecodes.c 67:#define ERROR_IF(cond, labelname) ((void)0) Python/modsupport.c 283:#define ERROR_NEED_PY_SSIZE_T_CLEAN \ Include/internal/pycore_token.h 76:#define ERRORTOKEN 60 Modules/cjkcodecs/multibytecodec.h 120:#define ERROR_STRICT (PyObject *)(1) 121:#define ERROR_IGNORE (PyObject *)(2) 122:#define ERROR_REPLACE (PyObject *)(3) 123:#define ERROR_ISCUSTOM(p) ((p) < ERROR_STRICT || ERROR_REPLACE < (p)) 124:#define ERROR_DECREF(p) \Fixed by #100215
OOI, do we know where
ERRORis previously defined?The "windows.h" header includes "wingdi.h", which defines
ERRORas a region flag with the value 0. This header gets included by "Include/internal/pycore_condvar.h":cpython/Include/internal/pycore_condvar.h
Lines 39 to 41 in 985a710
/* include windows if it hasn't been done before */ #define WIN32_LEAN_AND_MEAN #include <windows.h> In turn, it's included by "Include/internal/pcore_gil.h", which is included by "Include/internal/pycore_runtime.h", which is included by many files.
Metadata
Metadata
Assignees
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
I think that #100010 is the source.
Example: e4ea33b
I think we should do
#undef ERRORbeforehand.Will send a PR!
Linked PRs
ERRORmacro is reported to be implictly redefined #100214