Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

* 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.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35321 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information...
commit 338a0a0b73aee30228d84fc0e0fe45d3b17db866 1 parent 62b53bd
Eric Hodel drbrain authored
44 ChangeLog
... ... @@ -1,3 +1,47 @@
  1 +Sat Apr 14 08:38:20 2012 Eric Hodel <drbrain@segment7.net>
  2 +
  3 + * encoding.c (rb_enc_codepoint_len): Use UNREACHABLE to avoid "control
  4 + reaches end of non-void function" warnings. [ruby-trunk - Bug #6066]
  5 + * re.c (name_to_backref_number): ditto.
  6 + * object.c (rb_Float): ditto.
  7 + * io.c (io_readpartial): ditto.
  8 + * io.c (io_read_nonblock): ditto.
  9 + * pack.c (rb_uv_to_utf8): ditto.
  10 + * proc.c (rb_method_entry_arity): ditto.
  11 + * vm_method.c (rb_f_notimplement): ditto.
  12 + * struct.c (rb_struct_aset_id): ditto.
  13 + * class.c (rb_scan_args): ditto.
  14 + * process.c (rlimit_resource_type): ditto.
  15 + * process.c (rlimit_resource_value): ditto.
  16 + * process.c (p_uid_switch): ditto.
  17 + * process.c (p_gid_switch): ditto.
  18 + * ext/digest/digest.c (rb_digest_instance_update): ditto.
  19 + * ext/digest/digest.c (rb_digest_instance_finish): ditto.
  20 + * ext/digest/digest.c (rb_digest_instance_reset): ditto.
  21 + * ext/digest/digest.c (rb_digest_instance_block_length): ditto.
  22 + * ext/bigdecimal/bigdecimal.c (BigDecimalCmp): ditto.
  23 + * ext/dl/handle.c (rb_dlhandle_close): ditto.
  24 + * ext/tk/tcltklib.c (pending_exception_check0): ditto.
  25 + * ext/tk/tcltklib.c (pending_exception_check1): ditto.
  26 + * ext/tk/tcltklib.c (ip_cancel_eval_core): ditto.
  27 + * ext/tk/tcltklib.c (lib_get_reltype_name): ditto.
  28 + * ext/tk/tcltklib.c (create_dummy_encoding_for_tk_core): ditto.
  29 + * ext/tk/tkutil/tkutil.c (tk_hash_kv): ditto.
  30 + * ext/openssl/ossl_ssl.c (ossl_ssl_session_reused): ditto.
  31 + * ext/openssl/ossl_pkey_ec.c (ossl_ec_key_dsa_verify_asn1): ditto.
  32 + * ext/openssl/ossl_pkey_ec.c (ossl_ec_point_is_at_infinit): ditto.
  33 + * ext/openssl/ossl_pkey_ec.c (ossl_ec_point_is_on_curve): ditto.
  34 + * ext/fiddle/conversions.c (generic_to_value): ditto.
  35 + * ext/socket/raddrinfo.c (rsock_io_socket_addrinfo): ditto.
  36 + * ext/socket/socket.c (sock_s_getnameinfo): ditto.
  37 + * ext/ripper/eventids2.c (ripper_token2eventid): ditto.
  38 + * cont.c (return_fiber): ditto.
  39 + * dmydln.c (dln_load): ditto.
  40 + * vm_insnhelper.c (vm_search_normal_superclass): ditto.
  41 + * bignum.c (big_fdiv): ditto.
  42 + * marshal.c (r_symlink): ditto.
  43 + * marshal.c (r_symbol): ditto.
  44 +
1 45 Fri Apr 13 17:12:09 2012 NARUSE, Yui <naruse@ruby-lang.org>
2 46
3 47 * hash.c (inspect_i): keep string's coderange.
3  bignum.c
@@ -3001,7 +3001,8 @@ big_fdiv(VALUE x, VALUE y)
3001 3001 goto bignum;
3002 3002 }
3003 3003 rb_bug("big_fdiv");
3004   - /* NOTREACHED */
  3004 +
  3005 + UNREACHABLE;
