[前][次][番号順一覧][スレッド一覧]

ruby-changes:23270

From: drbrain <ko1@a...>
Date: Sat, 14 Apr 2012 08:46:00 +0900 (JST)
Subject: [ruby-changes:23270] drbrain:r35321 (trunk): * encoding.c (rb_enc_codepoint_len): Use UNREACHABLE to avoid "control

drbrain	2012-04-14 08:45:37 +0900 (Sat, 14 Apr 2012)

  New Revision: 35321

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=35321

  Log:
    * encoding.c (rb_enc_codepoint_len):  Use UNREACHABLE to avoid "control
      reaches end of non-void function" warnings.  [ruby-trunk - Bug #6066]
    * re.c (name_to_backref_number):  ditto.
    * object.c (rb_Float):  ditto.
    * io.c (io_readpartial):  ditto.
    * io.c (io_read_nonblock):  ditto.
    * pack.c (rb_uv_to_utf8):  ditto.
    * proc.c (rb_method_entry_arity):  ditto.
    * vm_method.c (rb_f_notimplement):  ditto.
    * struct.c (rb_struct_aset_id):  ditto.
    * class.c (rb_scan_args):  ditto.
    * process.c (rlimit_resource_type):  ditto.
    * process.c (rlimit_resource_value):  ditto.
    * process.c (p_uid_switch):  ditto.
    * process.c (p_gid_switch):  ditto.
    * ext/digest/digest.c (rb_digest_instance_update):  ditto.
    * ext/digest/digest.c (rb_digest_instance_finish):  ditto.
    * ext/digest/digest.c (rb_digest_instance_reset):  ditto.
    * ext/digest/digest.c (rb_digest_instance_block_length):  ditto.
    * ext/bigdecimal/bigdecimal.c (BigDecimalCmp):  ditto.
    * ext/dl/handle.c (rb_dlhandle_close):  ditto.
    * ext/tk/tcltklib.c (pending_exception_check0):  ditto.
    * ext/tk/tcltklib.c (pending_exception_check1):  ditto.
    * ext/tk/tcltklib.c (ip_cancel_eval_core):  ditto.
    * ext/tk/tcltklib.c (lib_get_reltype_name):  ditto.
    * ext/tk/tcltklib.c (create_dummy_encoding_for_tk_core):  ditto.
    * ext/tk/tkutil/tkutil.c (tk_hash_kv):  ditto.
    * ext/openssl/ossl_ssl.c (ossl_ssl_session_reused):  ditto.
    * ext/openssl/ossl_pkey_ec.c (ossl_ec_key_dsa_verify_asn1):  ditto.
    * ext/openssl/ossl_pkey_ec.c (ossl_ec_point_is_at_infinit):  ditto.
    * ext/openssl/ossl_pkey_ec.c (ossl_ec_point_is_on_curve):  ditto.
    * ext/fiddle/conversions.c (generic_to_value):  ditto.
    * ext/socket/raddrinfo.c (rsock_io_socket_addrinfo):  ditto.
    * ext/socket/socket.c (sock_s_getnameinfo):  ditto.
    * ext/ripper/eventids2.c (ripper_token2eventid):  ditto.
    * cont.c (return_fiber):  ditto.
    * dmydln.c (dln_load):  ditto.
    * vm_insnhelper.c (vm_search_normal_superclass):  ditto.
    * bignum.c (big_fdiv):  ditto.
    * marshal.c (r_symlink):  ditto.
    * marshal.c (r_symbol):  ditto.

  Modified files:
    trunk/ChangeLog
    trunk/bignum.c
    trunk/class.c
    trunk/cont.c
    trunk/dmydln.c
    trunk/encoding.c
    trunk/ext/bigdecimal/bigdecimal.c
    trunk/ext/digest/digest.c
    trunk/ext/dl/handle.c
    trunk/ext/fiddle/conversions.c
    trunk/ext/openssl/ossl_pkey_ec.c
    trunk/ext/openssl/ossl_ssl.c
    trunk/ext/ripper/eventids2.c
    trunk/ext/socket/raddrinfo.c
    trunk/ext/socket/socket.c
    trunk/ext/tk/tcltklib.c
    trunk/ext/tk/tkutil/tkutil.c
    trunk/io.c
    trunk/marshal.c
    trunk/object.c
    trunk/pack.c
    trunk/proc.c
    trunk/process.c
    trunk/re.c
    trunk/struct.c
    trunk/vm_insnhelper.c
    trunk/vm_method.c

