From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id B1DE422B44 for ; Thu, 25 Jul 2019 10:44:54 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tSa2Qy3gmObf for ; Thu, 25 Jul 2019 10:44:54 -0400 (EDT) Received: from smtpng1.m.smailru.net (smtpng1.m.smailru.net [94.100.181.251]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 7201A2578E for ; Thu, 25 Jul 2019 10:44:54 -0400 (EDT) From: "Alexander V. Tikhonov" Subject: [tarantool-patches] [PATCH v1] LTO build fails on warning message Date: Thu, 25 Jul 2019 17:44:47 +0300 Message-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-Help: List-Unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-Subscribe: List-Owner: List-post: List-Archive: To: Kirill Yukhin Cc: "Alexander V. Tikhonov" , tarantool-patches@freelists.org The uninitialized variable found that caused the fail on build, due to LTO builds with flag to check warnings as errors. Set the variable to 0 initial value. The found issue was: [100%] Built target xrow.test src/box/sql/vdbe.c: In function ‘sqlVdbeExec’: src/box/sql/vdbe.c:3691:11: error: ‘id’ may be used uninitialized in this function [-Werror=maybe-uninitialized] uint64_t id; ^ lto1: all warnings being treated as errors lto-wrapper: fatal error: /usr/bin/c++ returned 1 exit status compilation terminated. /usr/bin/ld: error: lto-wrapper failed collect2: error: ld returned 1 exit status Closes #4378 --- Github: https://github.com/tarantool/tarantool/tree/avtikhon/gh-4378-lto-fix-vdbe Issue: https://github.com/tarantool/tarantool/issues/4378 src/box/sql/vdbe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/box/sql/vdbe.c b/src/box/sql/vdbe.c index c0948693c..576597d52 100644 --- a/src/box/sql/vdbe.c +++ b/src/box/sql/vdbe.c @@ -3661,7 +3661,7 @@ case OP_Sequence: { /* out2 */ */ case OP_NextSequenceId: { pOut = &aMem[pOp->p2]; - uint64_t id; + uint64_t id = 0; tarantoolSqlNextSeqId(&id); id++; mem_set_u64(pOut, id); -- 2.17.1