Bug #1382
closedinline functions ought to be static
Description
=begin
While compiling Ruby with ongoing versions of clang/llvm, it appeared that rb_reserved_word, an inline function in lex.c.blt which is included in parse.y is not declared as static as it apparently should (C99). gcc supports it. Fix Ruby for clang.
=end
Files
Updated by nobu (Nobuyoshi Nakada) over 15 years ago
- Status changed from Open to Closed
- % Done changed from 0 to 100
=begin
Applied in changeset r23436.
=end
Updated by rue (Eero Saynatkari) over 15 years ago
=begin
Excerpts from Luiz Angelo Daros de Luca's message of Wed Apr 15 12:13:39 +0300 2009:
Bug #1382: inline functions ought to be static
http://redmine.ruby-lang.org/issues/show/1382Author: Ollivier Robert
Status: Open, Priority: Normal
Category: core
ruby -v: ruby 1.9.2dev (2009-04-14) [i386-darwin9.6.0]While compiling Ruby with ongoing versions of clang/llvm, it appeared that
rb_reserved_word, an inline function in lex.c.blt which is included in parse.y
is not declared as static as it apparently should (C99). gcc supports it. Fix
Ruby for clang.
I think strictly speaking the problem is the declaration
given at the top as non-inline, which causes it to try
an external lookup...so the C99-ish solution would be to
drop the first decl, leave the inline definition and then
define it extern in parse.y.
But making it static is probably simpler.
--
Magic is insufficiently advanced technology.
=end
Updated by akr (Akira Tanaka) over 15 years ago
=begin
lex.c.blt is generated by gperf. Don't modify it.
=end
Updated by nobu (Nobuyoshi Nakada) over 15 years ago
=begin
Hi,
At Sat, 16 May 2009 10:55:17 +0900,
Akira Tanaka wrote in [ruby-core:23475]:
lex.c.blt is generated by gperf. Don't modify it.
Seems lex.c.blt to need to be updated, for the platforms that
don't have gperf.
lex.c: defs/keywords
@
if cmp -s $(srcdir)/defs/lex.c.src $?; then
set -x;
cp $(srcdir)/lex.c.blt $@;
else
set -x;
gperf -C -p -j1 -i 1 -g -o -t -N rb_reserved_word -k1,3,$$ $? > $@.tmp &&
mv $@.tmp $@ &&
cp $? $(srcdir)/defs/lex.c.src &&
cp $@ $(srcdir)/lex.c.blt;
fi
--
Nobu Nakada
=end