Index: encoding.c
===================================================================
--- encoding.c	(revision 35320)
+++ encoding.c	(revision 35321)
@@ -928,6 +928,8 @@
     }
     else
 	rb_raise(rb_eArgError, "invalid byte sequence in %s", rb_enc_name(enc));
+
+    UNREACHABLE;
 }
 
 #undef rb_enc_codepoint
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 35320)
+++ ChangeLog	(revision 35321)
@@ -1,3 +1,47 @@
+Sat Apr 14 08:38:20 2012  Eric Hodel  <drbrain@s...>
+
+	* encoding.c (rb_enc_codepoint_len):  Use UNREACHABLE to avoid "control
+	  reaches end of non-void function" warnings.  [ruby-trunk - Bug #6066]
+	* re.c (name_to_backref_number):  ditto.
+	* object.c (rb_Float):  ditto.
+	* io.c (io_readpartial):  ditto.
+	* io.c (io_read_nonblock):  ditto.
+	* pack.c (rb_uv_to_utf8):  ditto.
+	* proc.c (rb_method_entry_arity):  ditto.
+	* vm_method.c (rb_f_notimplement):  ditto.
+	* struct.c (rb_struct_aset_id):  ditto.
+	* class.c (rb_scan_args):  ditto.
+	* process.c (rlimit_resource_type):  ditto.
+	* process.c (rlimit_resource_value):  ditto.
+	* process.c (p_uid_switch):  ditto.
+	* process.c (p_gid_switch):  ditto.
+	* ext/digest/digest.c (rb_digest_instance_update):  ditto.
+	* ext/digest/digest.c (rb_digest_instance_finish):  ditto.
+	* ext/digest/digest.c (rb_digest_instance_reset):  ditto.
+	* ext/digest/digest.c (rb_digest_instance_block_length):  ditto.
+	* ext/bigdecimal/bigdecimal.c (BigDecimalCmp):  ditto.
+	* ext/dl/handle.c (rb_dlhandle_close):  ditto.
+	* ext/tk/tcltklib.c (pending_exception_check0):  ditto.
+	* ext/tk/tcltklib.c (pending_exception_check1):  ditto.
+	* ext/tk/tcltklib.c (ip_cancel_eval_core):  ditto.
+	* ext/tk/tcltklib.c (lib_get_reltype_name):  ditto.
+	* ext/tk/tcltklib.c (create_dummy_encoding_for_tk_core):  ditto.
+	* ext/tk/tkutil/tkutil.c (tk_hash_kv):  ditto.
+	* ext/openssl/ossl_ssl.c (ossl_ssl_session_reused):  ditto.
+	* ext/openssl/ossl_pkey_ec.c (ossl_ec_key_dsa_verify_asn1):  ditto.
+	* ext/openssl/ossl_pkey_ec.c (ossl_ec_point_is_at_infinit):  ditto.
+	* ext/openssl/ossl_pkey_ec.c (ossl_ec_point_is_on_curve):  ditto.
+	* ext/fiddle/conversions.c (generic_to_value):  ditto.
+	* ext/socket/raddrinfo.c (rsock_io_socket_addrinfo):  ditto.
+	* ext/socket/socket.c (sock_s_getnameinfo):  ditto.
+	* ext/ripper/eventids2.c (ripper_token2eventid):  ditto.
+	* cont.c (return_fiber):  ditto.
+	* dmydln.c (dln_load):  ditto.
+	* vm_insnhelper.c (vm_search_normal_superclass):  ditto.
+	* bignum.c (big_fdiv):  ditto.
+	* marshal.c (r_symlink):  ditto.
+	* marshal.c (r_symbol):  ditto.
+
 Fri Apr 13 17:12:09 2012  NARUSE, Yui  <naruse@r...>
 
 	* hash.c (inspect_i): keep string's coderange.
