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 68E8628D73 for ; Fri, 5 Oct 2018 02:07:05 -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 t-lb5-7dtO8j for ; Fri, 5 Oct 2018 02:07:05 -0400 (EDT) Received: from smtp52.i.mail.ru (smtp52.i.mail.ru [94.100.177.112]) (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 D6DF22C3D9 for ; Fri, 5 Oct 2018 02:07:04 -0400 (EDT) Date: Fri, 5 Oct 2018 09:06:57 +0300 From: Alexander Turenko Subject: [tarantool-patches] Re: [PATCH] Fix RelWithDebInfoWError warnings on 2.0 Message-ID: <20181005060657.whks4diwbcztc5gx@tkn_work_nb> References: <0713b50dce1fc8a955bbc2e625a6269fbb21b6a1.1537547498.git.alexander.turenko@tarantool.org> <98f903498d96e1f1e4e515dbcb7e6059c09fca52.1537547907.git.alexander.turenko@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <98f903498d96e1f1e4e515dbcb7e6059c09fca52.1537547907.git.alexander.turenko@tarantool.org> 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: tarantool-patches@freelists.org Rebased on top of fresh 2.0, fixed one conflict around sqlite3OpenTable. WBR, Alexander Turenko. On Fri, Sep 21, 2018 at 07:41:51PM +0300, Alexander Turenko wrote: > Fixed warnings from -Wunused-parameter, -Wunused-variable, > -Wunused-but-set-variable. > > Fixed -Wsometimes-uninitialized on clang in where.c. > > Removed -Wall -Wextra -Werror from SQL CMakeLists.txt, because it is set > by tarantool itself and is redundant. > > Fixes #3238. > --- > > branch: https://github.com/tarantool/tarantool/tree/Totktonada/gh-3238-add-werror-for-ci-2.0 > issue: https://github.com/tarantool/tarantool/issues/3238 > > Please, push it to 2.0 if the changes look good for you. > > Note: this part of the patchset can be pushed to 2.0 before or just > after of 1.10 part. > > src/box/space_def.c | 2 ++ > src/box/sql/CMakeLists.txt | 3 --- > src/box/sql/build.c | 2 +- > src/box/sql/insert.c | 5 +++-- > src/box/sql/pragma.c | 6 +++--- > src/box/sql/vdbeaux.c | 2 +- > src/box/sql/vdbemem.c | 1 + > src/box/sql/where.c | 2 +- > 8 files changed, 12 insertions(+), 11 deletions(-) > > diff --git a/src/box/space_def.c b/src/box/space_def.c > index 542289ead..69b92c5c1 100644 > --- a/src/box/space_def.c > +++ b/src/box/space_def.c > @@ -153,6 +153,7 @@ space_def_dup(const struct space_def *src) > struct Expr *e = src->fields[i].default_value_expr; > if (e != NULL) { > char *expr_pos_old = expr_pos; > + (void) expr_pos_old; > e = sql_expr_dup(sql_get(), e, 0, &expr_pos); > assert(e != NULL); > /* Note: due to SQL legacy > @@ -233,6 +234,7 @@ space_def_new(uint32_t id, uint32_t uid, uint32_t exact_field_count, > struct Expr *e = def->fields[i].default_value_expr; > if (e != NULL) { > char *expr_pos_old = expr_pos; > + (void) expr_pos_old; > e = sql_expr_dup(sql_get(), e, 0, &expr_pos); > assert(e != NULL); > /* Note: due to SQL legacy > diff --git a/src/box/sql/CMakeLists.txt b/src/box/sql/CMakeLists.txt > index 1f852424a..73726bd9a 100644 > --- a/src/box/sql/CMakeLists.txt > +++ b/src/box/sql/CMakeLists.txt > @@ -2,9 +2,6 @@ if(CMAKE_BUILD_TYPE STREQUAL "Debug") > add_definitions(-DSQLITE_DEBUG=1) > add_definitions(-DSQLITE_ENABLE_SELECTTRACE) > add_definitions(-DSQLITE_ENABLE_WHERETRACE) > - > - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Werror") > - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror") > endif() > > set(EXT_SRC_DIR ${CMAKE_SOURCE_DIR}/extra) > diff --git a/src/box/sql/build.c b/src/box/sql/build.c > index 60b49df12..4ff3f6b87 100644 > --- a/src/box/sql/build.c > +++ b/src/box/sql/build.c > @@ -2379,7 +2379,7 @@ constraint_is_named(const char *name) > void > sql_create_index(struct Parse *parse, struct Token *token, > struct SrcList *tbl_name, struct ExprList *col_list, > - struct Token *start, enum sort_order sort_order, > + MAYBE_UNUSED struct Token *start, enum sort_order sort_order, > bool if_not_exist, enum sql_index_type idx_type) { > /* The index to be created. */ > struct index *index = NULL; > diff --git a/src/box/sql/insert.c b/src/box/sql/insert.c > index 03f4e1b14..e1a4481fa 100644 > --- a/src/box/sql/insert.c > +++ b/src/box/sql/insert.c > @@ -45,11 +45,12 @@ > */ > void > sqlite3OpenTable(Parse * pParse, /* Generate code into this VDBE */ > - int iCur, /* The cursor number of the table */ > + int iCur, /* The cursor number of the table */ > struct space *space, /* The table to be opened */ > - int opcode) /* OP_OpenRead or OP_OpenWrite */ > + MAYBE_UNUSED int opcode) /* OP_OpenRead or OP_OpenWrite */ > { > Vdbe *v; > + (void) v; > v = sqlite3GetVdbe(pParse); > assert(opcode == OP_OpenWrite || opcode == OP_OpenRead); > assert(space->index_count > 0); > diff --git a/src/box/sql/pragma.c b/src/box/sql/pragma.c > index 4f64ab6f2..b3fdd06c6 100644 > --- a/src/box/sql/pragma.c > +++ b/src/box/sql/pragma.c > @@ -430,7 +430,6 @@ sqlite3Pragma(Parse * pParse, Token * pId, /* First part of [schema.]id field */ > char *zLeft = 0; /* Nul-terminated UTF-8 string */ > char *zRight = 0; /* Nul-terminated UTF-8 string , or NULL */ > char *zTable = 0; /* Nul-terminated UTF-8 string or NULL */ > - int rc; /* return value form SQLITE_FCNTL_PRAGMA */ > sqlite3 *db = pParse->db; /* The database connection */ > Vdbe *v = sqlite3GetVdbe(pParse); /* Prepared statement */ > const PragmaName *pPragma; /* The pragma */ > @@ -526,8 +525,9 @@ sqlite3Pragma(Parse * pParse, Token * pId, /* First part of [schema.]id field */ > box_tuple_t *tuple; > box_iterator_t* iter; > iter = box_index_iterator(space_id, 0,ITER_ALL, key_buf, key_end); > - rc = box_iterator_next(iter, &tuple); > - assert(rc==0); > + int rc = box_iterator_next(iter, &tuple); > + (void) rc; > + assert(rc == 0); > for (i = 0; tuple!=NULL; i++, box_iterator_next(iter, &tuple)){ > /* 1 is name field number */ > const char *str = tuple_field_cstr(tuple, 1); > diff --git a/src/box/sql/vdbeaux.c b/src/box/sql/vdbeaux.c > index c843bc786..c270059c5 100644 > --- a/src/box/sql/vdbeaux.c > +++ b/src/box/sql/vdbeaux.c > @@ -2271,7 +2271,7 @@ sql_txn_begin(Vdbe *p) > } > > Savepoint * > -sql_savepoint(Vdbe *p, const char *zName) > +sql_savepoint(MAYBE_UNUSED Vdbe *p, const char *zName) > { > assert(p); > size_t nName = zName ? strlen(zName) + 1 : 0; > diff --git a/src/box/sql/vdbemem.c b/src/box/sql/vdbemem.c > index ef70442b3..8edbd83a5 100644 > --- a/src/box/sql/vdbemem.c > +++ b/src/box/sql/vdbemem.c > @@ -1597,6 +1597,7 @@ sql_stat4_column(struct sqlite3 *db, const char *record, uint32_t col_num, > const char *a = record; > assert(mp_typeof(a[0]) == MP_ARRAY); > uint32_t col_cnt = mp_decode_array(&a); > + (void) col_cnt; > assert(col_cnt > col_num); > for (uint32_t i = 0; i < col_num; i++) > mp_next(&a); > diff --git a/src/box/sql/where.c b/src/box/sql/where.c > index a9cbcda0d..ed9d93394 100644 > --- a/src/box/sql/where.c > +++ b/src/box/sql/where.c > @@ -4609,10 +4609,10 @@ sqlite3WhereBegin(Parse * pParse, /* The parser context */ > iIndexCur = pLevel->iTabCur; > op = 0; > } else if (pWInfo->eOnePass != ONEPASS_OFF) { > + iIndexCur = iAuxArg; > if (pTabItem->pTab->space->index_count != 0) { > uint32_t iid = 0; > struct index *pJ = pTabItem->pTab->space->index[iid]; > - iIndexCur = iAuxArg; > assert(wctrlFlags & > WHERE_ONEPASS_DESIRED); > while (pJ->def->iid != idx_def->iid) { > -- > 2.19.0 >