[Groonga-commit] groonga/groonga at fd32766 [master] clang: suppress warnings

Back to archive index

Kouhei Sutou null+****@clear*****
Tue Jun 11 17:51:07 JST 2013


Kouhei Sutou	2013-06-11 17:51:07 +0900 (Tue, 11 Jun 2013)

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

  Message:
    clang: suppress warnings
    
    Initialize variables explicitly.
    
        ii.c:3249:21: warning: variable 'dcn0' is used uninitialized whenever '||'
              condition is true [-Wsometimes-uninitialized]
                        if (!actual_db0_chunk_size ||
                            ^~~~~~~~~~~~~~~~~~~~~~
        ii.c:3252:56: note: uninitialized use occurs here
          ...fake_map2(ctx, ii->chunk, &dw0, dc0, dcn0, actual_db0_chunk_size);
                                                  ^~~~
        ii.c:3249:21: note: remove the '||' if its condition is always false
                        if (!actual_db0_chunk_size ||
                            ^~~~~~~~~~~~~~~~~~~~~~~~~
        ii.c:3222:50: note: initialize the variable 'dcn0' to silence this warning
          uint32_t dps0, dps1, dls0, dls1, sps, scn, dcn0, dcn1;
                                                         ^
                                                          = 0
        ii.c:3261:27: warning: variable 'dcn1' is used uninitialized whenever '||'
              condition is true [-Wsometimes-uninitialized]
                              if (!actual_db1_chunk_size ||
                                  ^~~~~~~~~~~~~~~~~~~~~~
        ii.c:3263:62: note: uninitialized use occurs here
          ...fake_map2(ctx, ii->chunk, &dw1, dc1, dcn1, actual_db1_chunk_size);
                                                  ^~~~
        ii.c:3261:27: note: remove the '||' if its condition is always false
                              if (!actual_db1_chunk_size ||
                                  ^~~~~~~~~~~~~~~~~~~~~~~~~
        ii.c:3222:56: note: initialize the variable 'dcn1' to silence this warning
          uint32_t dps0, dps1, dls0, dls1, sps, scn, dcn0, dcn1;
                                                               ^
                                                                = 0

  Modified files:
    lib/ii.c

  Modified: lib/ii.c (+1 -1)
===================================================================
--- lib/ii.c    2013-06-11 17:50:22 +0900 (6a194a4)
+++ lib/ii.c    2013-06-11 17:51:07 +0900 (4b76689)
@@ -3219,7 +3219,7 @@ buffer_split(grn_ctx *ctx, grn_ii *ii, uint32_t seg, grn_hash *h)
   grn_io_win sw, dw0, dw1;
   buffer *sb, *db0 = NULL, *db1 = NULL;
   uint8_t *sc = NULL, *dc0, *dc1;
-  uint32_t dps0, dps1, dls0, dls1, sps, scn, dcn0, dcn1;
+  uint32_t dps0, dps1, dls0, dls1, sps, scn, dcn0 = 0, dcn1 = 0;
   if (ii->header->binfo[seg] == NOT_ASSIGNED) { return GRN_FILE_CORRUPT; }
   if ((rc = buffer_segment_reserve(ctx, ii, &dls0, &dps0, &dls1, &dps1))) {
     return rc;
-------------- next part --------------
HTML����������������������������...
Download 



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