Index: re.c
===================================================================
--- re.c	(revision 35320)
+++ re.c	(revision 35321)
@@ -1665,6 +1665,8 @@
 	rb_raise(rb_eIndexError, "undefined group name reference: %s",
 				 StringValuePtr(s));
     }
+
+    UNREACHABLE;
 }
 
 /*
Index: object.c
===================================================================
--- object.c	(revision 35320)
+++ object.c	(revision 35321)
@@ -2483,6 +2483,8 @@
       default:
 	return rb_convert_type(val, T_FLOAT, "Float", "to_f");
     }
+
+    UNREACHABLE;
 }
 
 /*
Index: io.c
===================================================================
--- io.c	(revision 35320)
+++ io.c	(revision 35321)
@@ -2338,6 +2338,8 @@
         rb_eof_error();
     else
         return ret;
+
+    UNREACHABLE;
 }
 
 /*
@@ -2399,6 +2401,8 @@
         rb_eof_error();
     else
         return ret;
+
+    UNREACHABLE;
 }
 
 /*
Index: pack.c
===================================================================
--- pack.c	(revision 35320)
+++ pack.c	(revision 35321)
@@ -2199,6 +2199,8 @@
 	return 6;
     }
     rb_raise(rb_eRangeError, "pack(U): value out of range");
+
+    UNREACHABLE;
 }
 
 static const unsigned long utf8_limits[] = {
Index: proc.c
===================================================================
--- proc.c	(revision 35320)
+++ proc.c	(revision 35321)
@@ -1663,6 +1663,8 @@
       }
     }
     rb_bug("rb_method_entry_arity: invalid method entry type (%d)", def->type);
+
+    UNREACHABLE;
 }
 
 /*
Index: vm_method.c
===================================================================
--- vm_method.c	(revision 35320)
+++ vm_method.c	(revision 35321)
@@ -66,6 +66,8 @@
 rb_f_notimplement(int argc, VALUE *argv, VALUE obj)
 {
     rb_notimplement();
+
+    UNREACHABLE;
 }
 
 static void
Index: struct.c
===================================================================
--- struct.c	(revision 35320)
+++ struct.c	(revision 35321)
@@ -681,6 +681,8 @@
 	}
     }
     rb_name_error(id, "no member '%s' in struct", rb_id2name(id));
+
+    UNREACHABLE;
 }
 
 /*
Index: class.c
===================================================================
--- class.c	(revision 35320)
+++ class.c	(revision 35321)
@@ -1656,6 +1656,8 @@
 
   argc_error:
     rb_error_arity(argc, n_mand, f_var ? UNLIMITED_ARGUMENTS : n_mand + n_opt);
+
+    UNREACHABLE;
 }
 
 /*!
Index: process.c
===================================================================
--- process.c	(revision 35320)
+++ process.c	(revision 35321)
@@ -3829,6 +3829,8 @@
         return r;
 
     rb_raise(rb_eArgError, "invalid resource name: %s", name);
+
+    UNREACHABLE;
 }
 
 static rlim_t
@@ -3867,6 +3869,8 @@
     if (strcmp(name, "SAVED_CUR") == 0) return RLIM_SAVED_CUR;
 #endif
     rb_raise(rb_eArgError, "invalid resource value: %s", name);
+
+    UNREACHABLE;
 }
 #endif
 
@@ -5690,6 +5694,8 @@
 	errno = EPERM;
 	rb_sys_fail(0);
     }
+
+    UNREACHABLE;
 }
 #else
 static VALUE
@@ -5803,6 +5809,8 @@
 	errno = EPERM;
 	rb_sys_fail(0);
     }
+
+    UNREACHABLE;
 }
 #else
 static VALUE
Index: ext/digest/digest.c
===================================================================
--- ext/digest/digest.c	(revision 35320)
+++ ext/digest/digest.c	(revision 35321)
@@ -154,6 +154,8 @@
 rb_digest_instance_update(VALUE self, VALUE str)
 {
     rb_digest_instance_method_unimpl(self, "update");
+
+    UNREACHABLE;
 }
 
 /*
@@ -172,6 +174,8 @@
 rb_digest_instance_finish(VALUE self)
 {
     rb_digest_instance_method_unimpl(self, "finish");
+
+    UNREACHABLE;
 }
 
 /*
@@ -186,6 +190,8 @@
 rb_digest_instance_reset(VALUE self)
 {
     rb_digest_instance_method_unimpl(self, "reset");
+
+    UNREACHABLE;
 }
 
 /*
@@ -409,6 +415,8 @@
 rb_digest_instance_block_length(VALUE self)
 {
     rb_digest_instance_method_unimpl(self, "block_length");
+
+    UNREACHABLE;
 }
 
 /*
Index: ext/bigdecimal/bigdecimal.c
===================================================================
--- ext/bigdecimal/bigdecimal.c	(revision 35320)
+++ ext/bigdecimal/bigdecimal.c	(revision 35321)
@@ -971,6 +971,8 @@
     }
 
     rb_bug("Undefined operation in BigDecimalCmp()");
+
+    UNREACHABLE;
 }
 
 /* Returns True if the value is zero. */
