Project

General

Profile

Actions

Bug #9578

closed

‘Function’ undeclared in readline.c

Added by dmedvinsky (Dmitry Medvinsky) about 10 years ago. Updated almost 10 years ago.

Status:
Closed
Target version:
-
ruby -v:
2.0.0p353 (2013-11-22 revision 43784) [x86_64-linux]
[ruby-core:61141]

Description

When compiling Ruby 2.1.1, I get the following error

make[2]: Entering directory '/tmp/ruby-build.20140228114849.30108/ruby-2.1.1/ext/readline'
compiling readline.c
readline.c: In function ‘Init_readline’:
readline.c:1977:26: error: ‘Function’ undeclared (first use in this function)
     rl_pre_input_hook = (Function *)readline_pre_input_hook;
                          ^
readline.c:1977:26: note: each undeclared identifier is reported only once for each function it appears in
readline.c:1977:36: error: expected expression before ‘)’ token
     rl_pre_input_hook = (Function *)readline_pre_input_hook;
                                    ^
readline.c: At top level:
readline.c:634:1: warning: ‘readline_pre_input_hook’ defined but not used [-Wunused-function]
 readline_pre_input_hook(void)
 ^
Makefile:228: recipe for target 'readline.o' failed
make[2]: *** [readline.o] Error 1
make[2]: Leaving directory '/tmp/ruby-build.20140228114849.30108/ruby-2.1.1/ext/readline'
exts.mk:198: recipe for target 'ext/readline/all' failed
make[1]: *** [ext/readline/all] Error 2

Readline version:

/* Hex-encoded Readline version number. */
#define RL_READLINE_VERSION     0x0603          /* Readline 6.3 */
#define RL_VERSION_MAJOR        6
#define RL_VERSION_MINOR        3
    
...
    
extern rl_hook_func_t *rl_pre_input_hook;

OS version:

Linux 3.13.5-1-ARCH #1 SMP PREEMPT Sun Feb 23 00:25:24 CET 2014 x86_64 GNU/Linux

I can provide full configure and make logs, if required.


Related issues 3 (0 open3 closed)

Related to Backport21 - Backport #9630: Backport readline-6.3 support.Closednagachika (Tomoyuki Chikanaga)03/13/2014Actions
Related to Ruby master - Bug #9702: r45488以降、SolarisStudioで ext/readline がコンパイルエラー(readline 6.2使用)Closed04/04/2014Actions
Related to Backport200 - Backport #9631: Backport readline-6.3 support.Closed03/13/2014Actions

Updated by akr (Akira Tanaka) about 10 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

Applied in changeset r45225.


  • ext/readline/readline.c (Init_readline): Use rl_hook_func_t instead
    of Function to support readline-6.3. (rl_hook_func_t is available
    since readline-4.2.)
    Reported by Dmitry Medvinsky. [ruby-core:61141] [Bug #9578]

Updated by naruse (Yui NARUSE) about 10 years ago

  • Backport changed from 1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN to 1.9.3: REQUIRED, 2.0.0: REQUIRED, 2.1: REQUIRED

Updated by marcandre (Marc-Andre Lafortune) about 10 years ago

  • Status changed from Closed to Open

Now I can't build trunk:

ext/readline/readline.c: In function ‘Init_readline’:
ext/readline/readline.c:1977: error: ‘rl_hook_func_t’ undeclared (first use in this function)
ext/readline/readline.c:1977: error: (Each undeclared identifier is reported only once
ext/readline/readline.c:1977: error: for each function it appears in.)
ext/readline/readline.c:1977: error: expected expression before ‘)’ token

Updated by nobu (Nobuyoshi Nakada) about 10 years ago

  • Status changed from Open to Closed

Applied in changeset r45240.


extconf.rb: rl_hook_func_t for old readline

  • ext/readline/extconf.rb (rl_hook_func_t): define as Function for
    very old readline versions. [ruby-core:61209] [Bug #9578]

Updated by nagachika (Tomoyuki Chikanaga) about 10 years ago

  • Backport changed from 1.9.3: REQUIRED, 2.0.0: REQUIRED, 2.1: REQUIRED to 1.9.3: REQUIRED, 2.0.0: DONE, 2.1: REQUIRED

r45225 and r45240 were backported to ruby_2_0_0 at r45252.

Updated by nobu (Nobuyoshi Nakada) about 10 years ago

Updated by taca (Takahiro Kambe) almost 10 years ago

r45240 added these lines to extconf.rb:

unless readline.have_type("rl_hook_func_t")
  $DEFS << "-Drl_hook_func_t=Function"
end

But it should be $defs instead of $DEFS?

Updated by nagachika (Tomoyuki Chikanaga) almost 10 years ago

  • Status changed from Closed to Assigned
  • Assignee set to nobu (Nobuyoshi Nakada)
  • Backport changed from 1.9.3: REQUIRED, 2.0.0: DONE, 2.1: REQUIRED to 1.9.3: REQUIRED, 2.0.0: REQUIRED, 2.1: REQUIRED

Updated by nobu (Nobuyoshi Nakada) almost 10 years ago

Takahiro Kambe wrote:

But it should be $defs instead of $DEFS?

Exactly. Please commit it.

Updated by taca (Takahiro Kambe) almost 10 years ago

Nobuyoshi Nakada wrote:

Takahiro Kambe wrote:

But it should be $defs instead of $DEFS?

Exactly. Please commit it.

Who are you asking to commit? (BTW, I am not a committer.)

Updated by nobu (Nobuyoshi Nakada) almost 10 years ago

  • Status changed from Assigned to Closed

Applied in changeset r45488.


readline/extconf.rb: fix typo

Updated by nobu (Nobuyoshi Nakada) almost 10 years ago

Takahiro Kambe wrote:

Who are you asking to commit? (BTW, I am not a commiter.)

Really!?

Updated by ngoto (Naohisa Goto) almost 10 years ago

  • Related to Bug #9702: r45488以降、SolarisStudioで ext/readline がコンパイルエラー(readline 6.2使用) added

Updated by nobu (Nobuyoshi Nakada) almost 10 years ago

  • Description updated (diff)

Updated by usa (Usaku NAKAMURA) almost 10 years ago

Updated by nagachika (Tomoyuki Chikanaga) almost 10 years ago

  • Backport changed from 1.9.3: REQUIRED, 2.0.0: REQUIRED, 2.1: REQUIRED to 1.9.3: REQUIRED, 2.0.0: REQUIRED, 2.1: DONE

Updated by usa (Usaku NAKAMURA) almost 10 years ago

  • Backport changed from 1.9.3: REQUIRED, 2.0.0: REQUIRED, 2.1: DONE to 1.9.3: REQUIRED, 2.0.0: DONE, 2.1: DONE
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0