From: matz@... (Yukihiro Matsumoto) Date: 2000-05-01T18:36:01+09:00 Subject: [ruby-talk:02611] Re: linux-alpha/ccc / syntax Hi, In message "[ruby-talk:02609] linux-alpha/ccc / syntax" on 00/04/30, Wes Nakamura writes: |To get ruby 1.4.4 to compile with ccc, in eval.c line 726 in rb_eval's |prototype, the NODE* must be changed to NODE* volatile; the same for |line 732 in module_setup. I believe this is also the case with 1.5. From unknown reason, ccc does not allow volatile in function arguments. The code like below shut up ccc warnings. static VALUE rb_eval(self, n) VALUE self; NODE *n; { NODE * volatile node = n; |Attempting to load a (shared object) module causes an unaligned trap |followed by a segmentation violation. Normally the kernel handles |unaligned accesses gracefully, but in this case it doesn't. I've traced |it to do_entUnaUser in the kernel, which is supposed to handle the |unaligned accesses, and apparently _dl_relocate_object, which appears to |be in libc. (glibc 2.1.1 in this case) Extensions compiled by gcc seems to work fine. Ruby compiled by ccc can load extensions compiled by gcc. Probably ccc requires some option to be set to generate dynamic loadable object like -fPIC for gcc. Information is welcome. |Well, now that I've got a working ccc-compiled ruby, is there a |benchmark (rubystone? - nice name) to compare performance differences |between the ccc and gcc compiled versions? I often use time ./ruby sample/test.rb > /dev/null I really like to see rubystone though. |Also, I've got a syntax question. Using () across multiple lines for |method calls allows you to continue the parameter list without a \. |However, it doesn't work for grouping/precedence. Since parentheses can be used for group sentences, it is valid in Ruby. (print 5 print "\n" 55) It works line begin print 5 print "\n" 55 end Making newlines in parentheses work like Python introduces minor backward incompatibility. Although I guess nobody use this syntax. I think we should disscuss more before changing syntax. matz.