Skip to content

Module/readline.c has suspicious macro #108588

@sobolevn

Description

@sobolevn

Bug report

readline has two identical function signatures under different macro branches:

cpython/Modules/readline.c

Lines 1019 to 1024 in f75cefd

static int
#if defined(_RL_FUNCTION_TYPEDEF)
on_startup_hook(void)
#else
on_startup_hook(void)
#endif

and

cpython/Modules/readline.c

Lines 1033 to 1039 in f75cefd

#ifdef HAVE_RL_PRE_INPUT_HOOK
static int
#if defined(_RL_FUNCTION_TYPEDEF)
on_pre_input_hook(void)
#else
on_pre_input_hook(void)
#endif

Looks like that they became identical after a9305b5

Original issue when this macro was introduced: #64573
But, new versions of readline do not ship _RL_FUNCTION_TYPEDEF anymore: https://git.savannah.gnu.org/cgit/readline.git/tree/rltypedefs.h#n50

So, what should we do?

  1. Remove #if defined
  2. Revert a9305b5

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