maybe-uninitialized warning for uri treated as error in cur_hs.c

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • WT12.0.0, 8.2.0-rc0
    • Affects Version/s: None
    • Component/s: Build
    • None

      Compilation failure:

      [2025/07/18 14:58:59.705] FAILED: CMakeFiles/wt_objs.dir/src/cursor/cur_hs.c.o
      [2025/07/18 14:58:59.705] ccache /opt/mongodbtoolchain/v5/bin/gcc  -I/opt/mongodbtoolchain/revisions/79c9b62fe59b85252bd716333ebea111b4d03a12/stow/python3-v5.pJI/include/python3.10 -I/data/mci/c0a558dcffd55313a2b5c616a56f5ce7/wiredtiger/cmake_build/include -I/data/mci/c0a558dcffd55313a2b5c616a56f5ce7/wiredtiger/cmake_build/config -I/data/mci/c0a558dcffd55313a2b5c616a56f5ce7/wiredtiger/src/include -D_GNU_SOURCE -DHAVE_X86INTRIN_H -g -fPIC -fno-strict-aliasing -Og -g3 -ggdb3 -gdwarf-4 -Wcast-align -Wdouble-promotion -Werror -Wfloat-equal -Wformat-nonliteral -Wformat-security -Wformat=2 -Winit-self -Wmissing-declarations -Wmissing-field-initializers -Wno-reserved-identifier -Wno-switch-default -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=1 -Walloca -Walloc-zero -Wduplicated-branches -Wformat-overflow=2 -Wformat-truncation=2 -Wrestrict -Wmultistatement-macros -Waggregate-return -Wall -Wextra -Wshadow -Wsign-conversion -Wbad-function-cast -Wno-declaration-after-statement -Wjump-misses-init -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpointer-sign -Wstrict-prototypes -MD -MT CMakeFiles/wt_objs.dir/src/cursor/cur_hs.c.o -MF CMakeFiles/wt_objs.dir/src/cursor/cur_hs.c.o.d -o CMakeFiles/wt_objs.dir/src/cursor/cur_hs.c.o -c /data/mci/c0a558dcffd55313a2b5c616a56f5ce7/wiredtiger/src/cursor/cur_hs.c
      [2025/07/18 14:58:59.705] /data/mci/c0a558dcffd55313a2b5c616a56f5ce7/wiredtiger/src/cursor/cur_hs.c: In function '__wt_curhs_get_cached':
      [2025/07/18 14:58:59.705] /data/mci/c0a558dcffd55313a2b5c616a56f5ce7/wiredtiger/src/cursor/cur_hs.c:78:16: error: 'uri' may be used uninitialized [-Werror=maybe-uninitialized]
      [2025/07/18 14:58:59.705]    78 |     if ((ret = __wt_cursor_cache_get(session, uri, hash_value, NULL, NULL, &cursor)) == 0) {
      [2025/07/18 14:58:59.705]       |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      [2025/07/18 14:58:59.705] /data/mci/c0a558dcffd55313a2b5c616a56f5ce7/wiredtiger/src/cursor/cur_hs.c:73:17: note: 'uri' was declared here
      [2025/07/18 14:58:59.705]    73 |     const char *uri;
      [2025/07/18 14:58:59.705]       |                 ^~~
      [2025/07/18 14:58:59.705] In file included from /data/mci/c0a558dcffd55313a2b5c616a56f5ce7/wiredtiger/src/include/wt_internal.h:580,
      [2025/07/18 14:58:59.705]                  from /data/mci/c0a558dcffd55313a2b5c616a56f5ce7/wiredtiger/src/cursor/cur_hs.c:9:
      [2025/07/18 14:58:59.705] /data/mci/c0a558dcffd55313a2b5c616a56f5ce7/wiredtiger/src/cursor/cur_hs.c: In function '__wt_curhs_open_ext':
      [2025/07/18 14:58:59.705] /data/mci/c0a558dcffd55313a2b5c616a56f5ce7/wiredtiger/src/cursor/cur_hs.c:1442:12: error: 'uri' may be used uninitialized [-Werror=maybe-uninitialized]
      [2025/07/18 14:58:59.705]  1442 |     WT_ERR(__wt_strdup(session, uri, &cursor->uri));
      [2025/07/18 14:58:59.705] /data/mci/c0a558dcffd55313a2b5c616a56f5ce7/wiredtiger/src/include/error.h:47:21: note: in definition of macro 'WT_ERR'
      [2025/07/18 14:58:59.705]    47 |         if ((ret = (a)) != 0) \
      [2025/07/18 14:58:59.705]       |                     ^
      [2025/07/18 14:58:59.705] /data/mci/c0a558dcffd55313a2b5c616a56f5ce7/wiredtiger/src/cursor/cur_hs.c:1428:17: note: 'uri' was declared here
      [2025/07/18 14:58:59.705]  1428 |     const char *uri;
      [2025/07/18 14:58:59.705]       |                 ^~~
      [2025/07/18 14:58:59.705] At top level:
      [2025/07/18 14:58:59.705] cc1: note: unrecognized command-line option '-Wno-reserved-identifier' may have been intended to silence earlier diagnostics
      [2025/07/18 14:58:59.705] cc1: all warnings being treated as errors
      [2025/07/18 14:58:59.840] [100/671] Building C object CMakeFiles/wt_objs.dir/src/cursor/cur_file.c.o
      [2025/07/18 14:58:59.840] ninja: build stopped: subcommand failed.
      [2025/07/18 14:58:59.841] Command 'shell.exec' in function 'compile wiredtiger' (step 2.4 of 3) failed: shell script encountered problem: exit code 1.
      [2025/07/18 14:58:59.841] Finished command 'shell.exec' in function 'compile wiredtiger' (step 2.4 of 3) in 58.695425171s.
      [2025/07/18 14:58:59.841] Running task commands failed: running command: command failed: shell script encountered problem: exit code 1
      [2025/07/18 14:58:59.841] Finished running task commands in 1m23.247326674s.
      

              Assignee:
              Sid Mahajan
              Reporter:
              Sid Mahajan
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: