From a720a1c44702d91217b781e582269f1c57ecff1d Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Sat, 1 Jun 2024 16:22:31 +0900 Subject: [PATCH] Suppress -Wmaybe-uninitialized warnings with LTO --- ext/socket/raddrinfo.c | 2 +- prism_compile.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/socket/raddrinfo.c b/ext/socket/raddrinfo.c index e79bcfa332..4ca06021ba 100644 --- a/ext/socket/raddrinfo.c +++ b/ext/socket/raddrinfo.c @@ -481,7 +481,7 @@ rb_getaddrinfo(const char *hostp, const char *portp, const struct addrinfo *hint { int retry; struct getaddrinfo_arg *arg; - int err, gai_errno = 0; + int err = 0, gai_errno = 0; start: retry = 0; diff --git a/prism_compile.c b/prism_compile.c index 9f3a4b5fae..ede4c3a64e 100644 --- a/prism_compile.c +++ b/prism_compile.c @@ -992,7 +992,7 @@ pm_compile_conditional(rb_iseq_t *iseq, const pm_line_column_t *line_column, pm_ pm_compile_branch_condition(iseq, cond_seq, predicate, then_label, else_label, false, scope_node); PUSH_SEQ(ret, cond_seq); - rb_code_location_t conditional_location; + rb_code_location_t conditional_location = { 0 }; VALUE branches = Qfalse; if (then_label->refcnt && else_label->refcnt && PM_BRANCH_COVERAGE_P(iseq)) { @@ -6140,7 +6140,7 @@ pm_compile_node(rb_iseq_t *iseq, const pm_node_t *node, LINK_ANCHOR *const ret, // We're going to use this to uniquely identify each branch so that we // can track coverage information. - rb_code_location_t case_location; + rb_code_location_t case_location = { 0 }; VALUE branches = Qfalse; int branch_id = 0;