3005 3006 }
3006 3007
3007 3008 /*
2  class.c
@@ -1656,6 +1656,8 @@ rb_scan_args(int argc, const VALUE *argv, const char *fmt, ...)
1656 1656
1657 1657 argc_error:
1658 1658 rb_error_arity(argc, n_mand, f_var ? UNLIMITED_ARGUMENTS : n_mand + n_opt);
  1659 +
  1660 + UNREACHABLE;
1659 1661 }
1660 1662
1661 1663 /*!
2  cont.c
@@ -1110,6 +1110,8 @@ return_fiber(void)
1110 1110 fib->prev = Qnil;
1111 1111 return prev;
1112 1112 }
  1113 +
  1114 + UNREACHABLE;
1113 1115 }
1114 1116
1115 1117 VALUE rb_fiber_transfer(VALUE fib, int argc, VALUE *argv);
2  dmydln.c
@@ -4,4 +4,6 @@ void*
4 4 dln_load(const char *file)
5 5 {
6 6 rb_loaderror("this executable file can't load extension libraries");
  7 +
  8 + UNREACHABLE;
7 9 }
2  encoding.c
@@ -928,6 +928,8 @@ rb_enc_codepoint_len(const char *p, const char *e, int *len_p, rb_encoding *enc)
928 928 }
929 929 else
930 930 rb_raise(rb_eArgError, "invalid byte sequence in %s", rb_enc_name(enc));
  931 +
  932 + UNREACHABLE;
931 933 }
932 934
933 935 #undef rb_enc_codepoint
2  ext/bigdecimal/bigdecimal.c
@@ -971,6 +971,8 @@ BigDecimalCmp(VALUE self, VALUE r,char op)
971 971 }
972 972
973 973 rb_bug("Undefined operation in BigDecimalCmp()");
  974 +
  975 + UNREACHABLE;
974 976 }
975 977
976 978 /* Returns True if the value is zero. */
8 ext/digest/digest.c
@@ -154,6 +154,8 @@ static VALUE
154 154 rb_digest_instance_update(VALUE self, VALUE str)
155 155 {
156 156 rb_digest_instance_method_unimpl(self, "update");
  157 +
  158 + UNREACHABLE;
157 159 }
158 160
159 161 /*
@@ -172,6 +174,8 @@ static VALUE
172 174 rb_digest_instance_finish(VALUE self)
173 175 {
174 176 rb_digest_instance_method_unimpl(self, "finish");
  177 +
  178 + UNREACHABLE;
175 179 }
176 180
177 181 /*
@@ -186,6 +190,8 @@ static VALUE
186 190 rb_digest_instance_reset(VALUE self)
187 191 {
188 192 rb_digest_instance_method_unimpl(self, "reset");
  193 +
  194 + UNREACHABLE;
189 195 }
190 196
191 197 /*
@@ -409,6 +415,8 @@ static VALUE
409 415 rb_digest_instance_block_length(VALUE self)
410 416 {
411 417 rb_digest_instance_method_unimpl(self, "block_length");
  418 +
  419 + UNREACHABLE;
412 420 }
413 421
414 422 /*
2  ext/dl/handle.c
@@ -78,6 +78,8 @@ rb_dlhandle_close(VALUE self)
78 78 return INT2NUM(ret);
79 79 }
80 80 rb_raise(rb_eDLError, "dlclose() called too many times");
  81 +
  82 + UNREACHABLE;
81 83 }
82 84
83 85 VALUE
2  ext/fiddle/conversions.c
@@ -134,6 +134,8 @@ generic_to_value(VALUE rettype, fiddle_generic retval)
134 134 default:
135 135 rb_raise(rb_eRuntimeError, "unknown type %d", type);
136 136 }
  137 +
  138 + UNREACHABLE;
137 139 }
138 140
139 141 /* vim: set noet sw=4 sts=4 */
6 ext/openssl/ossl_pkey_ec.c
@@ -700,6 +700,8 @@ static VALUE ossl_ec_key_dsa_verify_asn1(VALUE self, VALUE data, VALUE sig)
700 700 }
701 701
702 702 ossl_raise(eECError, "ECDSA_verify");
  703 +
  704 + UNREACHABLE;
703 705 }
704 706
705 707 static void ossl_ec_group_free(ossl_ec_group *ec_group)
@@ -1349,6 +1351,8 @@ static VALUE ossl_ec_point_is_at_infinity(VALUE self)
1349 1351 case 0: return Qfalse;
1350 1352 default: ossl_raise(cEC_POINT, "EC_POINT_is_at_infinity");
1351 1353 }
  1354 +
  1355 + UNREACHABLE;