Index: ext/dl/handle.c
===================================================================
--- ext/dl/handle.c	(revision 35320)
+++ ext/dl/handle.c	(revision 35321)
@@ -78,6 +78,8 @@
 	return INT2NUM(ret);
     }
     rb_raise(rb_eDLError, "dlclose() called too many times");
+
+    UNREACHABLE;
 }
 
 VALUE
Index: ext/tk/tcltklib.c
===================================================================
--- ext/tk/tcltklib.c	(revision 35320)
+++ ext/tk/tcltklib.c	(revision 35321)
@@ -1407,6 +1407,8 @@
     } else {
         return 0;
     }
+
+    UNREACHABLE;
 }
 
 static int
@@ -1448,6 +1450,8 @@
     } else {
         return 0;
     }
+
+    UNREACHABLE;
 }
 
 
@@ -7781,6 +7785,8 @@
 #if TCL_MAJOR_VERSION < 8 || (TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION < 6)
     rb_raise(rb_eNotImpError,
 	     "cancel_eval is supported Tcl/Tk8.6 or later.");
+
+    UNREACHABLE;
 #else
     Tcl_Obj *msg_obj;
 
@@ -10014,6 +10020,8 @@
     default:
       rb_raise(rb_eRuntimeError, "tcltklib has invalid release type number");
     }
+
+    UNREACHABLE;
 }
 
 
@@ -10117,6 +10125,8 @@
       return Qnil;
     }
   }
+
+  UNREACHABLE;
 #else
     return name;
 #endif
Index: ext/tk/tkutil/tkutil.c
===================================================================
--- ext/tk/tkutil/tkutil.c	(revision 35320)
+++ ext/tk/tkutil/tkutil.c	(revision 35321)
@@ -800,6 +800,8 @@
         }
         rb_raise(rb_eArgError, "Hash is expected for 1st argument");
     }
+
+    UNREACHABLE;
 }
 
 static VALUE
Index: ext/openssl/ossl_ssl.c
===================================================================
--- ext/openssl/ossl_ssl.c	(revision 35320)
+++ ext/openssl/ossl_ssl.c	(revision 35321)
@@ -1593,6 +1593,8 @@
     case 0:	return Qfalse;
     default:	ossl_raise(eSSLError, "SSL_session_reused");
     }
