[ruby-cvs:62339] nobu:r55176 (trunk): ruby.h: fix for old clang

nobu at ruby-lang.org nobu at ruby-lang.org
Fri May 27 00:39:43 JST 2016

nobu	2016-05-27 00:39:43 +0900 (Fri, 27 May 2016)

  New Revision: 55176


    ruby.h: fix for old clang
    * include/ruby/ruby.h (rb_scan_args): add nul padding here to
      apply to all references.
    * include/ruby/ruby.h (rb_scan_args_verify): move length mismatch
      check outside conditional operators.
    Since old clang cannot optimize away string literal dereference by
    an immediate index, e.g., ""[0], and both of true and false side
    expressions are compiled and warned unintentionally.  With such
    old compilers, the check in rb_scan_args() does not work but may
    result unpredictable value if the format is wrong.

  Modified files:

More information about the ruby-cvs mailing list