[tarantool-patches] [PATCH v1] LTO build fails on warning message

Alexander V. Tikhonov avtikhon at tarantool.org
Thu Jul 25 17:44:47 MSK 2019


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





More information about the Tarantool-patches mailing list