+
+    UNREACHABLE;
 }
 
 /*
Index: ext/openssl/ossl_pkey_ec.c
===================================================================
--- ext/openssl/ossl_pkey_ec.c	(revision 35320)
+++ ext/openssl/ossl_pkey_ec.c	(revision 35321)
@@ -700,6 +700,8 @@
     }
 
     ossl_raise(eECError, "ECDSA_verify");
+
+    UNREACHABLE;
 }
 
 static void ossl_ec_group_free(ossl_ec_group *ec_group)
@@ -1349,6 +1351,8 @@
     case 0: return Qfalse;
     default: ossl_raise(cEC_POINT, "EC_POINT_is_at_infinity");
     }
+
+    UNREACHABLE;
 }
 
 /*
@@ -1370,6 +1374,8 @@
     case 0: return Qfalse;
     default: ossl_raise(cEC_POINT, "EC_POINT_is_on_curve");
     }
+
+    UNREACHABLE;
 }
 
 /*
Index: ext/fiddle/conversions.c
===================================================================
--- ext/fiddle/conversions.c	(revision 35320)
+++ ext/fiddle/conversions.c	(revision 35321)
@@ -134,6 +134,8 @@
       default:
 	rb_raise(rb_eRuntimeError, "unknown type %d", type);
     }
+
+    UNREACHABLE;
 }
 
 /* vim: set noet sw=4 sts=4 */
Index: ext/socket/raddrinfo.c
===================================================================
--- ext/socket/raddrinfo.c	(revision 35320)
+++ ext/socket/raddrinfo.c	(revision 35321)
@@ -2144,6 +2144,8 @@
       default:
         rb_raise(rb_eTypeError, "neither IO nor file descriptor");
     }
+
+    UNREACHABLE;
 }
 
 /*
Index: ext/socket/socket.c
===================================================================
--- ext/socket/socket.c	(revision 35320)
+++ ext/socket/socket.c	(revision 35321)
@@ -1334,6 +1334,8 @@
   error_exit_name:
     if (res) freeaddrinfo(res);
     rsock_raise_socket_error("getnameinfo", error);
+
+    UNREACHABLE;
 }
 
 /*
Index: ext/ripper/eventids2.c
===================================================================
--- ext/ripper/eventids2.c	(revision 35320)
+++ ext/ripper/eventids2.c	(revision 35321)
@@ -275,4 +275,6 @@
         return ripper_id_CHAR;
     }
     rb_raise(rb_eRuntimeError, "[Ripper FATAL] unknown token %d", tok);
+
+    UNREACHABLE;
 }
Index: cont.c
===================================================================
--- cont.c	(revision 35320)
+++ cont.c	(revision 35321)
@@ -1110,6 +1110,8 @@
 	fib->prev = Qnil;
 	return prev;
     }
+
+    UNREACHABLE;
 }
 
 VALUE rb_fiber_transfer(VALUE fib, int argc, VALUE *argv);
Index: dmydln.c
===================================================================
--- dmydln.c	(revision 35320)
+++ dmydln.c	(revision 35321)
@@ -4,4 +4,6 @@
 dln_load(const char *file)
 {
     rb_loaderror("this executable file can't load extension libraries");
+
+    UNREACHABLE;
 }
Index: vm_insnhelper.c
===================================================================
--- vm_insnhelper.c	(revision 35320)
+++ vm_insnhelper.c	(revision 35321)
@@ -1462,6 +1462,8 @@
     else {
 	rb_bug("vm_search_normal_superclass: should not be reach here");
     }
+
+    UNREACHABLE;
 }
 
 static void
Index: bignum.c
===================================================================
--- bignum.c	(revision 35320)
+++ bignum.c	(revision 35321)
@@ -3001,7 +3001,8 @@
 	goto bignum;
     }
     rb_bug("big_fdiv");
-    /* NOTREACHED */
+
+    UNREACHABLE;
 }
 
 /*
Index: marshal.c
===================================================================
--- marshal.c	(revision 35320)
+++ marshal.c	(revision 35321)
@@ -1147,6 +1147,8 @@
 	return (ID)id;
     }
     rb_raise(rb_eArgError, "bad symbol");
+
+    UNREACHABLE;
 }
 
 static ID
@@ -1193,6 +1195,8 @@
 	rb_raise(rb_eArgError, "dump format error for symbol(0x%x)", type);
 	break;
     }
+
+    UNREACHABLE;
 }
 
 static VALUE

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]