Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-10890

Compile error when CMAKE_BUILD_TYPE set to Release or RelWithDebInfo

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • 2023-04-18 Leviosa Not Leviosa

      There is a build error occurring when the cmake build type is set to Release or RelWithDebInfo

      ubuntu@ip-10-128-103-164:/data/wiredtiger/cmake_build$ ninja
      [46/574] Building C object CMakeFiles/wt_objs.dir/src/btree/bt_compact.c.o
      FAILED: CMakeFiles/wt_objs.dir/src/btree/bt_compact.c.o 
      ccache /opt/mongodbtoolchain/v4/bin/gcc  -I/usr/include/python3.8 -Iinclude -Iconfig -I../src/include -D_GNU_SOURCE -DHAVE_X86INTRIN_H -D_GNU_SOURCE -DHAVE_X86INTRIN_H  -DNDEBUG -fPIC   -O2 -Wcast-align -Wdouble-promotion -Werror -Wfloat-equal -Wformat-nonliteral -Wformat-security -Wformat=2 -Winit-self -Wmissing-declarations -Wmissing-field-initializers -Wpacked -Wpointer-arith -Wredundant-decls -Wswitch-enum -Wundef -Wuninitialized -Wunreachable-code -Wunused -Wwrite-strings -Wno-error=unsafe-loop-optimizations -Wformat-signedness -Wunused-macros -Wvariadic-macros -Wduplicated-cond -Wlogical-op -Wunused-const-variable=2 -Walloca -Walloc-zero -Wduplicated-branches -Wformat-overflow=2 -Wformat-truncation=2 -Wrestrict -Wmultistatement-macros -Waggregate-return -Wall -Wextra -Wshadow -Wsign-conversion -Wbad-function-cast -Wdeclaration-after-statement -Wjump-misses-init -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpointer-sign -Wstrict-prototypes -MD -MT CMakeFiles/wt_objs.dir/src/btree/bt_compact.c.o -MF CMakeFiles/wt_objs.dir/src/btree/bt_compact.c.o.d -o CMakeFiles/wt_objs.dir/src/btree/bt_compact.c.o   -c ../src/btree/bt_compact.c
      In file included from ../src/include/wt_internal.h:478,
                       from ../src/btree/bt_compact.c:9:
      In function '__cell_addr_window_cleanup',
          inlined from '__cell_unpack_window_cleanup' at ../src/include/cell_inline.h:1154:5,
          inlined from '__wt_cell_unpack_addr' at ../src/include/cell_inline.h:1167:5,
          inlined from '__compact_page_replace_addr' at ../src/btree/bt_compact.c:112:9,
          inlined from '__compact_page' at ../src/btree/bt_compact.c:190:13:
      ../src/include/cell_inline.h:1035:24: error: 'unpack.raw' may be used uninitialized [-Werror=maybe-uninitialized]
       1035 |         if (unpack_addr->raw == WT_CELL_ADDR_DEL && F_ISSET(dsk, WT_PAGE_FT_UPDATE)) {
            |             ~~~~~~~~~~~^~~~~
      ../src/btree/bt_compact.c: In function '__compact_page':
      ../src/btree/bt_compact.c:99:25: note: 'unpack' declared here
         99 |     WT_CELL_UNPACK_ADDR unpack;
            |                         ^~~~~~
      In function '__compact_page_replace_addr',
          inlined from '__compact_page' at ../src/btree/bt_compact.c:190:13:
      ../src/btree/bt_compact.c:121:23: error: 'unpack.raw' may be used uninitialized [-Werror=maybe-uninitialized]
        121 |         switch (unpack.raw) {
            |                 ~~~~~~^~~~
      ../src/btree/bt_compact.c: In function '__compact_page':
      ../src/btree/bt_compact.c:99:25: note: 'unpack' declared here
         99 |     WT_CELL_UNPACK_ADDR unpack;
            |                         ^~~~~~
      cc1: all warnings being treated as errors
      

            Assignee:
            backlog-server-storage-engines [DO NOT USE] Backlog - Storage Engines Team
            Reporter:
            jie.chen@mongodb.com Jie Chen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: