Navigation Menu

Skip to content

Commit

Permalink
clang: suppress warnings
Browse files Browse the repository at this point in the history
db.c:3220:47: warning: variable 'key' is uninitialized when used here
      [-Wuninitialized]
      if (grn_table_add_v_inline(ctx, table1, key, key_size, &value1, NULL)) {
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../include/groonga.h:1041:82: note: expanded from macro 'GRN_TABLE_EACH'
  ...(grn_array *)(table), (head), (tail), (id), (value), block);\
                                                          ^
../include/groonga.h:2734:7: note: expanded from macro 'GRN_ARRAY_EACH'
      block\
      ^~~~~
db.c:3171:12: note: initialize the variable 'key' to silence this warning
  void *key, *value1, *value2;
           ^
            = NULL

----

db.c:3221:24: warning: variable 'value2' is uninitialized when used here
      [-Wuninitialized]
        memcpy(value1, value2, value_size);
        ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
../include/groonga.h:1035:72: note: expanded from macro 'GRN_TABLE_EACH'
      GRN_DAT_EACH((ctx), (grn_dat *)(table), (id), (key), (key_size), block);\
                                                                       ^
../include/groonga.h:2876:9: note: expanded from macro 'GRN_DAT_EACH'
        block\
        ^~~~~
db.c:3171:37: note: initialize the variable 'value2' to silence this warning
  void *key = NULL, *value1, *value2;
                                    ^
                                     = NULL
  • Loading branch information
kou committed Aug 10, 2012
1 parent 4395fb1 commit fb385fd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/db.c
Expand Up @@ -3168,7 +3168,7 @@ grn_table_setoperation(grn_ctx *ctx, grn_obj *table1, grn_obj *table2, grn_obj *
grn_operator op)
{
grn_rc rc = GRN_SUCCESS;
void *key, *value1, *value2;
void *key = NULL, *value1 = NULL, *value2 = NULL;
uint32_t value_size = 0;
uint32_t key_size;
if (table1 != res) {
Expand Down

0 comments on commit fb385fd

Please sign in to comment.