Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-4633

Compilation of src/libmongoc/tests/test-mongoc-client.c fails with GCC 13.0.1

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 1.23.4
    • Affects Version/s: None
    • Component/s: None
    • None

      Summary

      Compilation of src/libmongoc/tests/test-mongoc-client.c fails with GCC 13.0.1

       

      FAILED: src/libmongoc/CMakeFiles/test-libmongoc-lib.dir/tests/test-mongoc-client.c.o
      /usr/bin/ccache /usr/bin/cc -DBSON_COMPILATION -DBSON_STATIC -DHAVE_STDARG_H -DHAVE_UNISTD_H -DMCOMMON_NAME_PREFIX=_mongoc_mcommon -DMONGOC_COMPILATION -DMONGOC_STATIC -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=700 -I/home/mark/src/mongo-c-driver/src/libmongoc/tests -I/home/mark/src/mongo-c-driver/src/libbson/src -I/home/mark/src/mongo-c-driver/cmake-build/src/libbson/src -I/home/mark/src/mongo-c-driver/cmake-build/src/libmongoc/src -I/home/mark/src/mongo-c-driver/cmake-build/src/libmongoc/src/mongoc -I/home/mark/src/mongo-c-driver/src/libmongoc/src -I/home/mark/src/mongo-c-driver/src/libmongoc/src/mongoc -I/home/mark/src/mongo-c-driver/src/libmongoc/../../src/common -I/home/mark/src/mongo-c-driver/cmake-build/src/libmongoc/../../src -I/home/mark/src/mongo-c-driver/cmake-build/src/libmongoc/../../src/common -I/home/mark/src/mongo-c-driver/cmake-build/src/libbson/src/bson -I/home/mark/src/mongo-c-driver/src/libbson/src/bson -I/home/mark/src/mongo-c-driver/src/libbson/../../src/common -I/home/mark/src/mongo-c-driver/cmake-build/src/libbson/../../src -I/home/mark/src/mongo-c-driver/cmake-build/src/libbson/../../src/common -O2 -g -DNDEBUG -std=c99 -Werror=implicit -Werror=return-type -Werror=incompatible-pointer-types -Werror=int-conversion -Werror=discarded-qualifiers -Werror=uninitialized -Wno-deprecated-declarations -fPIC -MD -MT src/libmongoc/CMakeFiles/test-libmongoc-lib.dir/tests/test-mongoc-client.c.o -MF src/libmongoc/CMakeFiles/test-libmongoc-lib.dir/tests/test-mongoc-client.c.o.d -o src/libmongoc/CMakeFiles/test-libmongoc-lib.dir/tests/test-mongoc-client.c.o -c /home/mark/src/mongo-c-driver/src/libmongoc/tests/test-mongoc-client.c
      /home/mark/src/mongo-c-driver/src/libmongoc/tests/test-mongoc-client.c: In function ‘test_mongoc_client_speculative_auth_failure’:
      /home/mark/src/mongo-c-driver/src/libmongoc/tests/test-mongoc-client.c:586:7: error: ‘pool’ may be used uninitialized [-Werror=maybe-uninitialized]
        586 |       mongoc_client_pool_destroy (pool);
            |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      /home/mark/src/mongo-c-driver/src/libmongoc/tests/test-mongoc-client.c:482:26: note: ‘pool’ was declared here
        482 |    mongoc_client_pool_t *pool;
            |                          ^~~~
      cc1: some warnings being treated as errors
      ninja: build stopped: cannot make progress due to previous errors.
       

      Environment

      Please provide the version of the C / CXX driver.

      Git Hash 2d27a1113362f648f75e27b6115fc666e4f75f74

      commit 2d27a1113362f648f75e27b6115fc666e4f75f74 (HEAD -> master, origin/master, origin/HEAD)
      Author: Kevin Albertson <kevin.albertson@mongodb.com>
      Date:   Fri Apr 28 19:54:52 2023 +0000

      Please provide the host OS, version, and architecture (example: Windows 10 64-bit x86).

      Fedora 38

      Please provide the C / CXX compiler and version.

      $ gcc --version
      gcc (GCC) 13.0.1 20230401 (Red Hat 13.0.1-0)
      Copyright (C) 2023 Free Software Foundation, Inc.
      This is free software; see the source for copying conditions.  There is NO
      warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

      If applicable, please attach the full output of the cmake command used to configure the C / CXX driver.

       

      How to Reproduce

      Steps to reproduce. If possible, please include a Short, Self Contained, Correct (Compilable), Example

      mkdir cmake-build
      cd cmake-build
      cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/home/mark/src/usr -GNinja ..
      ninja
      

      Additional Background

      Please provide any additional background information that may be helpful in diagnosing the bug.

            Assignee:
            kyle.kloberdanz@mongodb.com Kyle Kloberdanz (Inactive)
            Reporter:
            mark.benvenuto@mongodb.com Mark Benvenuto
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: