[Groonga-commit] groonga/groonga [master] clang: suppress a warning

Back to archive index

null+****@clear***** null+****@clear*****
Fri Aug 10 17:55:03 JST 2012


Kouhei Sutou	2012-08-10 17:55:03 +0900 (Fri, 10 Aug 2012)

  New Revision: 97cc4d9ff65230c193f878f15c9495640ed5bf96
  https://github.com/groonga/groonga/commit/97cc4d9ff65230c193f878f15c9495640ed5bf96

  Log:
    clang: suppress a warning
    
    db.c:3260:45: warning: variable 'key' 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:3254:12: note: initialize the variable 'key' to silence this warning
      void *key;
               ^
                = NULL

  Modified files:
    lib/db.c

  Modified: lib/db.c (+1 -1)
===================================================================
--- lib/db.c    2012-08-10 17:54:25 +0900 (898350e)
+++ lib/db.c    2012-08-10 17:55:03 +0900 (c54386f)
@@ -3251,7 +3251,7 @@ grn_rc
 grn_table_difference(grn_ctx *ctx, grn_obj *table1, grn_obj *table2,
                      grn_obj *res1, grn_obj *res2)
 {
-  void *key;
+  void *key = NULL;
   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)) {
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index