1352 1356 }
1353 1357
1354 1358 /*
@@ -1370,6 +1374,8 @@ static VALUE ossl_ec_point_is_on_curve(VALUE self)
1370 1374 case 0: return Qfalse;
1371 1375 default: ossl_raise(cEC_POINT, "EC_POINT_is_on_curve");
1372 1376 }
  1377 +
  1378 + UNREACHABLE;
1373 1379 }
1374 1380
1375 1381 /*
2  ext/openssl/ossl_ssl.c
@@ -1593,6 +1593,8 @@ ossl_ssl_session_reused(VALUE self)
1593 1593 case 0: return Qfalse;
1594 1594 default: ossl_raise(eSSLError, "SSL_session_reused");
1595 1595 }
  1596 +
  1597 + UNREACHABLE;
1596 1598 }
1597 1599
1598 1600 /*
2  ext/ripper/eventids2.c
@@ -275,4 +275,6 @@ ripper_token2eventid(int tok)
275 275 return ripper_id_CHAR;
276 276 }
277 277 rb_raise(rb_eRuntimeError, "[Ripper FATAL] unknown token %d", tok);
  278 +
  279 + UNREACHABLE;
278 280 }
2  ext/socket/raddrinfo.c
@@ -2144,6 +2144,8 @@ rsock_io_socket_addrinfo(VALUE io, struct sockaddr *addr, socklen_t len)
2144 2144 default:
2145 2145 rb_raise(rb_eTypeError, "neither IO nor file descriptor");
2146 2146 }
  2147 +
  2148 + UNREACHABLE;
2147 2149 }
2148 2150
2149 2151 /*
2  ext/socket/socket.c
@@ -1334,6 +1334,8 @@ sock_s_getnameinfo(int argc, VALUE *argv)
1334 1334 error_exit_name:
1335 1335 if (res) freeaddrinfo(res);
1336 1336 rsock_raise_socket_error("getnameinfo", error);
  1337 +
  1338 + UNREACHABLE;
1337 1339 }
1338 1340
1339 1341 /*
10 ext/tk/tcltklib.c
@@ -1407,6 +1407,8 @@ pending_exception_check0()
1407 1407 } else {
1408 1408 return 0;
1409 1409 }
  1410 +
  1411 + UNREACHABLE;
1410 1412 }
1411 1413
1412 1414 static int
@@ -1448,6 +1450,8 @@ pending_exception_check1(thr_crit_bup, ptr)
1448 1450 } else {
1449 1451 return 0;
1450 1452 }
  1453 +
  1454 + UNREACHABLE;
1451 1455 }
1452 1456
1453 1457
@@ -7781,6 +7785,8 @@ ip_cancel_eval_core(interp, msg, flag)
7781 7785 #if TCL_MAJOR_VERSION < 8 || (TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION < 6)
7782 7786 rb_raise(rb_eNotImpError,
7783 7787 "cancel_eval is supported Tcl/Tk8.6 or later.");
  7788 +
  7789 + UNREACHABLE;
7784 7790 #else
7785 7791 Tcl_Obj *msg_obj;
7786 7792
@@ -10014,6 +10020,8 @@ lib_get_reltype_name(self)
10014 10020 default:
10015 10021 rb_raise(rb_eRuntimeError, "tcltklib has invalid release type number");
10016 10022 }
  10023 +
  10024 + UNREACHABLE;
10017 10025 }
10018 10026
10019 10027
@@ -10117,6 +10125,8 @@ create_dummy_encoding_for_tk_core(interp, name, error_mode)
10117 10125 return Qnil;
10118 10126 }
10119 10127 }
  10128 +
  10129 + UNREACHABLE;
10120 10130 #else
10121 10131 return name;
10122 10132 #endif
2  ext/tk/tkutil/tkutil.c
@@ -800,6 +800,8 @@ tk_hash_kv(argc, argv, self)
800 800 }
801 801 rb_raise(rb_eArgError, "Hash is expected for 1st argument");
802 802 }
  803 +
  804 + UNREACHABLE;
803 805 }
804 806
805 807 static VALUE
4 io.c
@@ -2338,6 +2338,8 @@ io_readpartial(int argc, VALUE *argv, VALUE io)
2338 2338 rb_eof_error();
2339 2339 else
2340 2340 return ret;
  2341 +
  2342 + UNREACHABLE;
2341 2343 }
2342 2344
2343 2345 /*
@@ -2399,6 +2401,8 @@ io_read_nonblock(int argc, VALUE *argv, VALUE io)
2399 2401 rb_eof_error();
2400 2402 else
2401 2403 return ret;
  2404 +
  2405 + UNREACHABLE;
2402 2406 }
2403 2407
2404 2408 /*
4 marshal.c
@@ -1147,6 +1147,8 @@ r_symlink(struct load_arg *arg)
1147 1147 return (ID)id;
1148 1148 }
1149 1149 rb_raise(rb_eArgError, "bad symbol");
  1150 +
  1151 + UNREACHABLE;
1150 1152 }
1151 1153
1152 1154 static ID
@@ -1193,6 +1195,8 @@ r_symbol(struct load_arg *arg)
1193 1195 rb_raise(rb_eArgError, "dump format error for symbol(0x%x)", type);
1194 1196 break;
1195 1197 }
  1198 +
  1199 + UNREACHABLE;
1196 1200 }
1197 1201
1198 1202 static VALUE
2  object.c
@@ -2483,6 +2483,8 @@ rb_Float(VALUE val)
2483 2483 default:
2484 2484 return rb_convert_type(val, T_FLOAT, "Float", "to_f");
2485 2485 }
  2486 +
  2487 + UNREACHABLE;
2486 2488 }
2487 2489
2488 2490 /*
2  pack.c
@@ -2199,6 +2199,8 @@ rb_uv_to_utf8(char buf[6], unsigned long uv)
2199 2199 return 6;
2200 2200 }
2201 2201 rb_raise(rb_eRangeError, "pack(U): value out of range");
  2202 +
  2203 + UNREACHABLE;
2202 2204 }
2203 2205
2204 2206 static const unsigned long utf8_limits[] = {
2  proc.c
@@ -1663,6 +1663,8 @@ rb_method_entry_arity(const rb_method_entry_t *me)
1663 1663 }
1664 1664 }
1665 1665 rb_bug("rb_method_entry_arity: invalid method entry type (%d)", def->type);
  1666 +
  1667 + UNREACHABLE;
1666 1668 }
1667 1669
1668 1670 /*
8 process.c
@@ -3829,6 +3829,8 @@ rlimit_resource_type(VALUE rtype)
3829 3829 return r;
3830 3830
3831 3831 rb_raise(rb_eArgError, "invalid resource name: %s", name);
  3832 +
  3833 + UNREACHABLE;
3832 3834 }
3833 3835
3834 3836 static rlim_t
@@ -3867,6 +3869,8 @@ rlimit_resource_value(VALUE rval)
3867 3869 if (strcmp(name, "SAVED_CUR") == 0) return RLIM_SAVED_CUR;
3868 3870 #endif
3869 3871 rb_raise(rb_eArgError, "invalid resource value: %s", name);
  3872 +
  3873 + UNREACHABLE;
3870 3874 }
3871 3875 #endif
3872 3876
@@ -5690,6 +5694,8 @@ p_uid_switch(VALUE obj)
5690 5694 errno = EPERM;
5691 5695 rb_sys_fail(0);
5692 5696 }
  5697 +
  5698 + UNREACHABLE;
5693 5699 }
5694 5700 #else
5695 5701 static VALUE
@@ -5803,6 +5809,8 @@ p_gid_switch(VALUE obj)
5803 5809 errno = EPERM;
5804 5810 rb_sys_fail(0);
5805 5811 }
  5812 +
  5813 + UNREACHABLE;
5806 5814 }
5807 5815 #else
5808 5816 static VALUE
2  re.c
@@ -1665,6 +1665,8 @@ name_to_backref_number(struct re_registers *regs, VALUE regexp, const char* name
1665 1665 rb_raise(rb_eIndexError, "undefined group name reference: %s",
1666 1666 StringValuePtr(s));
1667 1667 }
  1668 +
  1669 + UNREACHABLE;
1668 1670 }
1669 1671
1670 1672 /*
2  struct.c
@@ -681,6 +681,8 @@ rb_struct_aset_id(VALUE s, ID id, VALUE val)
681 681 }
682 682 }
683 683 rb_name_error(id, "no member '%s' in struct", rb_id2name(id));
  684 +
  685 + UNREACHABLE;
684 686 }
685 687
686 688 /*
2  vm_insnhelper.c
@@ -1462,6 +1462,8 @@ vm_search_normal_superclass(VALUE klass, VALUE recv)
1462 1462 else {
1463 1463 rb_bug("vm_search_normal_superclass: should not be reach here");
1464 1464 }
  1465 +
  1466 + UNREACHABLE;
1465 1467 }
1466 1468
1467 1469 static void
2  vm_method.c
@@ -66,6 +66,8 @@ VALUE
66 66 rb_f_notimplement(int argc, VALUE *argv, VALUE obj)
67 67 {
68 68 rb_notimplement();
  69 +
  70 + UNREACHABLE;
69 71 }
70 72
71 73 static void

0 comments on commit 338a0a0

Please sign in to comment.
Something went wrong with that request. Please try again.