FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Compile error in decimal when `EXTRA_FUNCTIONALITY` enabled · Issue #152870 · python/cpython · GitHub

Repository navigation

Compile error in decimal when EXTRA_FUNCTIONALITY enabled #152870

Closed

Description

Bug report

Bug description:

When building CPython with libmpdec, enabling the EXTRA_FUNCTIONALITY option fails to compile:

./Modules/_decimal/_decimal.c:6996:12: error: too few arguments to function '_decimal_Context__apply'
  6996 |     return _decimal_Context__apply(context, x);
      |            ^~~~~~~~~~~~~~~~~~~~~~~

Steps to reproduce

  1. Install libmpdec.
  2. CFLAGS="-DEXTRA_FUNCTIONALITY" ./configure --with-pydebug
  3. make -j

Proposed fix

The wrapper should call the implementation function directly: _decimal_Context__apply_impl(context, cls, x).
If acceptable, I plan to open a PR for this.

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Linked PRs

Activity

  1. added
    type-bugAn unexpected behavior, bug, or error
    on Jul 2, 2026
  2. skirpichev commented on Jul 2, 2026

    Member

    I would prefer to drop EXTRA_FUNCTIONALITY flag.

  3. added 2 commits that reference this issue on Jul 3, 2026
  4. weixlu commented on Jul 3, 2026

    ContributorAuthor

    I would prefer to drop EXTRA_FUNCTIONALITY flag.

    Hi, I looked into the EXTRA_FUNCTIONALITY flag a bit. You're right — it is not covered by CI, and has regressed several times, so dropping it altogether is quite reasonable.

    That said, it guards a lot more than Context.apply — there's also MallocError and more (about 14 #ifdef blocks in total). So it's a fairly big task.

    I'd prefer to keep #152871 focused on just the compile fix. If OK, we can leave this issue open for further discussion on removing the flag.

  5. added a commit that references this issue on Jul 3, 2026
  6. self-assigned this
    on Jul 3, 2026
  7. added a commit that references this issue on Jul 3, 2026
  8. skirpichev commented on Jul 3, 2026

    Member

    I'd prefer to keep #152871 focused on just the compile fix.

    Fair enough. Here a new issue: #152939

  9. removed their assignment
    on Jul 3, 2026
  10. added a commit that references this issue on Jul 3, 2026
  11. weixlu commented on Jul 3, 2026

    ContributorAuthor

    Here a new issue: #152939

    Sure, then let me close this issue as complete

  12. skirpichev commented on Jul 3, 2026

    Member

    Thanks for the fix!

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

    extension-modulesC modules in the Modules dirtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL