diff --git a/ChangeLog b/ChangeLog index ee8afb4780..842cac4351 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Wed Jan 11 23:40:21 2012 Naohisa Goto + + * string.c (rb_str_concat): set array element after definition + to fix compile error with Fujitsu C Compiler 5.6 on Solaris 10 + on Sparc. [Bug #5878] [ruby-dev:45123] + Wed Jan 11 22:52:51 2012 CHIKANAGA Tomoyuki * gc.c (ruby_mimmalloc): don't set allocated size to header. diff --git a/string.c b/string.c index 55691d017c..9fd2480fd3 100644 --- a/string.c +++ b/string.c @@ -2093,7 +2093,8 @@ rb_str_concat(VALUE str1, VALUE str2) 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); }