Project

General

Profile

Actions

Bug #1382

closed

inline functions ought to be static

Added by roberto (Ollivier Robert) about 15 years ago. Updated almost 13 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 1.9.2dev (2009-04-14) [i386-darwin9.6.0]
Backport:
[ruby-core:23210]

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

static.diff (596 Bytes) static.diff Patch to add "static" to rb_reserved_word roberto (Ollivier Robert), 04/15/2009 06:12 PM
Actions #1

Updated by nobu (Nobuyoshi Nakada) almost 15 years ago

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

=begin
Applied in changeset r23436.
=end

Actions #2

Updated by rue (Eero Saynatkari) almost 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/1382

Author: 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

Actions #3

Updated by akr (Akira Tanaka) almost 15 years ago

=begin
lex.c.blt is generated by gperf. Don't modify it.
=end

Actions #4

Updated by nobu (Nobuyoshi Nakada) almost 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

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0