[ruby-trunk - Bug #5878][Open] compile error in string.c:2096 since r34236

Issue #5878 has been reported by Naohisa G…


Bug #5878: compile error in string.c:2096 since r34236
https://bugs.ruby-lang.org/issues/5878

Author: Naohisa G.
Status: Open
Priority: Normal
Assignee:
Category:
Target version:
ruby -v: ruby 2.0.0dev (2012-01-10) [sparc-solaris2.10]

r34236 以降、Solaris 10 上の Fujitsu fcc 5.6 にて、string.c
の2096行目がコンパイルエラーになります。

“string.c”, line 2096: error: initialization: constant expression is
expected fo
r variable: `buf’

以下のパッチでコンパイルが通り、Error/Failureが増えていないことを確認しました。

Index: string.c

— string.c (revision 34265)
+++ string.c (working copy)
@@ -2093,7 +2093,8 @@

 if (enc == rb_usascii_encoding()) {

/* US-ASCII automatically extended to ASCII-8BIT */

  • char buf[1] = {(char)code};
  • char buf[1];
  • buf[0] = (char)code;
    if (code > 0xFF) {
    rb_raise(rb_eRangeError, “%u out of char range”, code);
    }

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs