Various compier warnings

gcc 5.4 and 7.1, Debug and Release builds
This commit is contained in:
Sergei Golubchik 2017-10-22 13:18:38 +02:00
commit 2aa51f528f
21 changed files with 48 additions and 210 deletions

View file

@ -154,7 +154,7 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANGCXX)
MY_CHECK_AND_SET_COMPILER_FLAG("-Wformat=2")
MY_CHECK_AND_SET_COMPILER_FLAG("-Wstrict-aliasing=2")
MY_CHECK_AND_SET_COMPILER_FLAG("-fno-strict-aliasing")
MY_CHECK_AND_SET_COMPILER_FLAG("-Wdisabled-optimization")
MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-disabled-optimization")
MY_CHECK_AND_SET_COMPILER_FLAG("-Wfloat-equal")
MY_CHECK_AND_SET_COMPILER_FLAG("-Wpointer-arith")
MY_CHECK_AND_SET_COMPILER_FLAG("-Wdeclaration-after-statement")
@ -165,6 +165,7 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANGCXX)
MY_CHECK_AND_SET_COMPILER_FLAG("-fexceptions")
MY_CHECK_AND_SET_COMPILER_FLAG("-fimplicit-templates")
MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-clobbered")
MY_CHECK_AND_SET_COMPILER_FLAG("-Wno-implicit-fallthrough")
endif()
if(NOT DEFINED CMAKE_C_COMPILE_OPTIONS_PIC)

View file

@ -32,7 +32,6 @@ Cursor *CursorFactory::open(const Trie &trie,
UInt32 offset,
UInt32 limit,
UInt32 flags) {
GRN_DAT_THROW_IF(PARAM_ERROR, &trie == NULL);
const UInt32 cursor_type = flags & CURSOR_TYPE_MASK;
switch (cursor_type) {

View file

@ -544,7 +544,7 @@ regexp_next(grn_ctx *ctx, int nargs, grn_obj **args, grn_user_data *user_data)
grn_obj *buffer = &(tokenizer->buffer);
const char *current = tokenizer->next;
const char *end = tokenizer->end;
const const uint_least8_t *char_types = tokenizer->char_types;
const uint_least8_t *char_types = tokenizer->char_types;
grn_tokenize_mode mode = tokenizer->query->tokenize_mode;
grn_bool is_begin = tokenizer->is_begin;
grn_bool is_start_token = tokenizer->is_start_token;