summaryrefslogtreecommitdiffhomepage
path: root/src/string.c
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2019-08-25 01:29:49 +0900
committerGitHub <[email protected]>2019-08-25 01:29:49 +0900
commitee0806ad4b9280d72323c0b91217acb54bc63b21 (patch)
tree912a71de8dcda3dfce1343f1dea6f7df3bb4e329 /src/string.c
parent17623fd0d391ae65c62a058f5017edc86e1c51bb (diff)
parentc9c27e9d69ddd656343b8a0e876887f511fe6d03 (diff)
downloadmruby-ee0806ad4b9280d72323c0b91217acb54bc63b21.tar.gz
mruby-ee0806ad4b9280d72323c0b91217acb54bc63b21.zip
Merge pull request #4666 from dearblue/warn-str_new_capa
Suppress warning by gcc with `-Wmaybe-uninitialized`
Diffstat (limited to 'src/string.c')
-rw-r--r--src/string.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/string.c b/src/string.c
index 190e87123..8d1d53521 100644
--- a/src/string.c
+++ b/src/string.c
@@ -164,6 +164,8 @@ mrb_str_new_capa(mrb_state *mrb, size_t capa)
}
else if (capa >= MRB_INT_MAX) {
mrb_raise(mrb, E_ARGUMENT_ERROR, "string capacity size too big");
+ /* not reached */
+ s = NULL;
}
else {
s = str_init_normal_capa(mrb, mrb_obj_alloc_string(mrb), NULL, 0, capa);