Navigation Menu

Skip to content

Commit

Permalink
clang: suppress a warning
Browse files Browse the repository at this point in the history
db.c:3260:50: warning: variable 'key_size' is uninitialized when used here
      [-Wuninitialized]
      if ((id1 = grn_table_get(ctx, table1, key, key_size))) {
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
../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:3255:20: note: initialize the variable 'key_size' to silence this warning
  uint32_t key_size;
                   ^
                    = 0
  • Loading branch information
kou committed Aug 10, 2012
1 parent 2873a4c commit 59c3ec4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/db.c
Expand Up @@ -3252,7 +3252,7 @@ grn_table_difference(grn_ctx *ctx, grn_obj *table1, grn_obj *table2,
grn_obj *res1, grn_obj *res2)
{
void *key;
uint32_t key_size;
uint32_t key_size = 0;
if (table1 != res1 || table2 != res2) { return GRN_INVALID_ARGUMENT; }
if (grn_table_size(ctx, table1) > grn_table_size(ctx, table2)) {
GRN_TABLE_EACH(ctx, table2, 0, 0, id, &key, &key_size, NULL, {
Expand Down

0 comments on commit 59c3ec4

Please sign in to comment.