ruby-changes:42870
From: naruse <ko1@a...>
Date: Sun, 8 May 2016 08:59:04 +0900 (JST)
Subject: [ruby-changes:42870] naruse:r54943 (trunk): * configure.in: add -Wsuggest-attribute=noreturn and suppress warnings.
naruse 2016-05-08 09:55:28 +0900 (Sun, 08 May 2016) New Revision: 54943 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=54943 Log: * configure.in: add -Wsuggest-attribute=noreturn and suppress warnings. Modified files: trunk/ChangeLog trunk/configure.in trunk/dmydln.c trunk/include/ruby/intern.h trunk/include/ruby/ruby.h trunk/numeric.c trunk/process.c trunk/thread.c Index: include/ruby/intern.h =================================================================== --- include/ruby/intern.h (revision 54942) +++ include/ruby/intern.h (revision 54943) @@ -249,9 +249,9 @@ PRINTF_ARGS(NORETURN(void rb_loaderror_w https://github.com/ruby/ruby/blob/trunk/include/ruby/intern.h#L249 PRINTF_ARGS(NORETURN(void rb_name_error(ID, const char*, ...)), 2, 3); PRINTF_ARGS(NORETURN(void rb_name_error_str(VALUE, const char*, ...)), 2, 3); NORETURN(void rb_invalid_str(const char*, const char*)); -DEPRECATED(PRINTF_ARGS(void rb_compile_error(const char*, int, const char*, ...), 3, 4)); -DEPRECATED(PRINTF_ARGS(void rb_compile_error_with_enc(const char*, int, void *, const char*, ...), 4, 5)); -DEPRECATED(PRINTF_ARGS(void rb_compile_error_append(const char*, ...), 1, 2)); +NORETURN(DEPRECATED(PRINTF_ARGS(void rb_compile_error(const char*, int, const char*, ...), 3, 4))); +NORETURN(DEPRECATED(PRINTF_ARGS(void rb_compile_error_with_enc(const char*, int, void *, const char*, ...), 4, 5))); +NORETURN(DEPRECATED(PRINTF_ARGS(void rb_compile_error_append(const char*, ...), 1, 2))); NORETURN(void rb_error_frozen(const char*)); NORETURN(void rb_error_frozen_object(VALUE)); void rb_error_untrusted(VALUE); @@ -367,12 +367,12 @@ typedef fd_set rb_fdset_t; https://github.com/ruby/ruby/blob/trunk/include/ruby/intern.h#L367 NORETURN(void rb_exc_raise(VALUE)); NORETURN(void rb_exc_fatal(VALUE)); -VALUE rb_f_exit(int, const VALUE*); -VALUE rb_f_abort(int, const VALUE*); +NORETURN(VALUE rb_f_exit(int, const VALUE*)); +NORETURN(VALUE rb_f_abort(int, const VALUE*)); void rb_remove_method(VALUE, const char*); void rb_remove_method_id(VALUE, ID); -DEPRECATED(static inline void rb_disable_super(void)); -DEPRECATED(static inline void rb_enable_super(void)); +NORETURN(DEPRECATED(static inline void rb_disable_super(void))); +NORETURN(DEPRECATED(static inline void rb_enable_super(void))); static inline void rb_disable_super(void) { /* obsolete - no use */ @@ -388,7 +388,7 @@ typedef VALUE (*rb_alloc_func_t)(VALUE); https://github.com/ruby/ruby/blob/trunk/include/ruby/intern.h#L388 void rb_define_alloc_func(VALUE, rb_alloc_func_t); void rb_undef_alloc_func(VALUE); rb_alloc_func_t rb_get_alloc_func(VALUE); -DEPRECATED(void rb_clear_cache(void)); +NORETURN(DEPRECATED(void rb_clear_cache(void))); void rb_clear_constant_cache(void); void rb_clear_method_cache_by_class(VALUE); void rb_alias(VALUE, ID, ID); @@ -398,12 +398,12 @@ int rb_method_basic_definition_p(VALUE, https://github.com/ruby/ruby/blob/trunk/include/ruby/intern.h#L398 VALUE rb_eval_cmd(VALUE, VALUE, int); int rb_obj_respond_to(VALUE, ID, int); int rb_respond_to(VALUE, ID); -VALUE rb_f_notimplement(int argc, const VALUE *argv, VALUE obj); +NORETURN(VALUE rb_f_notimplement(int argc, const VALUE *argv, VALUE obj)); #if !defined(RUBY_EXPORT) && defined(_WIN32) RUBY_EXTERN VALUE (*const rb_f_notimplement_)(int, const VALUE *, VALUE); #define rb_f_notimplement (*rb_f_notimplement_) #endif -void rb_interrupt(void); +NORETURN(void rb_interrupt(void)); VALUE rb_apply(VALUE, ID, VALUE); void rb_backtrace(void); ID rb_frame_this_func(void); @@ -638,7 +638,7 @@ void rb_lastline_set(VALUE); https://github.com/ruby/ruby/blob/trunk/include/ruby/intern.h#L638 void rb_last_status_set(int status, rb_pid_t pid); VALUE rb_last_status_get(void); int rb_proc_exec(const char*); -VALUE rb_f_exec(int, const VALUE*); +NORETURN(VALUE rb_f_exec(int, const VALUE*)); rb_pid_t rb_waitpid(rb_pid_t pid, int *status, int flags); void rb_syswait(rb_pid_t pid); rb_pid_t rb_spawn(int, const VALUE*); @@ -776,8 +776,8 @@ VALUE rb_str_replace(VALUE, VALUE); https://github.com/ruby/ruby/blob/trunk/include/ruby/intern.h#L776 VALUE rb_str_inspect(VALUE); VALUE rb_str_dump(VALUE); VALUE rb_str_split(VALUE, const char*); -DEPRECATED(void rb_str_associate(VALUE, VALUE)); -DEPRECATED(VALUE rb_str_associated(VALUE)); +NORETURN(DEPRECATED(void rb_str_associate(VALUE, VALUE))); +NORETURN(DEPRECATED(VALUE rb_str_associated(VALUE))); void rb_str_setter(VALUE, ID, VALUE*); VALUE rb_str_intern(VALUE); VALUE rb_sym_to_s(VALUE); @@ -965,7 +965,7 @@ VALUE rb_const_get_at(VALUE, ID); https://github.com/ruby/ruby/blob/trunk/include/ruby/intern.h#L965 VALUE rb_const_get_from(VALUE, ID); void rb_const_set(VALUE, ID, VALUE); VALUE rb_const_remove(VALUE, ID); -VALUE rb_mod_const_missing(VALUE,VALUE); +NORETURN(VALUE rb_mod_const_missing(VALUE,VALUE)); VALUE rb_cvar_defined(VALUE, ID); void rb_cvar_set(VALUE, ID, VALUE); VALUE rb_cvar_get(VALUE, ID); @@ -983,7 +983,7 @@ VALUE rb_make_backtrace(void); https://github.com/ruby/ruby/blob/trunk/include/ruby/intern.h#L983 VALUE rb_make_exception(int, const VALUE*); /* deprecated */ -DEPRECATED(void rb_frame_pop(void)); +NORETURN(DEPRECATED(void rb_frame_pop(void))); RUBY_SYMBOL_EXPORT_END Index: include/ruby/ruby.h =================================================================== --- include/ruby/ruby.h (revision 54942) +++ include/ruby/ruby.h (revision 54943) @@ -1715,7 +1715,7 @@ VALUE rb_gvar_var_getter(ID id, void *da https://github.com/ruby/ruby/blob/trunk/include/ruby/ruby.h#L1715 void rb_gvar_var_setter(VALUE val, ID id, void *data, struct rb_global_variable *gvar); void rb_gvar_var_marker(VALUE *var); -void rb_gvar_readonly_setter(VALUE val, ID id, void *data, struct rb_global_variable *gvar); +NORETURN(void rb_gvar_readonly_setter(VALUE val, ID id, void *data, struct rb_global_variable *gvar)); void rb_define_variable(const char*,VALUE*); void rb_define_virtual_variable(const char*,VALUE(*)(ANYARGS),void(*)(ANYARGS)); Index: configure.in =================================================================== --- configure.in (revision 54942) +++ configure.in (revision 54943) @@ -835,6 +835,7 @@ if test "$GCC:${warnflags+set}:no" = yes https://github.com/ruby/ruby/blob/trunk/configure.in#L835 -Werror=division-by-zero \ -Werror=deprecated-declarations \ -Wno-packed-bitfield-compat \ + -Wsuggest-attribute=noreturn \ $extra_warning \ ; do if test "$particular_werror_flags" != yes; then Index: ChangeLog =================================================================== --- ChangeLog (revision 54942) +++ ChangeLog (revision 54943) @@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Sun May 8 08:31:03 2016 NARUSE, Yui <naruse@r...> + + * configure.in: add -Wsuggest-attribute=noreturn and suppress warnings. + Sun May 8 08:19:16 2016 NARUSE, Yui <naruse@r...> * configure.in: add -Werror=implicit-int to avoid missing type of Index: thread.c =================================================================== --- thread.c (revision 54942) +++ thread.c (revision 54943) @@ -2117,6 +2117,7 @@ rb_threadptr_signal_exit(rb_thread_t *th https://github.com/ruby/ruby/blob/trunk/thread.c#L2117 #define USE_SIGALTSTACK #endif +NORETURN(void ruby_thread_stack_overflow(rb_thread_t *th)); void ruby_thread_stack_overflow(rb_thread_t *th) { Index: process.c =================================================================== --- process.c (revision 54942) +++ process.c (revision 54943) @@ -2584,7 +2584,7 @@ rb_f_exec(int argc, const VALUE *argv) https://github.com/ruby/ruby/blob/trunk/process.c#L2584 rb_exec_fail(eargp, err, errmsg); RB_GC_GUARD(execarg_obj); rb_syserr_fail_str(err, fail_str); - return Qnil; /* dummy */ + UNREACHABLE; } #define ERRMSG(str) do { if (errmsg && 0 < errmsg_buflen) strlcpy(errmsg, (str), errmsg_buflen); } while (0) Index: numeric.c =================================================================== --- numeric.c (revision 54942) +++ numeric.c (revision 54943) @@ -2684,7 +2684,8 @@ rb_fix2int(VALUE val) https://github.com/ruby/ruby/blob/trunk/numeric.c#L2684 } #endif -void +NORETURN(static void rb_out_of_short(SIGNED_VALUE num)); +static void rb_out_of_short(SIGNED_VALUE num) { rb_raise(rb_eRangeError, "integer %"PRIdVALUE " too %s to convert to `short'", Index: dmydln.c =================================================================== --- dmydln.c (revision 54942) +++ dmydln.c (revision 54943) @@ -1,5 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/dmydln.c#L1 #include "ruby/ruby.h" +NORETURN(void *dln_load(const char *)); void* dln_load(const char *file) { -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/