GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — New GitHub warning: `'ERROR': macro redefinition` · Issue #100213 · python/cpython

New GitHub warning: 'ERROR': macro redefinition #100213

New issue
Copy link
New issue
Copy link
Closed
Closed
New GitHub warning: 'ERROR': macro redefinition#100213
Copy link
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

@sobolevn
sobolevn
opened on Dec 13, 2022
Issue body actions

I think that #100010 is the source.

Снимок экрана 2022-12-13 в 13 28 21

Example: e4ea33b

I think we should do #undef ERROR beforehand.
Will send a PR!

Linked PRs

  • gh-100213: ERROR macro is reported to be implictly redefined #100214

Activity

  1. sobolevn
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)
    on Dec 13, 2022
  2. sobolevn
    added a commit that references this issue on Dec 13, 2022

    pythongh-100213: `ERROR` macro is reported to be implictly redefined

    99f84fd
  3. markshannon commented on Dec 13, 2022

    @markshannon
    markshannon
    on Dec 13, 2022
    Member
    More actions

    OOI, do we know where ERROR is previously defined?

  4. sobolevn commented on Dec 13, 2022

    @sobolevn
    sobolevn
    on Dec 13, 2022
    MemberAuthor
    More actions

    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)                             \
    
    
  5. kumaraditya303 commented on Dec 13, 2022

    @kumaraditya303
    kumaraditya303
    on Dec 13, 2022
    Contributor
    More actions

    Fixed by #100215

  6. kumaraditya303
    closed this as completedon Dec 13, 2022
  7. eryksun commented on Dec 13, 2022

    @eryksun
    eryksun
    on Dec 13, 2022
    Contributor
    More actions

    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":

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.