ruby-changes:37897
From: nobu <ko1@a...>
Date: Mon, 16 Mar 2015 16:49:34 +0900 (JST)
Subject: [ruby-changes:37897] nobu:r49978 (trunk): ruby.h: suppress false warnings
nobu 2015-03-16 16:49:27 +0900 (Mon, 16 Mar 2015) New Revision: 49978 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=49978 Log: ruby.h: suppress false warnings * include/ruby/ruby.h (rb_data_object_alloc_warning): enable only if __builtin_choose_expr works with __builtin_constant_p so that warnings will be suppressed if klass is 0. Modified files: trunk/include/ruby/ruby.h trunk/random.c Index: include/ruby/ruby.h =================================================================== --- include/ruby/ruby.h (revision 49977) +++ include/ruby/ruby.h (revision 49978) @@ -1169,7 +1169,9 @@ rb_obj_freeze_inline(VALUE x) https://github.com/ruby/ruby/blob/trunk/include/ruby/ruby.h#L1169 # define RUBY_UNTYPED_DATA_FUNC(func) DEPRECATED(func) #endif +#if defined(HAVE_BUILTIN___BUILTIN_CHOOSE_EXPR_CONSTANT_P) RUBY_UNTYPED_DATA_FUNC(static inline VALUE rb_data_object_alloc_warning(VALUE,void*,RUBY_DATA_FUNC,RUBY_DATA_FUNC)); +#endif RUBY_UNTYPED_DATA_FUNC(static inline void *rb_data_object_get_warning(VALUE)); static inline VALUE Index: random.c =================================================================== --- random.c (revision 49977) +++ random.c (revision 49978) @@ -491,8 +491,6 @@ fill_random_bytes(void *seed, size_t siz https://github.com/ruby/ruby/blob/trunk/random.c#L491 } else { if (!old_prov) { -# undef RUBY_UNTYPED_DATA_WARNING -# define RUBY_UNTYPED_DATA_WARNING 0 rb_gc_register_mark_object(Data_Wrap_Struct(0, 0, release_crypt, &prov)); } else { -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/