GeezerVison is showing github.com — New GitHub warning: `'ERROR': macro redefinition` · Issue #100213 · python/cpython
New GitHub warning: 'ERROR': macro redefinition #100213Labels 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 DescriptionI think that #100010 is the source.

Example: e4ea33b
I think we should do #undef ERROR beforehand.
Will send a PR!
Linked PRs
Activitymarkshannon commented on Dec 13, 2022 OOI, do we know where ERROR is previously defined? sobolevn commented on Dec 13, 2022 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) \
kumaraditya303 commented on Dec 13, 2022 eryksun commented on Dec 13, 2022
OOI, do we know where ERROR is previously defined?
The "windows.h" header includes "wingdi.h", which defines ERROR as a region flag with the value 0. This header gets included by "Include/internal/pycore_condvar.h":
|
/* 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.
MetadataMetadatainterpreter-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 DevelopmentNo branches or pull requestsIssue actions
|