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

Back to archive index

null+****@clear***** null+****@clear*****
Fri Aug 10 17:57:38 JST 2012


Kouhei Sutou	2012-08-10 17:57:38 +0900 (Fri, 10 Aug 2012)

  New Revision: e3f87bda4b54b82bb9da50a73189e268a1c94b96
  https://github.com/groonga/groonga/commit/e3f87bda4b54b82bb9da50a73189e268a1c94b96

  Log:
    clang: suppress a warning
    
    db.c:6920:45: warning: variable 'p' is uninitialized when used here
          [-Wuninitialized]
                        uint8_t *u = (uint8_t *)p;
                                                ^
    db.c:6860:28: note: initialize the variable 'p' to silence this warning
                  const char *p;
                               ^
                                = NULL

  Modified files:
    lib/db.c

  Modified: lib/db.c (+2 -1)
===================================================================
--- lib/db.c    2012-08-10 17:55:03 +0900 (c54386f)
+++ lib/db.c    2012-08-10 17:57:38 +0900 (1550bd8)
@@ -6917,8 +6917,9 @@ grn_ctx_at(grn_ctx *ctx, grn_id id)
                   break;
                 case GRN_EXPR :
                   {
-                    uint8_t *u = (uint8_t *)p;
+                    uint8_t *u;
                     size = grn_vector_get_element(ctx, &v, 4, &p, NULL, NULL);
+                    u = (uint8_t *)p;
                     vp->ptr = grn_expr_open(ctx, spec, u, u + size);
                   }
                   break;
-------------- next part --------------
HTML����������������������������...
Download 



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