ruby-changes:55795
From: Nobuyoshi <ko1@a...>
Date: Thu, 23 May 2019 19:15:23 +0900 (JST)
Subject: [ruby-changes:55795] Nobuyoshi Nakada: fe3ff5afb0 (trunk): Suppress paranoid warnings for external/3rd-party libraries
https://git.ruby-lang.org/ruby.git/commit/?id=fe3ff5afb0 From fe3ff5afb07e171fd950623c69abfbabbb2762a3 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Thu, 23 May 2019 17:27:24 +0900 Subject: Suppress paranoid warnings for external/3rd-party libraries [Feature #15665] diff --git a/ext/socket/mkconstants.rb b/ext/socket/mkconstants.rb index 81b8224..620a5f6 100644 --- a/ext/socket/mkconstants.rb +++ b/ext/socket/mkconstants.rb @@ -180,6 +180,7 @@ int https://github.com/ruby/ruby/blob/trunk/ext/socket/mkconstants.rb#L180 % } default: + if (!str || !valp) {/* wrong argument */} return -1; } } diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h index 0c6d7e3..86e01f6 100644 --- a/include/ruby/ruby.h +++ b/include/ruby/ruby.h @@ -2198,6 +2198,7 @@ rb_array_ptr_use_start(VALUE a, int allow_transient) https://github.com/ruby/ruby/blob/trunk/include/ruby/ruby.h#L2198 } } #endif + (void)allow_transient; return rb_ary_ptr_use_start(a); } @@ -2208,6 +2209,7 @@ rb_array_ptr_use_end(VALUE a, int allow_transient) https://github.com/ruby/ruby/blob/trunk/include/ruby/ruby.h#L2209 { void rb_ary_ptr_use_end(VALUE a); rb_ary_ptr_use_end(a); + (void)allow_transient; } #if defined(EXTLIB) && defined(USE_DLN_A_OUT) diff --git a/internal.h b/internal.h index 2511aff..bf57094 100644 --- a/internal.h +++ b/internal.h @@ -117,10 +117,10 @@ extern "C" { https://github.com/ruby/ruby/blob/trunk/internal.h#L117 #endif #if !__has_feature(memory_sanitizer) -# define __msan_allocated_memory(x, y) -# define __msan_poison(x, y) -# define __msan_unpoison(x, y) -# define __msan_unpoison_string(x) +# define __msan_allocated_memory(x, y) ((void)(x), (void)(y)) +# define __msan_poison(x, y) ((void)(x), (void)(y)) +# define __msan_unpoison(x, y) ((void)(x), (void)(y)) +# define __msan_unpoison_string(x) ((void)(x)) #endif /*! diff --git a/lib/mkmf.rb b/lib/mkmf.rb index ea5a8ac..bf95484 100644 --- a/lib/mkmf.rb +++ b/lib/mkmf.rb @@ -2735,7 +2735,7 @@ MESSAGE https://github.com/ruby/ruby/blob/trunk/lib/mkmf.rb#L2735 ## # A C main function which does no work - MAIN_DOES_NOTHING = config_string('MAIN_DOES_NOTHING') || "int main(int argc, char **argv)\n{\n return 0;\n}" + MAIN_DOES_NOTHING = config_string('MAIN_DOES_NOTHING') || "int main(int argc, char **argv)\n{\n return !!argv[argc];\n}" UNIVERSAL_INTS = config_string('UNIVERSAL_INTS') {|s| Shellwords.shellwords(s)} || %w[int short long long\ long] -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/