Skip to content

Commit

Permalink
Suppress paranoid warnings for external/3rd-party libraries
Browse files Browse the repository at this point in the history
[Feature #15665]
  • Loading branch information
nobu committed May 23, 2019
1 parent dc95b57 commit fe3ff5a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions ext/socket/mkconstants.rb
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ def each_names_with_len(pat, prefix_optional=nil)
% }
default:
if (!str || !valp) {/* wrong argument */}
return -1;
}
}
Expand Down
2 changes: 2 additions & 0 deletions include/ruby/ruby.h
Original file line number Diff line number Diff line change
Expand Up @@ -2198,6 +2198,7 @@ rb_array_ptr_use_start(VALUE a, int allow_transient)
}
}
#endif
(void)allow_transient;

return rb_ary_ptr_use_start(a);
}
Expand All @@ -2208,6 +2209,7 @@ rb_array_ptr_use_end(VALUE a, int allow_transient)
{
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)
Expand Down
8 changes: 4 additions & 4 deletions internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,10 @@ extern "C" {
#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

/*!
Expand Down
2 changes: 1 addition & 1 deletion lib/mkmf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2735,7 +2735,7 @@ def MAIN_DOES_NOTHING(*refs)
##
# 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]

Expand Down

0 comments on commit fe3ff5a

Please sign in to comment.