Project

General

Profile

Bug #11487

id_table.c compile error by fcc on Solaris 10

Added by ngoto (Naohisa Goto) almost 4 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-dev:<unknown>]

Description

Solaris 10 上の古いfccにて、最近、id_table.c のコンパイルに失敗します。

下記は r51677 におけるエラーメッセージです。

fcc -O2 -KV9 -KVIS2  -DRUBY_EXPORT -I/usr/local/64/lib/libffi-3.0.10/include -I/usr/local/64/include   -I. -I.ext/include/sparc64-solaris2.10 -I./include -I. -o symbol.o -c symbol.c
(中略)
"./id_table.c", line 453: error: syntax error near `/'
"./id_table.c", line 1277: error: initialization: constant expression is expected for variable: `tmp_tbl'
make: *** [symbol.o] Error 1

2箇所にエラーが出ているのがわかります。

id_table.c の453行目は以下のとおりです。

        // fprintf(stderr, "memmove: %p -> %p (%d, capa: %d)\n", old_values, new_values, num, capa);

CのソースなのにC++形式のコメントを使っているのが原因です。

id_table.c の1277行目は以下のとおりです。

    struct hash_id_table tmp_tbl = {new_cap, 0, 0};

構造体の変数による初期化はできない主旨のエラーが出ています。
宣言後、1要素ずつ代入するように書き換えるとよさそうです。

Associated revisions

Revision 341c84ed
Added by nobu (Nobuyoshi Nakada) almost 4 years ago

id_table.c: fix for C89 compilers

  • id_table.c (list_table_extend, hash_table_extend): remove C99 features. [ruby-dev:49239] [Bug #11487]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51678 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 51678
Added by nobu (Nobuyoshi Nakada) almost 4 years ago

id_table.c: fix for C89 compilers

  • id_table.c (list_table_extend, hash_table_extend): remove C99 features. [ruby-dev:49239] [Bug #11487]

Revision 51678
Added by nobu (Nobuyoshi Nakada) almost 4 years ago

id_table.c: fix for C89 compilers

  • id_table.c (list_table_extend, hash_table_extend): remove C99 features. [ruby-dev:49239] [Bug #11487]

Revision 51678
Added by nobu (Nobuyoshi Nakada) almost 4 years ago

id_table.c: fix for C89 compilers

  • id_table.c (list_table_extend, hash_table_extend): remove C99 features. [ruby-dev:49239] [Bug #11487]

Revision 51678
Added by nobu (Nobuyoshi Nakada) almost 4 years ago

id_table.c: fix for C89 compilers

  • id_table.c (list_table_extend, hash_table_extend): remove C99 features. [ruby-dev:49239] [Bug #11487]

Revision 51678
Added by nobu (Nobuyoshi Nakada) almost 4 years ago

id_table.c: fix for C89 compilers

  • id_table.c (list_table_extend, hash_table_extend): remove C99 features. [ruby-dev:49239] [Bug #11487]

History

#1

Updated by nobu (Nobuyoshi Nakada) almost 4 years ago

  • Status changed from Open to Closed

Applied in changeset r51678.


id_table.c: fix for C89 compilers

  • id_table.c (list_table_extend, hash_table_extend): remove C99 features. [ruby-dev:49239] [Bug #11487]
#2

Updated by usa (Usaku NAKAMURA) almost 4 years ago

  • Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN to 2.0.0: DONTNEED, 2.1: DONTNEED, 2.2: DONTNEED

Also available in: Atom PDF