Skip to content

Compile error in decimal when EXTRA_FUNCTIONALITY enabled #152870

Description

@weixlu

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

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions