Bug #9578

‘Function’ undeclared in readline.c

Added by Dmitry Medvinsky over 1 year ago. Updated about 1 year ago.

[ruby-core:61141]
Status:Closed
Priority:Normal
Assignee:Nobuyoshi Nakada
ruby -v:2.0.0p353 (2013-11-22 revision 43784) [x86_64-linux] Backport:1.9.3: REQUIRED, 2.0.0: DONE, 2.1: DONE

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

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

Associated revisions

Revision 45225
Added by Akira Tanaka over 1 year ago

  • 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. [Bug #9578]

Revision 45225
Added by Akira Tanaka over 1 year ago

  • 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. [Bug #9578]

Revision 45240
Added by Nobuyoshi Nakada over 1 year ago

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. [Bug #9578]

Revision 45240
Added by Nobuyoshi Nakada over 1 year ago

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. [Bug #9578]

Revision 45488
Added by Nobuyoshi Nakada over 1 year ago

readline/extconf.rb: fix typo

  • ext/readline/extconf.rb: fix typo, $defs not $DEFS. [Bug #9578]

Revision 45488
Added by Nobuyoshi Nakada over 1 year ago

readline/extconf.rb: fix typo

  • ext/readline/extconf.rb: fix typo, $defs not $DEFS. [Bug #9578]

Revision 45746
Added by Usaku NAKAMURA about 1 year ago

merge revision(s) 45488: [Backport #9631]

* ext/readline/extconf.rb: fix typo, `$defs` not `$DEFS`.
   [Bug #9578]

Revision 45772
Added by Tomoyuki Chikanaga about 1 year ago

merge revision(s) r45225,r45240,r45488: [Backport #9578] [Backport #9630]

* 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.   [Bug #9578]

* ext/readline/extconf.rb (rl_hook_func_t): define as Function for
  very old readline versions.   [Bug #9578]

* ext/readline/extconf.rb: fix typo, `$defs` not `$DEFS`.
   [Bug #9578]

Revision 45773
Added by Tomoyuki Chikanaga about 1 year ago

merge revision(s) r45518: [Backport #9578] [Backport #9630] [Backport #9702]

* ext/readline/extconf.rb (rl_hook_func_t): check pointer type.
   [Bug #9702]

History

#1 Updated by Akira Tanaka over 1 year ago

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

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. [Bug #9578]

#2 Updated by Yui NARUSE over 1 year 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

#3 Updated by Marc-Andre Lafortune over 1 year 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

#4 Updated by Nobuyoshi Nakada over 1 year 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. [Bug #9578]

#5 Updated by Tomoyuki Chikanaga over 1 year 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.

#6 Updated by Nobuyoshi Nakada over 1 year ago

#7 Updated by Takahiro Kambe over 1 year 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?

#8 Updated by Tomoyuki Chikanaga over 1 year ago

  • 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
  • Status changed from Closed to Assigned
  • Assignee set to Nobuyoshi Nakada

#9 Updated by Nobuyoshi Nakada over 1 year ago

Takahiro Kambe wrote:

But it should be $defs instead of $DEFS?

Exactly. Please commit it.

#10 Updated by Takahiro Kambe over 1 year 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.)

#11 Updated by Nobuyoshi Nakada over 1 year ago

  • Status changed from Assigned to Closed

Applied in changeset r45488.


readline/extconf.rb: fix typo

  • ext/readline/extconf.rb: fix typo, $defs not $DEFS. [Bug #9578]

#12 Updated by Nobuyoshi Nakada over 1 year ago

Takahiro Kambe wrote:

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

Really!?

#13 Updated by Naohisa Goto over 1 year ago

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

#14 Updated by Nobuyoshi Nakada over 1 year ago

  • Description updated (diff)

#15 Updated by Usaku NAKAMURA about 1 year ago

#16 Updated by Tomoyuki Chikanaga about 1 year 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

#17 Updated by Usaku NAKAMURA about 1 year 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

Also available in: Atom PDF