ruby-changes:38977
From: nobu <ko1@a...>
Date: Mon, 29 Jun 2015 12:43:38 +0900 (JST)
Subject: [ruby-changes:38977] nobu:r51058 (trunk): mkmf.rb: suppress warnings
nobu 2015-06-29 12:43:21 +0900 (Mon, 29 Jun 2015) New Revision: 51058 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=51058 Log: mkmf.rb: suppress warnings * lib/mkmf.rb (check_sizeof, what_type): remove static qualifiers to suppress unneeded-internal-declaration warnings. Modified files: trunk/lib/mkmf.rb Index: lib/mkmf.rb =================================================================== --- lib/mkmf.rb (revision 51057) +++ lib/mkmf.rb (revision 51058) @@ -1326,7 +1326,7 @@ SRC https://github.com/ruby/ruby/blob/trunk/lib/mkmf.rb#L1326 # def check_sizeof(type, headers = nil, opts = "", &b) typedef, member, prelude = typedef_expr(type, headers) - prelude << "static #{typedef} *rbcv_ptr_;\n" + prelude << "#{typedef} *rbcv_ptr_;\n" prelude = [prelude] expr = "sizeof((*rbcv_ptr_)#{"." << member if member})" fmt = STRING_OR_FAILED_FORMAT @@ -1479,7 +1479,7 @@ SRC https://github.com/ruby/ruby/blob/trunk/lib/mkmf.rb#L1479 prelude = [cpp_include(headers).split(/^/)] prelude << ["typedef #{type} rbcv_typedef_;\n", "extern rbcv_typedef_ *#{func};\n", - "static rbcv_typedef_ #{var};\n", + "rbcv_typedef_ #{var};\n", ] type = "rbcv_typedef_" fmt = member && !(typeof = have_typeof?) ? "seems %s" : "%s" @@ -1490,7 +1490,7 @@ SRC https://github.com/ruby/ruby/blob/trunk/lib/mkmf.rb#L1490 type = "rbcv_mem_typedef_" prelude[-1] << "typedef #{typeof}(#{val}) #{type};\n" prelude[-1] << "extern #{type} *#{func};\n" - prelude[-1] << "static #{type} #{var};\n" + prelude[-1] << "#{type} #{var};\n" val = var end def fmt.%(x) @@ -1513,7 +1513,7 @@ SRC https://github.com/ruby/ruby/blob/trunk/lib/mkmf.rb#L1513 type = UNIVERSAL_INTS.find do |t| pre = prelude unless member - pre += [["static #{unsigned} #{t} #{ptr}#{var};\n", + pre += [["#{unsigned} #{t} #{ptr}#{var};\n", "extern #{unsigned} #{t} #{ptr}*#{func};\n"]] end try_static_assert("sizeof(#{ptr}#{val}) == sizeof(#{unsigned} #{t})", pre) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/